summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-07-09 22:23:13 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-07-09 22:23:13 +0000
commit28148ba82dfab4ae9a00124beab1aeb14708d08e (patch)
treee8893b9240117d416ba780b821b4ab3e994bd7ac /llvm/test
parent0f67c6c1d51c83be0db03d5eebc1679878b589c4 (diff)
downloadbcm5719-llvm-28148ba82dfab4ae9a00124beab1aeb14708d08e.tar.gz
bcm5719-llvm-28148ba82dfab4ae9a00124beab1aeb14708d08e.zip
MIR Serialization: Serialize the virtual register definitions.
The virtual registers are serialized using a YAML sequence of YAML inline mappings. Each mapping has the id of the virtual register and the register class. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10981 llvm-svn: 241868
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/MIR/X86/undefined-register-class.mir26
-rw-r--r--llvm/test/CodeGen/MIR/X86/virtual-registers.mir35
2 files changed, 61 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/MIR/X86/undefined-register-class.mir b/llvm/test/CodeGen/MIR/X86/undefined-register-class.mir
new file mode 100644
index 00000000000..a14d2303a7d
--- /dev/null
+++ b/llvm/test/CodeGen/MIR/X86/undefined-register-class.mir
@@ -0,0 +1,26 @@
+# RUN: not llc -march=x86-64 -start-after machine-sink -stop-after machine-sink -o /dev/null %s 2>&1 | FileCheck %s
+# This test ensures that the MIR parser reports an error when it encounters an
+# unknown register class.
+
+--- |
+
+ define i32 @test(i32 %a) {
+ entry:
+ ret i32 %a
+ }
+
+...
+---
+name: test
+isSSA: true
+tracksRegLiveness: true
+registers:
+ # CHECK: [[@LINE+1]]:20: use of undefined register class 'gr3200'
+ - {id: 0, class: 'gr3200'}
+body:
+ - id: 0
+ name: entry
+ instructions:
+ - 'RETQ %eax'
+...
+
diff --git a/llvm/test/CodeGen/MIR/X86/virtual-registers.mir b/llvm/test/CodeGen/MIR/X86/virtual-registers.mir
new file mode 100644
index 00000000000..154c71335bb
--- /dev/null
+++ b/llvm/test/CodeGen/MIR/X86/virtual-registers.mir
@@ -0,0 +1,35 @@
+# RUN: llc -march=x86-64 -start-after machine-sink -stop-after machine-sink -o /dev/null %s | FileCheck %s
+# This test ensures that the MIR parser parses virtual register definitions
+# correctly.
+
+--- |
+
+ define i32 @bar(i32 %a) {
+ entry:
+ %0 = icmp sle i32 %a, 10
+ br i1 %0, label %less, label %exit
+
+ less:
+ ret i32 0
+
+ exit:
+ ret i32 %a
+ }
+
+...
+---
+name: bar
+isSSA: true
+tracksRegLiveness: true
+# CHECK: registers:
+# CHECK-NEXT: - { id: 0, class: gr32 }
+# CHECK-NEXT: - { id: 1, class: gr32 }
+# CHECK-NEXT: - { id: 2, class: gr32 }
+registers:
+ - { id: 0, class: gr32 }
+ - { id: 1, class: gr32 }
+ - { id: 2, class: gr32 }
+body:
+ - id: 0
+...
+
OpenPOWER on IntegriCloud