URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 384 |
/* PR c/6660
|
/* PR c/6660
|
Test whether an unnamed field with user defined type - struct or union is
|
Test whether an unnamed field with user defined type - struct or union is
|
accepted. */
|
accepted. */
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-fms-extensions" } */
|
/* { dg-options "-fms-extensions" } */
|
|
|
typedef struct {
|
typedef struct {
|
unsigned short a;
|
unsigned short a;
|
unsigned short b;
|
unsigned short b;
|
} __attribute__ ((__packed__)) A;
|
} __attribute__ ((__packed__)) A;
|
|
|
typedef struct B_ {
|
typedef struct B_ {
|
unsigned int c;
|
unsigned int c;
|
unsigned int d;
|
unsigned int d;
|
} B;
|
} B;
|
|
|
typedef struct C_ {
|
typedef struct C_ {
|
B;
|
B;
|
unsigned int e;
|
unsigned int e;
|
unsigned int f;
|
unsigned int f;
|
} C;
|
} C;
|
|
|
typedef C D;
|
typedef C D;
|
|
|
typedef struct {
|
typedef struct {
|
A;
|
A;
|
D;
|
D;
|
struct {
|
struct {
|
unsigned short g;
|
unsigned short g;
|
unsigned short h;
|
unsigned short h;
|
} __attribute__ ((__packed__));
|
} __attribute__ ((__packed__));
|
union {
|
union {
|
int i;
|
int i;
|
long j;
|
long j;
|
};
|
};
|
int k;
|
int k;
|
} __attribute__ ((__packed__)) E;
|
} __attribute__ ((__packed__)) E;
|
|
|
E x;
|
E x;
|
|
|
void foo (void)
|
void foo (void)
|
{
|
{
|
x.a = 1;
|
x.a = 1;
|
x.b = 2;
|
x.b = 2;
|
x.c = 3;
|
x.c = 3;
|
x.d = 4;
|
x.d = 4;
|
x.e = 5;
|
x.e = 5;
|
x.f = 6;
|
x.f = 6;
|
x.g = 7;
|
x.g = 7;
|
x.h = 8;
|
x.h = 8;
|
x.i = 9;
|
x.i = 9;
|
x.j = 10;
|
x.j = 10;
|
x.k = 11;
|
x.k = 11;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.