Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Sema / vla-ext.c
blob4ad96d97901c9e5715bbfd9872c7f3ea4d39933d
1 /* RUN: %clang_cc1 -verify=off -std=c89 %s
2 * RUN: %clang_cc1 -verify=off -Wall -std=c89 %s
3 * RUN: %clang_cc1 -verify -pedantic -std=c89 %s
4 * RUN: %clang_cc1 -verify -Wvla-extension -std=c89 %s
5 * RUN: %clang_cc1 -verify=off -Wvla-cxx-extension -std=c89 %s
6 * RUN: %clang_cc1 -verify=off -pedantic -std=c99 %s
7 * RUN: %clang_cc1 -verify=off -Wall -std=c99 %s
8 * RUN: %clang_cc1 -verify=off -std=c99 -Wvla-extension %s
9 * The next run line still issues the extension warning because VLAs are an
10 * extension in C89, but the line after it will issue the congratulatory
11 * diagnostic.
12 * RUN: %clang_cc1 -verify -Wvla -std=c89 %s
13 * RUN: %clang_cc1 -verify=wvla -Wvla -std=c99 %s
16 /* off-no-diagnostics */
18 void func(int n) {
19 int array[n]; /* expected-warning {{variable length arrays are a C99 feature}}
20 wvla-warning {{variable length array used}}
22 (void)array;