1 // RUN: %clang_cc1 -w -debug-info-kind=line-tables-only -std=c++11 -fexceptions -fcxx-exceptions -S -mllvm -no-discriminators -emit-llvm %s -o - -triple %itanium_abi_triple | FileCheck %s
2 // RUN: %clang_cc1 -w -debug-info-kind=line-tables-only -std=c++11 -fexceptions -fcxx-exceptions -S -mllvm -no-discriminators -emit-llvm %s -o - -triple i686-linux-gnu | FileCheck %s
3 // RUN: %clang_cc1 -w -debug-info-kind=line-directives-only -std=c++11 -fexceptions -fcxx-exceptions -S -mllvm -no-discriminators -emit-llvm %s -o - -triple %itanium_abi_triple | FileCheck %s
4 // RUN: %clang_cc1 -w -debug-info-kind=line-directives-only -std=c++11 -fexceptions -fcxx-exceptions -S -mllvm -no-discriminators -emit-llvm %s -o - -triple i686-linux-gnu | FileCheck %s
8 extern "C" __complex
float complex_src();
9 extern "C" __complex
float *complex_sink();
11 // CHECK-LABEL: define
14 // CHECK: store {{.*}}, !dbg [[DBG_F1:!.*]]
27 // CHECK-LABEL: define
31 i
// CHECK: store i32 {{.*}} !dbg [[DBG_FOO_VALUE:!.*]]
33 j
// CHECK: store ptr {{.*}} !dbg [[DBG_FOO_REF:!.*]]
35 k
// CHECK: store float {{.*}} !dbg [[DBG_FOO_COMPLEX:!.*]]
39 // CHECK-LABEL: define {{.*}}f2{{.*}}
41 // CHECK: store float {{.*}} !dbg [[DBG_F2:!.*]]
48 // CHECK-LABEL: define
50 // CHECK: store float {{.*}} !dbg [[DBG_F3:!.*]]
57 // CHECK-LABEL: define
60 auto x
// CHECK: store {{.*}} !dbg [[DBG_F4:!.*]]
64 // CHECK-LABEL: define
67 auto x
// CHECK: store float {{.*}} !dbg [[DBG_F5:!.*]]
71 struct agg
{ int i
; };
74 // CHECK-LABEL: define
77 // CHECK: call void @llvm.memcpy{{.*}} !dbg [[DBG_F6:!.*]]
84 // CHECK-LABEL: define
89 int x
= ( // CHECK: load {{.*}} !dbg [[DBG_F7:!.*]]
93 // CHECK-LABEL: define
98 int x
= ( // CHECK: load {{.*}} !dbg [[DBG_F8:!.*]]
102 // CHECK-LABEL: define
107 auto x
= ( // CHECK: getelementptr {{.*}} !dbg [[DBG_F9:!.*]]
111 inline void *operator new(decltype(sizeof(1)), void *p
) noexcept
{ return p
; }
113 // CHECK-LABEL: define
117 // CHECK: store {{.*}} !dbg [[DBG_F10_STORE:!.*]]
119 new (void_src()) int(src()));
122 // noexcept just to simplify the codegen a bit
123 void fn() noexcept(true);
127 // noexcept(false) to convolute the global dtor
128 ~bar() noexcept(false);
130 // global ctor cleanup
131 // CHECK-LABEL: define
132 // CHECK: invoke{{ }}
133 // CHECK: invoke{{ }}
134 // CHECK: to label {{.*}}, !dbg [[DBG_GLBL_CTOR_B:!.*]]
137 // CHECK-LABEL: define
139 // global dtor cleanup
140 // CHECK-LABEL: define
141 // CHECK: invoke{{ }}
142 // CHECK: invoke{{ }}
143 // CHECK: to label {{.*}}, !dbg [[DBG_GLBL_DTOR_B:!.*]]
149 // CHECK-LABEL: define{{.*}}f11
150 __complex
double f11() {
152 // CHECK: store {{.*}} !dbg [[DBG_F11:!.*]]
157 // CHECK-LABEL: define
160 void f12_2(int = f12_1());
161 // CHECK: call {{.*}}{{(signext )?}}i32 noundef {{.*}} !dbg [[DBG_F12:!.*]]
166 // CHECK-LABEL: define
168 // CHECK: call {{.*}} !dbg [[DBG_F13:!.*]]
169 #define F13_IMPL 1, src()
179 // CHECK-LABEL: define
181 // CHECK: call {{.*}}f14_impl{{.*}}, !dbg [[DBG_F14_CTOR_CALL:![0-9]*]]
188 f14_use::f14_use() = default;
190 // CHECK-LABEL: define
191 // CHECK-LABEL: define
195 // CHECK: getelementptr {{.*}}, !dbg [[DBG_F15:![0-9]*]]
200 // CHECK-LABEL: define
201 void f16(__complex
float f
) {
202 __complex
float g
= //
203 // CHECK: add {{.*}}, !dbg [[DBG_F16:![0-9]*]]
208 // CHECK-LABEL: define
211 // CHECK: getelementptr {{.*}}, !dbg [[DBG_F17:![0-9]*]]
216 // CHECK-LABEL: define
217 void f18(int a
, int b
) {
218 // CHECK: icmp {{.*}}, !dbg [[DBG_F18_1:![0-9]*]]
219 // CHECK: br {{.*}}, !dbg [[DBG_F18_2:![0-9]*]]
227 // CHECK-LABEL: define
228 void f19(int a
, int b
) {
229 // CHECK: icmp {{.*}}, !dbg [[DBG_F19_1:![0-9]*]]
230 // CHECK: br {{.*}}, !dbg [[DBG_F19_2:![0-9]*]]
238 // CHECK-LABEL: define
239 void f20(int a
, int b
, int c
) {
240 // CHECK: icmp {{.*}}, !dbg [[DBG_F20_1:![0-9]*]]
241 // FIXME: Conditional operator's exprloc should be the '?' not the start of the
242 // expression, then this would go in the right place. (but adding getExprLoc to
243 // the ConditionalOperator breaks the ARC migration tool - need to investigate
245 // CHECK: br {{.*}}, !dbg [[DBG_F20_1]]
253 // CHECK-LABEL: define
255 void f21_b(int = f21_a());
257 // CHECK: call {{.*}}f21_b{{.*}}, !dbg [[DBG_F21:![0-9]*]]
262 // CHECK-LABEL: define
270 // CHECK: invoke {{.*}}src
271 // CHECK: call {{.*}}, !dbg [[DBG_F22:![0-9]*]]
272 // CHECK: call {{.*}}, !dbg [[DBG_F22]]
277 // CHECK-LABEL: define
281 void f23_b(f23_struct
= f23_a());
283 // CHECK: call {{.*}}f23_a{{.*}}, !dbg [[DBG_F23:![0-9]*]]
288 // CHECK-LABEL: define
289 void f24_a(__complex
float = complex_src());
291 // CHECK: call {{.*}}complex_src{{.*}}, !dbg [[DBG_F24:![0-9]*]]
296 // CHECK-LABEL: define
297 void f25_a(int x
= __builtin_LINE()) {}
299 // CHECK: call void @_Z5f25_ai(i32 noundef {{(signext )?}}2700)
303 // CHECK: [[DBG_F1]] = !DILocation(line: 100,
304 // CHECK: [[DBG_FOO_VALUE]] = !DILocation(line: 200,
305 // CHECK: [[DBG_FOO_REF]] = !DILocation(line: 202,
306 // CHECK: [[DBG_FOO_COMPLEX]] = !DILocation(line: 204,
307 // CHECK: [[DBG_F2]] = !DILocation(line: 300,
308 // CHECK: [[DBG_F3]] = !DILocation(line: 400,
309 // CHECK: [[DBG_F4]] = !DILocation(line: 500,
310 // CHECK: [[DBG_F5]] = !DILocation(line: 600,
311 // CHECK: [[DBG_F6]] = !DILocation(line: 700,
312 // CHECK: [[DBG_F7]] = !DILocation(line: 800,
313 // CHECK: [[DBG_F8]] = !DILocation(line: 900,
314 // CHECK: [[DBG_F9]] = !DILocation(line: 1000,
315 // CHECK: [[DBG_F10_STORE]] = !DILocation(line: 1100,
316 // CHECK: [[DBG_GLBL_CTOR_B]] = !DILocation(line: 1200,
317 // CHECK: [[DBG_GLBL_DTOR_B]] = !DILocation(line: 0,
318 // CHECK: [[DBG_F11]] = !DILocation(line: 1300,
319 // CHECK: [[DBG_F12]] = !DILocation(line: 1400,
320 // CHECK: [[DBG_F13]] = !DILocation(line: 1500,
321 // CHECK: [[DBG_F14_CTOR_CALL]] = !DILocation(line: 1600,
322 // CHECK: [[DBG_F15]] = !DILocation(line: 1700,
323 // CHECK: [[DBG_F16]] = !DILocation(line: 1800,
324 // CHECK: [[DBG_F17]] = !DILocation(line: 1900,
325 // CHECK: [[DBG_F18_1]] = !DILocation(line: 2000,
326 // CHECK: [[DBG_F18_2]] = !DILocation(line: 2001,
327 // CHECK: [[DBG_F19_1]] = !DILocation(line: 2100,
328 // CHECK: [[DBG_F19_2]] = !DILocation(line: 2101,
329 // CHECK: [[DBG_F20_1]] = !DILocation(line: 2200,
330 // CHECK: [[DBG_F23]] = !DILocation(line: 2500,
331 // CHECK: [[DBG_F24]] = !DILocation(line: 2600,