diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ced96b7f01b..040b2a26018 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-02-08 Jakub Jelinek + + PR tree-optimization/42890 + * g++.dg/torture/pr42890.C: New test. + 2010-02-08 Richard Guenther PR middle-end/42995 diff --git a/gcc/testsuite/g++.dg/torture/pr42890.C b/gcc/testsuite/g++.dg/torture/pr42890.C new file mode 100644 index 00000000000..937367665dc --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr42890.C @@ -0,0 +1,25 @@ +// PR tree-optimization/42890 +// { dg-do compile } + +extern "C" int puts (const char *) throw (); + +struct S +{ + const char *a; + const char **b; + S (const char *s) { a = s; b = &a; } + ~S () { puts (a); } +}; + +void +foo (int (*fn) (const char *)) +{ + S a ("foo"); + fn ("bar"); +} + +int +main () +{ + foo (puts); +}