URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* On H8/300 port, NOTICE_UPDATE_CC had a bug that causes the final
|
/* On H8/300 port, NOTICE_UPDATE_CC had a bug that causes the final
|
pass to remove test insns that should be kept. */
|
pass to remove test insns that should be kept. */
|
|
|
unsigned short
|
unsigned short
|
test1 (unsigned short w)
|
test1 (unsigned short w)
|
{
|
{
|
if ((w & 0xff00) == 0)
|
if ((w & 0xff00) == 0)
|
{
|
{
|
if (w == 0)
|
if (w == 0)
|
w = 2;
|
w = 2;
|
}
|
}
|
return w;
|
return w;
|
}
|
}
|
|
|
unsigned long
|
unsigned long
|
test2 (unsigned long w)
|
test2 (unsigned long w)
|
{
|
{
|
if ((w & 0xffff0000) == 0)
|
if ((w & 0xffff0000) == 0)
|
{
|
{
|
if (w == 0)
|
if (w == 0)
|
w = 2;
|
w = 2;
|
}
|
}
|
return w;
|
return w;
|
}
|
}
|
|
|
int
|
int
|
test3 (unsigned short a)
|
test3 (unsigned short a)
|
{
|
{
|
if (a & 1)
|
if (a & 1)
|
return 1;
|
return 1;
|
else if (a)
|
else if (a)
|
return 1;
|
return 1;
|
else
|
else
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
if (test1 (1) != 1)
|
if (test1 (1) != 1)
|
abort ();
|
abort ();
|
|
|
if (test2 (1) != 1)
|
if (test2 (1) != 1)
|
abort ();
|
abort ();
|
|
|
if (test3 (2) != 1)
|
if (test3 (2) != 1)
|
abort ();
|
abort ();
|
|
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.