[InstCombine] Signed saturation patterns
[llvm-core.git] / test / tools / dsymutil / X86 / odr-fwd-declaration2.cpp
blob7bb159fc0bfe89d044b6aa28a319ff26797136b8
1 /* Compile with:
2 for FILE in `seq 3`; do
3 clang -g -c X86/odr-fwd-declaration2.cpp -DFILE$FILE -o Inputs/odr-fwd-declaration2/$FILE.o
4 done
5 */
7 // RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/odr-fwd-declaration2 -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -v -debug-info - | FileCheck %s
9 #ifdef FILE1
10 # 1 "Header.h" 1
11 struct A {
12 struct B;
13 B *bPtr;
14 B &bRef;
15 int B::*bPtrToField;
17 # 3 "Source1.cpp" 2
18 void foo() {
19 A *ptr1 = 0;
22 // First we confirm that bPtr, bRef and bPtrToField reference the forward
23 // declaration of the struct B.
25 // CHECK: DW_TAG_member
26 // CHECK-NOT: {{DW_TAG|NULL}}
27 // CHECK: AT_name{{.*}} "bPtr"
28 // CHECK-NOT: {{DW_TAG|NULL}}
29 // CHECK: AT_type{{.*}}0x{{0*}}[[PTR1:[a-f0-9]*]]
31 // CHECK: [[STRUCT1:[a-f0-9]*]]:{{.*}}TAG_structure_type
32 // CHECK-NOT: {{DW_TAG|NULL}}
33 // CHECK: AT_name{{.*}} "B"
34 // CHECK-NOT: AT_byte_size
35 // CHECK: DW_AT_declaration
37 // CHECK: DW_TAG_member
38 // CHECK: AT_name{{.*}} "bRef"
39 // CHECK-NOT: {{DW_TAG|NULL}}
40 // CHECK: AT_type{{.*}}0x{{0*}}[[REF1:[a-f0-9]*]]
42 // CHECK: TAG_member
43 // CHECK-NOT: {{DW_TAG|NULL}}
44 // CHECK: AT_name{{.*}} "bPtrToField"
45 // CHECK-NOT: {{DW_TAG|NULL}}
46 // CHECK: AT_type{{.*}}0x{{0*}}[[PTRTOMEMBER1:[a-f0-9]*]]
48 // CHECK: [[PTR1]]:{{.*}}TAG_pointer_type
49 // CHECK-NOT: {{DW_TAG|NULL}}
50 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCT1]]
52 // CHECK: [[REF1]]:{{.*}}TAG_reference_type
53 // CHECK-NOT: {{DW_TAG|NULL}}
54 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCT1]]
56 // CHECK: [[PTRTOMEMBER1]]:{{.*}}TAG_ptr_to_member_type
57 // CHECK-NOT: {{DW_TAG|NULL}}
58 // CHECK: AT_containing_type{{.*}}0x{{0*}}[[STRUCT1]]
60 #elif defined(FILE2)
61 # 1 "Header.h" 1
62 struct A {
63 struct B;
64 B *bPtr;
65 B &bRef;
66 int B::*bPtrToField;
68 # 3 "Source2.cpp" 2
69 struct A::B {
70 int x;
72 void bar() {
73 A *ptr2 = 0;
76 // Next we confirm that bPtr, bRef and bPtrToField reference the definition of
77 // B, rather than its declaration.
79 // CHECK: [[STRUCTA:[a-f0-9]*]]:{{.*}}TAG_structure_type
80 // CHECK-NOT: {{DW_TAG|NULL}}
81 // CHECK: AT_name{{.*}} "A"
82 // CHECK-NOT: AT_byte_size
83 // CHECK: DW_AT_byte_size
85 // CHECK: DW_TAG_member
86 // CHECK-NOT: {{DW_TAG|NULL}}
87 // CHECK: AT_name{{.*}} "bPtr"
88 // CHECK-NOT: {{DW_TAG|NULL}}
89 // CHECK: AT_type{{.*}}0x{{0*}}[[PTR2:[a-f0-9]*]]
91 // CHECK: [[STRUCT2:[a-f0-9]*]]:{{.*}}TAG_structure_type
92 // CHECK-NOT: {{DW_TAG|NULL}}
93 // CHECK: AT_name{{.*}} "B"
94 // CHECK-NOT: {{DW_TAG|NULL}}
95 // CHECK: DW_AT_byte_size
97 // CHECK: DW_TAG_member
98 // CHECK: AT_name{{.*}} "bRef"
99 // CHECK-NOT: {{DW_TAG|NULL}}
100 // CHECK: AT_type{{.*}}0x{{0*}}[[REF2:[a-f0-9]*]]
102 // CHECK: TAG_member
103 // CHECK-NOT: {{DW_TAG|NULL}}
104 // CHECK: AT_name{{.*}} "bPtrToField"
105 // CHECK-NOT: {{DW_TAG|NULL}}
106 // CHECK: AT_type{{.*}}0x{{0*}}[[PTRTOMEMBER2:[a-f0-9]*]]
108 // CHECK: [[PTR2]]:{{.*}}TAG_pointer_type
109 // CHECK-NOT: {{DW_TAG|NULL}}
110 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCT2]]
112 // CHECK: [[REF2]]:{{.*}}TAG_reference_type
113 // CHECK-NOT: {{DW_TAG|NULL}}
114 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCT2]]
116 // CHECK: [[PTRTOMEMBER2]]:{{.*}}TAG_ptr_to_member_type
117 // CHECK-NOT: {{DW_TAG|NULL}}
118 // CHECK: AT_containing_type{{.*}}0x{{0*}}[[STRUCT2:[a-f0-9]*]]
120 #elif defined(FILE3)
121 # 1 "Header.h" 1
122 struct A {
123 struct B;
124 B *bPtr;
125 B &bRef;
126 int B::*bPtrToField;
128 # 3 "Source2.cpp" 2
129 struct A::B {
130 int x;
132 void bar() {
133 A *ptr2 = 0;
136 // Finally we confirm that uniquing isn't broken by checking that further
137 // references to 'struct A' point to its now complete definition.
139 // CHECK: TAG_variable
140 // CHECK-NOT: {{DW_TAG|NULL}}
141 // CHECK: AT_name{{.*}} "ptr2"
142 // CHECK-NOT: {{DW_TAG|NULL}}
143 // CHECK: AT_type{{.*}}0x{{0*}}[[PTR3:[a-f0-9]*]]
145 // CHECK: [[PTR3]]:{{.*}}TAG_pointer_type
146 // CHECK-NOT: {{DW_TAG|NULL}}
147 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCTA]]
149 #else
150 #error "You must define which file you generate"
151 #endif