URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 338 |
/* PR middle-end/27945 */
|
/* PR middle-end/27945 */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "" } */
|
/* { dg-options "" } */
|
|
|
extern int printf (const char *, ...);
|
extern int printf (const char *, ...);
|
extern void abort ();
|
extern void abort ();
|
|
|
int func(int levels)
|
int func(int levels)
|
{
|
{
|
struct bar {
|
struct bar {
|
unsigned char a;
|
unsigned char a;
|
int b[levels];
|
int b[levels];
|
} __attribute__ ((__packed__)) bar;
|
} __attribute__ ((__packed__)) bar;
|
|
|
struct foo {
|
struct foo {
|
unsigned char a;
|
unsigned char a;
|
int b[4];
|
int b[4];
|
} __attribute__ ((__packed__)) foo;
|
} __attribute__ ((__packed__)) foo;
|
|
|
printf("foo %d\n", sizeof(foo));
|
printf("foo %d\n", sizeof(foo));
|
printf("bar %d\n", sizeof(bar));
|
printf("bar %d\n", sizeof(bar));
|
|
|
if (sizeof (foo) != sizeof (bar))
|
if (sizeof (foo) != sizeof (bar))
|
abort ();
|
abort ();
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
func(4);
|
func(4);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.