[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / tools / dsymutil / X86 / odr-fwd-declaration.cpp
blob29b0ae2fb4e096f972d5e29b422af8fba122cd80
1 /* Compile with:
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
4 done
5 */
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
9 #ifdef FILE1
10 # 1 "Header.h" 1
11 typedef struct S *Sptr;
12 typedef Sptr *Sptrptr;
13 # 3 "Source1.cpp" 2
14 void foo() {
15 Sptrptr ptr1 = 0;
18 // First we confirm that the typedefs reference the forward declaration of the
19 // struct S.
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
54 #elif defined(FILE2)
55 # 1 "Header.h" 1
56 typedef struct S *Sptr;
57 typedef Sptr *Sptrptr;
58 # 3 "Source2.cpp" 2
59 struct S {
60 int field;
62 void bar() {
63 Sptrptr ptr2 = 0;
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}}
102 // CHECK: TAG_member
104 #elif defined(FILE3)
105 # 1 "Header.h" 1
106 typedef struct S *Sptr;
107 typedef Sptr *Sptrptr;
108 # 3 "Source1.cpp" 2
109 void foo() {
110 Sptrptr ptr1 = 0;
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
125 #else
126 #error "You must define which file you generate"
127 #endif