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