2016-12-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / vla-2.c
blobe6ddcccfb4b5cb75b651f5b716e2b13e2103c948
1 /* { dg-do compile } */
2 /* { dg-options "-std=gnu99" } */
3 /* { dg-require-effective-target alloca } */
5 /* These are crash tests related to PR middle-end/6994; see also
6 g++.dg/ext/vla1.C. Note that at present A and C cannot be inlined. */
8 static inline void A (int i)
10 struct S { int ar[1][i]; } s;
12 s.ar[0][0] = 0;
15 void B(void)
17 A(23);
20 static inline void C (int i)
22 union U { int ar[1][i]; } u;
24 u.ar[0][0] = 0;
27 void D(void)
29 C(23);