1 ; Do not promote null value because it may be unsafe to do so.
2 ; RUN: opt < %s -licm -S | not grep promoted
4 define i32 @f(i32 %foo, i32 %bar, i32 %com) {
6 %tmp2 = icmp eq i32 %foo, 0 ; <i1> [#uses=1]
7 br i1 %tmp2, label %cond_next, label %cond_true
9 cond_true: ; preds = %entry
12 cond_next: ; preds = %entry
15 bb: ; preds = %bb15, %cond_next
16 switch i32 %bar, label %bb15 [
21 %tmp8 = icmp eq i32 %com, 0 ; <i1> [#uses=1]
22 br i1 %tmp8, label %cond_next14, label %cond_true11
24 cond_true11: ; preds = %bb6
27 cond_next14: ; preds = %bb6
31 bb15: ; preds = %cond_next14, %bb
34 return: ; preds = %cond_true11, %cond_true
35 %storemerge = phi i32 [ 0, %cond_true ], [ undef, %cond_true11 ] ; <i32> [#uses=1]
39 define i32 @kdMain() {
41 %tmp1 = call i32 @f( i32 0, i32 1, i32 1 ) ; <i32> [#uses=0]
42 call void @exit( i32 0 )
46 declare void @exit(i32)