]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/template/spec35.C
Fix dg-require before dg-run directives in testsuite.
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / template / spec35.C
CommitLineData
736b8100
SB
1// PR c++/31923
2// C++ DR 605 -- "...the linkage of an explicit specialization must be that of
3// the template."
4
736b8100 5// { dg-do compile { target i?86-*-* x86_64-*-* } }
13cddbc1 6// { dg-require-weak "" }
736b8100
SB
7
8template<class T>
9static void f1 (T) { }
10
508515b0 11// { dg-final { scan-assembler-not ".glob(a|)l\[\t \]*_?_Z2f1IfEvT_" } }
736b8100
SB
12template<>
13void f1<float> (float) { } // Expected to have static linkage
14
15template<class T>
16void f2 (T) { }
17
508515b0 18// { dg-final { scan-assembler ".glob(a|)l\[\t \]*_?_Z2f2IfEvT_" } }
736b8100
SB
19template<>
20void f2<float> (float) { } // Expected to have global linkage
21
22void instantiator ()
23{
508515b0 24 // { dg-final { scan-assembler-not ".glob(a|)l\[\t \]*_?_Z2f1IiEvT_" } }
736b8100
SB
25 f1(0); // Expected to have static linkage
26
bc0bf7e9 27 // { dg-final { scan-assembler ".weak(_definition)?\[\t \]*_?_Z2f2IiEvT_" { target { ! { *-*-mingw* *-*-cygwin } } } } }
736b8100
SB
28 f2(0); // Expected to have weak global linkage
29}