1 ; RUN: opt -passes=loop-unroll -S < %s | FileCheck %s
2 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
3 target triple = "i686-pc-windows-msvc"
7 declare i1 @fn2(ptr, ptr)
9 define void @fn4(i1 %arg) personality ptr @__CxxFrameHandler3 {
13 for.body: ; preds = %for.inc, %entry
14 %i.05 = phi i8 [ 0, %entry ], [ %inc, %for.inc ]
15 store i8 undef, ptr undef, align 4
16 invoke void @fn1(ptr undef)
17 to label %call.i.noexc unwind label %ehcleanup
19 call.i.noexc: ; preds = %for.body
20 %call1.i2 = invoke i1 @fn2(ptr undef, ptr undef)
21 to label %call1.i.noexc unwind label %ehcleanup
23 call1.i.noexc: ; preds = %call.i.noexc
24 br i1 %arg, label %if.then.i, label %if.end4.i
26 if.then.i: ; preds = %call1.i.noexc
27 %tmp1 = load i8, ptr undef, align 4
28 %tobool.i = icmp eq i8 undef, undef
29 br i1 %arg, label %if.end4.i, label %if.then2.i
31 if.then2.i: ; preds = %if.then.i
32 %call3.i3 = invoke i1 @fn2(ptr undef, ptr null)
33 to label %call3.i.noexc unwind label %ehcleanup
35 call3.i.noexc: ; preds = %if.then2.i
38 if.end4.i: ; preds = %call3.i.noexc, %if.then.i, %call1.i.noexc
39 %tmp2 = load i8, ptr undef, align 4
42 if.then6.i: ; preds = %if.end4.i
43 %call7.i4 = invoke i1 @fn2(ptr undef, ptr null)
44 to label %call7.i.noexc unwind label %ehcleanup
46 call7.i.noexc: ; preds = %if.then6.i
49 fn3: ; preds = %call7.i.noexc
50 %tmp3 = load i8, ptr undef, align 4
51 %inc.i = add nsw i8 undef, undef
52 store i8 undef, ptr undef, align 4
55 for.inc: ; preds = %fn3
56 %inc = add nsw i8 %i.05, 1
57 %cmp = icmp slt i8 %inc, 6
58 br i1 %cmp, label %for.body, label %for.end
60 for.end: ; preds = %for.inc
62 to label %unreachable unwind label %ehcleanup
64 ehcleanup: ; preds = %for.end, %if.then6.i, %if.then2.i, %call.i.noexc, %for.body
65 %cp = cleanuppad within none []
66 cleanupret from %cp unwind to caller
69 ; CHECK-NOT: cleanuppad
71 unreachable: ; preds = %for.end
75 declare i32 @__CxxFrameHandler3(...)