summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-02-07 15:40:17 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-02-07 15:40:17 +0000
commit962dee4bd440e37c66761ddb9e6857992e03a091 (patch)
tree27c10242e71ecac2d1c8c44d95c3f65e823d44e7
parent5f8dfff7935f8db2412f8d66549de3b9c6f0fdc1 (diff)
downloadgcc-962dee4bd440e37c66761ddb9e6857992e03a091.tar.gz
new
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25071 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog17
-rw-r--r--gcc/testsuite/README11
-rw-r--r--gcc/testsuite/g++.dg/special/conpr-1.C18
-rw-r--r--gcc/testsuite/g++.dg/special/conpr-2.C20
-rw-r--r--gcc/testsuite/g++.dg/special/conpr-2a.C12
-rw-r--r--gcc/testsuite/g++.dg/special/conpr-3.C20
-rw-r--r--gcc/testsuite/g++.dg/special/conpr-3a.C11
-rw-r--r--gcc/testsuite/g++.dg/special/conpr-3b.C11
-rw-r--r--gcc/testsuite/g++.dg/special/ecos.exp75
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typedef6.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/nttp1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/nttp2.C30
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp55.C23
-rw-r--r--gcc/testsuite/lib/g++-dg.exp83
14 files changed, 366 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4cfd3fa735c..d51803cadb6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,20 @@
+1999-02-07 Jonathan Larmour <jlarmour@cygnus.co.uk>
+
+ * g++.dg/special/ecos.exp: New driver for new tests with special
+ requirements
+
+ * g++.dg/special/conpr-1.C: New test
+ * g++.dg/special/conpr-2.C: New test
+ * g++.dg/special/conpr-2a.C: New test
+ * g++.dg/special/conpr-3.C: New test
+ * g++.dg/special/conpr-3a.C: New test
+ * g++.dg/special/conpr-3b.C: New test
+
+ * lib/g++-dg.exp: New driver file, based on lib/gcc-dg.exp to
+ allow g++ to use the dg driver
+
+ * README: Add comment about g++.dg directory
+
Sat Feb 6 18:00:38 1999 Jeffrey A Law (law@cygnus.com)
* README: Update email addresses.
diff --git a/gcc/testsuite/README b/gcc/testsuite/README
index 84cd3919921..2b336f5b29d 100644
--- a/gcc/testsuite/README
+++ b/gcc/testsuite/README
@@ -7,7 +7,7 @@ need a current DejaGnu snapshot, which is available from
ftp://egcs.cygnus.com/pub/egcs/infrastructure, for example.
Most of these tests were originally developed and/or collected by
-Cygnus Support, but these days many are being added by the EGCS
+Cygnus Solutions, but these days many are being added by the EGCS
developers.
These tests are included "as is". If any of them fails, do not report
@@ -22,8 +22,8 @@ the EGCS tree. `make check-g++` runs the C++ testsuite only.
STRUCTURE OF THE TESTSUITE
-All C++ tests reside in subdirectories of g++.old-deja, based on the
-following structure:
+Almost all C++ tests reside in subdirectories of g++.old-deja, based on
+the following structure:
g++.benjamin Tests by Benjamin Koz
g++.bob
@@ -43,3 +43,8 @@ following structure:
g++.rfg
g++.robertl Tests from egcs-bugs@egcs.cygnus.com, gathered by Robert Lipe
+g++.old-deja uses a fixed driver for all g++ tests based on the old
+DejaGnu drivers. But just because its old, doesn't mean its redundant!
+Tests that want to use the normal dg.exp driver can be put in g++.dg instead.
+This may be required for platform-specific tests, or tests with other
+special requirements.
diff --git a/gcc/testsuite/g++.dg/special/conpr-1.C b/gcc/testsuite/g++.dg/special/conpr-1.C
new file mode 100644
index 00000000000..8ab6bfee258
--- /dev/null
+++ b/gcc/testsuite/g++.dg/special/conpr-1.C
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+
+class foo_t {
+ int x;
+public:
+ foo_t(void) { x=1; }
+ int get(void) { return x; }
+};
+
+static foo_t foo __attribute__((init_priority(5000)));
+
+int main(void) {
+
+ if (foo.get())
+ exit(0);
+ else
+ abort();
+}
diff --git a/gcc/testsuite/g++.dg/special/conpr-2.C b/gcc/testsuite/g++.dg/special/conpr-2.C
new file mode 100644
index 00000000000..07ba8ab9e89
--- /dev/null
+++ b/gcc/testsuite/g++.dg/special/conpr-2.C
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+class foo_t {
+ int x;
+ static int count;
+public:
+ foo_t(void) { x=++count; }
+ int get(void) { return x; }
+};
+
+int foo_t::count;
+
+extern foo_t foo1, foo2;
+
+int main(void) {
+
+ if ( (foo1.get() != 2) || (foo2.get() != 1) )
+ abort();
+ exit(0);
+}
diff --git a/gcc/testsuite/g++.dg/special/conpr-2a.C b/gcc/testsuite/g++.dg/special/conpr-2a.C
new file mode 100644
index 00000000000..69fb7d64831
--- /dev/null
+++ b/gcc/testsuite/g++.dg/special/conpr-2a.C
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+
+class foo_t {
+ int x;
+ static int count;
+public:
+ foo_t(void) { x=++count; }
+ int get(void) { return x; }
+};
+
+foo_t foo1 __attribute__((init_priority(6000)));
+foo_t foo2 __attribute__((init_priority(5000)));
diff --git a/gcc/testsuite/g++.dg/special/conpr-3.C b/gcc/testsuite/g++.dg/special/conpr-3.C
new file mode 100644
index 00000000000..07ba8ab9e89
--- /dev/null
+++ b/gcc/testsuite/g++.dg/special/conpr-3.C
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+class foo_t {
+ int x;
+ static int count;
+public:
+ foo_t(void) { x=++count; }
+ int get(void) { return x; }
+};
+
+int foo_t::count;
+
+extern foo_t foo1, foo2;
+
+int main(void) {
+
+ if ( (foo1.get() != 2) || (foo2.get() != 1) )
+ abort();
+ exit(0);
+}
diff --git a/gcc/testsuite/g++.dg/special/conpr-3a.C b/gcc/testsuite/g++.dg/special/conpr-3a.C
new file mode 100644
index 00000000000..b237bb57f36
--- /dev/null
+++ b/gcc/testsuite/g++.dg/special/conpr-3a.C
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+
+class foo_t {
+ int x;
+ static int count;
+public:
+ foo_t(void) { x=++count; }
+ int get(void) { return x; }
+};
+
+foo_t foo1 __attribute__((init_priority(6000)));
diff --git a/gcc/testsuite/g++.dg/special/conpr-3b.C b/gcc/testsuite/g++.dg/special/conpr-3b.C
new file mode 100644
index 00000000000..b5efa0c35f6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/special/conpr-3b.C
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+
+class foo_t {
+ int x;
+ static int count;
+public:
+ foo_t(void) { x=++count; }
+ int get(void) { return x; }
+};
+
+foo_t foo2 __attribute__((init_priority(5000)));
diff --git a/gcc/testsuite/g++.dg/special/ecos.exp b/gcc/testsuite/g++.dg/special/ecos.exp
new file mode 100644
index 00000000000..34a54b7f428
--- /dev/null
+++ b/gcc/testsuite/g++.dg/special/ecos.exp
@@ -0,0 +1,75 @@
+# Copyright (C) 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# jlarmour@cygnus.co.uk
+
+# This file was written by Jonathan Larmour (jlarmour@cygnus.co.uk).
+
+# G++ testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib g++-dg.exp
+
+###########
+# conpr-1.C
+###########
+
+dg-init
+dg-runtest "$srcdir/$subdir/conpr-1.C" "-finit-priority" ""
+dg-finish
+
+
+###########
+# conpr-2.C
+###########
+
+dg-init
+
+set lines [g++_target_compile "$srcdir/$subdir/conpr-2a.C" "conpr-2a.o" object "additional_flags=-finit-priority"]
+if ![string match "" $lines] then {
+ fail "conpr-2a.o"
+} else {
+ dg-runtest "$srcdir/$subdir/conpr-2.C" "conpr-2a.o" "-finit-priority"
+ file delete conpr-2a.o
+}
+dg-finish
+
+
+###########
+# conpr-3.C
+###########
+
+dg-init
+
+set lines [g++_target_compile "$srcdir/$subdir/conpr-3a.C" "conpr-3a.o" object "additional_flags=-finit-priority"]
+if ![string match "" $lines] then {
+ fail "conpr-3a.o"
+} else {
+ set lines [g++_target_compile "$srcdir/$subdir/conpr-3b.C" "conpr-3b.o" object "additional_flags=-finit-priority"]
+ if ![string match "" $lines] then {
+ fail "conpr-3b.o"
+ } else {
+ # run it with objects both ways around!
+ dg-runtest "$srcdir/$subdir/conpr-3.C" "conpr-3a.o conpr-3b.o" "-finit-priority"
+ dg-runtest "$srcdir/$subdir/conpr-3.C" "conpr-3b.o conpr-3a.o" "-finit-priority"
+ file delete conpr-3a.o conpr-3b.o
+ }
+}
+dg-finish
+
+
+### EOF ecos.exp
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typedef6.C b/gcc/testsuite/g++.old-deja/g++.other/typedef6.C
new file mode 100644
index 00000000000..53b81669172
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typedef6.C
@@ -0,0 +1,17 @@
+// Submitted by Jason Merrill <jason@cygnus.com>.
+// Bug: g++ fails to see through the T typedef in the C ctor.
+// Build don't link:
+
+struct A {
+ A (int) { }
+};
+
+typedef A T;
+
+struct B: public virtual T {
+ B (): T(1) { }
+};
+
+struct C: public B {
+ C (): T(1) { }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/nttp1.C b/gcc/testsuite/g++.old-deja/g++.pt/nttp1.C
new file mode 100644
index 00000000000..36b743848c4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/nttp1.C
@@ -0,0 +1,21 @@
+// Test for nested template template parameter feature
+
+template <template<template <class> class> class TTT> struct C
+{
+ int f();
+};
+
+template <template<template <class> class> class TTT> int C<TTT>::f()
+{
+ return 0;
+}
+
+template <template <class> class TT> struct D
+{
+};
+
+int main()
+{
+ C<D> c;
+ c.f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/nttp2.C b/gcc/testsuite/g++.old-deja/g++.pt/nttp2.C
new file mode 100644
index 00000000000..08781daf516
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/nttp2.C
@@ -0,0 +1,30 @@
+// Test for nested template template parameter feature
+
+template <template<template <class> class> class TTT> struct C
+{
+ int f() { return 0; }
+};
+
+template <template <class> class TT> struct D
+{
+ int a;
+};
+
+template <template <class> class TT> struct E
+{
+ int a;
+ int b;
+};
+
+template <template <template <template<class> class> class> class TTT>
+int g(TTT<E> t)
+{
+ TTT<D> tt;
+ return tt.f();
+}
+
+int main()
+{
+ C<E> c;
+ g(c);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp55.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp55.C
new file mode 100644
index 00000000000..10af608bcba
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp55.C
@@ -0,0 +1,23 @@
+// Build don't link:
+
+// Testing overloading of function argument involving template template
+// parameters
+
+// Reported by Thomus Kunert <kunert@physik.tu-dresden.de>
+
+template<class A>
+class H{};
+
+template <class T>
+void f( const T& ){} // #1
+
+template< template<class, class> class X,
+ class A, class B>
+void f( const X<A,B> & x ) // #2
+{}
+
+int main()
+{
+ H<int> h;
+ f(h); // #3
+}
diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp
new file mode 100644
index 00000000000..cad429e729e
--- /dev/null
+++ b/gcc/testsuite/lib/g++-dg.exp
@@ -0,0 +1,83 @@
+# Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-g++@prep.ai.mit.edu
+
+# Define g++ callbacks for dg.exp.
+
+load_lib dg.exp
+
+proc g++-dg-test { prog do_what extra_tool_flags } {
+ # Set up the compiler flags, based on what we're going to do.
+
+ switch $do_what {
+ "preprocess" {
+ set compile_type "preprocess"
+ set output_file "[file rootname [file tail $prog]].i"
+ }
+ "compile" {
+ set compile_type "assembly"
+ set output_file "[file rootname [file tail $prog]].s"
+ }
+ "assemble" {
+ set compile_type "object"
+ set output_file "[file rootname [file tail $prog]].o"
+ }
+ "link" {
+ set compile_type "executable"
+ set output_file "a.out"
+ # The following line is needed for targets like the i960 where
+ # the default output file is b.out. Sigh.
+ }
+ "run" {
+ set compile_type "executable"
+ # FIXME: "./" is to cope with "." not being in $PATH.
+ # Should this be handled elsewhere?
+ # YES.
+ set output_file "./a.out"
+ # This is the only place where we care if an executable was
+ # created or not. If it was, dg.exp will try to run it.
+ remote_file build delete $output_file;
+ }
+ default {
+ perror "$do_what: not a valid dg-do keyword"
+ return ""
+ }
+ }
+ set options ""
+ if { $extra_tool_flags != "" } {
+ lappend options "additional_flags=$extra_tool_flags"
+ }
+
+ set comp_output [g++_target_compile "$prog" "$output_file" "$compile_type" $options];
+
+ return [list $comp_output $output_file]
+}
+
+
+proc g++-dg-prune { system text } {
+
+ # If we see "region xxx is full" then the testcase is too big for ram.
+ # This is tricky to deal with in a large testsuite like c-torture so
+ # deal with it here. Just mark the testcase as unsupported.
+ if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $text] {
+ # The format here is important. See dg.exp.
+ return "::unsupported::memory full"
+ }
+
+ return $text
+}