From b10b344f7b4ce85095b76c8947a5c7b96313a27d Mon Sep 17 00:00:00 2001 From: jakub Date: Wed, 31 Jan 2001 17:38:11 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39380 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.dg/gnu99-init-1.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/testsuite/gcc.dg/gnu99-init-1.c') diff --git a/gcc/testsuite/gcc.dg/gnu99-init-1.c b/gcc/testsuite/gcc.dg/gnu99-init-1.c index 9c22c90103b..009c8515f1e 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); } -- cgit v1.2.1