Seen when running gas/testsuite/gas/sh/err-at.s
* config/tc-sh.c (get_operands): Always init operand type.
* testsuite/gas/sh/err-at.s: Expect unnecessary extra errors.
get_operands (sh_opcode_info *info, char *args, sh_operand_info *operand)
{
char *ptr = args;
+
+ operand[0].type = 0;
+ operand[1].type = 0;
+ operand[2].type = 0;
if (info->arg[0])
{
/* The pre-processor will eliminate whitespace in front of '@'
if (info->arg[1])
{
if (*ptr == ',')
- {
- ptr++;
- }
+ ptr++;
get_operand (&ptr, operand + 1);
/* ??? Hack: psha/pshl have a varying operand number depending on
the type of the first operand. We handle this by having the
if (info->arg[2] && operand[0].type != A_IMM)
{
if (*ptr == ',')
- {
- ptr++;
- }
+ ptr++;
get_operand (&ptr, operand + 2);
}
- else
- {
- operand[2].type = 0;
- }
- }
- else
- {
- operand[1].type = 0;
- operand[2].type = 0;
}
}
- else
- {
- operand[0].type = 0;
- operand[1].type = 0;
- operand[2].type = 0;
- }
return ptr;
}
start:
mov.l r1,@r0 ! ok
mov.l r1,@(r0) ! { dg-error "syntax error" }
+! { dg-bogus "invalid operands for opcode" "" { xfail *-*-* } 6 }
mov.l r1,@(r0,) ! { dg-error "syntax error" }
+! { dg-bogus "invalid operands for opcode" "" { xfail *-*-* } 8 }
mov.l r1,@(r0,r0) ! ok
mov.l r1,@(r0,r1) ! ok
mov.l r1,@(r1,r0) ! { dg-error "must be" }