154359Sroberto/* { dg-options "isa_rev<=5 -mgp64" } */
254359Sroberto/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
354359Sroberto/* { dg-final { scan-assembler-times "\tsdl\t" 1 } } */
454359Sroberto/* { dg-final { scan-assembler-times "\tsdr\t" 1 } } */
554359Sroberto/* { dg-final { scan-assembler-times "\tldl\t" 1 } } */
654359Sroberto/* { dg-final { scan-assembler-times "\tldr\t" 1 } } */
754359Sroberto/* { dg-final { scan-assembler-times "\tswl\t" 1 } } */
854359Sroberto/* { dg-final { scan-assembler-times "\tswr\t" 1 } } */
954359Sroberto/* { dg-final { scan-assembler-times "\tlwl\t" 1 } } */
1054359Sroberto/* { dg-final { scan-assembler-times "\tlwr\t" 1 } } */
1154359Sroberto/* { dg-final { scan-assembler-not "\tnop" } } */
1254359Sroberto
1354359Sroberto/* Test to make sure we produce the unaligned load/store for
1454359Sroberto   both 64bit and 32bits sized accesses.  */
1554359Sroberto
1654359Srobertostruct s
1754359Sroberto{
1854359Sroberto  char c;
1954359Sroberto  int i;
2054359Sroberto  long long l;
2154359Sroberto} __attribute__ ((packed)) s __attribute__((aligned(1) ));
2254359Sroberto
2354359SrobertoNOMIPS16 void
2454359Srobertosd (long long l)
2554359Sroberto{
2654359Sroberto  s.l = l;
2754359Sroberto}
2854359Sroberto
2954359SrobertoNOMIPS16 long long
3054359Srobertold ()
3154359Sroberto{
3254359Sroberto  return s.l;
3354359Sroberto}
3454359Sroberto
3554359SrobertoNOMIPS16 void
3654359Srobertosw (int i)
3754359Sroberto{
3854359Sroberto  s.i = i;
3954359Sroberto}
4054359Sroberto
4154359SrobertoNOMIPS16 int
4254359Srobertolw ()
4354359Sroberto{
4454359Sroberto  return s.i;
4554359Sroberto}
4654359Sroberto