• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -start-after branch-folder -stop-after branch-folder -o - %s | FileCheck %s
2# 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  }
31
32...
33---
34name: foo
35body: |
36  bb.0:
37...
38