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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [dtor10.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// Origin: Mark Mitchell 
3
 
4
extern "C" void abort ();
5
 
6
int j;
7
 
8
struct S {
9
  static S* s[5];
10
 
11
  S () { s[j++] = this; }
12
  S (const S&) { s[j++] = this; }
13
  ~S () {
14
    for (int k = 0; k < j; ++k)
15
      if (s[k] == this)
16
        return;
17
    abort ();
18
  }
19
};
20
 
21
S* S::s[5];
22
 
23
struct T {
24
  int i;
25
  S s;
26
};
27
 
28
T t;
29
 
30
T f () {
31
  return t;
32
}
33
 
34
void g (S) {
35
}
36
 
37
int main ()
38
{
39
  g (f ().s);
40
}
41
 

powered by: WebSVN 2.1.0

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