diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-31 00:47:15 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-31 00:47:15 +0000 |
| commit | cd07efa1736ba3c990f67d3343594dbbcddb08be (patch) | |
| tree | 9c9f832133b7d9d2643a16465b29bb9bba2ec8d0 /llvm/test/Assembler | |
| parent | 387a0e7ccec5dc6d2709ab29eab99d7e6948bfa2 (diff) | |
| download | bcm5719-llvm-cd07efa1736ba3c990f67d3343594dbbcddb08be.tar.gz bcm5719-llvm-cd07efa1736ba3c990f67d3343594dbbcddb08be.zip | |
Verifier: Move checks over from DIDescriptor::Verify()
Move over some more checks from `DIDescriptor::Verify()`, and change
`LLParser` to require non-null `file:` fields in compile units.
I've ignored the comment in test/Assembler/metadata-null-operands.ll
since I disagree with it. At the time that test was written (r229960),
the debug info verifier wasn't on by default, so my comment there is in
the context of not expecting the verifier to be useful. It is now, and
besides that, since r233394 we can check when parsing textual IR whether
an operand is null that shouldn't be.
llvm-svn: 233654
Diffstat (limited to 'llvm/test/Assembler')
| -rw-r--r-- | llvm/test/Assembler/invalid-mdcompileunit-null-file.ll | 4 | ||||
| -rw-r--r-- | llvm/test/Assembler/metadata-null-operands.ll | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/llvm/test/Assembler/invalid-mdcompileunit-null-file.ll b/llvm/test/Assembler/invalid-mdcompileunit-null-file.ll new file mode 100644 index 00000000000..613948f24ef --- /dev/null +++ b/llvm/test/Assembler/invalid-mdcompileunit-null-file.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s + +; CHECK: <stdin>:[[@LINE+1]]:27: error: 'file' cannot be null +!0 = !MDCompileUnit(file: null) diff --git a/llvm/test/Assembler/metadata-null-operands.ll b/llvm/test/Assembler/metadata-null-operands.ll index acae1d4be99..7e27eba45fe 100644 --- a/llvm/test/Assembler/metadata-null-operands.ll +++ b/llvm/test/Assembler/metadata-null-operands.ll @@ -1,13 +1,11 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s ; RUN: verify-uselistorder %s -; Don't crash on null operands. (If/when we add a verify check for these, we -; should disable the verifier for this test and remove this comment; the test -; is still important.) -!named = !{!0, !1} +; Don't crash on null operands. When we add a verify check for this, also +; require non-null in the assembler and rework this test to check for that ala +; test/Assembler/invalid-mdcompileunit-null-file.ll. +!named = !{!0} !0 = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: null) -!1 = !MDCompileUnit(language: DW_LANG_C, file: null) -; CHECK: !named = !{!0, !1} +; CHECK: !named = !{!0} ; CHECK: !0 = !MDDerivedType({{.*}}baseType: null{{.*}}) -; CHECK: !1 = !MDCompileUnit({{.*}}file: null{{.*}}) |

