1 /* PR middle-end/94004 - missing -Walloca on calls to alloca due
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
)
13 char a
[n
]; // { dg-warning "\\\[-Wvla-larger-than" }
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 } */