URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 318 |
Rev 338 |
// Test for bitfield alignment in structs on IA-32
|
// Test for bitfield alignment in structs on IA-32
|
// { dg-do run }
|
// { dg-do run }
|
// { dg-options "-O2" }
|
// { dg-options "-O2" }
|
// { dg-options "-mno-align-double -mno-ms-bitfields" { target *-*-interix* } }
|
// { dg-options "-mno-align-double -mno-ms-bitfields" { target *-*-interix* } }
|
|
|
extern void abort (void);
|
extern void abort (void);
|
extern void exit (int);
|
extern void exit (int);
|
|
|
struct X {
|
struct X {
|
int : 32;
|
int : 32;
|
};
|
};
|
|
|
struct Y {
|
struct Y {
|
int i : 32;
|
int i : 32;
|
};
|
};
|
|
|
int main () {
|
int main () {
|
if (__alignof__(struct X) != 1)
|
if (__alignof__(struct X) != 1)
|
abort ();
|
abort ();
|
if (__alignof__(struct Y) != 4)
|
if (__alignof__(struct Y) != 4)
|
abort ();
|
abort ();
|
|
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.