4d2cd03f4a3dd6132f22cb114dc75a101dfa39a2
[oota-llvm.git] / test / CodeGen / MIR / X86 / missing-implicit-operand.mir
1 # RUN: not llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
2 # This test ensures that the MIR parser reports an error when an instruction
3 # is missing one of its implicit register operands.
4
5 --- |
6
7   define i32 @foo(i32* %p) {
8   entry:
9     %a = load i32, i32* %p
10     %0 = icmp sle i32 %a, 10
11     br i1 %0, label %less, label %exit
12
13   less:
14     ret i32 0
15
16   exit:
17     ret i32 %a
18   }
19
20
21 ...
22 ---
23 name:            foo
24 body:
25  - id:              0
26    name:            entry
27    instructions:
28      - '%eax = MOV32rm %rdi, 1, _, 0, _'
29      - 'CMP32ri8 %eax, 10, implicit-def %eflags'
30 # CHECK: [[@LINE+1]]:24: missing implicit register operand 'implicit %eflags'
31      - 'JG_1 %bb.2.exit'
32  - id:              1
33    name:            less
34    instructions:
35      - '%eax = MOV32r0 implicit-def %eflags'
36  - id:              2
37    name:            exit
38    instructions:
39      - 'RETQ %eax'
40 ...