OSDN Git Service

* g++.dg/cdce3.C: Skip on alpha*-dec-osf5*.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / ext / instantiate1.C
1 // Test that 'extern template' suppresses instantiations.
2 // { dg-do compile }
3 // { dg-options "" }
4
5 template <class T> void f (T) { }
6 extern template void f (int);
7
8 template <class T> struct A {
9   void f ();
10 };
11 template <class T> void A<T>::f () { }
12 extern template struct A<int>;
13
14 // { dg-final { scan-assembler-not "\n_?_Z1fIiEvT_(:|\n|\t)" } }
15 void test_f_int () { f(42); } 
16
17 // { dg-final { scan-assembler-not "\n_?_ZN1AIiE1fEv(:|\n|\t)" } }
18 void test_A_int_f () { A<int> a; a.f (); }
19
20 // { dg-final { scan-assembler "\n_?_Z1fIdEvT_(:|\n|\t)" } }
21 void test_f_double () { f (2.0); }
22
23 // { dg-final { scan-assembler "\n_?_ZN1AIdE1fEv(:|\n|\t)" } }
24 void test_A_double_f () { A<double> b; b.f (); }