1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
llvm-mirror/test/CodeGen/MIR/X86/basic-block-liveins.mir
Justin Lebar 975bf7a977 When printing MIR, output to errs() rather than outs().
Summary:
Without this, this command

  $ llvm-run llc -stop-after machine-cp -o - <( echo '' )

outputs an error, because we close stdout twice -- once when closing the
file opened for "-o", and again when closing outs().

Also clarify in the outs() definition that you can't ever call it if you
want to open your own raw_fd_ostream on stdout.

Reviewers: jroelofs, tstellarAMD

Subscribers: jholewinski, qcolombet, dsanders, llvm-commits

Differential Revision: http://reviews.llvm.org/D17422

llvm-svn: 261286
2016-02-19 00:18:46 +00:00

63 lines
1.3 KiB
YAML

# RUN: llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
# This test ensures that the MIR parser parses basic block liveins correctly.
--- |
define i32 @test(i32 %a, i32 %b) {
body:
%c = add i32 %a, %b
ret i32 %c
}
define i32 @test2(i32 %a, i32 %b) {
body:
%c = add i32 %a, %b
ret i32 %c
}
define i32 @test3() {
body:
ret i32 0
}
...
---
name: test
body: |
; CHECK-LABEL: bb.0.body:
; CHECK-NEXT: liveins: %edi, %esi
bb.0.body:
liveins: %edi, %esi
%eax = LEA64_32r killed %rdi, 1, killed %rsi, 0, _
RETQ %eax
...
---
name: test2
body: |
; CHECK-LABEL: name: test2
; Verify that we can have multiple lists of liveins that will be merged into
; one.
; CHECK: bb.0.body:
; CHECK-NEXT: liveins: %edi, %esi
bb.0.body:
liveins: %edi
liveins: %esi
%eax = LEA64_32r killed %rdi, 1, killed %rsi, 0, _
RETQ %eax
...
---
name: test3
body: |
; Verify that we can have an empty list of liveins.
; CHECK-LABEL: name: test3
; CHECK: bb.0.body:
; CHECK-NEXT: %eax = MOV32r0 implicit-def dead %eflags
bb.0.body:
liveins:
%eax = MOV32r0 implicit-def dead %eflags
RETQ killed %eax
...