blob: 96337f7c3caf11c59376e2f2a0c1eda798bd0f31 [file] [log] [blame]
Reid Spencer266e42b2006-12-23 06:05:41 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | not grep 'icmp eq'
Chris Lattner21adf7d2005-01-01 16:00:56 +00002
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