For PR1319:
[oota-llvm.git] / test / Transforms / CorrelatedExprs / switch.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -cee -constprop -instcombine -dce | \
2 ; RUN:   llvm-dis | not grep REMOVE
3 ; END.
4
5 int %test_case_values_should_propagate(int %A) {
6     switch int %A, label %D [
7         int 40, label %C1
8         int 41, label %C2
9         int 42, label %C3
10     ]
11 C1:
12     %REMOVE1 = add int %A, 2     ; Should be 42.
13     ret int %REMOVE1
14 C2:
15     %REMOVE2 = add int %A, 3     ; Should be 44.
16     ret int %REMOVE2
17 C3:
18     %REMOVE3 = add int %A, 4     ; Should be 46.
19     ret int %REMOVE3
20 D:
21     ret int 10
22 }