brintos

brintos / llvm-project-archived public Read only

0
0
Text · 911 B · 4ad96d9 Raw
25 lines · c
1/* RUN: %clang_cc1 -verify=off -std=c89 %s2 * RUN: %clang_cc1 -verify=off -Wall -std=c89 %s3 * RUN: %clang_cc1 -verify -pedantic -std=c89 %s4 * RUN: %clang_cc1 -verify -Wvla-extension -std=c89 %s5 * RUN: %clang_cc1 -verify=off -Wvla-cxx-extension -std=c89 %s6 * RUN: %clang_cc1 -verify=off -pedantic -std=c99 %s7 * RUN: %clang_cc1 -verify=off -Wall -std=c99 %s8 * RUN: %clang_cc1 -verify=off -std=c99 -Wvla-extension %s9 * The next run line still issues the extension warning because VLAs are an10 * extension in C89, but the line after it will issue the congratulatory11 * diagnostic.12 * RUN: %clang_cc1 -verify -Wvla -std=c89 %s13 * RUN: %clang_cc1 -verify=wvla -Wvla -std=c99 %s14 */15 16/* off-no-diagnostics */17 18void func(int n) {19  int array[n]; /* expected-warning {{variable length arrays are a C99 feature}}20                   wvla-warning {{variable length array used}}21                 */22  (void)array;23}24 25