brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 5d6cc11 Raw
69 lines · cpp
1/* Compile with:2   for FILE in `seq 2`; do3     clang -g -c  odr-anon-namespace.cpp -DFILE$FILE -o odr-anon-namespace/$FILE.o4   done5 */6 7// RUN: dsymutil --linker parallel -f \8// RUN:   -oso-prepend-path=%p/../../Inputs/odr-anon-namespace \9// RUN:   -y %p/../dummy-debug-map.map -o - | \10// RUN:   llvm-dwarfdump -debug-info - | FileCheck %s11 12#ifdef FILE113// Currently dsymutil will unique the contents of anonymous14// namespaces if they are from the same file/line. Force this15// namespace to appear different eventhough it's the same (this16// uniquing is actually a bug kept for backward compatibility, see the17// comments in DeclContextTree::getChildDeclContext()).18#line 4219#endif20namespace {21class C {};22}23 24void foo() {25  C c;26}27 28// Keep the ifdef guards for FILE1 and FILE2 even if all the code is29// above to clearly show what the CHECK lines are testing.30#ifdef FILE131 32// CHECK: TAG_compile_unit33// CHECK-NOT: DW_TAG34// CHECK: AT_name{{.*}}"odr-anon-namespace.cpp"35 36// CHECK: DW_TAG_variable37// CHECK-NOT: DW_TAG38// CHECK: DW_AT_name {{.*}}"c"39// CHECK-NOT: DW_TAG40// CHECK: DW_AT_type {{.*}}0x[[C_FILE1:[0-9a-f]*]]41 42// CHECK: DW_TAG_namespace43// CHECK-NOT: {{DW_AT_name|NULL|DW_TAG}}44// CHECK: 0x[[C_FILE1]]:{{.*}}DW_TAG_class_type45// CHECK-NOT: DW_TAG46// CHECK: DW_AT_name{{.*}}"C"47 48#elif defined(FILE2)49 50// CHECK: TAG_compile_unit51// CHECK-NOT: DW_TAG52// CHECK: AT_name{{.*}}"odr-anon-namespace.cpp"53 54// CHECK: DW_TAG_variable55// CHECK-NOT: DW_TAG56// CHECK: DW_AT_name {{.*}}"c"57// CHECK-NOT: DW_TAG58// CHECK: DW_AT_type {{.*}}0x[[C_FILE2:[0-9a-f]*]]59 60// CHECK: DW_TAG_namespace61// CHECK-NOT: {{DW_AT_name|NULL|DW_TAG}}62// CHECK: 0x[[C_FILE2]]:{{.*}}DW_TAG_class_type63// CHECK-NOT: DW_TAG64// CHECK: DW_AT_name{{.*}}"C"65 66#else67#error "You must define which file you generate"68#endif69