@@ -27,7 +27,7 @@ endcatch:
27
27
; Need two copies of the call to @h, one under entry and one under catch.
28
28
; Currently we generate a load for each, though we shouldn't need one
29
29
; for the use in entry's copy.
30
- ; CHECK-LABEL: @test1(
30
+ ; CHECK-LABEL: define void @test1(
31
31
; CHECK: entry:
32
32
; CHECK: store i32 %x, i32* [[Slot:%[^ ]+]]
33
33
; CHECK: invoke void @f()
56
56
; Need two copies of %exit's call to @f -- the subsequent ret is only
57
57
; valid when coming from %entry, but on the path from %cleanup, this
58
58
; might be a valid call to @f which might dynamically not return.
59
- ; CHECK-LABEL: @test2(
59
+ ; CHECK-LABEL: define void @test2(
60
60
; CHECK: entry:
61
61
; CHECK: invoke void @f()
62
62
; CHECK: to label %[[exit:[^ ]+]] unwind label %cleanup
91
91
}
92
92
; Need two copies of %shared's call to @f (similar to @test2 but
93
93
; the two regions here are siblings, not parent-child).
94
- ; CHECK-LABEL: @test3(
94
+ ; CHECK-LABEL: define void @test3(
95
95
; CHECK: invoke void @f()
96
96
; CHECK: invoke void @f()
97
97
; CHECK: to label %[[exit:[^ ]+]] unwind
@@ -143,7 +143,7 @@ exit:
143
143
; Make sure we can clone regions that have internal control
144
144
; flow and SSA values. Here we need two copies of everything
145
145
; from %shared to %exit.
146
- ; CHECK-LABEL: @test4(
146
+ ; CHECK-LABEL: define void @test4(
147
147
; CHECK: entry:
148
148
; CHECK: to label %[[shared_E:[^ ]+]] unwind label %catch
149
149
; CHECK: catch:
@@ -221,7 +221,7 @@ exit:
221
221
; Simple nested case (catch-inside-cleanup). Nothing needs
222
222
; to be cloned. The def and use of %x are both in %outer
223
223
; and so don't need to be spilled.
224
- ; CHECK-LABEL: @test5(
224
+ ; CHECK-LABEL: define void @test5(
225
225
; CHECK: outer:
226
226
; CHECK: %x = call i32 @g()
227
227
; CHECK-NEXT: invoke void @f()
@@ -277,7 +277,7 @@ exit:
277
277
; %left still needs to be created because it's possible
278
278
; the dynamic path enters %left, then enters %inner,
279
279
; then calls @h, and that the call to @h doesn't return.
280
- ; CHECK-LABEL: @test6(
280
+ ; CHECK-LABEL: define void @test6(
281
281
; TODO: CHECKs
282
282
283
283
@@ -309,7 +309,7 @@ unreachable:
309
309
; Another case of a two-parent child (like @test6), this time
310
310
; with the join at the entry itself instead of following a
311
311
; non-pad join.
312
- ; CHECK-LABEL: @test7(
312
+ ; CHECK-LABEL: define void @test7(
313
313
; TODO: CHECKs
314
314
315
315
@@ -347,7 +347,7 @@ unreachable:
347
347
}
348
348
; %inner is a two-parent child which itself has a child; need
349
349
; to make two copies of both the %inner and %inner.child.
350
- ; CHECK-LABEL: @test8(
350
+ ; CHECK-LABEL: define void @test8(
351
351
; TODO: CHECKs
352
352
353
353
@@ -380,5 +380,41 @@ unreachable:
380
380
; the parent of the other, but that we'd somehow lost track in the CFG
381
381
; of which was which along the way; generating each possibility lets
382
382
; whichever case was correct execute correctly.
383
- ; CHECK-LABEL: @test9(
383
+ ; CHECK-LABEL: define void @test9(
384
384
; TODO: CHECKs
385
+
386
+ define void @test10 () personality i32 (...)* @__CxxFrameHandler3 {
387
+ entry:
388
+ invoke void @f ()
389
+ to label %unreachable unwind label %inner
390
+ inner:
391
+ %cleanup = cleanuppad []
392
+ ; make sure we don't overlook this cleanupret and try to process
393
+ ; successor %outer as a child of inner.
394
+ cleanupret %cleanup unwind label %outer
395
+ outer:
396
+ %catch = catchpad [] to label %catch.body unwind label %endpad
397
+ catch.body:
398
+ catchret %catch to label %exit
399
+ endpad:
400
+ catchendpad unwind to caller
401
+ exit:
402
+ ret void
403
+ unreachable:
404
+ unreachable
405
+ }
406
+ ; CHECK-LABEL: define void @test10(
407
+ ; CHECK-NEXT: entry:
408
+ ; CHECK-NEXT: invoke
409
+ ; CHECK-NEXT: to label %unreachable unwind label %inner
410
+ ; CHECK: inner:
411
+ ; CHECK-NEXT: %cleanup = cleanuppad
412
+ ; CHECK-NEXT: cleanupret %cleanup unwind label %outer
413
+ ; CHECK: outer:
414
+ ; CHECK-NEXT: %catch = catchpad [] to label %catch.body unwind label %endpad
415
+ ; CHECK: catch.body:
416
+ ; CHECK-NEXT: catchret %catch to label %exit
417
+ ; CHECK: endpad:
418
+ ; CHECK-NEXT: catchendpad unwind to caller
419
+ ; CHECK: exit:
420
+ ; CHECK-NEXT: ret void
0 commit comments