Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/vla-init-1.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* Test for tree-checking error when initializing a variable-length array (not allowed): constructor_max_index needs to be an INTEGER_CST. */ /* Origin: Joseph Myers <jsm28@cam.ac.uk>. */ /* { dg-do compile } */ /* { dg-options "" } */ int a; void foo (void) { int x[a] = { 1 }; /* { dg-error "variable-sized object may not be initialized" "VLA init" } */ /* { dg-warning "excess elements in array initializer" "excess" { target *-*-* } .-1 } */ /* { dg-message "near initialization" "near" { target *-*-* } .-2 } */ }