aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll')
-rw-r--r--test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll23
1 files changed, 23 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 0000000..81594db
--- /dev/null
+++ b/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll
@@ -0,0 +1,23 @@
+; This testcase can be simplified by "realizing" that alloca can never return
+; null.
+; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -simplifycfg | \
+; RUN: llvm-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
+}
+