Skip to content

Commit

Permalink
Add test for enum with two autoload annotations
Browse files Browse the repository at this point in the history
This is a heavily reduced case that shows the problem originally
reported in cms-sw/cmssw#42234.
  • Loading branch information
hahnjo committed Jul 26, 2023
1 parent f353a34 commit 09f72c3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cling/dict/enum/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List only header.h which transitively includes enum.h - this leads to two
# __attribute__((annotate("$clingAutoload$...")))
ROOTTEST_GENERATE_DICTIONARY(enumDict header.h LINKDEF LinkDef.h NO_CXXMODULE)

ROOTTEST_ADD_TEST(exec
MACRO execEnumDict.C
DEPENDS ${GENERATE_DICTIONARY_TEST}
)
1 change: 1 addition & 0 deletions cling/dict/enum/LinkDef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#pragma link C++ class std::vector<Enum>+;
9 changes: 9 additions & 0 deletions cling/dict/enum/enum.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef ENUM_H
#define ENUM_H

enum Enum {
A = 1,
B = 2,
};

#endif
5 changes: 5 additions & 0 deletions cling/dict/enum/execEnumDict.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "enum.h"

int execEnumDict() {
return gSystem->Load("enumDict");
}
1 change: 1 addition & 0 deletions cling/dict/enum/header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "enum.h"

0 comments on commit 09f72c3

Please sign in to comment.