From: Andrew MacLeod Date: Fri, 24 Sep 2004 16:22:19 +0000 (+0000) Subject: Test case for PR 17517 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2c55ffb2afee4862eeb5189135d237b5a7f25ead;p=gcc.git Test case for PR 17517 From-SVN: r88050 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e543df5d392..6b4225351b6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-09-24 Andrew MacLeod + + PR tree-optimzation/17517 + * g++.dg/tree-ssa/pr17517.C: New Test. + 2004-08-24 Nathan Sidwell PR c++/16889 diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr17517.C b/gcc/testsuite/g++.dg/tree-ssa/pr17517.C new file mode 100644 index 00000000000..bcd5e91dbae --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr17517.C @@ -0,0 +1,32 @@ +// Test PR 17517. Test case provided by Serge Belyshev. + + /* { dg-do compile } */ + /* { dg-options "-O2" } */ + + +extern void foo (); + +struct Ptr { + int * ptr; + Ptr () { ptr = 0; } + ~Ptr() { delete ptr; } + Ptr &operator= (int * p) { ptr = p; return *this; } +}; + +int *new_checker () { foo (); return 0; } + +void pipe (int c) +{ + Ptr checker; + + foo (); + for (;;) + { + switch (c) + { + case '-': + checker = new_checker (); + break; + } + } +}