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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [init/] [byval1.C] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// PR c++/3948
2
// Test that the destructor call for a value parameter gets the
3
// right address.
4
 
5
// { dg-do run }
6
 
7
void *p[2];
8
int i;
9
int r;
10
 
11
struct C
12
{
13
  int m;
14
 
15
  C() { p[i++] = this; }
16
  ~C() { if (p[--i] != this) r = 1; }
17
};
18
 
19
 
20
void Foo (C c)
21
{
22
  p[i++] = &c;
23
}
24
 
25
int main ()
26
{
27
  C c;
28
 
29
  Foo (c);
30
  return r;
31
}

powered by: WebSVN 2.1.0

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