2016-12-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / g++.dg / template / linkage1.C
blobac4d30b131a7e89a0d852f56781ea1ed29cc4d00
1 // PR c++/50372
2 // Test that a template instantiation has the same linkage as its argument.
3 // { dg-final { scan-assembler "(weak|glob)\[^\n\]*_Z3fooIXadL_Z13external_funcvEEEvv" } }
4 // { dg-final { scan-assembler-not "(weak|glob)\[^\n\]*_Z3fooIXadL_ZL11static_funcvEEEvv" { xfail powerpc-*-aix* } } }
6 template<void (*fptr)(void)>
7 void foo() { }
9 static void static_func() {}
10 void external_func() { }
12 void test()
14 #if __cplusplus > 199711L
15   foo<&static_func>();
16 #endif
17   foo<&external_func>();