blob: c65d34cc933ae2e2e0269f44cbb380dee899519d [file] [log] [blame]
Chris Lattner0ab5e2c2011-04-15 05:18:47 +00001; This is a basic sanity check for constant propagation. The add instruction
Chris Lattnerbafd51a2002-05-07 20:32:19 +00002; should be eliminated.
3
Dan Gohman72a13d22009-09-08 22:34:10 +00004; RUN: opt < %s -constprop -die -S | not grep phi
Chris Lattnerbafd51a2002-05-07 20:32:19 +00005
Tanya Lattner5640bd12008-03-01 09:15:35 +00006define i32 @test(i1 %B) {
Chris Lattnerbafd51a2002-05-07 20:32:19 +00007BB0:
Tanya Lattner5640bd12008-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 Lattnera6fee9d2003-06-28 23:23:34 +000016}
Tanya Lattner5640bd12008-03-01 09:15:35 +000017