Xamarin Public Jenkins (auto-signing) 468663ddbb Imported Upstream version 6.10.0.49
Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
2020-01-16 16:38:04 +00:00

12 lines
508 B
C

// RUN: %clang -fsanitize=vla-bound %s -O3 -o %t
// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-MINUS-ONE
// RUN: %run %t a 2>&1 | FileCheck %s --check-prefix=CHECK-ZERO
// RUN: %run %t a b
int main(int argc, char **argv) {
// CHECK-MINUS-ONE: vla.c:[[@LINE+2]]:11: runtime error: variable length array bound evaluates to non-positive value -1
// CHECK-ZERO: vla.c:[[@LINE+1]]:11: runtime error: variable length array bound evaluates to non-positive value 0
int arr[argc - 2];
return 0;
}