diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index e3215491fdf..83fedb70ebd 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -9357,7 +9357,7 @@ unsigned ARMAsmParser::validateTargetOperandClass(MCParsedAsmOperand *AsmOp, const MCExpr *SOExpr = Op->getImm(); int64_t Value; if (!SOExpr->EvaluateAsAbsolute(Value)) - return Match_Success; + return Match_InvalidOperand; assert((Value >= INT32_MIN && Value <= INT32_MAX) && "expression value must be representiable in 32 bits"); } diff --git a/test/MC/ARM/label_offset.s b/test/MC/ARM/label_offset.s new file mode 100644 index 00000000000..0aeb3b6ee69 --- /dev/null +++ b/test/MC/ARM/label_offset.s @@ -0,0 +1,8 @@ +@ RUN: not llvm-mc -triple=armv7-linux-gnuabi -filetype=obj < %s 2>&1 | FileCheck %s + +.text + cmp r2, #(l2 - l1) >> 6 +@ CHECK: error: invalid operand for instruction + +l1: +l2: