diff options
author | Chris Lattner <sabre@nondot.org> | 2003-06-22 20:32:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-06-22 20:32:35 +0000 |
commit | 578aa74541c51ac8218a12a4e770f5e188f6b2b6 (patch) | |
tree | dd6e69cd22b5aa35bda3818cec4dcc0990ba4f69 /test/Transforms/TailDup | |
parent | 5e11fd3965a5f65f1170ac2d9630b753734f0a4f (diff) | |
download | external_llvm-578aa74541c51ac8218a12a4e770f5e188f6b2b6.zip external_llvm-578aa74541c51ac8218a12a4e770f5e188f6b2b6.tar.gz external_llvm-578aa74541c51ac8218a12a4e770f5e188f6b2b6.tar.bz2 |
New testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/TailDup')
-rw-r--r-- | test/Transforms/TailDup/PHIUpdateTest.ll | 20 | ||||
-rw-r--r-- | test/Transforms/TailDup/basictest.ll | 22 |
2 files changed, 42 insertions, 0 deletions
diff --git a/test/Transforms/TailDup/PHIUpdateTest.ll b/test/Transforms/TailDup/PHIUpdateTest.ll new file mode 100644 index 0000000..08112b4 --- /dev/null +++ b/test/Transforms/TailDup/PHIUpdateTest.ll @@ -0,0 +1,20 @@ +; This test checks to make sure phi nodes are updated properly +; +; RUN: as < %s | opt -tailduplicate -disable-output + + + +int %test(bool %c, int %X, int %Y) { + br label %L + +L: + %A = add int %X, %Y + br bool %c, label %T, label %F + +F: + br bool %c, label %L, label %T + +T: + %V = phi int [%A, %L], [0, %F] + ret int %V +} diff --git a/test/Transforms/TailDup/basictest.ll b/test/Transforms/TailDup/basictest.ll new file mode 100644 index 0000000..66dcf63 --- /dev/null +++ b/test/Transforms/TailDup/basictest.ll @@ -0,0 +1,22 @@ +; RUN: as < %s | opt -tailduplicate -disable-output + +declare void %__main() + +int %main() { +entry: ; No predecessors! + call void %__main( ) + br label %loopentry + +loopentry: ; preds = %entry, %no_exit + %i.0 = phi int [ %inc, %no_exit ], [ 0, %entry ] ; <int> [#uses=2] + %tmp.1 = setle int %i.0, 99 ; <bool> [#uses=1] + br bool %tmp.1, label %no_exit, label %return + +no_exit: ; preds = %loopentry + %tmp.51 = call int %main( ) ; <int> [#uses=0] + %inc = add int %i.0, 1 ; <int> [#uses=1] + br label %loopentry + +return: ; preds = %loopentry + ret int %i.0 +} |