blob: 858c0becb148f713096d7e494b0cc559f0d2458c [file] [log] [blame]
Chris Lattner1610df22002-05-07 20:32:19 +00001; This is a basic sanity check for constant propogation. The add instruction
2; should be eliminated.
3
Tanya Lattnerec9a35a2008-03-01 09:15:35 +00004; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep phi
Chris Lattner1610df22002-05-07 20:32:19 +00005
Tanya Lattnerec9a35a2008-03-01 09:15:35 +00006define i32 @test(i1 %B) {
Chris Lattner1610df22002-05-07 20:32:19 +00007BB0:
Tanya Lattnerec9a35a2008-03-01 09:15:35 +00008 br i1 %B, label %BB1, label %BB3
9
10BB1: ; preds = %BB0
11 br label %BB3
12
13BB3: ; preds = %BB1, %BB0
14 %Ret = phi i32 [ 1, %BB0 ], [ 1, %BB1 ] ; <i32> [#uses=1]
15 ret i32 %Ret
Chris Lattner50e86822003-06-28 23:23:34 +000016}
Tanya Lattnerec9a35a2008-03-01 09:15:35 +000017