summaryrefslogtreecommitdiff
path: root/test/CodeGen/MIR
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-06-06 00:44:35 +0000
committerMatthias Braun <matze@braunis.de>2017-06-06 00:44:35 +0000
commit2144c5262ff63371de29230e3009c6aadf7881d1 (patch)
tree77af6170711c2ac4026106d9ee1aab469dc4f254 /test/CodeGen/MIR
parent20350be310e85c72c3fca145ad02b054e73d42a1 (diff)
CodeGen: Refactor MIR parsing
When parsing .mir files immediately construct the MachineFunctions and put them into MachineModuleInfo. This allows us to get rid of the delayed construction (and delayed error reporting) through the MachineFunctionInitialzier interface. Differential Revision: https://reviews.llvm.org/D33809 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/MIR')
-rw-r--r--test/CodeGen/MIR/AArch64/generic-virtual-registers-error.mir1
-rw-r--r--test/CodeGen/MIR/AArch64/generic-virtual-registers-with-regbank-error.mir1
-rw-r--r--test/CodeGen/MIR/Generic/function-missing-machine-function.mir13
-rw-r--r--test/CodeGen/MIR/X86/empty0.mir6
-rw-r--r--test/CodeGen/MIR/X86/empty1.mir8
-rw-r--r--test/CodeGen/MIR/X86/empty2.mir8
6 files changed, 22 insertions, 15 deletions
diff --git a/test/CodeGen/MIR/AArch64/generic-virtual-registers-error.mir b/test/CodeGen/MIR/AArch64/generic-virtual-registers-error.mir
index d63c2ef6e87..af785bcb10a 100644
--- a/test/CodeGen/MIR/AArch64/generic-virtual-registers-error.mir
+++ b/test/CodeGen/MIR/AArch64/generic-virtual-registers-error.mir
@@ -17,6 +17,5 @@ body: |
liveins: %w0
; ERR: generic virtual registers must have a type
; ERR-NEXT: %0
- ; ERR: Unable to initialize machine function
%0 = G_ADD i32 %w0, %w0
...
diff --git a/test/CodeGen/MIR/AArch64/generic-virtual-registers-with-regbank-error.mir b/test/CodeGen/MIR/AArch64/generic-virtual-registers-with-regbank-error.mir
index e331179773d..f177b91da55 100644
--- a/test/CodeGen/MIR/AArch64/generic-virtual-registers-with-regbank-error.mir
+++ b/test/CodeGen/MIR/AArch64/generic-virtual-registers-with-regbank-error.mir
@@ -18,6 +18,5 @@ body: |
liveins: %w0
; ERR: generic virtual registers must have a type
; ERR-NEXT: %0
- ; ERR: Unable to initialize machine function
%0 = G_ADD i32 %w0, %w0
...
diff --git a/test/CodeGen/MIR/Generic/function-missing-machine-function.mir b/test/CodeGen/MIR/Generic/function-missing-machine-function.mir
deleted file mode 100644
index f3a83480167..00000000000
--- a/test/CodeGen/MIR/Generic/function-missing-machine-function.mir
+++ /dev/null
@@ -1,13 +0,0 @@
-# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
-# This test verifies that an error is reported when a MIR file has some
-# function but is missing a corresponding machine function.
-
-# CHECK: no machine function information for function 'foo' in the MIR file
-
---- |
-
- define i32 @foo() {
- ret i32 0
- }
-
-...
diff --git a/test/CodeGen/MIR/X86/empty0.mir b/test/CodeGen/MIR/X86/empty0.mir
new file mode 100644
index 00000000000..4431af7c6a9
--- /dev/null
+++ b/test/CodeGen/MIR/X86/empty0.mir
@@ -0,0 +1,6 @@
+# RUN: llc -run-pass none -o - %s | FileCheck %s
+# Make sure empty files don't crash us
+# CHECK: --- |
+# ... moduleid, sourcefilename stuff here ..
+# CHECK: target datalayout =
+# CHECK: ...
diff --git a/test/CodeGen/MIR/X86/empty1.mir b/test/CodeGen/MIR/X86/empty1.mir
new file mode 100644
index 00000000000..d80b0cd3023
--- /dev/null
+++ b/test/CodeGen/MIR/X86/empty1.mir
@@ -0,0 +1,8 @@
+# RUN: llc -run-pass none -o - %s | FileCheck %s
+# Make sure empty files don't crash us
+--- |
+...
+# CHECK: --- |
+# ... moduleid, sourcefilename stuff here ..
+# CHECK: target datalayout =
+# CHECK: ...
diff --git a/test/CodeGen/MIR/X86/empty2.mir b/test/CodeGen/MIR/X86/empty2.mir
new file mode 100644
index 00000000000..7495807cd4d
--- /dev/null
+++ b/test/CodeGen/MIR/X86/empty2.mir
@@ -0,0 +1,8 @@
+# RUN: llc -run-pass none -o - %s | FileCheck %s
+# Make sure empty files don't crash us
+---
+...
+# CHECK: --- |
+# ... moduleid, sourcefilename stuff here ..
+# CHECK: target datalayout =
+# CHECK: ...