URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 323 |
Rev 384 |
/* { dg-do compile } */
|
/* { dg-do compile } */
|
|
|
struct unpacked
|
struct unpacked
|
{
|
{
|
int i;
|
int i;
|
char c;
|
char c;
|
};
|
};
|
|
|
#pragma pack(1)
|
#pragma pack(1)
|
|
|
struct packed
|
struct packed
|
{
|
{
|
int i;
|
int i;
|
char c;
|
char c;
|
};
|
};
|
|
|
struct packed_contains_unpacked
|
struct packed_contains_unpacked
|
{
|
{
|
char c;
|
char c;
|
struct unpacked uuuu; /* This should generate an error message. */
|
struct unpacked uuuu; /* This should generate an error message. */
|
}; /* { dg-error "unpacked structure/union inside a packed struct" "XFAILed until patch for generic GCC structure layout code is accepted" { xfail rx-*-* } } */
|
}; /* { dg-error "unpacked structure/union inside a packed struct" "XFAILed until patch for generic GCC structure layout code is accepted" { xfail rx-*-* } } */
|
|
|
union contains_unpacked
|
union contains_unpacked
|
{
|
{
|
char c;
|
char c;
|
struct unpacked uuuu; /* This should not. */
|
struct unpacked uuuu; /* This should not. */
|
};
|
};
|
|
|
struct packed_contains_packed
|
struct packed_contains_packed
|
{
|
{
|
char c;
|
char c;
|
struct packed ppppp; /* This should not. */
|
struct packed ppppp; /* This should not. */
|
};
|
};
|
|
|
#pragma pack()
|
#pragma pack()
|
|
|
struct unpacked_contains_packed
|
struct unpacked_contains_packed
|
{
|
{
|
char c;
|
char c;
|
struct packed p;
|
struct packed p;
|
};
|
};
|
|
|
struct unpacked_contains_unpacked
|
struct unpacked_contains_unpacked
|
{
|
{
|
char c;
|
char c;
|
struct unpacked u;
|
struct unpacked u;
|
};
|
};
|
|
|
|
|
int s1 = sizeof (struct unpacked);
|
int s1 = sizeof (struct unpacked);
|
int s2 = sizeof (struct packed);
|
int s2 = sizeof (struct packed);
|
int s3 = sizeof (struct packed_contains_unpacked);
|
int s3 = sizeof (struct packed_contains_unpacked);
|
int s4 = sizeof (struct packed_contains_packed);
|
int s4 = sizeof (struct packed_contains_packed);
|
int s5 = sizeof (struct unpacked_contains_packed);
|
int s5 = sizeof (struct unpacked_contains_packed);
|
int s6 = sizeof (struct unpacked_contains_unpacked);
|
int s6 = sizeof (struct unpacked_contains_unpacked);
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.