aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-13 23:28:39 +0000
committerChris Lattner <sabre@nondot.org>2004-11-13 23:28:39 +0000
commit78d223e1fb7cc0e5240c40416bd456dcfa776afa (patch)
tree0ba3e5bfeb33c1b5b6b903a48cc3aec51841e499 /test
parente6c745261ea2c4c523cb66f8935f6eceeab1c5ec (diff)
downloadexternal_llvm-78d223e1fb7cc0e5240c40416bd456dcfa776afa.zip
external_llvm-78d223e1fb7cc0e5240c40416bd456dcfa776afa.tar.gz
external_llvm-78d223e1fb7cc0e5240c40416bd456dcfa776afa.tar.bz2
Add a testcase for a function we cannot legally promote the argument of.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/ArgumentPromotion/control-flow.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/ArgumentPromotion/control-flow.ll b/test/Transforms/ArgumentPromotion/control-flow.ll
new file mode 100644
index 0000000..3907ed0
--- /dev/null
+++ b/test/Transforms/ArgumentPromotion/control-flow.ll
@@ -0,0 +1,18 @@
+; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | not grep 'load int\* null'
+
+implementation
+
+internal int %callee(bool %C, int* %P) {
+ br bool %C, label %T, label %F
+T:
+ ret int 17
+F:
+ %X = load int* %P
+ ret int %X
+}
+
+int %foo() {
+ %X = call int %callee(bool true, int* null)
+ ret int %X
+}
+