1 ; RUN: opt %s -simplifycfg | llvm-dis | \
2 ; RUN: not grep {call void @DEAD}
4 ; Test that we can thread a simple known condition through switch statements.
12 define void @test1(i32 %V) {
13 switch i32 %V, label %A [
18 ;; V == 4 if we get here.
21 ;; This switch is always statically determined.
22 switch i32 %V, label %A2 [
31 %cond2 = icmp eq i32 %V, 4 ; <i1> [#uses=1]
32 br i1 %cond2, label %Done, label %C
36 %cond = icmp ne i32 %V, 4 ; <i1> [#uses=1]
37 br i1 %cond, label %Done, label %C
38 Done: ; preds = %B, %A, %A2, %0
43 %cond3 = icmp eq i32 %V, 4 ; <i1> [#uses=1]
44 br i1 %cond3, label %Done, label %C
45 C: ; preds = %B, %A, %A2, %T, %T
50 define void @test2(i32 %V) {
51 switch i32 %V, label %A [
56 ;; V != 4, 17, 1234 here.
59 ;; This switch is always statically determined.
60 switch i32 %V, label %E [