diff options
author | Joseph Myers <joseph@codesourcery.com> | 2009-04-24 18:24:32 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2009-04-24 18:24:32 +0100 |
commit | 2b6da65c33c24de56b95b42c5dd2c771c425ef7c (patch) | |
tree | a6300e7d88299fc54fd9ad19a6c84f9e22ccfa43 /gcc/testsuite/gcc.dg/array-const-1.c | |
parent | bda61b12c2309d715e418754a0912bb75b5f1323 (diff) | |
download | gcc-2b6da65c33c24de56b95b42c5dd2c771c425ef7c.zip gcc-2b6da65c33c24de56b95b42c5dd2c771c425ef7c.tar.gz gcc-2b6da65c33c24de56b95b42c5dd2c771c425ef7c.tar.bz2 |
c-typeck.c (set_init_index): Allow array designators that are not integer constant expressions with a...
* c-typeck.c (set_init_index): Allow array designators that are
not integer constant expressions with a pedwarn if pedantic.
testsuite:
* gcc.dg/array-const-1.c, gcc.dg/array-const-2.c,
gcc.dg/array-const-3.c: New tests.
From-SVN: r146741
Diffstat (limited to 'gcc/testsuite/gcc.dg/array-const-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/array-const-1.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/array-const-1.c b/gcc/testsuite/gcc.dg/array-const-1.c new file mode 100644 index 0000000..0e0c462 --- /dev/null +++ b/gcc/testsuite/gcc.dg/array-const-1.c @@ -0,0 +1,8 @@ +/* Test for array designators not integer constant expressions but + folding to integer constants (used in Linux kernel, + <http://gcc.gnu.org/ml/gcc/2009-04/msg00611.html>). */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +extern int i; +int a[] = { [1 ? 1 : i] = 0 }; |