struct foo {
void *a;
int b;
};
union { int i; float f; } u = { };
union { int i; double f; } u2 = { };
union { double f; int i; } u3 = { };
int b[2] = {
[1] = 22
};
struct ds {
struct {
struct {
short a;
};
short b;
struct {
short c;
};
};
};
struct ds ds0 = { { { .a = 0 } } };
struct ds ds1 = { { .a = 1 } };
struct ds ds2 = { { .b = 1 } };
struct ds ds3 = { .a = 0 };
struct ds ds4 = { .c = 1 };
struct ds ds5 = { { { .a = 0 } }, .b = 1 };
struct ds ds6 = { { .a = 0, .b = 1 } };
struct ds ds7 = {
{ {
.a = 1
} },
.a = 2,
.b = 3
};
struct overwrite_string_struct1 {
__typeof(L"foo"[0]) L[6];
int M;
} overwrite_string1[] = { { { L"foo" }, 1 }, [0].L[2] = L'x'};
struct overwrite_string_struct2 {
char L[6];
int M;
} overwrite_string2[] = { { { "foo" }, 1 }, [0].L[2] = 'x'};
struct overwrite_string_struct3 {
char L[3];
int M;
} overwrite_string3[] = { { { "foo" }, 1 }, [0].L[2] = 'x'};
struct overwrite_string_struct4 {
char L[3];
int M;
} overwrite_string4[] = { { { "foobar" }, 1 }, [0].L[2] = 'x'};
struct overwrite_string_struct5 {
char L[6];
int M;
} overwrite_string5[] = { { { "foo" }, 1 }, [0].L[4] = 'y'};
union u_FFFF { char c; long l; } u1 = { .l = 0xFFFF };
typedef union u_16644 {
struct s_16644 {
int zero;
int one;
int two;
int three;
} a;
int b[4];
} union_16644_t;
union_16644_t union_16644_instance_0 =
{
.b[0] = 0,
.a.one = 1,
.b[2] = 2,
.a.three = 3,
};
union_16644_t union_16644_instance_1 =
{
.a.three = 13,
.b[2] = 12,
.a.one = 11,
.b[0] = 10,
};
union_16644_t union_16644_instance_2 =
{
.a.one = 21,
.b[1] = 20,
};
union_16644_t union_16644_instance_3 =
{
.b[1] = 30,
.a = {
.one = 31
}
};
union_16644_t union_16644_instance_4[2] =
{
[0].a.one = 2,
[1].a.zero = 3,
[0].a.zero = 5,
[1].b[1] = 4
};
struct leading_anon_bitfield { int : 32; int n; } lab = { .n = 123 };
struct Base {
struct {
int A;
};
};
struct Derived {
struct Base B;
};
struct Derived D = {{}, .B.A = 42};
void test1(int argc, char **argv)
{
static struct foo foo = {
.b = 1024,
};
union { int i; float f; } u2 = { };
union { int i; float f; } u3;
}
struct S {
int nkeys;
int *keys;
union {
void *data;
};
};
void test2(void) {
struct S *btkr;
*btkr = (struct S) {
.keys = 0,
{ .data = 0 },
};
}