instantiate1.C: Adjust to accommodate peculiarities of the SH.
authorAlexandre Oliva <aoliva@redhat.com>
Tue, 3 Apr 2001 08:38:45 +0000 (08:38 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Tue, 3 Apr 2001 08:38:45 +0000 (08:38 +0000)
* g++.old-deja/g++.ext/instantiate1.C: Adjust to accommodate
peculiarities of the SH.
* g++.old-deja/g++.ext/instantiate2.C: Likewise.

From-SVN: r41045

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.ext/instantiate1.C
gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C

index bd6039fb0311c1bd297b456418734201911337ab..c72d2def208ba3247f38b20d1eee2381c2234f81 100644 (file)
@@ -1,3 +1,9 @@
+2001-04-03  Alexandre Oliva  <aoliva@redhat.com>
+
+       * g++.old-deja/g++.ext/instantiate1.C: Adjust to accommodate
+       peculiarities of the SH.
+       * g++.old-deja/g++.ext/instantiate2.C: Likewise.
+
 2001-04-02  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
        * gcc.c-torture/execute/ieee/fp-cmp-1.c: Renamed nan to dnan.
        * g++.old-deja/g++.pt/overload15.C: New test to stress overloaded
        templatized constructors.
 
->>>>>>> 1.1119
 2001-02-24  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
 
        * gcc.c-torture/execute/20010224-1.c: New test.
index 8d5457f5944c98ee986c5a59c31c81862ea00745..8e0fbe073fd8e092446e1dcf4706e47a1ab3f0dd 100644 (file)
@@ -13,12 +13,22 @@ template <class T> struct A {
 template <class T> void A<T>::f () { }
 extern template struct A<int>;
 
+// 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_f_int () { f(42); } // ERROR - not instantiated
+
+void test_A_int_f () { A<int> a; a.f (); } // ERROR - not instantiated
+
+void test_f_double () { f (2.0); } // gets bogus error
+
+void test_A_double_f () { A<double> b; b.f (); } // gets bogus error
+
 int main ()
 {
-  f (42);                      // ERROR - not instantiated
-  A<int> a;
-  a.f ();                      // ERROR - not instantiated
-  f (2.0);                     // gets bogus error
-  A<double> b;
-  b.f ();                      // gets bogus error
+  test_f_int ();
+  test_A_int_f ();
+  test_f_double ();
+  test_A_double_f ();
 }
index 0b3dc24ea4c487e56c0196206a96e5d053296bbd..9a783a14b63a2cf7483761c370b284a405953df3 100644 (file)
@@ -10,10 +10,17 @@ template <class T> struct A {
 template <class T> T A<T>::t = 0;
 static template struct A<int>;
 
+// 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<int>::t = 42; } // gets bogus error
+
+void test_char() { A<char>::t = 42; } // ERROR - not instantiated XFAIL *-*-irix*
+// Irix's default linker does not produce line numbers so XFAIL it.
+
 int main ()
 {
-  A<int>::t = 42;              // gets bogus error
-  A<char>::t = 42;             // ERROR - not instantiated XFAIL mips*-*-*
-                               // Irix's default linker does not
-                               // produce line numbers so XFAIL it.
+  test_int ();
+  test_char ();
 }