diff options
Diffstat (limited to 'test/CodeGen/MIR/X86/unknown-machine-basic-block.mir')
-rw-r--r-- | test/CodeGen/MIR/X86/unknown-machine-basic-block.mir | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/CodeGen/MIR/X86/unknown-machine-basic-block.mir b/test/CodeGen/MIR/X86/unknown-machine-basic-block.mir new file mode 100644 index 000000000000..5bc979a83eaf --- /dev/null +++ b/test/CodeGen/MIR/X86/unknown-machine-basic-block.mir @@ -0,0 +1,38 @@ +# RUN: not llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s +# This test ensures that an error is reported when an invalid machine basic +# block index is used. + + +--- | + + define i32 @foo(i32* %p) { + entry: + %a = load i32, i32* %p + %b = icmp sle i32 %a, 10 + br i1 %b, label %0, label %1 + + ; <label>:0 + ret i32 0 + + ; <label>:1 + ret i32 %a + } + +... +--- +name: foo +body: + - id: 0 + name: entry + instructions: + - '%eax = MOV32rm %rdi, 1, _, 0, _' + - 'CMP32ri8 %eax, 10' + # CHECK: [[@LINE+1]]:14: use of undefined machine basic block #4 + - 'JG_1 %bb.4' + - id: 1 + instructions: + - '%eax = MOV32r0' + - id: 2 + instructions: + - 'RETQ %eax' +... |