[patch] New c-torture testcases.

Diego Novillo dnovillo@redhat.com
Sat May 26 19:54:00 GMT 2001


On Sat, 26 May 2001, Jeffrey Oldham wrote:

> 
>     Index: gcc.c-torture/compile/20010518-2.c
>     ===================================================================
>     + /* Large static storage.  */
>     + 
>     + static volatile char chars_1[INT_MAX / 2];
> 
> INT_MAX/2 = 2^{31} seems excessive.  MIPS's assembler complains about
> allocating such a large number:
> 
>     spawn /am/mother/vol/vol2/frameworks/pooma/joldham/dev4/gcc/objdir/gcc/xgcc -B/am/mother/vol/vol2/frameworks/pooma/joldham/dev4/gcc/objdir/gcc/ /users/joldham/pooma/dev4/gcc/gcc/testsuite/gcc.c-torture/compile/20010518-2.c -w -O0 -c -o /users/joldham/pooma/dev4/gcc/objdir/gcc/testsuite/20010518-2.o 
>     as: Error: /var/tmp//cctxXzfv.s, line 68: Not enough space
>     as: Error: /var/tmp//cctxXzfv.s, line 68: could not allocate enough memory for .space
>     compiler exited with status 1
>     output is:
>     as: Error: /var/tmp//cctxXzfv.s, line 68: Not enough space
>     as: Error: /var/tmp//cctxXzfv.s, line 68: could not allocate enough memory for .space
> 
> What is the test's purpose?  
>
Try to break the compiler and/or assembler with a large static
array.

> Can we find a different way to test the same thing that does
> not cause problems for assemblers?
> 
In my port I was having a similar problem. GAS was choking on the
constant, instead of emitting the proper relocation.

Now, why shouldn't this code compile? Not many machines would run
this code, of course. But if it's valid C, I'd say it should at
least compile.

Diego.



More information about the Gcc-patches mailing list