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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [static11.C] - Rev 774

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

// This is a copy of g++.old-deja/g++.pt/static11.C which at one
// time got a SEGV for mmix-knuth-mmixware when compiled with
// -da (or either -dj or -df).
// { dg-do compile }
// { dg-options "-da" }

extern "C" void _exit (int);

int r = 1;

struct A
{
  void f(){};
  A(){ ++r; }
  ~A(){ r -= 2; _exit (r); }
};

template<class T>
struct C
{
  C(){ a.f(); }
  static A a;
};

template <class T> A C<T>::a;
typedef C<int> B;

int main()
{
  C<int> c;
  return r;
}

// { dg-final { cleanup-rtl-dump "*" } }

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.