libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / c11-empty-init-2.c
blob3ec7c512a84d59a3f25f0d5a928ad7bbd1a00055
1 /* Test C11 does not support empty initializers. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c11 -pedantic" } */
5 struct s { int a; };
6 struct s s = {}; /* { dg-warning "empty initializer" } */
7 int x = {}; /* { dg-warning "empty initializer" } */
8 float y = {}; /* { dg-warning "empty initializer" } */
9 void *p = {}; /* { dg-warning "empty initializer" } */
10 union u { int a; long b; };
11 union u z = {}; /* { dg-warning "empty initializer" } */
12 int aa[2] = {}; /* { dg-warning "empty initializer" } */
14 void
15 f (int a)
17 int vla[a] = {}; /* { dg-warning "empty initializer" } */
18 struct s as = {}; /* { dg-warning "empty initializer" } */
19 int ax = {}; /* { dg-warning "empty initializer" } */
20 float ay = {}; /* { dg-warning "empty initializer" } */
21 void *ap = {}; /* { dg-warning "empty initializer" } */
22 union u az = {}; /* { dg-warning "empty initializer" } */
23 int aaa[2] = {}; /* { dg-warning "empty initializer" } */
24 int t = (int) {}; /* { dg-warning "empty initializer" } */