summaryrefslogtreecommitdiff
path: root/test/CodeGen/MIR
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-06-06 20:06:57 +0000
committerMatthias Braun <matze@braunis.de>2017-06-06 20:06:57 +0000
commitf632627ec767551f87ea469c02b4e9b1637fd1f9 (patch)
treedc379c7aad866c19927a2db8d50d5a0c1b4b5a6f /test/CodeGen/MIR
parentcfed19098f2b73fdf748a75b3302e2238ce784b3 (diff)
llc: Add ability to parse mir from stdin
- Add -x <language> option to switch between IR and MIR inputs. - Change MIR parser to read from stdin when filename is '-'. - Add a simple mir roundtrip test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/MIR')
-rw-r--r--test/CodeGen/MIR/X86/roundtrip.mir20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/MIR/X86/roundtrip.mir b/test/CodeGen/MIR/X86/roundtrip.mir
new file mode 100644
index 00000000000..c697f730604
--- /dev/null
+++ b/test/CodeGen/MIR/X86/roundtrip.mir
@@ -0,0 +1,20 @@
+# RUN: llc -o - %s -mtriple=x86_64-- -run-pass=none | llc -o - -x mir - -mtriple=x86_64-- -run-pass=none | FileCheck %s
+---
+# CHECK-LABEL: name: func0
+# CHECK: registers:
+# CHECK: - { id: 0, class: gr32, preferred-register: '' }
+# CHECK: - { id: 1, class: gr32, preferred-register: '' }
+# CHECK: body: |
+# CHECK: bb.0:
+# CHECK: %0 = MOV32r0 implicit-def %eflags
+# CHECK: dead %1 = COPY %0
+# CHECK: MOV32mr undef %rcx, 1, _, 0, _, killed %0 :: (volatile store 4)
+# CHECK: RETQ undef %eax
+name: func0
+body: |
+ bb.0:
+ %0 : gr32 = MOV32r0 implicit-def %eflags
+ dead %1 : gr32 = COPY %0
+ MOV32mr undef %rcx, 1, _, 0, _, killed %0 :: (volatile store 4)
+ RETQ undef %eax
+...