mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
Verifier: Make sure !llvm.ident's operand isn't null
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228815 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
94d09cbb9f
commit
e37f2a0dc6
@ -818,7 +818,7 @@ void Verifier::visitModuleIdents(const Module &M) {
|
||||
const MDNode *N = Idents->getOperand(i);
|
||||
Assert1(N->getNumOperands() == 1,
|
||||
"incorrect number of operands in llvm.ident metadata", N);
|
||||
Assert1(isa<MDString>(N->getOperand(0)),
|
||||
Assert1(dyn_cast_or_null<MDString>(N->getOperand(0)),
|
||||
("invalid value for llvm.ident metadata entry operand"
|
||||
"(the operand should be a string)"),
|
||||
N->getOperand(0));
|
||||
|
9
test/Verifier/ident-meta4.ll
Normal file
9
test/Verifier/ident-meta4.ll
Normal file
@ -0,0 +1,9 @@
|
||||
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
|
||||
; Verify that llvm.ident is properly structured.
|
||||
; llvm.ident takes a list of metadata entries.
|
||||
; Each metadata entry can contain one string only.
|
||||
|
||||
!llvm.ident = !{!0}
|
||||
!0 = !{null}
|
||||
; CHECK: assembly parsed, but does not verify as correct!
|
||||
; CHECK-NEXT: invalid value for llvm.ident metadata entry operand(the operand should be a string)
|
Loading…
Reference in New Issue
Block a user