2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / init / byval1.C
blob86c6e46830d3d6938266f5eae9a634d4b0886315
1 // PR c++/3948
2 // Test that the destructor call for a value parameter gets the
3 // right address.
5 // { dg-do run }
7 void *p[2];
8 int i;
9 int r;
11 struct C
13   int m;
14   
15   C() { p[i++] = this; }
16   ~C() { if (p[--i] != this) r = 1; }
20 void Foo (C c)
22   p[i++] = &c;
25 int main ()
26 {       
27   C c;
29   Foo (c);
30   return r;