MIR Tests: Add liveins and successors to make tests pass with machine verifier.
[oota-llvm.git] / test / CodeGen / MIR / X86 / implicit-register-flag.mir
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 the 'implicit' and 'implicit-def'
3 # register flags correctly.
4
5 --- |
6
7   define i32 @foo(i32 %a) {
8   entry:
9     %0 = icmp sle i32 %a, 10
10     br i1 %0, label %less, label %exit
11
12   less:
13     ret i32 0
14
15   exit:
16     ret i32 %a
17   }
18
19 ...
20 ---
21 name:            foo
22 body:
23   - id:          0
24     name:        entry
25     successors:  [ '%bb.1.less', '%bb.2.exit' ]
26     instructions:
27       # CHECK:      - 'CMP32ri8 %edi, 10, implicit-def %eflags'
28       # CHECK-NEXT: - 'JG_1 %bb.2.exit, implicit %eflags'
29       - 'CMP32ri8 %edi, 10, implicit-def %eflags'
30       - 'JG_1 %bb.2.exit, implicit %eflags'
31   - id:          1
32     name:        less
33     instructions:
34       # CHECK: - '%eax = MOV32r0 implicit-def %eflags'
35       - '%eax = MOV32r0 implicit-def %eflags'
36       - 'RETQ %eax'
37   - id:          2
38     name:        exit
39     instructions:
40       - '%eax = COPY %edi'
41       - 'RETQ %eax'
42 ...