diff options
-rw-r--r-- | lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 3 | ||||
-rw-r--r-- | test/MC/ARM/diagnostics.s | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 2fae489371..6e0062ac44 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -3284,7 +3284,8 @@ ARMAsmParser::OperandMatchResultTy ARMAsmParser:: parseProcIFlagsOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands) { SMLoc S = Parser.getTok().getLoc(); const AsmToken &Tok = Parser.getTok(); - assert(Tok.is(AsmToken::Identifier) && "Token is not an Identifier"); + if (!Tok.is(AsmToken::Identifier)) + return MatchOperand_NoMatch; StringRef IFlagsStr = Tok.getString(); // An iflags string of "none" is interpreted to mean that none of the AIF diff --git a/test/MC/ARM/diagnostics.s b/test/MC/ARM/diagnostics.s index 7da79c31dc..117c8514f3 100644 --- a/test/MC/ARM/diagnostics.s +++ b/test/MC/ARM/diagnostics.s @@ -315,3 +315,9 @@ @ CHECK-ERRORS: error: coprocessor option must be an immediate in range [0, 255] @ CHECK-ERRORS: ldc2 p2, c8, [r1], { -1 } @ CHECK-ERRORS: ^ + + @ Bad CPS instruction format. + cps f,#1 +@ CHECK-ERRORS: error: invalid operand for instruction +@ CHECK-ERRORS: cps f,#1 +@ CHECK-ERRORS: ^ |