xref: /llvm-project/llvm/test/CodeGen/MIR/Generic/llvm-ir-error-reported.mir (revision ff9af4c43ad71eeba2cabe99609cfaa0fd54c1d0)
1# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
2# This test ensures an error is reported if the embedded LLVM IR contains an
3# error.
4
5--- |
6
7  ; CHECK: [[@LINE+3]]:15: use of undefined value '%a'
8  define i32 @foo(i32 %x, i32 %y) {
9    %z = alloca i32, align 4
10    store i32 %a, ptr %z, align 4
11    br label %Test
12  Test:
13    %m = load i32, ptr %z, align 4
14    %cond = icmp eq i32 %y, %m
15    br i1 %cond, label %IfEqual, label %IfUnequal
16  IfEqual:
17    ret i32 1
18  IfUnequal:
19    ret i32 0
20  }
21
22...
23