Testcase for feature we should support eventually
authorChris Lattner <sabre@nondot.org>
Tue, 12 Aug 2003 14:58:08 +0000 (14:58 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 12 Aug 2003 14:58:08 +0000 (14:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7772 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll [new file with mode: 0644]

diff --git a/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll b/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll
new file mode 100644 (file)
index 0000000..335b884
--- /dev/null
@@ -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
+}
+