summaryrefslogtreecommitdiff
path: root/test/Sema/warn-vla.c
blob: 01fe45173bbbaa9645303914f4df3c3f1818161f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// RUN: %clang_cc1 -std=c99 -fsyntax-only -verify -Wvla %s
// RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -Wvla %s

void test1(int n) {
  int v[n]; // expected-warning {{variable length array used}}
}

void test2(int n, int v[n]) { // expected-warning {{variable length array used}}
}

void test3(int n, int v[n]); // expected-warning {{variable length array used}}