Add a testcase for a function we cannot legally promote the argument of.
authorChris Lattner <sabre@nondot.org>
Sat, 13 Nov 2004 23:28:39 +0000 (23:28 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 13 Nov 2004 23:28:39 +0000 (23:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17716 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/ArgumentPromotion/control-flow.ll [new file with mode: 0644]

diff --git a/test/Transforms/ArgumentPromotion/control-flow.ll b/test/Transforms/ArgumentPromotion/control-flow.ll
new file mode 100644 (file)
index 0000000..3907ed0
--- /dev/null
@@ -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
+}
+