diff options
| author | Alex Lorenz <arphaman@gmail.com> | 2015-07-09 21:21:33 +0000 |
|---|---|---|
| committer | Alex Lorenz <arphaman@gmail.com> | 2015-07-09 21:21:33 +0000 |
| commit | c8704b02df54ff109f3fe28798aed5ff8b8ecb29 (patch) | |
| tree | 719148d7f61da0821d7e4fb85c8c9dde785644ad /llvm/test/CodeGen/MIR/machine-function-missing-body-error.mir | |
| parent | dcb9f0907f15c5a660cf8f9ffe315015af5fcaff (diff) | |
| download | bcm5719-llvm-c8704b02df54ff109f3fe28798aed5ff8b8ecb29.tar.gz bcm5719-llvm-c8704b02df54ff109f3fe28798aed5ff8b8ecb29.zip | |
MIR Parser: Report an error when parsing machine function with an empty body.
This commit adds a new error which is reported when the MIR Parser encounters
a machine function without any machine basic blocks. The machine verifier
expects that the machine functions have at least one MBB, and this error will
prevent machine functions without MBBs from reaching the machine verifier and
crashing with an assertion.
llvm-svn: 241862
Diffstat (limited to 'llvm/test/CodeGen/MIR/machine-function-missing-body-error.mir')
| -rw-r--r-- | llvm/test/CodeGen/MIR/machine-function-missing-body-error.mir | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/MIR/machine-function-missing-body-error.mir b/llvm/test/CodeGen/MIR/machine-function-missing-body-error.mir new file mode 100644 index 00000000000..0dc7477f627 --- /dev/null +++ b/llvm/test/CodeGen/MIR/machine-function-missing-body-error.mir @@ -0,0 +1,15 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -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 +... |

