1 ; RUN: opt -attributor --attributor-disable=false -attributor-max-iterations-verify -attributor-max-iterations=3 -S < %s | FileCheck %s
3 declare void @no_return_call() nofree noreturn nounwind readnone
5 declare void @normal_call() readnone
9 declare i32 @foo_noreturn_nounwind() noreturn nounwind
11 declare i32 @foo_noreturn() noreturn
13 declare i32 @bar() nosync readnone
15 ; This internal function has no live call sites, so all its BBs are considered dead,
16 ; and nothing should be deduced for it.
18 ; CHECK-NOT: define internal i32 @dead_internal_func(i32 %0)
19 define internal i32 @dead_internal_func(i32 %0) {
20 %2 = icmp slt i32 %0, 1
21 br i1 %2, label %3, label %5
23 ; <label>:3: ; preds = %5, %1
24 %4 = phi i32 [ 1, %1 ], [ %8, %5 ]
27 ; <label>:5: ; preds = %1, %5
28 %6 = phi i32 [ %9, %5 ], [ 1, %1 ]
29 %7 = phi i32 [ %8, %5 ], [ 1, %1 ]
30 %8 = mul nsw i32 %6, %7
31 %9 = add nuw nsw i32 %6, 1
32 %10 = icmp eq i32 %6, %0
33 br i1 %10, label %3, label %5
36 ; CHECK: Function Attrs: nofree norecurse nounwind uwtable willreturn
37 define i32 @volatile_load(i32*) norecurse nounwind uwtable {
38 %2 = load volatile i32, i32* %0, align 4
42 ; CHECK: Function Attrs: nofree norecurse nosync nounwind readonly uwtable willreturn
43 ; CHECK-NEXT: define internal i32 @internal_load(i32* nocapture nonnull readonly dereferenceable(4) %0)
44 define internal i32 @internal_load(i32*) norecurse nounwind uwtable {
45 %2 = load i32, i32* %0, align 4
48 ; TEST 1: Only first block is live.
50 ; CHECK: Function Attrs: nofree noreturn nosync nounwind
51 ; CHECK-NEXT: define i32 @first_block_no_return(i32 %a, i32* nocapture nonnull readonly %ptr1, i32* nocapture readnone %ptr2)
52 define i32 @first_block_no_return(i32 %a, i32* nonnull %ptr1, i32* %ptr2) #0 {
54 call i32 @internal_load(i32* %ptr1)
55 ; CHECK: call i32 @internal_load(i32* nocapture nonnull readonly %ptr1)
56 call void @no_return_call()
57 ; CHECK: call void @no_return_call()
58 ; CHECK-NEXT: unreachable
60 call i32 @dead_internal_func(i32 10)
61 %cmp = icmp eq i32 %a, 0
62 br i1 %cmp, label %cond.true, label %cond.false
64 cond.true: ; preds = %entry
65 call i32 @internal_load(i32* %ptr2)
66 %load = call i32 @volatile_load(i32* %ptr1)
67 call void @normal_call()
68 %call = call i32 @foo()
71 cond.false: ; preds = %entry
72 call void @normal_call()
73 %call1 = call i32 @bar()
76 cond.end: ; preds = %cond.false, %cond.true
77 %cond = phi i32 [ %call, %cond.true ], [ %call1, %cond.false ]
81 ; TEST 2: cond.true is dead, but cond.end is not, since cond.false is live
83 ; This is just an example. For example we can put a sync call in a
84 ; dead block and check if it is deduced.
86 ; CHECK: Function Attrs: nosync
87 ; CHECK-NEXT: define i32 @dead_block_present(i32 %a, i32* nocapture readnone %ptr1)
88 define i32 @dead_block_present(i32 %a, i32* %ptr1) #0 {
90 %cmp = icmp eq i32 %a, 0
91 br i1 %cmp, label %cond.true, label %cond.false
93 cond.true: ; preds = %entry
94 call void @no_return_call()
95 ; CHECK: call void @no_return_call()
96 ; CHECK-NEXT: unreachable
97 %call = call i32 @volatile_load(i32* %ptr1)
100 cond.false: ; preds = %entry
101 call void @normal_call()
102 %call1 = call i32 @bar()
105 cond.end: ; preds = %cond.false, %cond.true
107 ; CHECK-NEXT: ret i32 %call1
108 %cond = phi i32 [ %call, %cond.true ], [ %call1, %cond.false ]
112 ; TEST 3: both cond.true and cond.false are dead, therfore cond.end is dead as well.
114 define i32 @all_dead(i32 %a) #0 {
116 %cmp = icmp eq i32 %a, 0
117 br i1 %cmp, label %cond.true, label %cond.false
119 cond.true: ; preds = %entry
120 call void @no_return_call()
121 ; CHECK: call void @no_return_call()
122 ; CHECK-NEXT: unreachable
123 call i32 @dead_internal_func(i32 10)
125 %call = call i32 @foo()
128 cond.false: ; preds = %entry
129 call void @no_return_call()
130 ; CHECK: call void @no_return_call()
131 ; CHECK-NEXT: unreachable
132 call i32 @dead_internal_func(i32 10)
134 %call1 = call i32 @bar()
137 cond.end: ; preds = %cond.false, %cond.true
138 %cond = phi i32 [ %call, %cond.true ], [ %call1, %cond.false ]
142 declare i32 @__gxx_personality_v0(...)
144 ; TEST 4: All blocks are live.
146 ; CHECK: define i32 @all_live(i32 %a)
147 define i32 @all_live(i32 %a) #0 {
149 %cmp = icmp eq i32 %a, 0
150 br i1 %cmp, label %cond.true, label %cond.false
152 cond.true: ; preds = %entry
153 call void @normal_call()
154 %call = call i32 @foo_noreturn()
157 cond.false: ; preds = %entry
158 call void @normal_call()
159 %call1 = call i32 @bar()
162 cond.end: ; preds = %cond.false, %cond.true
163 %cond = phi i32 [ %call, %cond.true ], [ %call1, %cond.false ]
167 ; TEST 5 noreturn invoke instruction with a unreachable normal successor block.
169 ; CHECK: define i32 @invoke_noreturn(i32 %a)
170 define i32 @invoke_noreturn(i32 %a) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
172 %cmp = icmp eq i32 %a, 0
173 br i1 %cmp, label %cond.true, label %cond.false
175 cond.true: ; preds = %entry
176 call void @normal_call()
177 %call = invoke i32 @foo_noreturn() to label %continue
178 unwind label %cleanup
179 ; CHECK: %call = invoke i32 @foo_noreturn()
180 ; CHECK-NEXT: to label %continue unwind label %cleanup
182 cond.false: ; preds = %entry
183 call void @normal_call()
184 %call1 = call i32 @bar()
187 cond.end: ; preds = %cond.false, %continue
188 %cond = phi i32 [ %call, %continue ], [ %call1, %cond.false ]
193 ; CHECK-NEXT: unreachable
197 %res = landingpad { i8*, i32 }
202 ; TEST 4.1 noreturn invoke instruction replaced by a call and an unreachable instruction
205 ; CHECK: define i32 @invoke_noreturn_nounwind(i32 %a)
206 define i32 @invoke_noreturn_nounwind(i32 %a) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
208 %cmp = icmp eq i32 %a, 0
209 br i1 %cmp, label %cond.true, label %cond.false
211 cond.true: ; preds = %entry
212 call void @normal_call()
213 %call = invoke i32 @foo_noreturn_nounwind() to label %continue
214 unwind label %cleanup
215 ; CHECK: call void @normal_call()
216 ; CHECK-NEXT: call i32 @foo_noreturn_nounwind()
217 ; CHECK-NEXT: unreachable
219 ; CHECK-NOT: @foo_noreturn_nounwind()
221 cond.false: ; preds = %entry
222 call void @normal_call()
223 %call1 = call i32 @bar()
226 cond.end: ; preds = %cond.false, %continue
227 %cond = phi i32 [ %call, %continue ], [ %call1, %cond.false ]
234 %res = landingpad { i8*, i32 }
239 ; TEST 6: Undefined behvior, taken from LangRef.
240 ; FIXME: Should be able to detect undefined behavior.
242 ; CHECK: define void @ub(i32* nocapture writeonly %0)
243 define void @ub(i32* %0) {
244 %poison = sub nuw i32 0, 1 ; Results in a poison value.
245 %still_poison = and i32 %poison, 0 ; 0, but also poison.
246 %poison_yet_again = getelementptr i32, i32* %0, i32 %still_poison
247 store i32 0, i32* %poison_yet_again ; Undefined behavior due to store to poison.
251 define void @inf_loop() #0 {
255 while.body: ; preds = %entry, %while.body
259 ; TEST 7: Infinite loop.
260 ; FIXME: Detect infloops, and mark affected blocks dead.
262 define i32 @test5(i32, i32) #0 {
263 %3 = icmp sgt i32 %0, %1
264 br i1 %3, label %cond.if, label %cond.elseif
266 cond.if: ; preds = %2
267 %4 = tail call i32 @bar()
270 cond.elseif: ; preds = %2
271 call void @inf_loop()
272 %5 = icmp slt i32 %0, %1
273 br i1 %5, label %cond.end, label %cond.else
275 cond.else: ; preds = %cond.elseif
276 %6 = tail call i32 @foo()
279 cond.end: ; preds = %cond.if, %cond.else, %cond.elseif
280 %7 = phi i32 [ %1, %cond.elseif ], [ 0, %cond.else ], [ 0, %cond.if ]
284 define void @rec() #0 {
291 ; FIXME: everything after first block should be marked dead
292 ; and unreachable should be put after call to @rec().
294 define i32 @test6(i32, i32) #0 {
296 %3 = icmp sgt i32 %0, %1
297 br i1 %3, label %cond.if, label %cond.elseif
299 cond.if: ; preds = %2
300 %4 = tail call i32 @bar()
303 cond.elseif: ; preds = %2
305 %5 = icmp slt i32 %0, %1
306 br i1 %5, label %cond.end, label %cond.else
308 cond.else: ; preds = %cond.elseif
309 %6 = tail call i32 @foo()
312 cond.end: ; preds = %cond.if, %cond.else, %cond.elseif
313 %7 = phi i32 [ %1, %cond.elseif ], [ 0, %cond.else ], [ 0, %cond.if ]
317 ; FIXME: contains recursive call to itself in cond.elseif block
319 define i32 @test7(i32, i32) #0 {
320 %3 = icmp sgt i32 %0, %1
321 br i1 %3, label %cond.if, label %cond.elseif
323 cond.if: ; preds = %2
324 %4 = tail call i32 @bar()
327 cond.elseif: ; preds = %2
328 %5 = tail call i32 @test7(i32 %0, i32 %1)
329 %6 = icmp slt i32 %0, %1
330 br i1 %6, label %cond.end, label %cond.else
332 cond.else: ; preds = %cond.elseif
333 %7 = tail call i32 @foo()
336 cond.end: ; preds = %cond.if, %cond.else, %cond.elseif
337 %8 = phi i32 [ %1, %cond.elseif ], [ 0, %cond.else ], [ 0, %cond.if ]
343 ; char a1 __attribute__((aligned(8)));
344 ; char a2 __attribute__((aligned(16)));
346 ; char* f1(char* a ){
347 ; return a?a:f2(&a1);
350 ; return a?f1(a):f3(&a2);
354 ; return a?&a1: f1(&a2);
357 @a1 = common global i8 0, align 8
358 @a2 = common global i8 0, align 16
360 define internal i8* @f1(i8* readnone %0) local_unnamed_addr #0 {
361 ; ATTRIBUTOR: define internal i8* @f1(i8* readnone %0)
362 %2 = icmp eq i8* %0, null
363 br i1 %2, label %3, label %5
365 ; <label>:3: ; preds = %1
366 ; ATTRIBUTOR: %4 = tail call i8* undef(i8* nonnull align 8 @a1)
367 %4 = tail call i8* @f2(i8* nonnull @a1)
370 ; <label>:5: ; preds = %1, %3
371 %6 = phi i8* [ %4, %3 ], [ %0, %1 ]
375 define internal i8* @f2(i8* readnone %0) local_unnamed_addr #0 {
376 ; ATTRIBUTOR: define internal i8* @f2(i8* readnone %0)
377 %2 = icmp eq i8* %0, null
378 br i1 %2, label %5, label %3
380 ; <label>:3: ; preds = %1
382 ; ATTRIBUTOR: %4 = tail call i8* undef(i8* nonnull align 8 %0)
383 %4 = tail call i8* @f1(i8* nonnull %0)
386 ; <label>:5: ; preds = %1
387 ; ATTRIBUTOR: %6 = tail call i8* undef(i8* nonnull align 16 @a2)
388 %6 = tail call i8* @f3(i8* nonnull @a2)
391 ; <label>:7: ; preds = %5, %3
392 %8 = phi i8* [ %4, %3 ], [ %6, %5 ]
396 define internal i8* @f3(i8* readnone %0) local_unnamed_addr #0 {
397 ; ATTRIBUTOR: define internal i8* @f3(i8* readnone %0)
398 %2 = icmp eq i8* %0, null
399 br i1 %2, label %3, label %5
401 ; <label>:3: ; preds = %1
402 ; ATTRIBUTOR: %4 = tail call i8* undef(i8* nonnull align 16 @a2)
403 %4 = tail call i8* @f1(i8* nonnull @a2)
406 ; <label>:5: ; preds = %1, %3
407 %6 = phi i8* [ %4, %3 ], [ @a1, %1 ]
411 define void @test_unreachable() {
412 ; CHECK: define void @test_unreachable()
413 ; CHECK-NEXT: call void @test_unreachable()
414 ; CHECK-NEXT: unreachable
416 call void @test_unreachable()
420 define linkonce_odr void @non_exact1() {
421 call void @non_dead_a0()
422 call void @non_dead_a1()
423 call void @non_dead_a2()
424 call void @non_dead_a3()
425 call void @non_dead_a4()
426 call void @non_dead_a5()
427 call void @non_dead_a6()
428 call void @non_dead_a7()
429 call void @non_dead_a8()
430 call void @non_dead_a9()
431 call void @non_dead_a10()
432 call void @non_dead_a11()
433 call void @non_dead_a12()
434 call void @non_dead_a13()
435 call void @non_dead_a14()
436 call void @non_dead_a15()
440 define internal void @middle() {
442 call void @non_dead_b0()
443 call void @non_dead_b1()
444 call void @non_dead_b2()
445 call void @non_dead_b3()
448 call void @non_dead_b4()
449 call void @non_dead_b5()
450 call void @non_dead_b6()
451 call void @non_dead_b7()
454 call void @non_dead_b8()
455 call void @non_dead_b9()
456 call void @non_dead_b10()
457 call void @non_dead_b11()
460 call void @non_dead_b12()
461 call void @non_dead_b13()
462 call void @non_dead_b14()
463 call void @non_dead_b15()
466 call void @non_exact2()
469 define linkonce_odr void @non_exact2() {
470 call void @non_dead_c0()
471 call void @non_dead_c1()
472 call void @non_dead_c2()
473 call void @non_dead_c3()
474 call void @non_dead_c4()
475 call void @non_dead_c5()
476 call void @non_dead_c6()
477 call void @non_dead_c7()
478 call void @non_dead_c8()
479 call void @non_dead_c9()
480 call void @non_dead_c10()
481 call void @non_dead_c11()
482 call void @non_dead_c12()
483 call void @non_dead_c13()
484 call void @non_dead_c14()
485 call void @non_dead_c15()
486 call void @non_exact3()
489 define linkonce_odr void @non_exact3() {
490 call void @non_dead_d0()
491 call void @non_dead_d1()
492 call void @non_dead_d2()
493 call void @non_dead_d3()
494 call void @non_dead_d4()
495 call void @non_dead_d5()
496 call void @non_dead_d6()
497 call void @non_dead_d7()
498 call void @non_dead_d8()
499 call void @non_dead_d9()
500 call void @non_dead_d10()
501 call void @non_dead_d11()
502 call void @non_dead_d12()
503 call void @non_dead_d13()
504 call void @non_dead_d14()
505 call void @non_dead_d15()
506 %nr = call i32 @foo_noreturn()
510 ; CHECK: define linkonce_odr void @non_exact3() {
511 ; CHECK-NEXT: call void @non_dead_d0()
512 ; CHECK-NEXT: call void @non_dead_d1()
513 ; CHECK-NEXT: call void @non_dead_d2()
514 ; CHECK-NEXT: call void @non_dead_d3()
515 ; CHECK-NEXT: call void @non_dead_d4()
516 ; CHECK-NEXT: call void @non_dead_d5()
517 ; CHECK-NEXT: call void @non_dead_d6()
518 ; CHECK-NEXT: call void @non_dead_d7()
519 ; CHECK-NEXT: call void @non_dead_d8()
520 ; CHECK-NEXT: call void @non_dead_d9()
521 ; CHECK-NEXT: call void @non_dead_d10()
522 ; CHECK-NEXT: call void @non_dead_d11()
523 ; CHECK-NEXT: call void @non_dead_d12()
524 ; CHECK-NEXT: call void @non_dead_d13()
525 ; CHECK-NEXT: call void @non_dead_d14()
526 ; CHECK-NEXT: call void @non_dead_d15()
527 ; CHECK-NEXT: %nr = call i32 @foo_noreturn()
528 ; CHECK-NEXT: unreachable
531 define internal void @non_dead_a0() { ret void }
532 define internal void @non_dead_a1() { ret void }
533 define internal void @non_dead_a2() { ret void }
534 define internal void @non_dead_a3() { ret void }
535 define internal void @non_dead_a4() { ret void }
536 define internal void @non_dead_a5() { ret void }
537 define internal void @non_dead_a6() { ret void }
538 define internal void @non_dead_a7() { ret void }
539 define internal void @non_dead_a8() { ret void }
540 define internal void @non_dead_a9() { ret void }
541 define internal void @non_dead_a10() { ret void }
542 define internal void @non_dead_a11() { ret void }
543 define internal void @non_dead_a12() { ret void }
544 define internal void @non_dead_a13() { ret void }
545 define internal void @non_dead_a14() { ret void }
546 define internal void @non_dead_a15() { ret void }
547 define internal void @non_dead_b0() { ret void }
548 define internal void @non_dead_b1() { ret void }
549 define internal void @non_dead_b2() { ret void }
550 define internal void @non_dead_b3() { ret void }
551 define internal void @non_dead_b4() { ret void }
552 define internal void @non_dead_b5() { ret void }
553 define internal void @non_dead_b6() { ret void }
554 define internal void @non_dead_b7() { ret void }
555 define internal void @non_dead_b8() { ret void }
556 define internal void @non_dead_b9() { ret void }
557 define internal void @non_dead_b10() { ret void }
558 define internal void @non_dead_b11() { ret void }
559 define internal void @non_dead_b12() { ret void }
560 define internal void @non_dead_b13() { ret void }
561 define internal void @non_dead_b14() { ret void }
562 define internal void @non_dead_b15() { ret void }
563 define internal void @non_dead_c0() { ret void }
564 define internal void @non_dead_c1() { ret void }
565 define internal void @non_dead_c2() { ret void }
566 define internal void @non_dead_c3() { ret void }
567 define internal void @non_dead_c4() { ret void }
568 define internal void @non_dead_c5() { ret void }
569 define internal void @non_dead_c6() { ret void }
570 define internal void @non_dead_c7() { ret void }
571 define internal void @non_dead_c8() { ret void }
572 define internal void @non_dead_c9() { ret void }
573 define internal void @non_dead_c10() { ret void }
574 define internal void @non_dead_c11() { ret void }
575 define internal void @non_dead_c12() { ret void }
576 define internal void @non_dead_c13() { ret void }
577 define internal void @non_dead_c14() { ret void }
578 define internal void @non_dead_c15() { ret void }
579 define internal void @non_dead_d0() { ret void }
580 define internal void @non_dead_d1() { ret void }
581 define internal void @non_dead_d2() { ret void }
582 define internal void @non_dead_d3() { ret void }
583 define internal void @non_dead_d4() { ret void }
584 define internal void @non_dead_d5() { ret void }
585 define internal void @non_dead_d6() { ret void }
586 define internal void @non_dead_d7() { ret void }
587 define internal void @non_dead_d8() { ret void }
588 define internal void @non_dead_d9() { ret void }
589 define internal void @non_dead_d10() { ret void }
590 define internal void @non_dead_d11() { ret void }
591 define internal void @non_dead_d12() { ret void }
592 define internal void @non_dead_d13() { ret void }
593 define internal void @non_dead_d14() { ret void }
594 define internal void @non_dead_d15() { ret void }
595 define internal void @dead_e0() { call void @dead_e1() ret void }
596 define internal void @dead_e1() { call void @dead_e2() ret void }
597 define internal void @dead_e2() { ret void }
599 ; CHECK: define internal void @non_dead_a0()
600 ; CHECK: define internal void @non_dead_a1()
601 ; CHECK: define internal void @non_dead_a2()
602 ; CHECK: define internal void @non_dead_a3()
603 ; CHECK: define internal void @non_dead_a4()
604 ; CHECK: define internal void @non_dead_a5()
605 ; CHECK: define internal void @non_dead_a6()
606 ; CHECK: define internal void @non_dead_a7()
607 ; CHECK: define internal void @non_dead_a8()
608 ; CHECK: define internal void @non_dead_a9()
609 ; CHECK: define internal void @non_dead_a10()
610 ; CHECK: define internal void @non_dead_a11()
611 ; CHECK: define internal void @non_dead_a12()
612 ; CHECK: define internal void @non_dead_a13()
613 ; CHECK: define internal void @non_dead_a14()
614 ; CHECK: define internal void @non_dead_a15()
615 ; CHECK: define internal void @non_dead_b0()
616 ; CHECK: define internal void @non_dead_b1()
617 ; CHECK: define internal void @non_dead_b2()
618 ; CHECK: define internal void @non_dead_b3()
619 ; CHECK: define internal void @non_dead_b4()
620 ; CHECK: define internal void @non_dead_b5()
621 ; CHECK: define internal void @non_dead_b6()
622 ; CHECK: define internal void @non_dead_b7()
623 ; CHECK: define internal void @non_dead_b8()
624 ; CHECK: define internal void @non_dead_b9()
625 ; CHECK: define internal void @non_dead_b10()
626 ; CHECK: define internal void @non_dead_b11()
627 ; CHECK: define internal void @non_dead_b12()
628 ; CHECK: define internal void @non_dead_b13()
629 ; CHECK: define internal void @non_dead_b14()
630 ; CHECK: define internal void @non_dead_b15()
631 ; CHECK: define internal void @non_dead_c0()
632 ; CHECK: define internal void @non_dead_c1()
633 ; CHECK: define internal void @non_dead_c2()
634 ; CHECK: define internal void @non_dead_c3()
635 ; CHECK: define internal void @non_dead_c4()
636 ; CHECK: define internal void @non_dead_c5()
637 ; CHECK: define internal void @non_dead_c6()
638 ; CHECK: define internal void @non_dead_c7()
639 ; CHECK: define internal void @non_dead_c8()
640 ; CHECK: define internal void @non_dead_c9()
641 ; CHECK: define internal void @non_dead_c10()
642 ; CHECK: define internal void @non_dead_c11()
643 ; CHECK: define internal void @non_dead_c12()
644 ; CHECK: define internal void @non_dead_c13()
645 ; CHECK: define internal void @non_dead_c14()
646 ; CHECK: define internal void @non_dead_c15()
647 ; CHECK: define internal void @non_dead_d0()
648 ; CHECK: define internal void @non_dead_d1()
649 ; CHECK: define internal void @non_dead_d2()
650 ; CHECK: define internal void @non_dead_d3()
651 ; CHECK: define internal void @non_dead_d4()
652 ; CHECK: define internal void @non_dead_d5()
653 ; CHECK: define internal void @non_dead_d6()
654 ; CHECK: define internal void @non_dead_d7()
655 ; CHECK: define internal void @non_dead_d8()
656 ; CHECK: define internal void @non_dead_d9()
657 ; CHECK: define internal void @non_dead_d10()
658 ; CHECK: define internal void @non_dead_d11()
659 ; CHECK: define internal void @non_dead_d12()
660 ; CHECK: define internal void @non_dead_d13()
661 ; CHECK: define internal void @non_dead_d14()
662 ; Verify we actually deduce information for these functions.
663 ; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn
664 ; CHECK-NEXT: define internal void @non_dead_d15()
665 ; CHECK-NOT: define internal void @dead_e
668 declare void @blowup() noreturn
669 define void @live_with_dead_entry() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
670 ; CHECK: define void @live_with_dead_entry(
672 ; CHECK-NEXT: invoke void @blowup()
673 ; CHECK-NEXT: to label %live_with_dead_entry.dead unwind label %lpad
674 ; CHECK: lpad: ; preds = %entry
675 ; CHECK-NEXT: %0 = landingpad { i8*, i32 }
676 ; CHECK-NEXT: catch i8* null
677 ; CHECK-NEXT: br label %live_with_dead_entry
678 ; CHECK: live_with_dead_entry.dead: ; preds = %entry
679 ; CHECK-NEXT: unreachable
680 ; CHECK: live_with_dead_entry: ; preds = %lpad
681 ; CHECK-NEXT: ret void
683 invoke void @blowup() to label %live_with_dead_entry unwind label %lpad
685 %0 = landingpad { i8*, i32 } catch i8* null
686 br label %live_with_dead_entry
687 live_with_dead_entry:
691 define void @live_with_dead_entry_lp() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
692 ; CHECK: define void @live_with_dead_entry_lp(
694 ; CHECK-NEXT: invoke void @blowup()
695 ; CHECK-NEXT: to label %live_with_dead_entry.dead unwind label %lp1
696 ; CHECK: lp1: ; preds = %entry
697 ; CHECK-NEXT: %lp = landingpad { i8*, i32 }
698 ; CHECK-NEXT: catch i8* null
699 ; CHECK-NEXT: invoke void @blowup()
700 ; CHECK-NEXT: to label %live_with_dead_entry.dead1 unwind label %lp2
701 ; CHECK: lp2: ; preds = %lp1
702 ; CHECK-NEXT: %0 = landingpad { i8*, i32 }
703 ; CHECK-NEXT: catch i8* null
704 ; CHECK-NEXT: br label %live_with_dead_entry
705 ; CHECK: live_with_dead_entry.dead: ; preds = %entry
706 ; CHECK-NEXT: unreachable
707 ; CHECK: live_with_dead_entry.dead1: ; preds = %lp1
708 ; CHECK-NEXT: unreachable
709 ; CHECK: live_with_dead_entry: ; preds = %lp2
710 ; CHECK-NEXT: ret void
712 invoke void @blowup() to label %live_with_dead_entry unwind label %lp1
714 %lp = landingpad { i8*, i32 } catch i8* null
715 invoke void @blowup() to label %live_with_dead_entry unwind label %lp2
717 %0 = landingpad { i8*, i32 } catch i8* null
718 br label %live_with_dead_entry
719 live_with_dead_entry: