MIR Parser: report an error when a basic block isn't found.
This commit reports an error when the MIR parser can't find
a basic block with the machine basic block's name.
llvm-svn: 240174
diff --git a/llvm/test/CodeGen/MIR/machine-basic-block-unknown-name.mir b/llvm/test/CodeGen/MIR/machine-basic-block-unknown-name.mir
new file mode 100644
index 0000000..4c363c6
--- /dev/null
+++ b/llvm/test/CodeGen/MIR/machine-basic-block-unknown-name.mir
@@ -0,0 +1,18 @@
+# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
+# This test ensures that an error is reported whenever the MIR parser can't find
+# a basic block with the machine basis block's name.
+
+--- |
+
+ define i32 @foo() {
+ entry:
+ ret i32 0
+ }
+
+...
+---
+name: foo
+body:
+ # CHECK: basic block 'entrie' is not defined in the function 'foo'
+ - name: entrie
+...