summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/MIR/Generic/llvm-ir-error-reported.mir
blob: 15824cb2ca6d7615b4f60eea0cb5c6cdc8e2282a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
# This test ensures an error is reported if the embedded LLVM IR contains an
# error.

--- |
  
  ; CHECK: [[@LINE+3]]:15: use of undefined value '%a'
  define i32 @foo(i32 %x, i32 %y) {
    %z = alloca i32, align 4
    store i32 %a, i32* %z, align 4
    br label %Test
  Test:
    %m = load i32, i32* %z, align 4
    %cond = icmp eq i32 %y, %m
    br i1 %cond, label %IfEqual, label %IfUnequal
  IfEqual:
    ret i32 1
  IfUnequal:
    ret i32 0
  }
  
...
OpenPOWER on IntegriCloud