diff options
author | Chris Lattner <sabre@nondot.org> | 2006-06-01 21:54:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-06-01 21:54:58 +0000 |
commit | 29c312300ebfaa8987c744e3cc60dc8fdf6a6738 (patch) | |
tree | ae3a469f8959a89778cbbec44530ba7774a898d6 | |
parent | ecf626fedf7020a45375753800b3a1a972c90e01 (diff) | |
download | external_llvm-29c312300ebfaa8987c744e3cc60dc8fdf6a6738.zip external_llvm-29c312300ebfaa8987c744e3cc60dc8fdf6a6738.tar.gz external_llvm-29c312300ebfaa8987c744e3cc60dc8fdf6a6738.tar.bz2 |
testcase for the recent inliner improvement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28643 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Transforms/Inline/inline_prune.ll | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/Transforms/Inline/inline_prune.ll b/test/Transforms/Inline/inline_prune.ll new file mode 100644 index 0000000..fdbdf83 --- /dev/null +++ b/test/Transforms/Inline/inline_prune.ll @@ -0,0 +1,40 @@ +; RUN: llvm-as < %s | opt -inline -disable-output && +; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep 'callee[12](' && +; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep mul + +implementation + +internal int %callee1(int %A, int %B) { + %cond = seteq int %A, 123 + br bool %cond, label %T, label %F +T: + %C = mul int %B, %B + ret int %C +F: + ret int 0 +} + +internal int %callee2(int %A, int %B) { + switch int %A, label %T [ + int 10, label %F + int 1234, label %G + ] + %cond = seteq int %A, 123 + br bool %cond, label %T, label %F +T: + %C = mul int %B, %B + ret int %C +F: + ret int 0 +G: + %D = mul int %B, %B + %E = mul int %D, %B + ret int %E +} + +int %test(int %A) { + %X = call int %callee1(int 10, int %A) + %Y = call int %callee2(int 10, int %A) + %Z = add int %X, %Y + ret int %Z +} |