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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [dtors5.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// GROUPS passed destructors
3
// dtor file:
4
// Message-Id: <1992Jun25.181845.18886@leland.Stanford.EDU>
5
// From: niz@leland.stanford.edu (Jim Nisbet)
6
// Subject: gcc 2.2.2 -- c++ bug: destructor called twice (example)
7
// Date: 25 Jun 92 18:18:45 GMT
8
 
9
#include 
10
 
11
int things = 0;
12
 
13
class foo {
14
public:
15
   foo() { things++; }
16
   foo(const foo&) { things++; }
17
   ~foo() { things--; }
18
 
19
   int i;
20
};
21
 
22
void
23
sub(foo f) {
24
   ;
25
}
26
 
27
 
28
int main() {
29
   sub(foo());
30
   if (things == 0)
31
     printf ("PASS\n");
32
   else
33
     { printf ("FAIL\n"); return 1; }
34
}

powered by: WebSVN 2.1.0

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