Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / crash24.C
blobe1e9d32c94fd46027c20742647016958d259af4e
1 // { dg-do assemble  }
2 // { dg-options "-O" }
3 // GROUPS passed old-abort
4 // gcc puts the array into a register, and then the store_bit_field () code
5 // in expmed.c gets confused when it tries to store zero past the end of the
6 // register (because the index is past the array bounds).   It ends up calling
7 // store_split_bit_field, which then aborts, because we don't have a split bit
8 // field.
9 //
10 // Seems easiest to detect this case in the front end, i.e. access outside the
11 // array bounds, and then force the array to be allocated on the stack instead
12 // of a register.
14 int
15 main()
17   char i[1];
19   i[1] = 0;
21   return 0;