URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 316 |
Rev 338 |
/* { dg-do run } */
|
/* { dg-do run } */
|
union double_union
|
union double_union
|
{
|
{
|
double d;
|
double d;
|
int i[2];
|
int i[2];
|
};
|
};
|
void _dtoa_r (double) __attribute__ ((__noinline__));
|
void _dtoa_r (double) __attribute__ ((__noinline__));
|
void _vfprintf_r (double) __attribute__ ((__noinline__));
|
void _vfprintf_r (double) __attribute__ ((__noinline__));
|
void
|
void
|
__sprint_r(int);
|
__sprint_r(int);
|
void
|
void
|
_vfprintf_r(double da)
|
_vfprintf_r(double da)
|
{
|
{
|
double ffp = da;
|
double ffp = da;
|
double value = ffp;
|
double value = ffp;
|
union double_union tmp;
|
union double_union tmp;
|
|
|
tmp.d = value;
|
tmp.d = value;
|
|
|
if ((tmp.i[1]) & ((unsigned)0x80000000L)) {
|
if ((tmp.i[1]) & ((unsigned)0x80000000L)) {
|
value = -value;
|
value = -value;
|
}
|
}
|
|
|
_dtoa_r (value);
|
_dtoa_r (value);
|
|
|
if (ffp != 0)
|
if (ffp != 0)
|
__sprint_r(value == 0);
|
__sprint_r(value == 0);
|
__asm__ ("");
|
__asm__ ("");
|
}
|
}
|
|
|
|
|
double dd = -.012;
|
double dd = -.012;
|
double ff = .012;
|
double ff = .012;
|
|
|
void exit (int) __attribute__ ((__noreturn__));
|
void exit (int) __attribute__ ((__noreturn__));
|
void abort (void) __attribute__ ((__noreturn__));
|
void abort (void) __attribute__ ((__noreturn__));
|
void *memset(void *s, int c, __SIZE_TYPE__ n);
|
void *memset(void *s, int c, __SIZE_TYPE__ n);
|
void _dtoa_r (double d)
|
void _dtoa_r (double d)
|
{
|
{
|
if (d != ff)
|
if (d != ff)
|
abort ();
|
abort ();
|
__asm__ ("");
|
__asm__ ("");
|
}
|
}
|
|
|
void __sprint_r (int i)
|
void __sprint_r (int i)
|
{
|
{
|
if (i != 0)
|
if (i != 0)
|
abort ();
|
abort ();
|
__asm__ ("");
|
__asm__ ("");
|
}
|
}
|
|
|
int clearstack (void) __attribute__ ((__noinline__));
|
int clearstack (void) __attribute__ ((__noinline__));
|
int clearstack (void)
|
int clearstack (void)
|
{
|
{
|
char doodle[128];
|
char doodle[128];
|
memset (doodle, 0, sizeof doodle);
|
memset (doodle, 0, sizeof doodle);
|
__asm__ volatile ("" : : "g" (doodle) : "memory");
|
__asm__ volatile ("" : : "g" (doodle) : "memory");
|
return doodle[127];
|
return doodle[127];
|
}
|
}
|
|
|
void doit (void) __attribute__ ((__noinline__));
|
void doit (void) __attribute__ ((__noinline__));
|
void doit (void)
|
void doit (void)
|
{
|
{
|
_vfprintf_r (dd);
|
_vfprintf_r (dd);
|
_vfprintf_r (ff);
|
_vfprintf_r (ff);
|
__asm__ ("");
|
__asm__ ("");
|
}
|
}
|
|
|
int main(void)
|
int main(void)
|
{
|
{
|
clearstack ();
|
clearstack ();
|
doit ();
|
doit ();
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.