URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 384 |
/* Test for tree-checking error when initializing a variable-length array
|
/* Test for tree-checking error when initializing a variable-length array
|
(not allowed): constructor_max_index needs to be an INTEGER_CST. */
|
(not allowed): constructor_max_index needs to be an INTEGER_CST. */
|
/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
|
/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "" } */
|
/* { dg-options "" } */
|
|
|
int a;
|
int a;
|
|
|
void
|
void
|
foo (void)
|
foo (void)
|
{
|
{
|
int x[a] = { 1 }; /* { dg-error "variable-sized object may not be initialized" "VLA init" } */
|
int x[a] = { 1 }; /* { dg-error "variable-sized object may not be initialized" "VLA init" } */
|
/* { dg-warning "excess elements in array initializer" "" { target *-*-* } 12 } */
|
/* { dg-warning "excess elements in array initializer" "" { target *-*-* } 12 } */
|
/* { dg-warning "near initialization" "" { target *-*-* } 12 } */
|
/* { dg-warning "near initialization" "" { target *-*-* } 12 } */
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.