[MIParser] Set RegClassOrRegBank during instruction parsing
[llvm-complete.git] / test / Transforms / SimplifyCFG / dce-cond-after-folding-terminator.ll
blob9c414b488373e643fbd01c9070add421cbdb6120
1 ; RUN: opt -S <%s -simplifycfg | FileCheck %s
3 define void @test_br(i32 %x) {
4 entry:
5 ; CHECK-LABEL: @test_br(
6 ; CHECK-NEXT: entry:
7 ; CHECK-NEXT: ret void
8   %cmp = icmp eq i32 %x, 10
9   br i1 %cmp, label %if.then, label %if.then
11 if.then:                                          ; preds = %entry
12   br label %if.end
14 if.end:                                           ; preds = %if.else, %if.then
15   ret void
18 define void @test_switch(i32 %x) nounwind {
19 entry:
20 ; CHECK-LABEL: @test_switch(
21 ; CHECK-NEXT: entry:
22 ; CHECK-NEXT: ret void
23   %rem = srem i32 %x, 3
24   switch i32 %rem, label %sw.bb [
25     i32 1, label %sw.bb
26     i32 10, label %sw.bb
27   ]
29 sw.bb:                                            ; preds = %sw.default, %entry, %entry
30   br label %sw.epilog
32 sw.epilog:                                        ; preds = %sw.bb
33   ret void
36 define void @test_indirectbr(i32 %x) {
37 entry:
38 ; CHECK-LABEL: @test_indirectbr(
39 ; CHECK-NEXT: entry:
40 ; CHECK-NEXT:   ret void
42   %label = bitcast i8* blockaddress(@test_indirectbr, %L1) to i8*
43   indirectbr i8* %label, [label %L1, label %L2]
45 L1:                                               ; preds = %entry
46   ret void
47 L2:                                               ; preds = %entry
48   ret void