Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / ubsan / TestCases / Misc / vla.c
blob1939551f2ddbe01c03a08d104e5e55ddddde2b58
1 // RUN: %clang -fsanitize=vla-bound %s -O3 -o %t
2 // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-MINUS-ONE
3 // RUN: %run %t a 2>&1 | FileCheck %s --check-prefix=CHECK-ZERO
4 // RUN: %run %t a b
6 int main(int argc, char **argv) {
7 // CHECK-MINUS-ONE: vla.c:[[@LINE+2]]:11: runtime error: variable length array bound evaluates to non-positive value -1
8 // CHECK-ZERO: vla.c:[[@LINE+1]]:11: runtime error: variable length array bound evaluates to non-positive value 0
9 int arr[argc - 2];
10 return 0;