summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-27 01:16:22 +0000
committerChris Lattner <sabre@nondot.org>2006-05-27 01:16:22 +0000
commit5ca32a6d6c2fadbc12a3cad49c2f86f62596ae4f (patch)
tree5eadb2e4df0678bfa84ddc466a7c833e972131c8 /test
parent729c6d1da87ad5b3bf849c4102b255657f67276c (diff)
downloadllvm-5ca32a6d6c2fadbc12a3cad49c2f86f62596ae4f.tar.gz
llvm-5ca32a6d6c2fadbc12a3cad49c2f86f62596ae4f.tar.bz2
llvm-5ca32a6d6c2fadbc12a3cad49c2f86f62596ae4f.tar.xz
New testcase: check that the inliner constant folds instructions on the
fly if it can. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/Inline/inline_constprop.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/Inline/inline_constprop.ll b/test/Transforms/Inline/inline_constprop.ll
new file mode 100644
index 0000000000..edfb0905f9
--- /dev/null
+++ b/test/Transforms/Inline/inline_constprop.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | opt -inline -disable-output &&
+; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep callee &&
+; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep div
+
+implementation
+
+internal int %callee(int %A, int %B) {
+ %C = div int %A, %B
+ ret int %C
+}
+
+int %test() {
+ %X = call int %callee(int 10, int 3)
+ ret int %X
+}