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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// PR 14535
2
// { dg-do run }
3
// { dg-options "-O -finline" }
4
//
5
// Original test case failure required that Raiser constructor be inlined.
6
 
7
extern "C" void abort();
8
bool destructor_called = false;
9
 
10
struct B {
11
    virtual void Run(){};
12
};
13
 
14
struct D : public B {
15
    virtual void Run()
16
      {
17
        struct O {
18
            ~O() { destructor_called = true; };
19
        } o;
20
 
21
        struct Raiser {
22
            Raiser()  throw( int ) {throw 1;};
23
        } raiser;
24
      };
25
};
26
 
27
int main() {
28
    try {
29
      D d;
30
      static_cast(d).Run();
31
    } catch (...) {}
32
 
33
    if (!destructor_called)
34
      abort ();
35
}

powered by: WebSVN 2.1.0

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