[RISCV][FMV] Support target_clones (#85786)
[llvm-project.git] / clang / test / Analysis / lifetime-cfg-output.cpp
blobd8b8dc4a71d4aec7f7542b901525c3db3eb9e6da
1 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-checker=debug.DumpCFG -analyzer-config cfg-lifetime=true %s > %t 2>&1
2 // RUN: FileCheck --input-file=%t %s
4 // FIXME Most of the cases in this file test only with the objects of type `A`,
5 // that has a non-trivial destructor. The types with a trivial destructor
6 // ends their lifetime when the underlying memory is released, i.e. they
7 // are destroyed last, after all objects with non-trivial destructors.
8 // Consequently, they are handled differently in code, and we should make
9 // sure that test cover also trivially destructible types.
11 extern bool UV;
12 class A {
13 public:
14 // CHECK: [B2 (ENTRY)]
15 // CHECK-NEXT: Succs (1): B1
16 // CHECK: [B1]
17 // CHECK-NEXT: 1: true
18 // CHECK-NEXT: 2: UV
19 // CHECK-NEXT: 3: [B1.2] = [B1.1]
20 // CHECK-NEXT: Preds (1): B2
21 // CHECK-NEXT: Succs (1): B0
22 // CHECK: [B0 (EXIT)]
23 // CHECK-NEXT: Preds (1): B1
24 A() {
25 UV = true;
27 // CHECK: [B3 (ENTRY)]
28 // CHECK-NEXT: Succs (1): B2
29 // CHECK: [B1]
30 // CHECK-NEXT: 1: 0
31 // CHECK-NEXT: 2: this
32 // CHECK-NEXT: 3: [B1.2]->p
33 // CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, LValueToRValue, int *)
34 // CHECK-NEXT: 5: *[B1.4]
35 // CHECK-NEXT: 6: [B1.5] = [B1.1]
36 // CHECK-NEXT: Preds (1): B2
37 // CHECK-NEXT: Succs (1): B0
38 // CHECK: [B2]
39 // CHECK-NEXT: 1: this
40 // CHECK-NEXT: 2: [B2.1]->p
41 // CHECK-NEXT: 3: [B2.2] (ImplicitCastExpr, LValueToRValue, int *)
42 // CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, PointerToBoolean, _Bool)
43 // CHECK-NEXT: T: if [B2.4]
44 // CHECK-NEXT: Preds (1): B3
45 // CHECK-NEXT: Succs (2): B1 B0
46 // CHECK: [B0 (EXIT)]
47 // CHECK-NEXT: Preds (2): B1 B2
48 ~A() {
49 if (p)
50 *p = 0;
52 // CHECK: [B2 (ENTRY)]
53 // CHECK-NEXT: Succs (1): B1
54 // CHECK: [B1]
55 // CHECK-NEXT: 1: 1
56 // CHECK-NEXT: 2: return [B1.1];
57 // CHECK-NEXT: Preds (1): B2
58 // CHECK-NEXT: Succs (1): B0
59 // CHECK: [B0 (EXIT)]
60 // CHECK-NEXT: Preds (1): B1
61 operator int() const { return 1; }
62 int *p;
65 // CHECK: [B2 (ENTRY)]
66 // CHECK-NEXT: Succs (1): B1
67 // CHECK: [B1]
68 // CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], A)
69 // CHECK-NEXT: 2: A a;
70 // CHECK-NEXT: 3: a
71 // CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const A)
72 // CHECK-NEXT: 5: const A &b = a;
73 // CHECK-NEXT: 6: A() (CXXConstructExpr, [B1.9], A)
74 // CHECK-NEXT: 7: [B1.6] (BindTemporary)
75 // CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const A)
76 // CHECK-NEXT: 9: [B1.8]
77 // CHECK-NEXT: 10: const A &c = A();
78 // CHECK-NEXT: 11: [B1.10].~A() (Implicit destructor)
79 // CHECK-NEXT: 12: [B1.10] (Lifetime ends)
80 // CHECK-NEXT: 13: [B1.2].~A() (Implicit destructor)
81 // CHECK-NEXT: 14: [B1.2] (Lifetime ends)
82 // CHECK-NEXT: 15: [B1.5] (Lifetime ends)
83 // CHECK-NEXT: Preds (1): B2
84 // CHECK-NEXT: Succs (1): B0
85 // CHECK: [B0 (EXIT)]
86 // CHECK-NEXT: Preds (1): B1
87 void test_const_ref() {
88 A a;
89 const A &b = a;
90 const A &c = A();
93 // CHECK: [B2 (ENTRY)]
94 // CHECK-NEXT: Succs (1): B1
95 // CHECK: [B1]
96 // CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], A[2])
97 // CHECK-NEXT: 2: A a[2];
98 // CHECK-NEXT: 3: (CXXConstructExpr, [B1.4], A[0])
99 // CHECK-NEXT: 4: A b[0];
100 // CHECK-NEXT: 5: [B1.2].~A[2]() (Implicit destructor)
101 // lifetime of a ends when its destructors are run
102 // CHECK-NEXT: 6: [B1.2] (Lifetime ends)
103 // lifetime of b ends when its storage duration ends
104 // CHECK-NEXT: 7: [B1.4] (Lifetime ends)
105 // CHECK-NEXT: Preds (1): B2
106 // CHECK-NEXT: Succs (1): B0
107 // CHECK: [B0 (EXIT)]
108 // CHECK-NEXT: Preds (1): B1
109 void test_array() {
110 A a[2];
111 A b[0];
114 // CHECK: [B2 (ENTRY)]
115 // CHECK-NEXT: Succs (1): B1
116 // CHECK: [B1]
117 // CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], A)
118 // CHECK-NEXT: 2: A a;
119 // CHECK-NEXT: 3: (CXXConstructExpr, [B1.4], A)
120 // CHECK-NEXT: 4: A c;
121 // CHECK-NEXT: 5: (CXXConstructExpr, [B1.6], A)
122 // CHECK-NEXT: 6: A d;
123 // CHECK-NEXT: 7: [B1.6].~A() (Implicit destructor)
124 // CHECK-NEXT: 8: [B1.6] (Lifetime ends)
125 // CHECK-NEXT: 9: [B1.4].~A() (Implicit destructor)
126 // CHECK-NEXT: 10: [B1.4] (Lifetime ends)
127 // CHECK-NEXT: 11: (CXXConstructExpr, [B1.12], A)
128 // CHECK-NEXT: 12: A b;
129 // CHECK-NEXT: 13: [B1.12].~A() (Implicit destructor)
130 // CHECK-NEXT: 14: [B1.12] (Lifetime ends)
131 // CHECK-NEXT: 15: [B1.2].~A() (Implicit destructor)
132 // CHECK-NEXT: 16: [B1.2] (Lifetime ends)
133 // CHECK-NEXT: Preds (1): B2
134 // CHECK-NEXT: Succs (1): B0
135 // CHECK: [B0 (EXIT)]
136 // CHECK-NEXT: Preds (1): B1
137 void test_scope() {
138 A a;
140 A c;
141 A d;
143 A b;
146 // CHECK: [B4 (ENTRY)]
147 // CHECK-NEXT: Succs (1): B3
148 // CHECK: [B1]
149 // CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], A)
150 // CHECK-NEXT: 2: A c;
151 // CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
152 // CHECK-NEXT: 4: [B1.2] (Lifetime ends)
153 // CHECK-NEXT: 5: [B3.4].~A() (Implicit destructor)
154 // CHECK-NEXT: 6: [B3.4] (Lifetime ends)
155 // CHECK-NEXT: 7: [B3.2].~A() (Implicit destructor)
156 // CHECK-NEXT: 8: [B3.2] (Lifetime ends)
157 // CHECK-NEXT: Preds (1): B3
158 // CHECK-NEXT: Succs (1): B0
159 // CHECK: [B2]
160 // CHECK-NEXT: 1: return;
161 // CHECK-NEXT: 2: [B3.4].~A() (Implicit destructor)
162 // CHECK-NEXT: 3: [B3.4] (Lifetime ends)
163 // CHECK-NEXT: 4: [B3.2].~A() (Implicit destructor)
164 // CHECK-NEXT: 5: [B3.2] (Lifetime ends)
165 // CHECK-NEXT: Preds (1): B3
166 // CHECK-NEXT: Succs (1): B0
167 // CHECK: [B3]
168 // CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], A)
169 // CHECK-NEXT: 2: A a;
170 // CHECK-NEXT: 3: (CXXConstructExpr, [B3.4], A)
171 // CHECK-NEXT: 4: A b;
172 // CHECK-NEXT: 5: UV
173 // CHECK-NEXT: 6: [B3.5] (ImplicitCastExpr, LValueToRValue, _Bool)
174 // CHECK-NEXT: T: if [B3.6]
175 // CHECK-NEXT: Preds (1): B4
176 // CHECK-NEXT: Succs (2): B2 B1
177 // CHECK: [B0 (EXIT)]
178 // CHECK-NEXT: Preds (2): B1 B2
179 void test_return() {
180 A a;
181 A b;
182 if (UV)
183 return;
184 A c;
187 // CHECK: [B5 (ENTRY)]
188 // CHECK-NEXT: Succs (1): B4
189 // CHECK: [B1]
190 // CHECK-NEXT: 1: [B4.6].~A() (Implicit destructor)
191 // CHECK-NEXT: 2: [B4.6] (Lifetime ends)
192 // CHECK-NEXT: 3: [B4.2].~A() (Implicit destructor)
193 // CHECK-NEXT: 4: [B4.2] (Lifetime ends)
194 // CHECK-NEXT: Preds (2): B2 B3
195 // CHECK-NEXT: Succs (1): B0
196 // CHECK: [B2]
197 // CHECK-NEXT: 1: (CXXConstructExpr, [B2.2], A)
198 // CHECK-NEXT: 2: A c;
199 // CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
200 // CHECK-NEXT: 4: [B2.2] (Lifetime ends)
201 // CHECK-NEXT: Preds (1): B4
202 // CHECK-NEXT: Succs (1): B1
203 // CHECK: [B3]
204 // CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], A)
205 // CHECK-NEXT: 2: A c;
206 // CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
207 // CHECK-NEXT: 4: [B3.2] (Lifetime ends)
208 // CHECK-NEXT: Preds (1): B4
209 // CHECK-NEXT: Succs (1): B1
210 // CHECK: [B4]
211 // CHECK-NEXT: 1: (CXXConstructExpr, [B4.2], A)
212 // CHECK-NEXT: 2: A a;
213 // CHECK-NEXT: 3: a
214 // CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, NoOp, const A)
215 // CHECK-NEXT: 5: [B4.4] (CXXConstructExpr, [B4.6], A)
216 // CHECK-NEXT: 6: A b = a;
217 // CHECK-NEXT: 7: b
218 // CHECK-NEXT: 8: [B4.7] (ImplicitCastExpr, NoOp, const class A)
219 // CHECK-NEXT: 9: [B4.8].operator int
220 // CHECK-NEXT: 10: [B4.8]
221 // CHECK-NEXT: 11: [B4.10] (ImplicitCastExpr, UserDefinedConversion, int)
222 // CHECK-NEXT: 12: [B4.11] (ImplicitCastExpr, IntegralToBoolean, _Bool)
223 // CHECK-NEXT: T: if [B4.12]
224 // CHECK-NEXT: Preds (1): B5
225 // CHECK-NEXT: Succs (2): B3 B2
226 // CHECK: [B0 (EXIT)]
227 // CHECK-NEXT: Preds (1): B1
228 void test_if_implicit_scope() {
229 A a;
230 if (A b = a)
231 A c;
232 else
233 A c;
236 // CHECK: [B9 (ENTRY)]
237 // CHECK-NEXT: Succs (1): B8
238 // CHECK: [B1]
239 // CHECK-NEXT: 1: [B8.6].~A() (Implicit destructor)
240 // CHECK-NEXT: 2: [B8.6] (Lifetime ends)
241 // CHECK-NEXT: 3: (CXXConstructExpr, [B1.4], A)
242 // CHECK-NEXT: 4: A e;
243 // CHECK-NEXT: 5: [B1.4].~A() (Implicit destructor)
244 // CHECK-NEXT: 6: [B1.4] (Lifetime ends)
245 // CHECK-NEXT: 7: [B8.2].~A() (Implicit destructor)
246 // CHECK-NEXT: 8: [B8.2] (Lifetime ends)
247 // CHECK-NEXT: Preds (2): B2 B5
248 // CHECK-NEXT: Succs (1): B0
249 // CHECK: [B2]
250 // CHECK-NEXT: 1: (CXXConstructExpr, [B2.2], A)
251 // CHECK-NEXT: 2: A d;
252 // CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
253 // CHECK-NEXT: 4: [B2.2] (Lifetime ends)
254 // CHECK-NEXT: 5: [B4.2].~A() (Implicit destructor)
255 // CHECK-NEXT: 6: [B4.2] (Lifetime ends)
256 // CHECK-NEXT: Preds (1): B4
257 // CHECK-NEXT: Succs (1): B1
258 // CHECK: [B3]
259 // CHECK-NEXT: 1: return;
260 // CHECK-NEXT: 2: [B4.2].~A() (Implicit destructor)
261 // CHECK-NEXT: 3: [B4.2] (Lifetime ends)
262 // CHECK-NEXT: 4: [B8.6].~A() (Implicit destructor)
263 // CHECK-NEXT: 5: [B8.6] (Lifetime ends)
264 // CHECK-NEXT: 6: [B8.2].~A() (Implicit destructor)
265 // CHECK-NEXT: 7: [B8.2] (Lifetime ends)
266 // CHECK-NEXT: Preds (1): B4
267 // CHECK-NEXT: Succs (1): B0
268 // CHECK: [B4]
269 // CHECK-NEXT: 1: (CXXConstructExpr, [B4.2], A)
270 // CHECK-NEXT: 2: A c;
271 // CHECK-NEXT: 3: UV
272 // CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, LValueToRValue, _Bool)
273 // CHECK-NEXT: T: if [B4.4]
274 // CHECK-NEXT: Preds (1): B8
275 // CHECK-NEXT: Succs (2): B3 B2
276 // CHECK: [B5]
277 // CHECK-NEXT: 1: (CXXConstructExpr, [B5.2], A)
278 // CHECK-NEXT: 2: A d;
279 // CHECK-NEXT: 3: [B5.2].~A() (Implicit destructor)
280 // CHECK-NEXT: 4: [B5.2] (Lifetime ends)
281 // CHECK-NEXT: 5: [B7.2].~A() (Implicit destructor)
282 // CHECK-NEXT: 6: [B7.2] (Lifetime ends)
283 // CHECK-NEXT: Preds (1): B7
284 // CHECK-NEXT: Succs (1): B1
285 // CHECK: [B6]
286 // CHECK-NEXT: 1: return;
287 // CHECK-NEXT: 2: [B7.2].~A() (Implicit destructor)
288 // CHECK-NEXT: 3: [B7.2] (Lifetime ends)
289 // CHECK-NEXT: 4: [B8.6].~A() (Implicit destructor)
290 // CHECK-NEXT: 5: [B8.6] (Lifetime ends)
291 // CHECK-NEXT: 6: [B8.2].~A() (Implicit destructor)
292 // CHECK-NEXT: 7: [B8.2] (Lifetime ends)
293 // CHECK-NEXT: Preds (1): B7
294 // CHECK-NEXT: Succs (1): B0
295 // CHECK: [B7]
296 // CHECK-NEXT: 1: (CXXConstructExpr, [B7.2], A)
297 // CHECK-NEXT: 2: A c;
298 // CHECK-NEXT: 3: UV
299 // CHECK-NEXT: 4: [B7.3] (ImplicitCastExpr, LValueToRValue, _Bool)
300 // CHECK-NEXT: T: if [B7.4]
301 // CHECK-NEXT: Preds (1): B8
302 // CHECK-NEXT: Succs (2): B6 B5
303 // CHECK: [B8]
304 // CHECK-NEXT: 1: (CXXConstructExpr, [B8.2], A)
305 // CHECK-NEXT: 2: A a;
306 // CHECK-NEXT: 3: a
307 // CHECK-NEXT: 4: [B8.3] (ImplicitCastExpr, NoOp, const A)
308 // CHECK-NEXT: 5: [B8.4] (CXXConstructExpr, [B8.6], A)
309 // CHECK-NEXT: 6: A b = a;
310 // CHECK-NEXT: 7: b
311 // CHECK-NEXT: 8: [B8.7] (ImplicitCastExpr, NoOp, const class A)
312 // CHECK-NEXT: 9: [B8.8].operator int
313 // CHECK-NEXT: 10: [B8.8]
314 // CHECK-NEXT: 11: [B8.10] (ImplicitCastExpr, UserDefinedConversion, int)
315 // CHECK-NEXT: 12: [B8.11] (ImplicitCastExpr, IntegralToBoolean, _Bool)
316 // CHECK-NEXT: T: if [B8.12]
317 // CHECK-NEXT: Preds (1): B9
318 // CHECK-NEXT: Succs (2): B7 B4
319 // CHECK: [B0 (EXIT)]
320 // CHECK-NEXT: Preds (3): B1 B3 B6
321 void test_if_jumps() {
322 A a;
323 if (A b = a) {
324 A c;
325 if (UV)
326 return;
327 A d;
328 } else {
329 A c;
330 if (UV)
331 return;
332 A d;
334 A e;
337 // CHECK: [B6 (ENTRY)]
338 // CHECK-NEXT: Succs (1): B5
339 // CHECK: [B1]
340 // CHECK-NEXT: 1: [B4.4].~A() (Implicit destructor)
341 // CHECK-NEXT: 2: [B4.4] (Lifetime ends)
342 // CHECK-NEXT: 3: [B5.2].~A() (Implicit destructor)
343 // CHECK-NEXT: 4: [B5.2] (Lifetime ends)
344 // CHECK-NEXT: Preds (1): B4
345 // CHECK-NEXT: Succs (1): B0
346 // CHECK: [B2]
347 // CHECK-NEXT: Preds (1): B3
348 // CHECK-NEXT: Succs (1): B4
349 // CHECK: [B3]
350 // CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], A)
351 // CHECK-NEXT: 2: A c;
352 // CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
353 // CHECK-NEXT: 4: [B3.2] (Lifetime ends)
354 // CHECK-NEXT: 5: [B4.4].~A() (Implicit destructor)
355 // CHECK-NEXT: 6: [B4.4] (Lifetime ends)
356 // CHECK-NEXT: Preds (1): B4
357 // CHECK-NEXT: Succs (1): B2
358 // CHECK: [B4]
359 // CHECK-NEXT: 1: a
360 // CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const A)
361 // CHECK-NEXT: 3: [B4.2] (CXXConstructExpr, [B4.4], A)
362 // CHECK-NEXT: 4: A b = a;
363 // CHECK-NEXT: 5: b
364 // CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
365 // CHECK-NEXT: 7: [B4.6].operator int
366 // CHECK-NEXT: 8: [B4.6]
367 // CHECK-NEXT: 9: [B4.8] (ImplicitCastExpr, UserDefinedConversion, int)
368 // CHECK-NEXT: 10: [B4.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
369 // CHECK-NEXT: T: while [B4.10]
370 // CHECK-NEXT: Preds (2): B2 B5
371 // CHECK-NEXT: Succs (2): B3 B1
372 // CHECK: [B5]
373 // CHECK-NEXT: 1: (CXXConstructExpr, [B5.2], A)
374 // CHECK-NEXT: 2: A a;
375 // CHECK-NEXT: Preds (1): B6
376 // CHECK-NEXT: Succs (1): B4
377 // CHECK: [B0 (EXIT)]
378 // CHECK-NEXT: Preds (1): B1
379 void test_while_implicit_scope() {
380 A a;
381 while (A b = a)
382 A c;
385 // CHECK: [B12 (ENTRY)]
386 // CHECK-NEXT: Succs (1): B11
387 // CHECK: [B1]
388 // CHECK-NEXT: 1: [B10.4].~A() (Implicit destructor)
389 // CHECK-NEXT: 2: [B10.4] (Lifetime ends)
390 // CHECK-NEXT: 3: (CXXConstructExpr, [B1.4], A)
391 // CHECK-NEXT: 4: A e;
392 // CHECK-NEXT: 5: [B1.4].~A() (Implicit destructor)
393 // CHECK-NEXT: 6: [B1.4] (Lifetime ends)
394 // CHECK-NEXT: 7: [B11.2].~A() (Implicit destructor)
395 // CHECK-NEXT: 8: [B11.2] (Lifetime ends)
396 // CHECK-NEXT: Preds (2): B8 B10
397 // CHECK-NEXT: Succs (1): B0
398 // CHECK: [B2]
399 // CHECK-NEXT: Preds (2): B3 B6
400 // CHECK-NEXT: Succs (1): B10
401 // CHECK: [B3]
402 // CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], A)
403 // CHECK-NEXT: 2: A d;
404 // CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
405 // CHECK-NEXT: 4: [B3.2] (Lifetime ends)
406 // CHECK-NEXT: 5: [B9.2].~A() (Implicit destructor)
407 // CHECK-NEXT: 6: [B9.2] (Lifetime ends)
408 // CHECK-NEXT: 7: [B10.4].~A() (Implicit destructor)
409 // CHECK-NEXT: 8: [B10.4] (Lifetime ends)
410 // CHECK-NEXT: Preds (1): B5
411 // CHECK-NEXT: Succs (1): B2
412 // CHECK: [B4]
413 // CHECK-NEXT: 1: return;
414 // CHECK-NEXT: 2: [B9.2].~A() (Implicit destructor)
415 // CHECK-NEXT: 3: [B9.2] (Lifetime ends)
416 // CHECK-NEXT: 4: [B10.4].~A() (Implicit destructor)
417 // CHECK-NEXT: 5: [B10.4] (Lifetime ends)
418 // CHECK-NEXT: 6: [B11.2].~A() (Implicit destructor)
419 // CHECK-NEXT: 7: [B11.2] (Lifetime ends)
420 // CHECK-NEXT: Preds (1): B5
421 // CHECK-NEXT: Succs (1): B0
422 // CHECK: [B5]
423 // CHECK-NEXT: 1: UV
424 // CHECK-NEXT: 2: [B5.1] (ImplicitCastExpr, LValueToRValue, _Bool)
425 // CHECK-NEXT: T: if [B5.2]
426 // CHECK-NEXT: Preds (1): B7
427 // CHECK-NEXT: Succs (2): B4 B3
428 // CHECK: [B6]
429 // CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
430 // CHECK-NEXT: 2: [B9.2] (Lifetime ends)
431 // CHECK-NEXT: 3: [B10.4].~A() (Implicit destructor)
432 // CHECK-NEXT: 4: [B10.4] (Lifetime ends)
433 // CHECK-NEXT: T: continue;
434 // CHECK-NEXT: Preds (1): B7
435 // CHECK-NEXT: Succs (1): B2
436 // CHECK: [B7]
437 // CHECK-NEXT: 1: UV
438 // CHECK-NEXT: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
439 // CHECK-NEXT: T: if [B7.2]
440 // CHECK-NEXT: Preds (1): B9
441 // CHECK-NEXT: Succs (2): B6 B5
442 // CHECK: [B8]
443 // CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
444 // CHECK-NEXT: 2: [B9.2] (Lifetime ends)
445 // CHECK-NEXT: T: break;
446 // CHECK-NEXT: Preds (1): B9
447 // CHECK-NEXT: Succs (1): B1
448 // CHECK: [B9]
449 // CHECK-NEXT: 1: (CXXConstructExpr, [B9.2], A)
450 // CHECK-NEXT: 2: A c;
451 // CHECK-NEXT: 3: UV
452 // CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
453 // CHECK-NEXT: T: if [B9.4]
454 // CHECK-NEXT: Preds (1): B10
455 // CHECK-NEXT: Succs (2): B8 B7
456 // CHECK: [B10]
457 // CHECK-NEXT: 1: a
458 // CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const A)
459 // CHECK-NEXT: 3: [B10.2] (CXXConstructExpr, [B10.4], A)
460 // CHECK-NEXT: 4: A b = a;
461 // CHECK-NEXT: 5: b
462 // CHECK-NEXT: 6: [B10.5] (ImplicitCastExpr, NoOp, const class A)
463 // CHECK-NEXT: 7: [B10.6].operator int
464 // CHECK-NEXT: 8: [B10.6]
465 // CHECK-NEXT: 9: [B10.8] (ImplicitCastExpr, UserDefinedConversion, int)
466 // CHECK-NEXT: 10: [B10.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
467 // CHECK-NEXT: T: while [B10.10]
468 // CHECK-NEXT: Preds (2): B2 B11
469 // CHECK-NEXT: Succs (2): B9 B1
470 // CHECK: [B11]
471 // CHECK-NEXT: 1: (CXXConstructExpr, [B11.2], A)
472 // CHECK-NEXT: 2: A a;
473 // CHECK-NEXT: Preds (1): B12
474 // CHECK-NEXT: Succs (1): B10
475 // CHECK: [B0 (EXIT)]
476 // CHECK-NEXT: Preds (2): B1 B4
477 void test_while_jumps() {
478 A a;
479 while (A b = a) {
480 A c;
481 if (UV)
482 break;
483 if (UV)
484 continue;
485 if (UV)
486 return;
487 A d;
489 A e;
492 // CHECK: [B12 (ENTRY)]
493 // CHECK-NEXT: Succs (1): B11
494 // CHECK: [B1]
495 // CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], A)
496 // CHECK-NEXT: 2: A d;
497 // CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
498 // CHECK-NEXT: 4: [B1.2] (Lifetime ends)
499 // CHECK-NEXT: 5: [B11.2].~A() (Implicit destructor)
500 // CHECK-NEXT: 6: [B11.2] (Lifetime ends)
501 // CHECK-NEXT: Preds (2): B8 B2
502 // CHECK-NEXT: Succs (1): B0
503 // CHECK: [B2]
504 // CHECK-NEXT: 1: UV
505 // CHECK-NEXT: 2: [B2.1] (ImplicitCastExpr, LValueToRValue, _Bool)
506 // CHECK-NEXT: T: do ... while [B2.2]
507 // CHECK-NEXT: Preds (2): B3 B6
508 // CHECK-NEXT: Succs (2): B10 B1
509 // CHECK: [B3]
510 // CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], A)
511 // CHECK-NEXT: 2: A c;
512 // CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
513 // CHECK-NEXT: 4: [B3.2] (Lifetime ends)
514 // CHECK-NEXT: 5: [B9.2].~A() (Implicit destructor)
515 // CHECK-NEXT: 6: [B9.2] (Lifetime ends)
516 // CHECK-NEXT: Preds (1): B5
517 // CHECK-NEXT: Succs (1): B2
518 // CHECK: [B4]
519 // CHECK-NEXT: 1: return;
520 // CHECK-NEXT: 2: [B9.2].~A() (Implicit destructor)
521 // CHECK-NEXT: 3: [B9.2] (Lifetime ends)
522 // CHECK-NEXT: 4: [B11.2].~A() (Implicit destructor)
523 // CHECK-NEXT: 5: [B11.2] (Lifetime ends)
524 // CHECK-NEXT: Preds (1): B5
525 // CHECK-NEXT: Succs (1): B0
526 // CHECK: [B5]
527 // CHECK-NEXT: 1: UV
528 // CHECK-NEXT: 2: [B5.1] (ImplicitCastExpr, LValueToRValue, _Bool)
529 // CHECK-NEXT: T: if [B5.2]
530 // CHECK-NEXT: Preds (1): B7
531 // CHECK-NEXT: Succs (2): B4 B3
532 // CHECK: [B6]
533 // CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
534 // CHECK-NEXT: 2: [B9.2] (Lifetime ends)
535 // CHECK-NEXT: T: continue;
536 // CHECK-NEXT: Preds (1): B7
537 // CHECK-NEXT: Succs (1): B2
538 // CHECK: [B7]
539 // CHECK-NEXT: 1: UV
540 // CHECK-NEXT: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
541 // CHECK-NEXT: T: if [B7.2]
542 // CHECK-NEXT: Preds (1): B9
543 // CHECK-NEXT: Succs (2): B6 B5
544 // CHECK: [B8]
545 // CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
546 // CHECK-NEXT: 2: [B9.2] (Lifetime ends)
547 // CHECK-NEXT: T: break;
548 // CHECK-NEXT: Preds (1): B9
549 // CHECK-NEXT: Succs (1): B1
550 // CHECK: [B9]
551 // CHECK-NEXT: 1: (CXXConstructExpr, [B9.2], A)
552 // CHECK-NEXT: 2: A b;
553 // CHECK-NEXT: 3: UV
554 // CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
555 // CHECK-NEXT: T: if [B9.4]
556 // CHECK-NEXT: Preds (2): B10 B11
557 // CHECK-NEXT: Succs (2): B8 B7
558 // CHECK: [B10]
559 // CHECK-NEXT: Preds (1): B2
560 // CHECK-NEXT: Succs (1): B9
561 // CHECK: [B11]
562 // CHECK-NEXT: 1: (CXXConstructExpr, [B11.2], A)
563 // CHECK-NEXT: 2: A a;
564 // CHECK-NEXT: Preds (1): B12
565 // CHECK-NEXT: Succs (1): B9
566 // CHECK: [B0 (EXIT)]
567 // CHECK-NEXT: Preds (2): B1 B4
568 void test_do_jumps() {
569 A a;
570 do {
571 A b;
572 if (UV)
573 break;
574 if (UV)
575 continue;
576 if (UV)
577 return;
578 A c;
579 } while (UV);
580 A d;
583 // CHECK: [B6 (ENTRY)]
584 // CHECK-NEXT: Succs (1): B5
585 // CHECK: [B1]
586 // CHECK-NEXT: 1: [B4.4].~A() (Implicit destructor)
587 // CHECK-NEXT: 2: [B4.4] (Lifetime ends)
588 // CHECK-NEXT: 3: [B5.2].~A() (Implicit destructor)
589 // CHECK-NEXT: 4: [B5.2] (Lifetime ends)
590 // CHECK-NEXT: Preds (1): B4
591 // CHECK-NEXT: Succs (1): B0
592 // CHECK: [B2]
593 // CHECK-NEXT: 1: b
594 // CHECK-NEXT: 2: [B2.1].p
595 // CHECK-NEXT: 3: [B4.4].~A() (Implicit destructor)
596 // CHECK-NEXT: 4: [B4.4] (Lifetime ends)
597 // CHECK-NEXT: Preds (1): B3
598 // CHECK-NEXT: Succs (1): B4
599 // CHECK: [B3]
600 // CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], A)
601 // CHECK-NEXT: 2: A c;
602 // CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
603 // CHECK-NEXT: 4: [B3.2] (Lifetime ends)
604 // CHECK-NEXT: Preds (1): B4
605 // CHECK-NEXT: Succs (1): B2
606 // CHECK: [B4]
607 // CHECK-NEXT: 1: a
608 // CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const A)
609 // CHECK-NEXT: 3: [B4.2] (CXXConstructExpr, [B4.4], A)
610 // CHECK-NEXT: 4: A b = a;
611 // CHECK-NEXT: 5: b
612 // CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
613 // CHECK-NEXT: 7: [B4.6].operator int
614 // CHECK-NEXT: 8: [B4.6]
615 // CHECK-NEXT: 9: [B4.8] (ImplicitCastExpr, UserDefinedConversion, int)
616 // CHECK-NEXT: 10: [B4.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
617 // CHECK-NEXT: T: for (...; [B4.10]; ...)
618 // CHECK-NEXT: Preds (2): B2 B5
619 // CHECK-NEXT: Succs (2): B3 B1
620 // CHECK: [B5]
621 // CHECK-NEXT: 1: (CXXConstructExpr, [B5.2], A)
622 // CHECK-NEXT: 2: A a;
623 // CHECK-NEXT: Preds (1): B6
624 // CHECK-NEXT: Succs (1): B4
625 // CHECK: [B0 (EXIT)]
626 // CHECK-NEXT: Preds (1): B1
627 void test_for_implicit_scope() {
628 for (A a; A b = a; b.p)
629 A c;
632 // CHECK: [B12 (ENTRY)]
633 // CHECK-NEXT: Succs (1): B11
634 // CHECK: [B1]
635 // CHECK-NEXT: 1: [B10.4].~A() (Implicit destructor)
636 // CHECK-NEXT: 2: [B10.4] (Lifetime ends)
637 // CHECK-NEXT: 3: [B11.4].~A() (Implicit destructor)
638 // CHECK-NEXT: 4: [B11.4] (Lifetime ends)
639 // CHECK-NEXT: 5: (CXXConstructExpr, [B1.6], A)
640 // CHECK-NEXT: 6: A f;
641 // CHECK-NEXT: 7: [B1.6].~A() (Implicit destructor)
642 // CHECK-NEXT: 8: [B1.6] (Lifetime ends)
643 // CHECK-NEXT: 9: [B11.2].~A() (Implicit destructor)
644 // CHECK-NEXT: 10: [B11.2] (Lifetime ends)
645 // CHECK-NEXT: Preds (2): B8 B10
646 // CHECK-NEXT: Succs (1): B0
647 // CHECK: [B2]
648 // CHECK-NEXT: 1: [B10.4].~A() (Implicit destructor)
649 // CHECK-NEXT: 2: [B10.4] (Lifetime ends)
650 // CHECK-NEXT: Preds (2): B3 B6
651 // CHECK-NEXT: Succs (1): B10
652 // CHECK: [B3]
653 // CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], A)
654 // CHECK-NEXT: 2: A e;
655 // CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
656 // CHECK-NEXT: 4: [B3.2] (Lifetime ends)
657 // CHECK-NEXT: 5: [B9.2].~A() (Implicit destructor)
658 // CHECK-NEXT: 6: [B9.2] (Lifetime ends)
659 // CHECK-NEXT: Preds (1): B5
660 // CHECK-NEXT: Succs (1): B2
661 // CHECK: [B4]
662 // CHECK-NEXT: 1: return;
663 // CHECK-NEXT: 2: [B9.2].~A() (Implicit destructor)
664 // CHECK-NEXT: 3: [B9.2] (Lifetime ends)
665 // CHECK-NEXT: 4: [B10.4].~A() (Implicit destructor)
666 // CHECK-NEXT: 5: [B10.4] (Lifetime ends)
667 // CHECK-NEXT: 6: [B11.4].~A() (Implicit destructor)
668 // CHECK-NEXT: 7: [B11.4] (Lifetime ends)
669 // CHECK-NEXT: 8: [B11.2].~A() (Implicit destructor)
670 // CHECK-NEXT: 9: [B11.2] (Lifetime ends)
671 // CHECK-NEXT: Preds (1): B5
672 // CHECK-NEXT: Succs (1): B0
673 // CHECK: [B5]
674 // CHECK-NEXT: 1: UV
675 // CHECK-NEXT: 2: [B5.1] (ImplicitCastExpr, LValueToRValue, _Bool)
676 // CHECK-NEXT: T: if [B5.2]
677 // CHECK-NEXT: Preds (1): B7
678 // CHECK-NEXT: Succs (2): B4 B3
679 // CHECK: [B6]
680 // CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
681 // CHECK-NEXT: 2: [B9.2] (Lifetime ends)
682 // CHECK-NEXT: T: continue;
683 // CHECK-NEXT: Preds (1): B7
684 // CHECK-NEXT: Succs (1): B2
685 // CHECK: [B7]
686 // CHECK-NEXT: 1: UV
687 // CHECK-NEXT: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
688 // CHECK-NEXT: T: if [B7.2]
689 // CHECK-NEXT: Preds (1): B9
690 // CHECK-NEXT: Succs (2): B6 B5
691 // CHECK: [B8]
692 // CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
693 // CHECK-NEXT: 2: [B9.2] (Lifetime ends)
694 // CHECK-NEXT: T: break;
695 // CHECK-NEXT: Preds (1): B9
696 // CHECK-NEXT: Succs (1): B1
697 // CHECK: [B9]
698 // CHECK-NEXT: 1: (CXXConstructExpr, [B9.2], A)
699 // CHECK-NEXT: 2: A d;
700 // CHECK-NEXT: 3: UV
701 // CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
702 // CHECK-NEXT: T: if [B9.4]
703 // CHECK-NEXT: Preds (1): B10
704 // CHECK-NEXT: Succs (2): B8 B7
705 // CHECK: [B10]
706 // CHECK-NEXT: 1: b
707 // CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const A)
708 // CHECK-NEXT: 3: [B10.2] (CXXConstructExpr, [B10.4], A)
709 // CHECK-NEXT: 4: A c = b;
710 // CHECK-NEXT: 5: c
711 // CHECK-NEXT: 6: [B10.5] (ImplicitCastExpr, NoOp, const class A)
712 // CHECK-NEXT: 7: [B10.6].operator int
713 // CHECK-NEXT: 8: [B10.6]
714 // CHECK-NEXT: 9: [B10.8] (ImplicitCastExpr, UserDefinedConversion, int)
715 // CHECK-NEXT: 10: [B10.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
716 // CHECK-NEXT: T: for (...; [B10.10]; )
717 // CHECK-NEXT: Preds (2): B2 B11
718 // CHECK-NEXT: Succs (2): B9 B1
719 // CHECK: [B11]
720 // CHECK-NEXT: 1: (CXXConstructExpr, [B11.2], A)
721 // CHECK-NEXT: 2: A a;
722 // CHECK-NEXT: 3: (CXXConstructExpr, [B11.4], A)
723 // CHECK-NEXT: 4: A b;
724 // CHECK-NEXT: Preds (1): B12
725 // CHECK-NEXT: Succs (1): B10
726 // CHECK: [B0 (EXIT)]
727 // CHECK-NEXT: Preds (2): B1 B4
728 void test_for_jumps() {
729 A a;
730 for (A b; A c = b; ) {
731 A d;
732 if (UV)
733 break;
734 if (UV)
735 continue;
736 if (UV)
737 return;
738 A e;
740 A f;
743 // CHECK: [B9 (ENTRY)]
744 // CHECK-NEXT: Succs (1): B8
745 // CHECK: [B1]
746 // CHECK-NEXT: 1: [B7.4].~A() (Implicit destructor)
747 // CHECK-NEXT: 2: [B7.4] (Lifetime ends)
748 // CHECK-NEXT: 3: [B8.2].~A() (Implicit destructor)
749 // CHECK-NEXT: 4: [B8.2] (Lifetime ends)
750 // CHECK-NEXT: Preds (1): B7
751 // CHECK-NEXT: Succs (1): B0
752 // CHECK: [B2]
753 // CHECK-NEXT: 1: [B5.4] ? [B3.3] : [B4.2]
754 // CHECK-NEXT: 2: [B7.4].~A() (Implicit destructor)
755 // CHECK-NEXT: 3: [B7.4] (Lifetime ends)
756 // CHECK-NEXT: Preds (2): B3 B4
757 // CHECK-NEXT: Succs (1): B7
758 // CHECK: [B3]
759 // CHECK-NEXT: 1: b
760 // CHECK-NEXT: 2: [B3.1].p
761 // CHECK-NEXT: 3: [B3.2]++
762 // CHECK-NEXT: Preds (1): B5
763 // CHECK-NEXT: Succs (1): B2
764 // CHECK: [B4]
765 // CHECK-NEXT: 1: 0
766 // CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NullToPointer, int *)
767 // CHECK-NEXT: Preds (1): B5
768 // CHECK-NEXT: Succs (1): B2
769 // CHECK: [B5]
770 // CHECK-NEXT: 1: b
771 // CHECK-NEXT: 2: [B5.1].p
772 // CHECK-NEXT: 3: [B5.2] (ImplicitCastExpr, LValueToRValue, int *)
773 // CHECK-NEXT: 4: [B5.3] (ImplicitCastExpr, PointerToBoolean, _Bool)
774 // CHECK-NEXT: T: [B5.4] ? ... : ...
775 // CHECK-NEXT: Preds (1): B6
776 // CHECK-NEXT: Succs (2): B3 B4
777 // CHECK: [B6]
778 // CHECK-NEXT: 1: 0
779 // CHECK-NEXT: 2: (void)[B6.1] (CStyleCastExpr, ToVoid, void)
780 // CHECK-NEXT: Preds (1): B7
781 // CHECK-NEXT: Succs (1): B5
782 // CHECK: [B7]
783 // CHECK-NEXT: 1: a
784 // CHECK-NEXT: 2: [B7.1] (ImplicitCastExpr, NoOp, const A)
785 // CHECK-NEXT: 3: [B7.2] (CXXConstructExpr, [B7.4], A)
786 // CHECK-NEXT: 4: A b = a;
787 // CHECK-NEXT: 5: b
788 // CHECK-NEXT: 6: [B7.5] (ImplicitCastExpr, NoOp, const class A)
789 // CHECK-NEXT: 7: [B7.6].operator int
790 // CHECK-NEXT: 8: [B7.6]
791 // CHECK-NEXT: 9: [B7.8] (ImplicitCastExpr, UserDefinedConversion, int)
792 // CHECK-NEXT: 10: [B7.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
793 // CHECK-NEXT: T: for (...; [B7.10]; ...)
794 // CHECK-NEXT: Preds (2): B2 B8
795 // CHECK-NEXT: Succs (2): B6 B1
796 // CHECK: [B8]
797 // CHECK-NEXT: 1: (CXXConstructExpr, [B8.2], A)
798 // CHECK-NEXT: 2: A a;
799 // CHECK-NEXT: Preds (1): B9
800 // CHECK-NEXT: Succs (1): B7
801 void test_for_inc_conditional() {
802 for (A a; A b = a; b.p ? b.p++ : 0)
803 (void)0;
806 // CHECK: [B2 (ENTRY)]
807 // CHECK-NEXT: Succs (1): B1
808 // CHECK: [B1]
809 // CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], A)
810 // CHECK-NEXT: 2: A a;
811 // CHECK-NEXT: 3: int n;
812 // CHECK-NEXT: 4: n
813 // CHECK-NEXT: 5: &[B1.4]
814 // CHECK-NEXT: 6: a
815 // CHECK-NEXT: 7: [B1.6].p
816 // CHECK-NEXT: 8: [B1.7] = [B1.5]
817 // CHECK-NEXT: 9: [B1.2].~A() (Implicit destructor)
818 // CHECK-NEXT: 10: [B1.2] (Lifetime ends)
819 // CHECK-NEXT: 11: [B1.3] (Lifetime ends)
820 // CHECK-NEXT: Preds (1): B2
821 // CHECK-NEXT: Succs (1): B0
822 // CHECK: [B0 (EXIT)]
823 // CHECK-NEXT: Preds (1): B1
824 void test_trivial_vs_non_trivial_order() {
825 A a;
826 int n;
827 a.p = &n;
830 // CHECK: [B4 (ENTRY)]
831 // CHECK-NEXT: Succs (1): B3
832 // CHECK: [B1]
833 // CHECK-NEXT: a:
834 // CHECK-NEXT: 1: 1
835 // CHECK-NEXT: 2: i
836 // CHECK-NEXT: 3: [B1.2] = [B1.1]
837 // CHECK-NEXT: 4: [B2.1] (Lifetime ends)
838 // CHECK-NEXT: Preds (2): B2 B3
839 // CHECK-NEXT: Succs (1): B0
840 // CHECK: [B2]
841 // CHECK-NEXT: 1: int i;
842 // CHECK-NEXT: Succs (1): B1
843 // CHECK: [B3]
844 // CHECK-NEXT: T: goto a;
845 // CHECK-NEXT: Preds (1): B4
846 // CHECK-NEXT: Succs (1): B1
847 // CHECK: [B0 (EXIT)]
848 // CHECK-NEXT: Preds (1): B1
849 void goto_past_declaration() {
850 goto a;
851 int i;
853 i = 1;
856 // CHECK: [B4 (ENTRY)]
857 // CHECK-NEXT: Succs (1): B3
858 // CHECK: [B1]
859 // CHECK-NEXT: a:
860 // CHECK-NEXT: 1: 1
861 // CHECK-NEXT: 2: k
862 // CHECK-NEXT: 3: [B1.2] = [B1.1]
863 // CHECK-NEXT: 4: [B2.4] (Lifetime ends)
864 // CHECK-NEXT: Preds (2): B2 B3
865 // CHECK-NEXT: Succs (1): B0
866 // CHECK: [B2]
867 // CHECK-NEXT: 1: int j;
868 // CHECK-NEXT: 2: [B2.1] (Lifetime ends)
869 // CHECK-NEXT: 3: [B3.1] (Lifetime ends)
870 // CHECK-NEXT: 4: int k;
871 // CHECK-NEXT: Succs (1): B1
872 // CHECK: [B3]
873 // CHECK-NEXT: 1: int i;
874 // CHECK-NEXT: 2: [B3.1] (Lifetime ends)
875 // CHECK-NEXT: T: goto a;
876 // CHECK-NEXT: Preds (1): B4
877 // CHECK-NEXT: Succs (1): B1
878 // CHECK: [B0 (EXIT)]
879 // CHECK-NEXT: Preds (1): B1
880 void goto_past_declaration2() {
882 int i;
883 goto a;
884 int j;
887 int k;
889 k = 1;
893 struct B {
894 ~B();
897 // CHECK: [B5 (ENTRY)]
898 // CHECK-NEXT: Succs (1): B3
899 // CHECK: [B1]
900 // CHECK-NEXT: 1: i
901 // CHECK-NEXT: 2: [B1.1]++
902 // CHECK-NEXT: 3: [B2.4].~B() (Implicit destructor)
903 // CHECK-NEXT: 4: [B2.4] (Lifetime ends)
904 // CHECK-NEXT: 5: [B2.2].~B() (Implicit destructor)
905 // CHECK-NEXT: 6: [B2.2] (Lifetime ends)
906 // CHECK-NEXT: 7: [B3.1] (Lifetime ends)
907 // CHECK-NEXT: Succs (1): B0
908 // CHECK: [B2]
909 // CHECK-NEXT: label:
910 // CHECK-NEXT: 1: (CXXConstructExpr, [B2.2], B)
911 // CHECK-NEXT: 2: B b1;
912 // CHECK-NEXT: 3: (CXXConstructExpr, [B2.4], B)
913 // CHECK-NEXT: 4: B b2;
914 // CHECK-NEXT: Preds (2): B3 B4
915 // CHECK-NEXT: Succs (1): B4
916 // CHECK: [B3]
917 // CHECK-NEXT: 1: int i;
918 // CHECK-NEXT: Preds (1): B5
919 // CHECK-NEXT: Succs (1): B2
920 // CHECK: [B4]
921 // CHECK-NEXT: 1: [B2.4].~B() (Implicit destructor)
922 // CHECK-NEXT: 2: [B2.4] (Lifetime ends)
923 // CHECK-NEXT: 3: [B2.2].~B() (Implicit destructor)
924 // CHECK-NEXT: 4: [B2.2] (Lifetime ends)
925 // CHECK-NEXT: T: goto label;
926 // CHECK-NEXT: Preds (1): B2
927 // CHECK-NEXT: Succs (1): B2
928 // CHECK: [B0 (EXIT)]
929 // CHECK-NEXT: Preds (1): B1
930 int backpatched_goto() {
931 int i;
932 label:
933 B b1;
934 B b2;
935 goto label;
936 i++;