xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/warn-vla.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c99 -fsyntax-only -verify -Wvla %s
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -Wvla %s
3*f4a2713aSLionel Sambuc 
test1(int n)4*f4a2713aSLionel Sambuc void test1(int n) {
5*f4a2713aSLionel Sambuc   int v[n]; // expected-warning {{variable length array used}}
6*f4a2713aSLionel Sambuc }
7*f4a2713aSLionel Sambuc 
test2(int n,int v[n])8*f4a2713aSLionel Sambuc void test2(int n, int v[n]) { // expected-warning {{variable length array used}}
9*f4a2713aSLionel Sambuc }
10*f4a2713aSLionel Sambuc 
11*f4a2713aSLionel Sambuc void test3(int n, int v[n]); // expected-warning {{variable length array used}}
12*f4a2713aSLionel Sambuc 
13