URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* { dg-do link } */
|
/* { dg-do link } */
|
/* { dg-options "-O2" } */
|
/* { dg-options "-O2" } */
|
|
|
extern void link_error (void);
|
extern void link_error (void);
|
|
|
|
|
void test(int x)
|
void test(int x)
|
{
|
{
|
if ((x & ~x) != 0)
|
if ((x & ~x) != 0)
|
link_error ();
|
link_error ();
|
if ((~x & x) != 0)
|
if ((~x & x) != 0)
|
link_error ();
|
link_error ();
|
|
|
if ((x ^ ~x) != -1)
|
if ((x ^ ~x) != -1)
|
link_error ();
|
link_error ();
|
if ((~x ^ x) != -1)
|
if ((~x ^ x) != -1)
|
link_error ();
|
link_error ();
|
|
|
if ((x | ~x) != -1)
|
if ((x | ~x) != -1)
|
link_error ();
|
link_error ();
|
if ((~x | x) != -1)
|
if ((~x | x) != -1)
|
link_error ();
|
link_error ();
|
|
|
if (x && !x)
|
if (x && !x)
|
link_error ();
|
link_error ();
|
if (!x && x)
|
if (!x && x)
|
link_error ();
|
link_error ();
|
|
|
if (!(x || !x))
|
if (!(x || !x))
|
link_error ();
|
link_error ();
|
if (!(!x || x))
|
if (!(!x || x))
|
link_error ();
|
link_error ();
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
test (0);
|
test (0);
|
test (1);
|
test (1);
|
test (-1);
|
test (-1);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.