From df398f729f6d9dcdf321267f5e799dc4bc258be4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 12 Aug 2003 14:58:08 +0000 Subject: [PATCH] Testcase for feature we should support eventually git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7772 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../InstCombine/2003-08-12-AllocaNonNull.ll | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll 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 00000000000..335b8846943 --- /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 ; [#uses=2] + %tmp.1 = setne int* %live_head, null ; [#uses=1] + br bool %tmp.1, label %then, label %UnifiedExitNode + +then: + %tmp.4 = call int (...)* %bitmap_clear( int* %live_head ) ; [#uses=0] + br label %UnifiedExitNode + +UnifiedExitNode: + ret int 0 +} + -- 2.34.1