libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vla-stexp-5.c
blob68614f2d6b98ce5d397f9181a579da9cdd4dd6a8
1 /* PR29970 */
2 /* { dg-do run } */
3 /* { dg-options "-Wunused-variable" } */
4 /* { dg-require-effective-target alloca } */
9 int foo2a(void) // should not ICE
11 return ({ int n = 20; struct { int x[n];} x; x.x[12] = 1; sizeof(x); });
15 int foo2b(void) // should not ICE
17 return sizeof *({ int n = 20; struct { int x[n];} x; x.x[12] = 1; &x; });
20 int main()
22 if (sizeof(struct { int x[20]; }) != foo2a())
23 __builtin_abort();
25 if (sizeof(struct { int x[20]; }) != foo2b())
26 __builtin_abort();
28 return 0;