1 ; RUN: opt < %s -loop-unroll -S | FileCheck %s
4 ; This should not unroll since the address of the loop header is taken.
7 ; CHECK: store i8* blockaddress(@test1, %l1), i8** %P
11 define i32 @test1(i8** %P) nounwind ssp {
13 store i8* blockaddress(@test1, %l1), i8** %P
16 l1: ; preds = %l1, %entry
17 %x.0 = phi i32 [ 0, %entry ], [ %inc, %l1 ]
18 %inc = add nsw i32 %x.0, 1
19 %exitcond = icmp eq i32 %inc, 3
20 br i1 %exitcond, label %l2, label %l1
26 ; This should not unroll since the call is 'noduplicate'.
29 define i32 @test2(i8** %P) nounwind ssp {
33 l1: ; preds = %l1, %entry
34 %x.0 = phi i32 [ 0, %entry ], [ %inc, %l1 ]
35 ; CHECK: call void @f()
36 ; CHECK-NOT: call void @f()
37 call void @f() noduplicate
38 %inc = add nsw i32 %x.0, 1
39 %exitcond = icmp eq i32 %inc, 3
40 br i1 %exitcond, label %l2, label %l1