2 for FILE in `seq 3`; do
3 clang -g -c X86/odr-fwd-declaration.cpp -DFILE$FILE -o Inputs/odr-fwd-declaration/$FILE.o
7 // RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/odr-fwd-declaration -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -v -debug-info - | FileCheck %s
11 typedef struct S
*Sptr
;
12 typedef Sptr
*Sptrptr
;
18 // First we confirm that the typedefs reference the forward declaration of the
21 // CHECK: TAG_variable
22 // CHECK-NOT: {{DW_TAG|NULL}}
23 // CHECK: AT_name{{.*}} "ptr1"
24 // CHECK-NOT: {{DW_TAG|NULL}}
25 // CHECK: AT_type{{.*}}0x{{0*}}[[TYPEDEF1:[a-f0-9]*]]
27 // CHECK: [[TYPEDEF1]]:{{.*}}TAG_typedef
28 // CHECK-NOT: {{DW_TAG|NULL}}
29 // CHECK: AT_type{{.*}}0x{{0*}}[[PTR1:[a-f0-9]*]]
30 // CHECK-NOT: {{DW_TAG|NULL}}
31 // CHECK: AT_name{{.*}} "Sptrptr"
33 // CHECK: [[PTR1]]:{{.*}}TAG_pointer_type
34 // CHECK-NOT: {{DW_TAG|NULL}}
35 // CHECK: AT_type{{.*}}0x{{0*}}[[TYPEDEF2:[a-f0-9]*]]
37 // CHECK: [[TYPEDEF2]]:{{.*}}TAG_typedef
38 // CHECK-NOT: {{DW_TAG|NULL}}
39 // CHECK: AT_type{{.*}}0x{{0*}}[[PTR2:[a-f0-9]*]]
40 // CHECK-NOT: {{DW_TAG|NULL}}
41 // CHECK: AT_name{{.*}} "Sptr"
43 // CHECK: [[PTR2]]:{{.*}}TAG_pointer_type
44 // CHECK-NOT: {{DW_TAG|NULL}}
45 // CHECK: AT_type{{.*}}0x{{0*}}[[FWDSTRUCT:[a-f0-9]*]]
47 // CHECK: [[FWDSTRUCT]]:{{.*}}TAG_structure_type
48 // CHECK-NOT: {{DW_TAG|NULL}}
49 // CHECK: AT_name{{.*}} "S"
50 // CHECK-NOT: {{DW_TAG|NULL}}
51 // CHECK: AT_declaration
52 // CHECK-NOT: AT_byte_size
56 typedef struct S
*Sptr
;
57 typedef Sptr
*Sptrptr
;
66 // Next we confirm that the typedefs reference the definition rather than the
67 // previous declaration of S.
69 // CHECK: TAG_variable
70 // CHECK-NOT: {{DW_TAG|NULL}}
71 // CHECK: AT_name{{.*}} "ptr2"
72 // CHECK-NOT: {{DW_TAG|NULL}}
73 // CHECK: AT_type{{.*}}0x{{0*}}[[TYPEDEF3:[a-f0-9]*]]
75 // CHECK: [[TYPEDEF3]]:{{.*}}TAG_typedef
76 // CHECK-NOT: {{DW_TAG|NULL}}
77 // CHECK: AT_type{{.*}}0x{{0*}}[[PTR3:[a-f0-9]*]]
78 // CHECK-NOT: {{DW_TAG|NULL}}
79 // CHECK: AT_name{{.*}} "Sptrptr"
81 // CHECK: [[PTR3]]:{{.*}}TAG_pointer_type
82 // CHECK-NOT: {{DW_TAG|NULL}}
83 // CHECK: AT_type{{.*}}0x{{0*}}[[TYPEDEF4:[a-f0-9]*]]
85 // CHECK: [[TYPEDEF4]]:{{.*}}TAG_typedef
86 // CHECK-NOT: {{DW_TAG|NULL}}
87 // CHECK: AT_type{{.*}}0x{{0*}}[[PTR4:[a-f0-9]*]]
88 // CHECK-NOT: {{DW_TAG|NULL}}
89 // CHECK: AT_name{{.*}} "Sptr"
91 // CHECK: [[PTR4]]:{{.*}}TAG_pointer_type
92 // CHECK-NOT: {{DW_TAG|NULL}}
93 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCT:[a-f0-9]*]]
95 // CHECK: [[STRUCT]]:{{.*}}TAG_structure_type
96 // CHECK-NOT: {{DW_TAG|NULL}}
97 // CHECK: AT_name{{.*}} "S"
98 // CHECK-NOT: {{DW_TAG|NULL}}
99 // CHECK-NOT: AT_declaration
100 // CHECK: AT_byte_size
101 // CHECK-NOT: {{DW_TAG|NULL}}
106 typedef struct S
*Sptr
;
107 typedef Sptr
*Sptrptr
;
113 // Finally we confirm that uniquing is not broken and the same typedef is
114 // referenced by ptr1.
116 // CHECK: TAG_variable
117 // CHECK-NOT: {{DW_TAG|NULL}}
118 // CHECK: AT_name{{.*}} "ptr1"
119 // CHECK-NOT: {{DW_TAG|NULL}}
120 // CHECK: AT_type{{.*}}0x{{0*}}[[TYPEDEF3]]
121 // CHECK-NOT: TAG_typedef
122 // CHECK-NOT: TAG_pointer
123 // CHECK-NOT: TAG_structure_type
126 #error "You must define which file you generate"