1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
2 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
4 ;; Test case for bug 25299, contributed by David Majnemer.
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-unknown-linux-gnu"
9 define void @f(i1 %B) personality i1 undef {
12 ; CHECK-NEXT: call void @g()
13 ; CHECK-NEXT: br label [[CONTINUE:%.*]]
15 ; CHECK-NEXT: call void @g()
16 ; CHECK-NEXT: br label [[CONTINUE]]
20 to label %continue unwind label %unwind
22 unwind: ; preds = %entry
23 %tmp101 = landingpad { ptr, i32 }
25 br i1 %B, label %resume, label %then
27 then: ; preds = %cleanup1
30 resume: ; preds = %cleanup2, %then, %cleanup1, %unwind
31 %tmp104 = phi { ptr, i32 } [ %tmp101, %then ], [ %tmp106, %cleanup2 ], [ %tmp101, %unwind ]
32 resume { ptr, i32 } %tmp104
34 continue: ; preds = %entry, %continue
36 to label %continue unwind label %cleanup2
38 cleanup2: ; preds = %continue
39 %tmp106 = landingpad { ptr, i32 }