blob: 6166efb1103f1a5167e7f824a75b452d23ce7d48 [file] [log] [blame]
Dan Gohman5bb7c7c2009-09-08 22:34:10 +00001; RUN: opt < %s -condprop -S | not grep phi
Evan Cheng62366a72009-04-14 23:40:03 +00002
3define i32 @foo(i1, i32, i32) {
4prologue:
5 br i1 %0, label %eq, label %ne
6
7eq: ; preds = %prologue
8 store i32 0, i32* inttoptr (i32 10000 to i32*)
9 %3 = icmp eq i32 %1, %2 ; <i1> [#uses=1]
10 br label %join
11
12ne: ; preds = %prologue
13 %4 = icmp ne i32 %1, %2 ; <i1> [#uses=1]
14 br label %join
15
16join: ; preds = %ne, %eq
17 %5 = phi i1 [ %3, %eq ], [ %4, %ne ] ; <i1> [#uses=1]
18 br i1 %5, label %yes, label %no
19
20yes: ; preds = %join
21 store i32 0, i32* inttoptr (i32 20000 to i32*)
22 ret i32 5
23
24no: ; preds = %join
25 ret i32 20
26}