}
bool isValidAsmImmediate(const llvm::APInt &Value) const {
if (!ImmSet.empty())
- return ImmSet.count(Value.getZExtValue()) != 0;
- return !ImmRange.isConstrained || (Value.sge(ImmRange.Min) && Value.sle(ImmRange.Max));
+ return Value.isSignedIntN(32) &&
+ ImmSet.count(Value.getZExtValue()) != 0;
+ return !ImmRange.isConstrained ||
+ (Value.sge(ImmRange.Min) && Value.sle(ImmRange.Max));
}
void setIsReadWrite() { Flags |= CI_ReadWrite; }
static const int Invalid1 = 1;
static const int Invalid2 = 42;
static const int Invalid3 = 0;
+ static const long long Invalid4 = 0x1000000ff;
static const int Valid1 = 0xff;
static const int Valid2 = 0xffff;
static const int Valid3 = 0xffffffff;
__asm__("xorl %0,%2"
: "=r"(i)
: "0"(i), "L"(Invalid3)); // expected-error{{value '0' out of range for constraint 'L'}}
+ __asm__("xorl %0,%2"
+ : "=r"(i)
+ : "0"(i), "L"(Invalid4)); // expected-error{{value '4294967551' out of range for constraint 'L'}}
__asm__("xorl %0,%2"
: "=r"(i)
: "0"(i), "L"(Valid1)); // expected-no-error