OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [linkage1.C] - Rev 847

Go to most recent revision | Compare with Previous | Blame | View Log

// PR c++/50372
// Test that a template instantiation has the same linkage as its argument.
// { dg-final { scan-assembler "(weak|glob)\[^\n\]*_Z3fooIXadL_Z13external_funcvEEEvv" } }
// { dg-final { scan-assembler-not "(weak|glob)\[^\n\]*_Z3fooIXadL_ZL11static_funcvEEEvv" } }

template<void (*fptr)(void)>
void foo() { }

static void static_func() {}
void external_func() { }

void test()
{
#if __cplusplus > 199711L
  foo<&static_func>();
#endif
  foo<&external_func>();
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.