1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | \
2 ; RUN: not grep {call void %DEAD}
4 ; Test that we can thread a simple known condition through switch statements.
10 void %test1(uint %V) {
11 switch uint %V, label %A [
17 T: ;; V == 4 if we get here.
19 ;; This switch is always statically determined.
20 switch uint %V, label %A2 [
28 %cond2 = seteq uint %V, 4 ;; always false
29 br bool %cond2, label %Done, label %C
33 %cond = setne uint %V, 4 ;; always true
34 br bool %cond, label %Done, label %C
42 %cond3 = seteq uint %V, 4 ;; always true
43 br bool %cond3, label %Done, label %C
49 void %test2(uint %V) {
50 switch uint %V, label %A [
56 A: ;; V != 4, 17, 1234 here.
58 ;; This switch is always statically determined.
59 switch uint %V, label %E [
65 call void %DEAD() ;; unreacahble.