diff options
Diffstat (limited to 'test/Analysis/BasicAA/pure-const-dce.ll')
-rw-r--r-- | test/Analysis/BasicAA/pure-const-dce.ll | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/test/Analysis/BasicAA/pure-const-dce.ll b/test/Analysis/BasicAA/pure-const-dce.ll index 54e6e79a5e50..266e607b21a4 100644 --- a/test/Analysis/BasicAA/pure-const-dce.ll +++ b/test/Analysis/BasicAA/pure-const-dce.ll @@ -1,7 +1,25 @@ -; RUN: opt < %s -basicaa -gvn -S | grep TestConst | count 2 -; RUN: opt < %s -basicaa -gvn -S | grep TestPure | count 3 -; RUN: opt < %s -basicaa -gvn -S | grep TestNone | count 4 -@g = global i32 0 ; <i32*> [#uses=1] +; RUN: opt < %s -basicaa -gvn -S | FileCheck %s + +@g = global i32 0 + +; CHECK: @test +; CHECK: entry +; CHECK: %tmp0 = call i32 @TestConst(i32 5) readnone +; CHECK-NEXT: %tmp1 = call i32 @TestPure(i32 6) readonly +; CHECK-NEXT: %tmp2 = call i32 @TestNone(i32 7) +; CHECK-NEXT: store i32 1, i32* @g +; CHECK-NEXT: %tmp5 = call i32 @TestPure(i32 6) readonly +; CHECK-NEXT: %tmp7 = call i32 @TestNone(i32 7) +; CHECK-NEXT: %tmp8 = call i32 @TestNone(i32 7) +; CHECK-NEXT: %sum0 = add i32 %tmp0, %tmp1 +; CHECK-NEXT: %sum1 = add i32 %sum0, %tmp2 +; CHECK-NEXT: %sum2 = add i32 %sum1, %tmp0 +; CHECK-NEXT: %sum3 = add i32 %sum2, %tmp0 +; CHECK-NEXT: %sum4 = add i32 %sum3, %tmp5 +; CHECK-NEXT: %sum5 = add i32 %sum4, %tmp5 +; CHECK-NEXT: %sum6 = add i32 %sum5, %tmp7 +; CHECK-NEXT: %sum7 = add i32 %sum6, %tmp8 +; CHECK-NEXT: ret i32 %sum7 define i32 @test() { entry: |