summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/sh/pr21255-2-ml.c
blob: c63a573ea9d95142d5245958341ef1b035ea275c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-ml -O2 -fomit-frame-pointer" } */
/* { dg-final { scan-assembler "mov @\\(4,r.\\),r.; mov @r.,r." } } */
double d;

double
f (void)
{
  double r;

/* If -mb from the target options is passed after -ml from dg-options, we
   end up with th reverse endianness.  */
#if TARGET_SHMEDIA || defined (__BIG_ENDIAN__)
  asm ("mov @(4,r1),r4; mov @r1,r3");
#else
  asm ("mov %S1,%S0; mov %R1,%R0" : "=&r" (r) : "m" (d));
#endif
  return r;
}