llvm.org GIT mirror llvm / 09b4588
ARM: raise error message when complex SO expressions can't really be solved as a constant at compilation time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204898 91177308-0d34-0410-b5e6-96231b3b80d8 Jiangning Liu 6 years ago
2 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
93569356 const MCExpr *SOExpr = Op->getImm();
93579357 int64_t Value;
93589358 if (!SOExpr->EvaluateAsAbsolute(Value))
9359 return Match_Success;
9359 return Match_InvalidOperand;
93609360 assert((Value >= INT32_MIN && Value <= INT32_MAX) &&
93619361 "expression value must be representiable in 32 bits");
93629362 }
0 @ RUN: not llvm-mc -triple=armv7-linux-gnuabi -filetype=obj < %s 2>&1 | FileCheck %s
1
2 .text
3 cmp r2, #(l2 - l1) >> 6
4 @ CHECK: error: invalid operand for instruction
5
6 l1:
7 l2: