// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core -verify %s
typedefunsignedlongsize_t;#defineBIGINDEX65536Usize_tcheck_VLA_overflow_sizeof(unsignedintx){if(x == BIGINDEX){// We expect here that size_t is a 64 bit value.
// Size of this array should be the first to overflow.
size_t s =sizeof(char[x][x][x][x]);// expected-warning{{Declared variable-length array (VLA) has too large size [core.VLASize]}}
return s;}return0;}voidcheck_VLA_overflow_typedef(void){unsignedint x = BIGINDEX;typedefchar VLA[x][x][x][x];// expected-warning{{Declared variable-length array (VLA) has too large size [core.VLASize]}}
}voidcheck_VLA_no_overflow(void){unsignedint x = BIGINDEX;typedefchar VLA[x][x][x][x -1];typedefchar VLA1[0xffffffffu];}