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/] [cris/] [torture/] [pr34773.c] - Blame information for rev 316

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 316 jeremybenn
/* { dg-do run } */
2
union double_union
3
{
4
  double d;
5
  int i[2];
6
};
7
void _dtoa_r (double) __attribute__ ((__noinline__));
8
void _vfprintf_r (double) __attribute__ ((__noinline__));
9
void
10
__sprint_r(int);
11
void
12
_vfprintf_r(double da)
13
{
14
 double ffp = da;
15
 double value = ffp;
16
 union double_union tmp;
17
 
18
 tmp.d = value;
19
 
20
 if ((tmp.i[1]) & ((unsigned)0x80000000L)) {
21
   value = -value;
22
 }
23
 
24
 _dtoa_r (value);
25
 
26
 if (ffp != 0)
27
   __sprint_r(value == 0);
28
 __asm__ ("");
29
}
30
 
31
 
32
double dd = -.012;
33
double ff = .012;
34
 
35
void exit (int) __attribute__ ((__noreturn__));
36
void abort (void) __attribute__ ((__noreturn__));
37
void *memset(void *s, int c, __SIZE_TYPE__ n);
38
void _dtoa_r (double d)
39
{
40
  if (d != ff)
41
    abort ();
42
  __asm__ ("");
43
}
44
 
45
void __sprint_r (int i)
46
{
47
  if (i != 0)
48
    abort ();
49
  __asm__ ("");
50
}
51
 
52
int clearstack (void) __attribute__ ((__noinline__));
53
int clearstack (void)
54
{
55
  char doodle[128];
56
  memset (doodle, 0, sizeof doodle);
57
  __asm__ volatile ("" : : "g" (doodle) : "memory");
58
  return doodle[127];
59
}
60
 
61
void doit (void) __attribute__ ((__noinline__));
62
void doit (void)
63
{
64
  _vfprintf_r (dd);
65
  _vfprintf_r (ff);
66
  __asm__ ("");
67
}
68
 
69
int main(void)
70
{
71
  clearstack ();
72
  doit ();
73
  exit (0);
74
}

powered by: WebSVN 2.1.0

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