diff options
author | Jakub Jelinek <jakub@redhat.com> | 2001-01-31 18:38:11 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2001-01-31 18:38:11 +0100 |
commit | ce662d4c92d5a0fd86a4ea80e91ca58db778b7ee (patch) | |
tree | 707e99442268409e3649852380d881d2309809da /gcc/testsuite/gcc.dg/gnu99-init-1.c | |
parent | 4673dd2cc142a761e9a5d0df21e1001f52498ec5 (diff) | |
download | gcc-ce662d4c92d5a0fd86a4ea80e91ca58db778b7ee.zip gcc-ce662d4c92d5a0fd86a4ea80e91ca58db778b7ee.tar.gz gcc-ce662d4c92d5a0fd86a4ea80e91ca58db778b7ee.tar.bz2 |
c-typeck.c (set_init_index): If first is equal to last, assume as if it was not a range at all.
* c-typeck.c (set_init_index): If first is equal to last, assume as
if it was not a range at all.
* gcc.dg/gnu99-init-1.c: Add test for [0 ... 0] range.
From-SVN: r39380
Diffstat (limited to 'gcc/testsuite/gcc.dg/gnu99-init-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/gnu99-init-1.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gnu99-init-1.c b/gcc/testsuite/gcc.dg/gnu99-init-1.c index 9c22c90..009c851 100644 --- a/gcc/testsuite/gcc.dg/gnu99-init-1.c +++ b/gcc/testsuite/gcc.dg/gnu99-init-1.c @@ -24,6 +24,7 @@ struct M o[] = { [0 ... 5].O = { [1 ... 2].K[0 ... 1] = 4 }, struct M p[] = { [0 ... 5].O[1 ... 2].K = { [0 ... 1] = 4 }, [5].O[2].K[2] = 5, 6, 7 }; int q[3][3] = { [0 ... 1] = { [1 ... 2] = 23 }, [1][2] = 24 }; +int r[1] = { [0 ... 1 - 1] = 27 }; int main (void) { @@ -73,5 +74,7 @@ int main (void) abort (); if (q[2][0] || q[2][1] || q[2][2]) abort (); + if (r[0] != 27) + abort (); exit (0); } |