summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/cleanup1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/cleanup1.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cleanup1.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cleanup1.C b/gcc/testsuite/g++.old-deja/g++.other/cleanup1.C
new file mode 100644
index 000000000..27eb8ede4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cleanup1.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// Bug: fold is too eager about pushing down CLEANUP_POINT_EXPR.
+
+int d;
+
+struct A {
+ A() { }
+ ~A() { d = 1; }
+};
+
+int f (const A& a)
+{
+ return 1;
+}
+
+int main ()
+{
+ if (f (A()) && d == 0)
+ return 0;
+ return 1;
+}