URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 384 |
/* Problem only noticed on SH for -mcbranchdi DImode comparison with constants.
|
/* Problem only noticed on SH for -mcbranchdi DImode comparison with constants.
|
* Target dependant failure but test valid for alls. */
|
* Target dependant failure but test valid for alls. */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-O0" } */
|
/* { dg-options "-O0" } */
|
/* { dg-options "-O0 -mcbranchdi" { target sh4-*-* } } */
|
/* { dg-options "-O0 -mcbranchdi" { target sh4-*-* } } */
|
|
|
extern void abort(void);
|
extern void abort(void);
|
extern void exit(int);
|
extern void exit(int);
|
|
|
int test2(long long n)
|
int test2(long long n)
|
{
|
{
|
if (n < 2)
|
if (n < 2)
|
return 1;
|
return 1;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int test1(long long n)
|
int test1(long long n)
|
{
|
{
|
if (n < 1)
|
if (n < 1)
|
return 1;
|
return 1;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int test0(long long n)
|
int test0(long long n)
|
{
|
{
|
if (n < 0)
|
if (n < 0)
|
return 1;
|
return 1;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int test1n(long long n)
|
int test1n(long long n)
|
{
|
{
|
if (n < -1LL)
|
if (n < -1LL)
|
return 1;
|
return 1;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int test2n(long long n)
|
int test2n(long long n)
|
{
|
{
|
if (n < -2LL)
|
if (n < -2LL)
|
return 1;
|
return 1;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
if (test2n (-1LL))
|
if (test2n (-1LL))
|
abort ();
|
abort ();
|
|
|
if (test2n (-2LL))
|
if (test2n (-2LL))
|
abort ();
|
abort ();
|
|
|
if (test2n (0LL))
|
if (test2n (0LL))
|
abort ();
|
abort ();
|
|
|
if (test2n (1LL))
|
if (test2n (1LL))
|
abort ();
|
abort ();
|
|
|
if (test2n (2LL))
|
if (test2n (2LL))
|
abort ();
|
abort ();
|
|
|
if (test1n (-1LL))
|
if (test1n (-1LL))
|
abort ();
|
abort ();
|
|
|
if (!test1n (-2LL))
|
if (!test1n (-2LL))
|
abort ();
|
abort ();
|
|
|
if (test1n (0LL))
|
if (test1n (0LL))
|
abort ();
|
abort ();
|
|
|
if (test1n (1LL))
|
if (test1n (1LL))
|
abort ();
|
abort ();
|
|
|
if (test1n (2LL))
|
if (test1n (2LL))
|
abort ();
|
abort ();
|
|
|
if (!test0 (-1LL))
|
if (!test0 (-1LL))
|
abort ();
|
abort ();
|
|
|
if (!test0 (-2LL))
|
if (!test0 (-2LL))
|
abort ();
|
abort ();
|
|
|
if (test0 (0LL))
|
if (test0 (0LL))
|
abort ();
|
abort ();
|
|
|
if (test0 (1LL))
|
if (test0 (1LL))
|
abort ();
|
abort ();
|
|
|
if (test0 (2LL))
|
if (test0 (2LL))
|
abort ();
|
abort ();
|
|
|
if (!test2 (-1LL))
|
if (!test2 (-1LL))
|
abort ();
|
abort ();
|
|
|
if (!test2 (-2LL))
|
if (!test2 (-2LL))
|
abort ();
|
abort ();
|
|
|
if (!test2 (0LL))
|
if (!test2 (0LL))
|
abort ();
|
abort ();
|
|
|
if (!test2 (1LL))
|
if (!test2 (1LL))
|
abort ();
|
abort ();
|
|
|
if (test2 (2LL))
|
if (test2 (2LL))
|
abort ();
|
abort ();
|
|
|
if (!test1 (-1LL))
|
if (!test1 (-1LL))
|
abort ();
|
abort ();
|
|
|
if (!test1 (-2LL))
|
if (!test1 (-2LL))
|
abort ();
|
abort ();
|
|
|
if (!test1 (0LL))
|
if (!test1 (0LL))
|
abort ();
|
abort ();
|
|
|
if (test1 (1LL))
|
if (test1 (1LL))
|
abort ();
|
abort ();
|
|
|
if (test1 (2LL))
|
if (test1 (2LL))
|
abort ();
|
abort ();
|
|
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
|
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.