URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [init/] [ctor1.C] - Rev 316
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
// Copyright (C) 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 12 Oct 2002 <nathan@codesourcery.com>
// From WindRiver SPR 80797
// We were inadvertently SAVE_EXPRing volatile arrays during delete[]
struct A
{
A *ptr;
static int ok;
A () {ptr = this;}
~A () {ok = ptr == this;}
};
int A::ok = -1;
struct B
{
B *ptr;
static int ok;
B () {ptr = this;}
~B () {ok = ptr == this;}
};
int B::ok = -1;
struct C
{
A volatile a;
B volatile b[1];
C ();
};
C::C ()
{
throw 1;
}
int main ()
{
try
{
C c;
}
catch (...)
{
if (A::ok != 1)
return 1;
if (B::ok != 1)
return 2;
return 0;
}
return 3;
}
Go to most recent revision | Compare with Previous | Blame | View Log