OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [eh/] [ctor1.C] - Blame information for rev 751

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
 
3
// Copyright (C) 2001 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 26 Dec 2001 
5
 
6
// PR 411
7
 
8
bool was_f_in_Bar_destroyed=false;
9
 
10
struct Foo
11
{
12
  ~Foo()
13
  {
14
    was_f_in_Bar_destroyed=true;
15
  }
16
};
17
 
18
struct Bar
19
{
20
  ~Bar()
21
  {
22
    throw 1;
23
  }
24
 
25
  Foo f;
26
};
27
 
28
int main()
29
{
30
  try
31
    {
32
      Bar f;
33
    }
34
  catch(int i)
35
    {
36
      if(was_f_in_Bar_destroyed)
37
        {
38
          return 0;
39
        }
40
    }
41
  return 1;
42
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.