OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [p9732b.C] - Blame information for rev 305

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// prms-id: 9732
3
 
4
int count;
5
int bail = 0;
6
 
7
extern "C" void abort (void);
8
extern "C" void _exit (int);
9
 
10
 
11
struct base {
12
  base () { ++count; }
13
  ~base () { --count; }
14
  base(const base&o) { ++count; }
15
};
16
 
17
class D {
18
public:
19
  ~D() {
20
    if (bail++)
21
      {
22
        // On some Linux boxes, we run the dtor for d twice,
23
        // once before exit, and once after!
24
        abort ();
25
      }
26
    else
27
      {
28
        if (count != 0)
29
          _exit (1);
30
        _exit (0);
31
      }
32
  }
33
} d;
34
 
35
base base_object;
36
 
37
base base_returning_function ();
38
 
39
const base& base_ref = base_returning_function ();
40
 
41
int main () {
42
}
43
 
44
base base_returning_function () {
45
  base local_base_object;
46
  return local_base_object;
47
}

powered by: WebSVN 2.1.0

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