URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// PR 20670: f29 corrupted when unwind stack. This tries to test that FP
|
// PR 20670: f29 corrupted when unwind stack. This tries to test that FP
|
// registers are properly saved and restored by defining 20 different FP
|
// registers are properly saved and restored by defining 20 different FP
|
// local variables.
|
// local variables.
|
// { dg-do run }
|
// { dg-do run }
|
// { dg-options "-O" }
|
// { dg-options "-O" }
|
#include
|
#include
|
|
|
double zero = 0.0;
|
double zero = 0.0;
|
double another_zero = 0.0;
|
double another_zero = 0.0;
|
|
|
int
|
int
|
sub (void)
|
sub (void)
|
{
|
{
|
throw (0);
|
throw (0);
|
}
|
}
|
|
|
int
|
int
|
main (void)
|
main (void)
|
{
|
{
|
double a, b, c, d, e, f, g, h, i, j;
|
double a, b, c, d, e, f, g, h, i, j;
|
double a1, b1, c1, d1, e1, f1, g1, h1, i1, j1;
|
double a1, b1, c1, d1, e1, f1, g1, h1, i1, j1;
|
|
|
a = zero;
|
a = zero;
|
b = a + 1;
|
b = a + 1;
|
c = b + 1;
|
c = b + 1;
|
d = c + 1;
|
d = c + 1;
|
e = d + 1;
|
e = d + 1;
|
f = e + 1;
|
f = e + 1;
|
g = f + 1;
|
g = f + 1;
|
h = g + 1;
|
h = g + 1;
|
i = h + 1;
|
i = h + 1;
|
j = i + 1;
|
j = i + 1;
|
|
|
a1 = another_zero;
|
a1 = another_zero;
|
b1 = a1 + 1;
|
b1 = a1 + 1;
|
c1 = b1 + 1;
|
c1 = b1 + 1;
|
d1 = c1 + 1;
|
d1 = c1 + 1;
|
e1 = d1 + 1;
|
e1 = d1 + 1;
|
f1 = e1 + 1;
|
f1 = e1 + 1;
|
g1 = f1 + 1;
|
g1 = f1 + 1;
|
h1 = g1 + 1;
|
h1 = g1 + 1;
|
i1 = h1 + 1;
|
i1 = h1 + 1;
|
j1 = i1 + 1;
|
j1 = i1 + 1;
|
|
|
try
|
try
|
{
|
{
|
sub ();
|
sub ();
|
}
|
}
|
catch (...)
|
catch (...)
|
{
|
{
|
if (a != 0.0)
|
if (a != 0.0)
|
abort ();
|
abort ();
|
if (b != 1.0)
|
if (b != 1.0)
|
abort ();
|
abort ();
|
if (c != 2.0)
|
if (c != 2.0)
|
abort ();
|
abort ();
|
if (d != 3.0)
|
if (d != 3.0)
|
abort ();
|
abort ();
|
if (e != 4.0)
|
if (e != 4.0)
|
abort ();
|
abort ();
|
if (f != 5.0)
|
if (f != 5.0)
|
abort ();
|
abort ();
|
if (g != 6.0)
|
if (g != 6.0)
|
abort ();
|
abort ();
|
if (h != 7.0)
|
if (h != 7.0)
|
abort ();
|
abort ();
|
if (i != 8.0)
|
if (i != 8.0)
|
abort ();
|
abort ();
|
if (j != 9.0)
|
if (j != 9.0)
|
abort ();
|
abort ();
|
|
|
if (a1 != 0.0)
|
if (a1 != 0.0)
|
abort ();
|
abort ();
|
if (b1 != 1.0)
|
if (b1 != 1.0)
|
abort ();
|
abort ();
|
if (c1 != 2.0)
|
if (c1 != 2.0)
|
abort ();
|
abort ();
|
if (d1 != 3.0)
|
if (d1 != 3.0)
|
abort ();
|
abort ();
|
if (e1 != 4.0)
|
if (e1 != 4.0)
|
abort ();
|
abort ();
|
if (f1 != 5.0)
|
if (f1 != 5.0)
|
abort ();
|
abort ();
|
if (g1 != 6.0)
|
if (g1 != 6.0)
|
abort ();
|
abort ();
|
if (h1 != 7.0)
|
if (h1 != 7.0)
|
abort ();
|
abort ();
|
if (i1 != 8.0)
|
if (i1 != 8.0)
|
abort ();
|
abort ();
|
if (j1 != 9.0)
|
if (j1 != 9.0)
|
abort ();
|
abort ();
|
}
|
}
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.