brintos

brintos / llvm-project-archived public Read only

0
0
Text · 508 B · 1939551 Raw
12 lines · c
1// RUN: %clang -fsanitize=vla-bound %s -O3 -o %t2// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-MINUS-ONE3// RUN: %run %t a 2>&1 | FileCheck %s --check-prefix=CHECK-ZERO4// RUN: %run %t a b5 6int 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 -18  // CHECK-ZERO: vla.c:[[@LINE+1]]:11: runtime error: variable length array bound evaluates to non-positive value 09  int arr[argc - 2];10  return 0;11}12