aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1998-10-29 16:23:53 -0500
committerJason Merrill <jason@gcc.gnu.org>1998-10-29 16:23:53 -0500
commit1a7a342d99f8faaee26b0c897e48c5b2363a4ae5 (patch)
tree53803ebf152493a1bdcd14b2ee5819334e629a91
parent384278ddcda89f5e44c4a15223521fdfafbe4083 (diff)
downloadgcc-1a7a342d99f8faaee26b0c897e48c5b2363a4ae5.zip
gcc-1a7a342d99f8faaee26b0c897e48c5b2363a4ae5.tar.gz
gcc-1a7a342d99f8faaee26b0c897e48c5b2363a4ae5.tar.bz2
new
From-SVN: r23435
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/loop1.C30
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/union1.C16
2 files changed, 46 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/loop1.C b/gcc/testsuite/g++.old-deja/g++.other/loop1.C
new file mode 100644
index 0000000..3380dd4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/loop1.C
@@ -0,0 +1,30 @@
+// Test for bad loop optimization of goto fixups.
+// Special g++ Options: -O2
+
+typedef bool (*ftype) ();
+
+int c, d;
+struct A {
+ A() { ++c; }
+ A(const A&) { ++c; }
+ ~A() { ++d; }
+};
+
+void f (ftype func)
+{
+ A a;
+ do {
+ if ((*func)()) return;
+ } while (true);
+}
+
+bool test ()
+{
+ return true;
+}
+
+main ()
+{
+ f (test);
+ return (c != d);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/union1.C b/gcc/testsuite/g++.old-deja/g++.other/union1.C
new file mode 100644
index 0000000..6573b4d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/union1.C
@@ -0,0 +1,16 @@
+// Build don't link:
+
+class A
+{
+ private:
+ int myInt;
+
+ public:
+ A& operator = (int right) {myInt = right; return *this;}
+};
+
+union B
+{
+ char f1;
+ A f2; // gets bogus error - non-copy assignment op is OK
+};