struct I { int k[3]; };
struct M { struct I o[2]; };
struct M v1[1] = { [0].o[0 ... 1].k[0 ... 1] = 4, 5 };
unsigned v2[2][3] = {[0 ... 1][0 ... 1] = 2222, 3333};
void f1(void) {
int a = { 1 };
}
void f2(void) {
int a[2][2] = { { 1, 2 }, { 3, 4 } };
int b[3][3] = { { 1, 2 }, { 3, 4 } };
int *c[2] = { &a[1][1], &b[2][2] };
int *d[2][2] = { {&a[1][1], &b[2][2]}, {&a[0][0], &b[1][1]} };
int *e[3][3] = { {&a[1][1], &b[2][2]}, {&a[0][0], &b[1][1]} };
char ext[3][3] = {".Y",".U",".V"};
}
typedef void (* F)(void);
extern void foo(void);
struct S { F f; };
void f3(void) {
struct S a[1] = { { foo } };
}
const int g3 = 10;
int f4(void) {
static const int g4 = 12;
return g4;
}
typedef union vec3 {
struct { double x, y, z; };
double component[3];
} vec3;
vec3 f5(vec3 value) {
return (vec3) {{
.x = value.x
}};
}
void f6(void) {
int x;
long ids[] = { (long) &x };
}
struct a7 {
int b;
char v[];
};
struct a7 test7 = { .b = 0, .v = "bar" };
int huge_array[1000000000] = {1, 0, 2, 0, 3, 0, 0, 0};
struct Huge {
int a;
int arr[1000 * 1000 * 1000];
} huge_struct = {1, {2, 0, 0, 0}};
const char large_array_with_zeroes[1000] = {
'a', 'b', 'c', 1, 2, 3, 'x', 'y', 'z', 'z', 'y', [20] = 'q'
};
char global;
const void *large_array_with_zeroes_2[100] = {
[9] = &global
};
const void *large_array_with_zeroes_3[1000] = {
[9] = &global
};
char test8(int X) {
char str[100000] = "abc"; return str[X];
}
void bar(void*);
void test9(int X) {
int Arr[100] = { X }; bar(Arr);
}
struct a {
int a, b, c, d, e, f, g, h, i, j, k, *p;
};
struct b {
struct a a,b,c,d,e,f,g;
};
void test10(int X) {
struct b S = { .a.a = X, .d.e = X, .f.e = 0, .f.f = 0, .f.p = 0 };
bar(&S);
}
void nonzeroMemseti8(void) {
char arr[33] = { 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, };
}
void nonzeroMemseti16(void) {
unsigned short arr[17] = { 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, };
}
void nonzeroMemseti32(void) {
unsigned arr[9] = { 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, };
}
void nonzeroMemseti64(void) {
unsigned long long arr[7] = { 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, };
}
void nonzeroMemsetf32(void) {
float arr[9] = { 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, };
}
void nonzeroMemsetf64(void) {
double arr[7] = { 0x1.4444444444444p+69, 0x1.4444444444444p+69, 0x1.4444444444444p+69, 0x1.4444444444444p+69, 0x1.4444444444444p+69, 0x1.4444444444444p+69, 0x1.4444444444444p+69, };
}
void nonzeroPaddedUnionMemset(void) {
union U { char c; int i; };
union U arr[9] = { 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, };
}
void nonzeroNestedMemset(void) {
union U { char c; int i; };
struct S { union U u; short i; };
struct S arr[5] = { { {0xF0}, 0xF0F0 }, { {0xF0}, 0xF0F0 }, { {0xF0}, 0xF0F0 }, { {0xF0}, 0xF0F0 }, { {0xF0}, 0xF0F0 }, };
}
struct test11S {
int A[10];
};
void test11(struct test11S *P) {
*P = (struct test11S) { .A = { [0 ... 3] = 4 } };
}
struct test12 {
struct test12 (*p)(void);
} test12g;
void test13(int x) {
struct X { int a; int b : 10; int c; };
struct X y = {.c = x};
}
void PR20473(void) {
bar((char[2]) {""});
bar((char[3]) {""});
}
struct S14 { int a[16]; };
void test14(struct S14 *s14) {
*s14 = (struct S14) { { [5 ... 11] = 17 } };
}