blob: eeb3e9a57b06c81455b9f6960e00ab6bc660f49b [file] [log] [blame]
Chris Lattner67982da2011-02-18 05:05:01 +00001; RUN: opt < %s -loop-unroll -S | FileCheck %s
2
3
4; This should not unroll since the address of the loop header is taken.
5
6; CHECK: @test1
7; CHECK: store i8* blockaddress(@test1, %l1), i8** %P
8; CHECK: l1:
9; CHECK-NEXT: phi i32
10; rdar://8287027
11define i32 @test1(i8** %P) nounwind ssp {
12entry:
13 store i8* blockaddress(@test1, %l1), i8** %P
14 br label %l1
15
16l1: ; 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
21
22l2: ; preds = %l1
23 ret i32 0
24}