URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
int foo1(void)
|
int foo1(void)
|
{
|
{
|
union {
|
union {
|
char a[sizeof (unsigned)];
|
char a[sizeof (unsigned)];
|
unsigned b;
|
unsigned b;
|
} u;
|
} u;
|
|
|
u.b = 0x01;
|
u.b = 0x01;
|
return u.a[0];
|
return u.a[0];
|
}
|
}
|
|
|
int foo2(void)
|
int foo2(void)
|
{
|
{
|
volatile union {
|
volatile union {
|
char a[sizeof (unsigned)];
|
char a[sizeof (unsigned)];
|
unsigned b;
|
unsigned b;
|
} u;
|
} u;
|
|
|
u.b = 0x01;
|
u.b = 0x01;
|
return u.a[0];
|
return u.a[0];
|
}
|
}
|
|
|
int main(void)
|
int main(void)
|
{
|
{
|
if (foo1() != foo2())
|
if (foo1() != foo2())
|
abort ();
|
abort ();
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.