b610f89d82baa9977a4fa723331a86b771781d81
[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    successors:      [ '%bb.1.less', '%bb.2.exit' ]
28    instructions:
29      - '%eax = MOV32rm %rdi, 1, _, 0, _'
30      - 'CMP32ri8 %eax, 10, implicit-def %eflags'
31 # CHECK: [[@LINE+1]]:24: missing implicit register operand 'implicit %eflags'
32      - 'JG_1 %bb.2.exit'
33  - id:              1
34    name:            less
35    instructions:
36      - '%eax = MOV32r0 implicit-def %eflags'
37  - id:              2
38    name:            exit
39    instructions:
40      - 'RETQ %eax'
41 ...