From 9838939b3a5118bd6f8cd74654126c28c61adec7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 15 Apr 2007 01:00:37 +0000 Subject: [PATCH] new testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36039 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/store-merge.ll | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/Transforms/InstCombine/store-merge.ll diff --git a/test/Transforms/InstCombine/store-merge.ll b/test/Transforms/InstCombine/store-merge.ll new file mode 100644 index 00000000000..c457a2f9c9a --- /dev/null +++ b/test/Transforms/InstCombine/store-merge.ll @@ -0,0 +1,36 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 %storemerge} | wc -l | grep 2 +;; Simple sinking tests + +; "if then else" +define i32 @test1(i1 %C) { + %A = alloca i32 + br i1 %C, label %Cond, label %Cond2 + +Cond: + store i32 -987654321, i32* %A + br label %Cont + +Cond2: + store i32 47, i32* %A + br label %Cont + +Cont: + %V = load i32* %A + ret i32 %V +} + +; "if then" +define i32 @test2(i1 %C) { + %A = alloca i32 + store i32 47, i32* %A + br i1 %C, label %Cond, label %Cont + +Cond: + store i32 -987654321, i32* %A + br label %Cont + +Cont: + %V = load i32* %A + ret i32 %V +} +