summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-07 21:28:54 +0000
committerChris Lattner <sabre@nondot.org>2004-03-07 21:28:54 +0000
commitf2b8692b739fca79f9fdf5e7777dd679adfddd6e (patch)
tree3babf4d990997797a147cb7dfe7849af7b2297ba
parentd6f62ba55b26c91eeaffac776915d7527e231339 (diff)
downloadbcm5719-llvm-f2b8692b739fca79f9fdf5e7777dd679adfddd6e.tar.gz
bcm5719-llvm-f2b8692b739fca79f9fdf5e7777dd679adfddd6e.zip
New testcase
llvm-svn: 12192
-rw-r--r--llvm/test/Regression/Transforms/ArgumentPromotion/basictest.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Regression/Transforms/ArgumentPromotion/basictest.ll b/llvm/test/Regression/Transforms/ArgumentPromotion/basictest.ll
new file mode 100644
index 00000000000..dd7a785d7df
--- /dev/null
+++ b/llvm/test/Regression/Transforms/ArgumentPromotion/basictest.ll
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | opt -argpromotion -mem2reg | llvm-dis | not grep alloca
+
+implementation
+
+internal int %test(int *%X, int* %Y) {
+ %A = load int* %X
+ %B = load int* %Y
+ %C = add int %A, %B
+ ret int %C
+}
+
+internal int %caller(int* %B) {
+ %A = alloca int
+ store int 1, int* %A
+ %C = call int %test(int* %A, int* %B)
+ ret int %C
+}
+
+int %callercaller() {
+ %B = alloca int
+ store int 2, int* %B
+ %X = call int %caller(int* %B)
+ ret int %X
+}
OpenPOWER on IntegriCloud