blob: ea215e39e94ded92dce0c819948362370281ccab [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | \
2; RUN: not grep {icmp eq}
3
4; Check that simplifycfg deletes a dead 'seteq' instruction when it
5; folds a conditional branch into a switch instruction.
6
7declare void %foo()
8declare void %bar()
9
10void %testcfg(uint %V) {
11 %C = seteq uint %V, 18
12 %D = seteq uint %V, 180
13 %E = or bool %C, %D
14 br bool %E, label %L1, label %Sw
15Sw:
16 switch uint %V, label %L1 [
17 uint 15, label %L2
18 uint 16, label %L2
19 ]
20L1:
21 call void %foo()
22 ret void
23L2:
24 call void %bar()
25 ret void
26}
27