diff options
Diffstat (limited to 'test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll')
-rw-r--r-- | test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll b/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll new file mode 100644 index 0000000..3cdb1e3 --- /dev/null +++ b/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | opt -scalar-evolution -analyze | not grep Unpredictable + +define void @foo(i32 %n) { +entry: + br label %header +header: + %i = phi i32 [ 0, %entry ], [ %i.inc, %next ] + %cond = icmp sgt i32 %n, %i + br i1 %cond, label %next, label %return +next: + %i.inc = add i32 %i, 1 + br label %header +return: + ret void +} |