Alejandro Colomar <a...@kernel.org> writes: > [...] > diff --git a/gcc/testsuite/gcc.dg/countof-vla.c > b/gcc/testsuite/gcc.dg/countof-vla.c > new file mode 100644 > index 000000000000..cc225df20689 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/countof-vla.c > @@ -0,0 +1,35 @@ > +/* { dg-do compile } */ > +/* { dg-options "-std=c2y -pedantic-errors -Wvla-parameter" } */ > + > +void fix_fix (int i, > + char (*a)[3][5], > + int (*x)[_Countof (*a)], > + short (*)[_Generic(x, int (*)[3]: 1)]); > +void fix_var (int i, > + char (*a)[3][i], /* dg-warn "variable" */
'dg-warn' is not a valid dg directive. It should be 'dg-warning', but it needs to be surrounded by braces too, i.e. { dg-warning "variable" }