[llvm] r204898 - ARM: raise error message when complex SO expressions can't really be
Jiangning Liu
jiangning.liu at arm.com
Thu Mar 27 00:42:59 PDT 2014
Author: jiangning
Date: Thu Mar 27 02:42:58 2014
New Revision: 204898
URL: http://llvm.org/viewvc/llvm-project?rev=204898&view=rev
Log:
ARM: raise error message when complex SO expressions can't really be
solved as a constant at compilation time.
Added:
llvm/trunk/test/MC/ARM/label_offset.s
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=204898&r1=204897&r2=204898&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Thu Mar 27 02:42:58 2014
@@ -9357,7 +9357,7 @@ unsigned ARMAsmParser::validateTargetOpe
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");
}
Added: llvm/trunk/test/MC/ARM/label_offset.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/label_offset.s?rev=204898&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/label_offset.s (added)
+++ llvm/trunk/test/MC/ARM/label_offset.s Thu Mar 27 02:42:58 2014
@@ -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:
More information about the llvm-commits
mailing list