diff options
Diffstat (limited to 'test/Analysis/ScalarEvolution')
4 files changed, 39 insertions, 3 deletions
diff --git a/test/Analysis/ScalarEvolution/2010-09-03-RequiredTransitive.ll b/test/Analysis/ScalarEvolution/2010-09-03-RequiredTransitive.ll index aba0ce7..5a02398 100644 --- a/test/Analysis/ScalarEvolution/2010-09-03-RequiredTransitive.ll +++ b/test/Analysis/ScalarEvolution/2010-09-03-RequiredTransitive.ll @@ -1,8 +1,10 @@ -; RUN: opt -indvars -scalar-evolution -analyze %s +; RUN: opt -indvars -scalar-evolution -analyze < %s | FileCheck %s ; This test checks if the SCEV analysis is printed out at all. ; It failed once as the RequiredTransitive option was not implemented ; correctly. +; CHECK: Classifying expressions for: @main + define i32 @main() nounwind { entry: br label %for.cond diff --git a/test/Analysis/ScalarEvolution/2011-03-09-ExactNoMaxBECount.ll b/test/Analysis/ScalarEvolution/2011-03-09-ExactNoMaxBECount.ll index 9f17e27..49e944d 100644 --- a/test/Analysis/ScalarEvolution/2011-03-09-ExactNoMaxBECount.ll +++ b/test/Analysis/ScalarEvolution/2011-03-09-ExactNoMaxBECount.ll @@ -1,4 +1,4 @@ -; RUN: opt -indvars %s +; RUN: opt -indvars < %s ; PR9424: Attempt to use a SCEVCouldNotCompute object! ; The inner loop computes the Step and Start of the outer loop. ; Call that Vexit. The outer End value is max(2,Vexit), because diff --git a/test/Analysis/ScalarEvolution/fold.ll b/test/Analysis/ScalarEvolution/fold.ll index 4e2adf1..57006dd 100644 --- a/test/Analysis/ScalarEvolution/fold.ll +++ b/test/Analysis/ScalarEvolution/fold.ll @@ -1,4 +1,4 @@ -; RUN: opt -analyze -scalar-evolution %s -S | FileCheck %s +; RUN: opt -analyze -scalar-evolution -S < %s | FileCheck %s define i16 @test1(i8 %x) { %A = zext i8 %x to i12 diff --git a/test/Analysis/ScalarEvolution/scev-invalid.ll b/test/Analysis/ScalarEvolution/scev-invalid.ll new file mode 100644 index 0000000..aac0d31 --- /dev/null +++ b/test/Analysis/ScalarEvolution/scev-invalid.ll @@ -0,0 +1,34 @@ +; RUN: opt < %s -S -indvars -loop-unroll | FileCheck %s +; +; PR15570: SEGV: SCEV back-edge info invalid after dead code removal. +; +; Indvars creates a SCEV expression for the loop's back edge taken +; count, then determines that the comparison is always true and +; removes it. +; +; When loop-unroll asks for the expression, it contains a NULL +; SCEVUnknkown (as a CallbackVH). +; +; forgetMemoizedResults should invalidate the backedge taken count expression. + +; CHECK: @test +; CHECK-NOT: phi +; CHECK-NOT: icmp +; CHECK: ret void +define void @test() { +entry: + %xor1 = xor i32 0, 1 + br label %b17 + +b17: + br i1 undef, label %b22, label %b18 + +b18: + %phi1 = phi i32 [ %add1, %b18 ], [ %xor1, %b17 ] + %add1 = add nsw i32 %phi1, -1 + %cmp1 = icmp sgt i32 %add1, 0 + br i1 %cmp1, label %b18, label %b22 + +b22: + ret void +} |