summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-12 14:58:08 +0000
committerChris Lattner <sabre@nondot.org>2003-08-12 14:58:08 +0000
commitdf398f729f6d9dcdf321267f5e799dc4bc258be4 (patch)
tree72936106584637e99867e92df6a1289915a8d2e2
parent42f3372742d6fabef22aa2267498ef0fb10c1e71 (diff)
downloadllvm-df398f729f6d9dcdf321267f5e799dc4bc258be4.tar.gz
llvm-df398f729f6d9dcdf321267f5e799dc4bc258be4.tar.bz2
llvm-df398f729f6d9dcdf321267f5e799dc4bc258be4.tar.xz
Testcase for feature we should support eventually
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7772 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll b/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll
new file mode 100644
index 0000000000..335b884694
--- /dev/null
+++ b/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll
@@ -0,0 +1,22 @@
+; This testcase can be simplified by "realizing" that alloca can never return
+; null.
+; RUN: as < %s | opt -instcombine -simplifycfg | dis | not grep 'br '
+
+implementation ; Functions:
+
+declare int %bitmap_clear(...)
+
+int %oof() {
+entry:
+ %live_head = alloca int ; <int*> [#uses=2]
+ %tmp.1 = setne int* %live_head, null ; <bool> [#uses=1]
+ br bool %tmp.1, label %then, label %UnifiedExitNode
+
+then:
+ %tmp.4 = call int (...)* %bitmap_clear( int* %live_head ) ; <int> [#uses=0]
+ br label %UnifiedExitNode
+
+UnifiedExitNode:
+ ret int 0
+}
+