summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/cleanup4.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cleanup4.C34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C b/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C
new file mode 100644
index 000000000..8bdaa1977
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C
@@ -0,0 +1,34 @@
+// { dg-do assemble }
+// { dg-options "-O2 -fno-exceptions" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class foo
+{
+public:
+ foo ();
+ ~foo ();
+};
+
+class bar
+{
+public:
+ bar ();
+ bar (const foo&);
+};
+
+int i;
+foo f ();
+
+inline bar x ()
+{
+ switch (i)
+ {
+ case 0: return bar (f ());
+ default: return bar ();
+ }
+}
+
+bar y ()
+{
+ return x ();
+}