Test case for PR 17517

From-SVN: r88050
This commit is contained in:
Andrew MacLeod 2004-09-24 16:22:19 +00:00 committed by Andrew Macleod
parent 8d481c2e58
commit 2c55ffb2af
2 changed files with 37 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2004-09-24 Andrew MacLeod <amacleod@redhat.com>
PR tree-optimzation/17517
* g++.dg/tree-ssa/pr17517.C: New Test.
2004-08-24 Nathan Sidwell <nathan@codesourcery.com>
PR c++/16889

View file

@ -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;
}
}
}