[TableGen] Fix validateOperandClass for non Phyical Reg (#118146)
[llvm-project.git] / llvm / test / Transforms / SimplifyCFG / dce-cond-after-folding-terminator.ll
blob191db310fde50a1be9276cbce6773928ade640e2
1 ; RUN: opt -S <%s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 | 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 ptr blockaddress(@test_indirectbr, %L1) to ptr
43   indirectbr ptr %label, [label %L1, label %L2]
45 L1:                                               ; preds = %entry
46   ret void
47 L2:                                               ; preds = %entry
48   ret void