Add new test to make sure simplifycfg doesn't leave around trivially
[oota-llvm.git] / test / Transforms / SimplifyCFG / DeadSetCC.ll
1 ; 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
6 declare void %foo()
7 declare void %bar()
8
9 void %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
14 Sw:
15        switch uint %V, label %L1 [
16               uint 15, label %L2
17               uint 16, label %L2
18         ]
19 L1:
20         call void %foo()
21         ret void
22 L2:
23         call void %bar()
24         ret void
25 }
26