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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [sparc/] [20001013-1.c] - Blame information for rev 327

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

Line No. Rev Author Line
1 326 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target ultrasparc_hw } */
3
/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
4
 
5
extern void abort (void);
6
extern void exit (int);
7
 
8
int l;
9
 
10
int baz (double x)
11
{
12
  return l == 0;
13
}
14
 
15
double bar (double x)
16
{
17
  return 1.0;
18
}
19
 
20
double foo (double x)
21
{
22
  if (l == -1 || baz (x)) return x;
23
  if (x < 0.0)
24
    return bar (x);
25
  else
26
    return 0.0;
27
}
28
 
29
union {
30
  double d;
31
  long long l;
32
} x = { l: 0x7ff8000000000000LL }, y;
33
 
34
main ()
35
{
36
  unsigned int fsr = 0;
37
  __asm __volatile ("ld %0, %%fsr" : : "m" (fsr));
38
  y.d = foo (x.d);
39
  __asm __volatile ("st %%fsr, %0" : "=m" (fsr));
40
  if (x.l != y.l || (fsr & 0x3ff))
41
    abort ();
42
  exit (0);
43
}

powered by: WebSVN 2.1.0

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