OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [mips-hilo-2.c] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Due to a reload inheritance bug, the asm statement in f() would be passed
2
   the low part of u.ll on little-endian 32-bit targets.  */
3
/* { dg-do run { target mips*-*-* } } */
4
 
5
extern void abort (void);
6
extern void exit (int);
7
 
8
#if !defined(__mips16)
9
unsigned int g;
10
 
11
unsigned long long f (unsigned int x)
12
{
13
  union { unsigned long long ll; unsigned int parts[2]; } u;
14
 
15
  u.ll = ((unsigned long long) x * x);
16
  asm ("mflo\t%0" : "=r" (g) : "l" (u.parts[1]));
17
  return u.ll;
18
}
19
 
20
int main ()
21
{
22
  union { unsigned long long ll; unsigned int parts[2]; } u;
23
 
24
  u.ll = f (0x12345678);
25
  if (g != u.parts[1])
26
    abort ();
27
  exit (0);
28
}
29
#else
30
int main () { exit (0); }
31
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.