Replace assertion failure for badly formatted CPS instrution with error message.
authorRichard Barton <richard.barton@arm.com>
Thu, 14 Jun 2012 10:48:04 +0000 (10:48 +0000)
committerRichard Barton <richard.barton@arm.com>
Thu, 14 Jun 2012 10:48:04 +0000 (10:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158445 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/diagnostics.s

index 2fae489371dacdd770a64be571adb663afbf5689..6e0062ac44d93aeb0fd529c7e9d5d532e29d01b7 100644 (file)
@@ -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
index 7da79c31dc35cdf702fed7be7d875ba17cc6be55..117c8514f3abc9d0df8b744f230aa871d3190410 100644 (file)
 @ 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:               ^