"invalid lvalue in asm input for constraint '%0'">;
def err_asm_invalid_input_constraint : Error<
"invalid input constraint '%0' in asm">;
+ def err_asm_immediate_expected : Error<"constraint '%0' expects "
+ "an integer constant expression">;
def err_asm_invalid_type_in_input : Error<
"invalid type %0 in asm input for constraint '%1'">;
def err_asm_tying_incompatible_types : Error<
llvm::APSInt Result;
if (!InputExpr->EvaluateAsInt(Result, Context))
return StmtError(
- Diag(InputExpr->getLocStart(), diag::err_asm_invalid_type_in_input)
- << InputExpr->getType() << Info.getConstraintStr()
- << InputExpr->getSourceRange());
+ Diag(InputExpr->getLocStart(), diag::err_asm_immediate_expected)
+ << Info.getConstraintStr() << InputExpr->getSourceRange());
if (Result.slt(Info.getImmConstantMin()) ||
Result.sgt(Info.getImmConstantMax()))
return StmtError(Diag(InputExpr->getLocStart(),
static const int AboveMax = 32;
__asm__("xorl %0,%2"
: "=r"(i)
- : "0"(i), "I"(j)); // expected-error{{invalid type 'int' in asm input for constraint 'I'}}
+ : "0"(i), "I"(j)); // expected-error{{constraint 'I' expects an integer constant expression}}
__asm__("xorl %0,%2"
: "=r"(i)
: "0"(i), "I"(BelowMin)); // expected-error{{value '-1' out of range for constraint 'I'}}
static const int AboveMax = 64;
__asm__("xorl %0,%2"
: "=r"(i)
- : "0"(i), "J"(j)); // expected-error{{invalid type 'int' in asm input for constraint 'J'}}
+ : "0"(i), "J"(j)); // expected-error{{constraint 'J' expects an integer constant expression}}
__asm__("xorl %0,%2"
: "=r"(i)
: "0"(i), "J"(BelowMin)); // expected-error{{value '-1' out of range for constraint 'J'}}
static const int AboveMax = 128;
__asm__("xorl %0,%2"
: "=r"(i)
- : "0"(i), "K"(j)); // expected-error{{invalid type 'int' in asm input for constraint 'K'}}
+ : "0"(i), "K"(j)); // expected-error{{constraint 'K' expects an integer constant expression}}
__asm__("xorl %0,%2"
: "=r"(i)
: "0"(i), "K"(BelowMin)); // expected-error{{value '-129' out of range for constraint 'K'}}
static const int AboveMax = 4;
__asm__("xorl %0,%2"
: "=r"(i)
- : "0"(i), "M"(j)); // expected-error{{invalid type 'int' in asm input for constraint 'M'}}
+ : "0"(i), "M"(j)); // expected-error{{constraint 'M' expects an integer constant expression}}
__asm__("xorl %0,%2"
: "=r"(i)
: "0"(i), "M"(BelowMin)); // expected-error{{value '-1' out of range for constraint 'M'}}
static const int AboveMax = 256;
__asm__("xorl %0,%2"
: "=r"(i)
- : "0"(i), "N"(j)); // expected-error{{invalid type 'int' in asm input for constraint 'N'}}
+ : "0"(i), "N"(j)); // expected-error{{constraint 'N' expects an integer constant expression}}
__asm__("xorl %0,%2"
: "=r"(i)
: "0"(i), "N"(BelowMin)); // expected-error{{value '-1' out of range for constraint 'N'}}
static const int AboveMax = 128;
__asm__("xorl %0,%2"
: "=r"(i)
- : "0"(i), "O"(j)); // expected-error{{invalid type 'int' in asm input for constraint 'O'}}
+ : "0"(i), "O"(j)); // expected-error{{constraint 'O' expects an integer constant expression}}
__asm__("xorl %0,%2"
: "=r"(i)
: "0"(i), "O"(BelowMin)); // expected-error{{value '-1' out of range for constraint 'O'}}