libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / Wvla-larger-than-4.c
blob7d27829736fbdfe06b02dcd536247c833df44546
1 /* PR middle-end/94004 - missing -Walloca on calls to alloca due
2 to -Wno-system-headers
3 { dg-do compile }
4 { dg-options "-O2 -Wall -Wvla-larger-than=31 -ftrack-macro-expansion=0" }
5 { dg-require-effective-target alloca } */
7 void sink (void*, ...);
9 static inline void inline_use_vla (unsigned n)
11 if (n > 32)
12 n = 32;
13 char a[n]; // { dg-warning "\\\[-Wvla-larger-than" }
14 sink (a, 2);
17 static inline void use_inlined_vla (unsigned n)
19 inline_use_vla (n); // this call is okay
20 inline_use_vla (n + 1); // this one is not (line 20)
23 void call_inline (void)
25 use_inlined_vla (31); // line 25
28 /* Verify that the inlining context is included and that it points
29 to the correct line number in the inlined function:
30 { dg-message "function 'inline_use_vla'.*inlined from 'use_inlined_vla'.*:20:.*inlined from 'call_inline' .*:25:" "" { target *-*-* } 0 } */