blob: 3d9e284457cf6e5884b3b8b9c3ccd9d231e80680 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; This is a basic sanity check for constant propogation. The add instruction
2; should be eliminated.
3
Dan Gohman5bb7c7c2009-09-08 22:34:10 +00004; RUN: opt < %s -constprop -die -S | not grep phi
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00006define i32 @test(i1 %B) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007BB0:
Tanya Lattner4c4d0b82008-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
Dan Gohmanf17a25c2007-07-18 16:29:46 +000016}
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000017