47 lines · plain
1; Do not promote null value because it may be unsafe to do so.2; RUN: opt < %s -passes=licm -S | not grep promoted3 4define i32 @f(i32 %foo, i32 %bar, i32 %com) {5entry:6 %tmp2 = icmp eq i32 %foo, 0 ; <i1> [#uses=1]7 br i1 %tmp2, label %cond_next, label %cond_true8 9cond_true: ; preds = %entry10 br label %return11 12cond_next: ; preds = %entry13 br label %bb14 15bb: ; preds = %bb15, %cond_next16 switch i32 %bar, label %bb15 [17 i32 1, label %bb618 ]19 20bb6: ; preds = %bb21 %tmp8 = icmp eq i32 %com, 0 ; <i1> [#uses=1]22 br i1 %tmp8, label %cond_next14, label %cond_true1123 24cond_true11: ; preds = %bb625 br label %return26 27cond_next14: ; preds = %bb628 store i8 0, ptr null29 br label %bb1530 31bb15: ; preds = %cond_next14, %bb32 br label %bb33 34return: ; preds = %cond_true11, %cond_true35 %storemerge = phi i32 [ 0, %cond_true ], [ undef, %cond_true11 ] ; <i32> [#uses=1]36 ret i32 %storemerge37}38 39define i32 @kdMain() {40entry:41 %tmp1 = call i32 @f( i32 0, i32 1, i32 1 ) ; <i32> [#uses=0]42 call void @exit( i32 0 )43 unreachable44}45 46declare void @exit(i32)47