summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-06-15 20:30:22 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-06-15 20:30:22 +0000
commit735c47ec3e9a5d64343e764b72c4e35f171b06bb (patch)
tree9f5819d9580cf59726a54c04159ad1b1a35319bd /llvm/test/CodeGen
parent49e9010ca339099d23c56e768d0b0fcf40929719 (diff)
downloadbcm5719-llvm-735c47ec3e9a5d64343e764b72c4e35f171b06bb.tar.gz
bcm5719-llvm-735c47ec3e9a5d64343e764b72c4e35f171b06bb.zip
MIR Serialization: Connect the machine function analysis pass to the MIR parser.
This commit connects the machine function analysis pass (which creates machine functions) to the MIR parser, which will initialize the machine functions with the state from the MIR file and reconstruct the machine IR. This commit introduces a new interface called 'MachineFunctionInitializer', which can be used to provide custom initialization for the machine functions. This commit also introduces a new diagnostic class called 'DiagnosticInfoMIRParser' which is used for MIR parsing errors. This commit modifies the default diagnostic handling in LLVMContext - now the the diagnostics are printed directly into llvm::errs() so that the MIR parsing errors can be printed with colours. Reviewers: Justin Bogner Differential Revision: http://reviews.llvm.org/D9928 llvm-svn: 239753
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/MIR/function-missing-machine-function.mir13
-rw-r--r--llvm/test/CodeGen/MIR/llvm-ir-error-reported.mir2
-rw-r--r--llvm/test/CodeGen/MIR/llvmIR.mir3
-rw-r--r--llvm/test/CodeGen/MIR/machine-function-missing-name.mir2
4 files changed, 18 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/MIR/function-missing-machine-function.mir b/llvm/test/CodeGen/MIR/function-missing-machine-function.mir
new file mode 100644
index 00000000000..71b5b284534
--- /dev/null
+++ b/llvm/test/CodeGen/MIR/function-missing-machine-function.mir
@@ -0,0 +1,13 @@
+# RUN: not llc -start-after branch-folder -stop-after branch-folder -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/llvm/test/CodeGen/MIR/llvm-ir-error-reported.mir b/llvm/test/CodeGen/MIR/llvm-ir-error-reported.mir
index 013b28cd789..3508c341c44 100644
--- a/llvm/test/CodeGen/MIR/llvm-ir-error-reported.mir
+++ b/llvm/test/CodeGen/MIR/llvm-ir-error-reported.mir
@@ -4,7 +4,7 @@
--- |
- ; CHECK: [[@LINE+3]]:15: error: use of undefined value '%a'
+ ; CHECK: [[@LINE+3]]:15: use of undefined value '%a'
define i32 @foo(i32 %x, i32 %y) {
%z = alloca i32, align 4
store i32 %a, i32* %z, align 4
diff --git a/llvm/test/CodeGen/MIR/llvmIR.mir b/llvm/test/CodeGen/MIR/llvmIR.mir
index 7a7b46b6263..4d7fde240c5 100644
--- a/llvm/test/CodeGen/MIR/llvmIR.mir
+++ b/llvm/test/CodeGen/MIR/llvmIR.mir
@@ -30,3 +30,6 @@
}
...
+---
+name: foo
+...
diff --git a/llvm/test/CodeGen/MIR/machine-function-missing-name.mir b/llvm/test/CodeGen/MIR/machine-function-missing-name.mir
index 54668f1a5ef..b16156e54bd 100644
--- a/llvm/test/CodeGen/MIR/machine-function-missing-name.mir
+++ b/llvm/test/CodeGen/MIR/machine-function-missing-name.mir
@@ -14,7 +14,7 @@
...
---
-# CHECK: [[@LINE+1]]:1: error: missing required key 'name'
+# CHECK: [[@LINE+1]]:1: missing required key 'name'
nme: foo
...
---
OpenPOWER on IntegriCloud