1 # RUN: llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s | FileCheck %s
2 # This test ensures that the MIR parser parses basic block successors correctly.
6 define i32 @foo(i32 %a) {
8 %0 = icmp sle i32 %a, 10
9 br i1 %0, label %less, label %exit
18 define i32 @bar(i32 %a) {
20 %b = icmp sle i32 %a, 10
21 br i1 %b, label %0, label %1
34 ; CHECK-LABEL: bb.0.entry:
35 ; CHECK: successors: %bb.1.less(0x40000000 / 0x80000000 = 50.00%), %bb.2.exit(0x40000000 / 0x80000000 = 50.00%)
36 ; CHECK-LABEL: bb.1.less:
38 successors: %bb.1.less, %bb.2.exit
41 CMP32ri8 %edi, 10, implicit-def %eflags
42 JG_1 %bb.2.exit, implicit killed %eflags
45 %eax = MOV32r0 implicit-def dead %eflags
51 %eax = COPY killed %edi
57 ; CHECK-LABEL: name: bar
58 ; Verify that we can have multiple lists of successors that will be merged
60 ; CHECK-LABEL: bb.0.entry:
61 ; CHECK: successors: %bb.1(0x80000000 / 0x80000000 = 100.00%), %bb.2(0x00000000 / 0x80000000 = 0.00%)
67 CMP32ri8 %edi, 10, implicit-def %eflags
68 JG_1 %bb.2, implicit killed %eflags
70 ; Verify that we can have an empty list of successors.
72 ; CHECK-NEXT: %eax = MOV32r0 implicit-def dead %eflags
75 %eax = MOV32r0 implicit-def dead %eflags
81 %eax = COPY killed %edi