1 ; RUN: opt -loop-unroll -S %s | FileCheck %s
3 ; Check that the loop body exists.
6 ; CHECK: asm.fallthrough
10 ; Check that the loop body does not get unrolled. We could modify this test in
11 ; the future to support loop unrolling callbr's IFF we checked that the callbr
12 ; operands were unrolled/updated correctly, as today they are not.
13 ; CHECK-NOT: if.then.1
14 ; CHECK-NOT: asm.fallthrough.1
16 ; CHECK-NOT: for.inc.1
17 ; CHECK-NOT: if.then.2
18 ; CHECK-NOT: asm.fallthrough.2
20 ; CHECK-NOT: for.inc.2
22 define dso_local void @d() {
26 for.cond.cleanup: ; preds = %for.inc
29 for.body: ; preds = %for.inc, %entry
30 %e.04 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
31 %tobool = icmp eq i32 %e.04, 0
32 br i1 %tobool, label %for.inc, label %if.then
34 if.then: ; preds = %for.body
35 callbr void asm sideeffect "1: nop\0A\09.quad b, ${0:l}, $$5\0A\09", "X,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@d, %l_yes))
36 to label %asm.fallthrough [label %l_yes]
38 asm.fallthrough: ; preds = %if.then
41 l_yes: ; preds = %asm.fallthrough, %if.then
42 %call = tail call i32 (...) @g()
45 for.inc: ; preds = %for.body, %l_yes
46 %inc = add nuw nsw i32 %e.04, 1
47 %exitcond = icmp eq i32 %inc, 3
48 br i1 %exitcond, label %for.cond.cleanup, label %for.body
51 declare dso_local i32 @g(...) local_unnamed_addr