diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/other/array4.C')
-rw-r--r-- | gcc/testsuite/g++.dg/other/array4.C | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/array4.C b/gcc/testsuite/g++.dg/other/array4.C new file mode 100644 index 000000000..97ccc986d --- /dev/null +++ b/gcc/testsuite/g++.dg/other/array4.C @@ -0,0 +1,19 @@ +// PR C++/28906: new on an array causes incomplete arrays to +// become complete with the wrong size. +// The sizeof machineMain should be 5 and not 100. +// { dg-do run } + + +extern char machineMain[]; +void sort (long len) +{ + new char[100]; +} +char machineMain[] = "main"; +int main(void) +{ + if (sizeof(machineMain)!=sizeof("main")) + __builtin_abort(); +} + + |