blob: 2edc55dbc1f050fcea27893afc45fb948a2612d6 [file] [log] [blame]
Chris Lattner813fc422009-09-15 06:34:29 +00001; RUN: opt < %s -constprop -die -S | FileCheck %s
2
Chris Lattner4f538502002-05-03 20:12:31 +00003; This is a basic sanity check for constant propogation. The add instruction
4; should be eliminated.
Chris Lattner813fc422009-09-15 06:34:29 +00005define i32 @test1(i1 %B) {
Tanya Lattnerec9a35a2008-03-01 09:15:35 +00006 br i1 %B, label %BB1, label %BB2
7
Chris Lattner813fc422009-09-15 06:34:29 +00008BB1:
9 %Val = add i32 0, 0
Tanya Lattnerec9a35a2008-03-01 09:15:35 +000010 br label %BB3
11
Chris Lattner813fc422009-09-15 06:34:29 +000012BB2:
Tanya Lattnerec9a35a2008-03-01 09:15:35 +000013 br label %BB3
14
Chris Lattner813fc422009-09-15 06:34:29 +000015BB3:
16; CHECK: @test1
17; CHECK: %Ret = phi i32 [ 0, %BB1 ], [ 1, %BB2 ]
18 %Ret = phi i32 [ %Val, %BB1 ], [ 1, %BB2 ]
Tanya Lattnerec9a35a2008-03-01 09:15:35 +000019 ret i32 %Ret
Chris Lattner50e86822003-06-28 23:23:34 +000020}
Tanya Lattnerec9a35a2008-03-01 09:15:35 +000021