2 for FILE in `seq 3`; do
3 clang -g -c odr-member-functions.cpp -DFILE$FILE -o odr-member-functions/$FILE.o
7 // RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/odr-member-functions -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-info - | FileCheck %s
10 __attribute__((always_inline
)) void foo() { bar(); }
11 __attribute__((always_inline
)) void foo(int i
) { if (i
) bar(); }
14 template<typename T
> void baz(T t
) {}
22 // CHECK: TAG_compile_unit
23 // CHECK-NOT: {{DW_TAG|NULL}}
24 // CHECK: AT_name{{.*}}"odr-member-functions.cpp"
26 // CHECK: 0x[[S:[0-9a-f]*]]:{{.*}}DW_TAG_structure_type
27 // CHECK-NOT: {{DW_TAG|NULL}}
28 // CHECK: DW_AT_name{{.*}}"S"
30 // CHECK: 0x[[FOO:[0-9a-f]*]]:{{.*}}DW_TAG_subprogram
31 // CHECK-NEXT: DW_AT_MIPS_linkage_name{{.*}}"_ZN1S3fooEv"
33 // CHECK: 0x[[FOOI:[0-9a-f]*]]:{{.*}}DW_TAG_subprogram
34 // CHECK-NEXT: DW_AT_MIPS_linkage_name{{.*}}"_ZN1S3fooEi"
39 // Check that the overloaded member functions are resolved correctly
44 // CHECK: TAG_compile_unit
46 // CHECK: AT_name{{.*}}"odr-member-functions.cpp"
48 // Normal member functions should be desribed by the type in the first
49 // CU, thus we should be able to reuse its definition and avoid
51 // CHECK-NOT: DW_TAG_structure_type
53 // CHECK: 0x[[FOO_SUB:[0-9a-f]*]]:{{.*}}DW_TAG_subprogram
54 // CHECK-NEXT: DW_AT_specification{{.*}}[[FOO]]
55 // CHECK-NOT: DW_TAG_structure_type
56 // CHECK: 0x[[FOOI_SUB:[0-9a-f]*]]:{{.*}}DW_TAG_subprogram
57 // CHECK-NEXT: DW_AT_specification{{.*}}[[FOOI]]
58 // CHECK-NOT: DW_TAG_structure_type
60 // CHECK: DW_TAG_variable
62 // CHECK: DW_AT_name {{.*}}"s"
64 // CHECK: DW_AT_type {{.*}}[[S]]
65 // CHECK: DW_TAG_inlined_subroutine
66 // CHECK-NEXT: DW_AT_abstract_origin{{.*}}[[FOO_SUB]]
68 // CHECK: DW_AT_call_line{{.*}}40
69 // CHECK: DW_TAG_inlined_subroutine
70 // CHECK-NEXT: DW_AT_abstract_origin{{.*}}[[FOOI_SUB]]
72 // CHECK: DW_AT_call_line{{.*}}41
80 // CHECK: TAG_compile_unit
82 // CHECK: AT_name{{.*}}"odr-member-functions.cpp"
84 // Template or other implicit members will be included in the type
85 // only if they are generated. Thus actually creating a new type.
86 // CHECK: DW_TAG_structure_type
88 // Skip 'normal' member functions
89 // CHECK: DW_TAG_subprogram
90 // CHECK: DW_TAG_subprogram
91 // CHECK: DW_TAG_subprogram
93 // This is the 'baz' member
94 // CHECK: 0x[[BAZ:[0-9a-f]*]]: DW_TAG_subprogram
96 // CHECK: DW_AT_MIPS_linkage_name {{.*}}"_ZN1S3bazIiEEvT_"
98 // CHECK: DW_AT_name {{.*}}"baz<int>"
101 // CHECK: DW_TAG_subprogram
103 // baz instanciation:
104 // CHECK: DW_TAG_subprogram
106 // CHECK: DW_AT_specification {{.*}}[[BAZ]] "_ZN1S3bazIiEEvT_"
108 #error "You must define which file you generate"