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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [const2.C] - Rev 699

Compare with Previous | Blame | View Log

// { dg-do link }
// This test should get a linker error for the reference to A<int>::i.
// { dg-prune-output "ld: symbol" }
// { dg-message "i" "" { target *-*-* } 0 }

template <class T> struct B { static const int i = 3; };
template <class T> struct A { static const int i = B<T>::i; };
const int *p = &A<int>::i;

int main ()
{
  // Examine p to prevent optimising linkers from discarding it.
  return (p != 0);
}

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.