1 ; Do not promote null value because it may be unsafe to do so. 2 ; RUN: opt < %s -licm -S | not grep promoted 3 4 define i32 @f(i32 %foo, i32 %bar, i32 %com) { 5 entry: 6 %tmp2 = icmp eq i32 %foo, 0 ; <i1> [#uses=1] 7 br i1 %tmp2, label %cond_next, label %cond_true 8 9 cond_true: ; preds = %entry 10 br label %return 11 12 cond_next: ; preds = %entry 13 br label %bb 14 15 bb: ; preds = %bb15, %cond_next 16 switch i32 %bar, label %bb15 [ 17 i32 1, label %bb6 18 ] 19 20 bb6: ; preds = %bb 21 %tmp8 = icmp eq i32 %com, 0 ; <i1> [#uses=1] 22 br i1 %tmp8, label %cond_next14, label %cond_true11 23 24 cond_true11: ; preds = %bb6 25 br label %return 26 27 cond_next14: ; preds = %bb6 28 store i8 0, i8* null 29 br label %bb15 30 31 bb15: ; preds = %cond_next14, %bb 32 br label %bb 33 34 return: ; preds = %cond_true11, %cond_true 35 %storemerge = phi i32 [ 0, %cond_true ], [ undef, %cond_true11 ] ; <i32> [#uses=1] 36 ret i32 %storemerge 37 } 38 39 define i32 @kdMain() { 40 entry: 41 %tmp1 = call i32 @f( i32 0, i32 1, i32 1 ) ; <i32> [#uses=0] 42 call void @exit( i32 0 ) 43 unreachable 44 } 45 46 declare void @exit(i32) 47