diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 769601c7e633..adeb3ba15a92 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -4167,8 +4167,8 @@ bool LLParser::parseMDField(LocTy Loc, StringRef Name, DIFlagField &Result) { Val = DINode::getFlag(Lex.getStrVal()); if (!Val) - return tokError(Twine("invalid debug info flag flag '") + - Lex.getStrVal() + "'"); + return tokError(Twine("invalid debug info flag '") + Lex.getStrVal() + + "'"); Lex.Lex(); return false; }; diff --git a/llvm/test/Assembler/invalid-diflag-bad.ll b/llvm/test/Assembler/invalid-diflag-bad.ll new file mode 100644 index 000000000000..cde59f6ce667 --- /dev/null +++ b/llvm/test/Assembler/invalid-diflag-bad.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s + +; CHECK: :[[@LINE+1]]:27: error: invalid debug info flag 'DIFlagUnknown' +!0 = !DISubprogram(flags: DIFlagUnknown)