diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/opt/dtor1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/opt/dtor1.C | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/dtor1.C b/gcc/testsuite/g++.dg/opt/dtor1.C new file mode 100644 index 000000000..0352676c5 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/dtor1.C @@ -0,0 +1,27 @@ +// { dg-do run } +// { dg-options "-O2" } + +int i; + +struct S { + S (); + S (const S&); + ~S (); +}; + +S::S () { ++i; } +S::S (const S&) { ++i; } +S::~S () { --i; } + +inline void f (S) { +} + +int main () { + { + S s; + f (s); + } + + return i; +} + |