token = parser.peek_current_token ();
- bool is_explicit_reg = false;
bool is_global_asm = inline_asm.is_global_asm;
if (!is_global_asm && check_identifier (parser, "in"))
{
{
// TODO: Unexpected error, please return the correct error
rust_error_at (token->get_locus (),
- "Unexpected token encountered in parse_options");
+ "expected one of %qs, %qs, %qs, %qs, %qs, %qs, %qs, "
+ "%qs, %qs, or %qs, found %qs",
+ ")", "att_syntax", "may_unwind", "nomem", "noreturn",
+ "nostack", "preserves_flags", "pure", "raw",
+ "readonly", token->as_string ().c_str ());
+ return -1;
}
if (parser.skip_token (RIGHT_PAREN))
{
if (fm_string == tl::nullopt)
{
rust_error_at (parser.peek_current_token ()->get_locus (),
- "asm template must be a string literal");
+ "%s template must be a string literal", "asm");
return tl::nullopt;
}
unsafe {
asm!("nop", options(nomem, nomem)); // { dg-error "the 'nomem' option was already provided" }
asm!("nop", options(noreturn, noreturn)); // { dg-error "the 'noreturn' option was already provided" }
+ asm!("nop", options(xxx)); // { dg-error "expected one of '\\)', 'att_syntax', 'may_unwind', 'nomem', 'noreturn', 'nostack', 'preserves_flags', 'pure', 'raw', or 'readonly', found 'xxx'" }
+ asm!("nop", options(+)); // { dg-error "expected one of '\\)', 'att_syntax', 'may_unwind', 'nomem', 'noreturn', 'nostack', 'preserves_flags', 'pure', 'raw', or 'readonly', found '\\+'" }
+
}
}
\ No newline at end of file