| 1 |
// PR target/15551 |
| 2 |
// This used to crash on pentium4-pc-cygwin due to an alloca problem. |
| 3 |
// Testcase submitted by Hans Horn to mingw bug tracker |
| 4 |
// |
| 5 |
// { dg-do run } |
| 6 |
// { dg-options "-O3" } |
| 7 |
// { dg-skip-if "requires hosted libstdc++ for cstring" { ! hostedlib } } |
| 8 |
|
| 9 |
#include <cstring> |
| 10 |
#include <fstream> |
| 11 |
#include <cstdio> |
| 12 |
using namespace std; |
| 13 |
|
| 14 |
ostream* logfile; |
| 15 |
|
| 16 |
int main () { |
| 17 |
|
| 18 |
logfile = new ofstream("bar", ios::out); |
| 19 |
|
| 20 |
char expList[20000]; |
| 21 |
strcpy(expList, "foo"); |
| 22 |
|
| 23 |
delete logfile; |
| 24 |
remove ("bar"); |
| 25 |
|
| 26 |
return 0; |
| 27 |
} |