URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
struct A { int i, j; char pad[512]; } a;
|
struct A { int i, j; char pad[512]; } a;
|
|
|
int __attribute__((noinline))
|
int __attribute__((noinline))
|
foo (void)
|
foo (void)
|
{
|
{
|
__builtin_memset (&a, 0x26, sizeof a);
|
__builtin_memset (&a, 0x26, sizeof a);
|
return a.i;
|
return a.i;
|
}
|
}
|
|
|
void __attribute__((noinline))
|
void __attribute__((noinline))
|
bar (void)
|
bar (void)
|
{
|
{
|
__builtin_memset (&a, 0x36, sizeof a);
|
__builtin_memset (&a, 0x36, sizeof a);
|
a.i = 0x36363636;
|
a.i = 0x36363636;
|
a.j = 0x36373636;
|
a.j = 0x36373636;
|
}
|
}
|
|
|
int
|
int
|
main (void)
|
main (void)
|
{
|
{
|
int i;
|
int i;
|
if (sizeof (int) != 4 || __CHAR_BIT__ != 8)
|
if (sizeof (int) != 4 || __CHAR_BIT__ != 8)
|
return 0;
|
return 0;
|
|
|
if (foo () != 0x26262626)
|
if (foo () != 0x26262626)
|
__builtin_abort ();
|
__builtin_abort ();
|
for (i = 0; i < sizeof a; i++)
|
for (i = 0; i < sizeof a; i++)
|
if (((char *)&a)[i] != 0x26)
|
if (((char *)&a)[i] != 0x26)
|
__builtin_abort ();
|
__builtin_abort ();
|
|
|
bar ();
|
bar ();
|
if (a.j != 0x36373636)
|
if (a.j != 0x36373636)
|
__builtin_abort ();
|
__builtin_abort ();
|
a.j = 0x36363636;
|
a.j = 0x36363636;
|
for (i = 0; i < sizeof a; i++)
|
for (i = 0; i < sizeof a; i++)
|
if (((char *)&a)[i] != 0x36)
|
if (((char *)&a)[i] != 0x36)
|
__builtin_abort ();
|
__builtin_abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.