diff options
author | Justin Bogner <mail@justinbogner.com> | 2017-04-11 19:32:41 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2017-04-11 19:32:41 +0000 |
commit | b86967b0063c156af1aa5ecb686e364cb8c2ee5f (patch) | |
tree | 644b3d308c509c34616c990284a5571311460c8b /test/CodeGen/MIR | |
parent | 4e34a0eb576a38011998e67a244c6e9b9c914fde (diff) |
MIR: Allow parsing of empty machine functions
If you run llc -stop-after=codegenprepare and feed the resulting MIR
to llc -start-after=codegenprepare, you'll have an empty machine
function since we haven't run any isel yet. Of course, this only works
if the MIRParser believes you that this is okay.
This is essentially a revert of r241862 with a fix for the problem it
was papering over.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/MIR')
8 files changed, 17 insertions, 41 deletions
diff --git a/test/CodeGen/MIR/Generic/llvmIR.mir b/test/CodeGen/MIR/Generic/llvmIR.mir index 432b18ff939..5c0e60e916f 100644 --- a/test/CodeGen/MIR/Generic/llvmIR.mir +++ b/test/CodeGen/MIR/Generic/llvmIR.mir @@ -28,10 +28,8 @@ IfUnequal: ret i32 0 } - + ... --- name: foo -body: | - bb.0: ... diff --git a/test/CodeGen/MIR/Generic/llvmIRMissing.mir b/test/CodeGen/MIR/Generic/llvmIRMissing.mir index 9bd2a3e35a3..419f60be806 100644 --- a/test/CodeGen/MIR/Generic/llvmIRMissing.mir +++ b/test/CodeGen/MIR/Generic/llvmIRMissing.mir @@ -4,6 +4,4 @@ --- # CHECK: name: foo name: foo -body: | - bb.0: ... diff --git a/test/CodeGen/MIR/Generic/machine-function-missing-body-error.mir b/test/CodeGen/MIR/Generic/machine-function-missing-body-error.mir deleted file mode 100644 index 1896371db36..00000000000 --- a/test/CodeGen/MIR/Generic/machine-function-missing-body-error.mir +++ /dev/null @@ -1,15 +0,0 @@ -# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s -# This test ensures that the MIR parser reports an error when it encounters a -# machine function with an empty body. - ---- | - - define i32 @foo() { - ret i32 0 - } - -... ---- -# CHECK: machine function 'foo' requires at least one machine basic block in its body -name: foo -... diff --git a/test/CodeGen/MIR/Generic/machine-function-missing-body.mir b/test/CodeGen/MIR/Generic/machine-function-missing-body.mir new file mode 100644 index 00000000000..0fd970c3af7 --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-function-missing-body.mir @@ -0,0 +1,15 @@ +# RUN: llc -run-pass none -o - %s | FileCheck %s +# This test ensures that the MIR parser accepts files with llvm IR but +# no machine function body. + +--- | + ; CHECK: define i32 @foo() + define i32 @foo() { + ret i32 0 + } + +... +--- +# CHECK: name: foo +name: foo +... diff --git a/test/CodeGen/MIR/Generic/machine-function-missing-function.mir b/test/CodeGen/MIR/Generic/machine-function-missing-function.mir index c547bb25d75..b218afd72ea 100644 --- a/test/CodeGen/MIR/Generic/machine-function-missing-function.mir +++ b/test/CodeGen/MIR/Generic/machine-function-missing-function.mir @@ -12,12 +12,8 @@ ... --- name: foo -body: | - bb.0: ... --- # CHECK: function 'faa' isn't defined in the provided LLVM IR name: faa -body: | - bb.0: ... diff --git a/test/CodeGen/MIR/Generic/machine-function-missing-name.mir b/test/CodeGen/MIR/Generic/machine-function-missing-name.mir index 30f0e51b3b6..bc279a6ecfd 100644 --- a/test/CodeGen/MIR/Generic/machine-function-missing-name.mir +++ b/test/CodeGen/MIR/Generic/machine-function-missing-name.mir @@ -16,11 +16,7 @@ --- # CHECK: [[@LINE+1]]:1: missing required key 'name' nme: foo -body: | - bb.0: ... --- name: bar -body: | - bb.0: ... diff --git a/test/CodeGen/MIR/Generic/machine-function.mir b/test/CodeGen/MIR/Generic/machine-function.mir index f9001cca4c2..9c19b980e67 100644 --- a/test/CodeGen/MIR/Generic/machine-function.mir +++ b/test/CodeGen/MIR/Generic/machine-function.mir @@ -18,7 +18,7 @@ define i32 @func2() { ret i32 0 } - + ... --- # CHECK: name: foo @@ -26,8 +26,6 @@ # CHECK-NEXT: exposesReturnsTwice: false # CHECK: ... name: foo -body: | - bb.0: ... --- # CHECK: name: bar @@ -35,8 +33,6 @@ body: | # CHECK-NEXT: exposesReturnsTwice: false # CHECK: ... name: bar -body: | - bb.0: ... --- # CHECK: name: func @@ -45,8 +41,6 @@ body: | # CHECK: ... name: func alignment: 8 -body: | - bb.0: ... --- # CHECK: name: func2 @@ -56,6 +50,4 @@ body: | name: func2 alignment: 16 exposesReturnsTwice: true -body: | - bb.0: ... diff --git a/test/CodeGen/MIR/Generic/register-info.mir b/test/CodeGen/MIR/Generic/register-info.mir index af3f44f9abc..84a6125abe8 100644 --- a/test/CodeGen/MIR/Generic/register-info.mir +++ b/test/CodeGen/MIR/Generic/register-info.mir @@ -20,8 +20,6 @@ # CHECK: tracksRegLiveness: false # CHECK: ... name: foo -body: | - bb.0: ... --- # CHECK: name: bar @@ -29,6 +27,4 @@ body: | # CHECK: ... name: bar tracksRegLiveness: true -body: | - bb.0: ... |