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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc4/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [t39.C] - Rev 519

Compare with Previous | Blame | View Log

// { dg-do run  }
extern "C" int printf (const char *, ...);

template <class T>
struct frob {
  T *ptr;
  void print ();
  frob (T* init) { ptr = init; }
};

template <class T>
void frob<T>::print () {
  printf ("this = %08x\n", this);
  printf (" ptr = %08x\n", ptr);
  printf (" values = %x %x %x ...\n", ptr[0], ptr[1], ptr[2]);
}

  static int x[10];
  frob<const char> fc ("hello");
  frob<int> fi (x);

int main () {
  fc.print ();
  fi.print ();
  return 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.