blob: 5c0e60e916f06d0e3ff7648262c73153ae9e5a58 [file] [log] [blame]
Matthias Braun538859c2016-07-16 02:24:59 +00001# RUN: llc -run-pass none -o - %s | FileCheck %s
Alex Lorenz2bdb4e12015-05-27 18:02:19 +00002# This test ensures that the LLVM IR that's embedded with MIR is parsed
3# correctly.
4
5--- |
6 ; CHECK: define i32 @foo(i32 %x, i32 %y)
7 ; CHECK: %z = alloca i32, align 4
8 ; CHECK: store i32 %x, i32* %z, align 4
9 ; CHECK: br label %Test
10 ; CHECK: Test:
11 ; CHECK: %m = load i32, i32* %z, align 4
12 ; CHECK: %cond = icmp eq i32 %y, %m
13 ; CHECK: br i1 %cond, label %IfEqual, label %IfUnequal
14 ; CHECK: IfEqual:
15 ; CHECK: ret i32 1
16 ; CHECK: IfUnequal:
17 ; CHECK: ret i32 0
18 define i32 @foo(i32 %x, i32 %y) {
19 %z = alloca i32, align 4
20 store i32 %x, i32* %z, align 4
21 br label %Test
22 Test:
23 %m = load i32, i32* %z, align 4
24 %cond = icmp eq i32 %y, %m
25 br i1 %cond, label %IfEqual, label %IfUnequal
26 IfEqual:
27 ret i32 1
28 IfUnequal:
29 ret i32 0
30 }
Justin Bogner20dd36a2017-04-11 19:32:41 +000031
Alex Lorenz2bdb4e12015-05-27 18:02:19 +000032...
Alex Lorenz735c47e2015-06-15 20:30:22 +000033---
34name: foo
35...