From f11b17f00017922b3f821cb0f73b2b6f918702b2 Mon Sep 17 00:00:00 2001 From: rth Date: Thu, 28 Mar 2002 01:52:55 +0000 Subject: [PATCH] * g++.dg/ext/instantiate1.C: Use scan-assembler, not link errors. * g++.dg/ext/instantiate2.C, g++.dg/ext/instantiate3.C: Likewise; move from g++.old-deja/g++.ext/. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51491 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 6 +++++ gcc/testsuite/g++.dg/ext/instantiate1.C | 18 +++++---------- gcc/testsuite/g++.dg/ext/instantiate2.C | 15 +++++++++++++ gcc/testsuite/g++.dg/ext/instantiate3.C | 14 ++++++++++++ gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C | 27 ----------------------- gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C | 20 ----------------- 6 files changed, 40 insertions(+), 60 deletions(-) create mode 100644 gcc/testsuite/g++.dg/ext/instantiate2.C create mode 100644 gcc/testsuite/g++.dg/ext/instantiate3.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f660231..5cf5780 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2002-03-27 Richard Henderson + + * g++.dg/ext/instantiate1.C: Use scan-assembler, not link errors. + * g++.dg/ext/instantiate2.C, g++.dg/ext/instantiate3.C: Likewise; + move from g++.old-deja/g++.ext/. + 2002-03-27 Mark Mitchell * g++.dg/init/new2.C: New test. diff --git a/gcc/testsuite/g++.dg/ext/instantiate1.C b/gcc/testsuite/g++.dg/ext/instantiate1.C index 90a4af0..04d7400 100644 --- a/gcc/testsuite/g++.dg/ext/instantiate1.C +++ b/gcc/testsuite/g++.dg/ext/instantiate1.C @@ -1,5 +1,5 @@ // Test that 'extern template' suppresses instantiations. -// { dg-do link } +// { dg-do compile } // { dg-options "" } template void f (T) { } @@ -11,22 +11,14 @@ template struct A { template void A::f () { } extern template struct A; -// { dg-error "void f\\(int\\)" "suppressing f" { target *-*-* } "0" } +// { dg-final { scan-assembler-not "\n_?_Z1fIiEvT_(:|\n)" } } void test_f_int () { f(42); } -// { dg-error "A::f\\(\\)" "suppressing A" { target *-*-* } "0" } +// { dg-final { scan-assembler-not "\n_?_ZN1AIiE1fEv(:|\n)" } } void test_A_int_f () { A a; a.f (); } -// { dg-bogus "void f\\(double\\)" "f" { target *-*-* } "0" } +// { dg-final { scan-assembler "\n_?_Z1fIdEvT_(:|\n)" } } void test_f_double () { f (2.0); } -// { dg-bogus "A::f\\(\\)" "A" { target *-*-* } "0" } +// { dg-final { scan-assembler "\n_?_ZN1AIdE1fEv(:|\n)" } } void test_A_double_f () { A b; b.f (); } - -int main () -{ - test_f_int (); - test_A_int_f (); - test_f_double (); - test_A_double_f (); -} diff --git a/gcc/testsuite/g++.dg/ext/instantiate2.C b/gcc/testsuite/g++.dg/ext/instantiate2.C new file mode 100644 index 0000000..c812dba --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/instantiate2.C @@ -0,0 +1,15 @@ +// Test that 'static template' instantiates statics. +// { dg-do compile } +// { dg-options "-fno-implicit-templates" } + +template struct A { + static T t; +}; +template T A::t = 0; +static template struct A; + +// { dg-final { scan-assembler "\n_?_ZN1AIiE1tE(:|\n)" } } +void test_int() { A::t = 42; } + +// { dg-final { scan-assembler-not "\n_?_ZN1AIcE1tE(:|\n)" } } +void test_char() { A::t = 42; } diff --git a/gcc/testsuite/g++.dg/ext/instantiate3.C b/gcc/testsuite/g++.dg/ext/instantiate3.C new file mode 100644 index 0000000..c0f61fc --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/instantiate3.C @@ -0,0 +1,14 @@ +// Test that 'inline template' instantiates the vtable. +// { dg-do compile } +// { dg-options "-O -fno-implicit-templates" } + +template struct A { + virtual void f () { } +}; +inline template struct A; + +// { dg-final { scan-assembler "\n_?_ZTV1AIiE(:|\n)" } } +A a; + +// { dg-final { scan-assembler-not "\n_?_ZTV1AIcE(:|\n)" } } +A b; diff --git a/gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C b/gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C deleted file mode 100644 index 8052332..0000000 --- a/gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C +++ /dev/null @@ -1,27 +0,0 @@ -// Test that 'static template' instantiates statics. -// Special g++ Options: -g -fno-implicit-templates - -// Ignore the 'ld returned 1' message from collect2. -// excess errors test - XFAIL *-*-* - -template struct A { - static T t; -}; -template T A::t = 0; -static template struct A; - -// These functions must be defined in a single line, so that, even if -// constants or pointers are placed in the code section (for example, -// on the SH), we still get the same line numbers. - -void test_int() { A::t = 42; } // gets bogus error - -void test_char() { A::t = 42; } // ERROR - not instantiated XFAIL *-*-irix* *-*-hpux* -// Irix's default linker does not produce line numbers so XFAIL it. -// Similarly for HP's linker - -int main () -{ - test_int (); - test_char (); -} diff --git a/gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C b/gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C deleted file mode 100644 index f3149d1..0000000 --- a/gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C +++ /dev/null @@ -1,20 +0,0 @@ -// Test that 'inline template' instantiates the vtable. -// Special g++ Options: -g -O -fno-implicit-templates - -// Ignore the 'ld returned 1' message from collect2. -// excess errors test - XFAIL *-*-* - -template struct A { - virtual void f () { } -}; -inline template struct A; - -A a; // gets bogus error -A b; // ERROR - not instantiated XFAIL mips*-*-* *-*-hpux* i?86-pc-cygwin - // Irix's default linker does not - // produce line numbers so XFAIL it. - // Similarly for HPUX. - -int main () -{ -} -- 2.7.4