brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 2c01ab1 Raw
83 lines · plain
1# RUN: llc -mtriple=x86_64 -run-pass none -o - %s | FileCheck %s2# This test ensures that the MIR parser parses basic block successors correctly.3 4--- |5 6  define i32 @foo(i32 %a) {7  entry:8    %0 = icmp sle i32 %a, 109    br i1 %0, label %less, label %exit10 11  less:12    ret i32 013 14  exit:15    ret i32 %a16  }17 18  define i32 @bar(i32 %a) {19  entry:20    %b = icmp sle i32 %a, 1021    br i1 %b, label %0, label %122 23  ; <label>:024    ret i32 025 26  ; <label>:127    ret i32 %a28  }29 30...31---32name:            foo33body: |34  ; CHECK-LABEL: bb.0.entry:35  ; CHECK-LABEL: bb.1.less:36  bb.0.entry:37    successors: %bb.1.less, %bb.2.exit38    liveins: $edi39 40    CMP32ri8 $edi, 10, implicit-def $eflags41    JCC_1 %bb.2.exit, 15, implicit killed $eflags42 43  bb.1.less:44    $eax = MOV32r0 implicit-def dead $eflags45    RET64 killed $eax46 47  bb.2.exit:48    liveins: $edi49 50    $eax = COPY killed $edi51    RET64 killed $eax52...53---54name:            bar55body: |56  ; CHECK-LABEL: name: bar57  ; Verify that we can have multiple lists of successors that will be merged58  ; into one.59  ; CHECK-LABEL: bb.0.entry:60  ; CHECK:         successors: %bb.1(0x80000000), %bb.2(0x00000000)61  bb.0.entry:62    liveins: $edi63    successors: %bb.164    successors: %bb.265 66    CMP32ri8 $edi, 10, implicit-def $eflags67    JCC_1 %bb.2, 15, implicit killed $eflags68 69  ; Verify that we can have an empty list of successors.70  ; CHECK-LABEL: bb.1:71  ; CHECK-NEXT:  $eax = MOV32r0 implicit-def dead $eflags72  bb.1:73    successors:74    $eax = MOV32r0 implicit-def dead $eflags75    RET64 killed $eax76 77  bb.2:78    liveins: $edi79 80    $eax = COPY killed $edi81    RET64 killed $eax82...83