URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// This is a copy of g++.old-deja/g++.pt/static11.C which at one
|
// 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
|
// time got a SEGV for mmix-knuth-mmixware when compiled with
|
// -da (or either -dj or -df).
|
// -da (or either -dj or -df).
|
// { dg-do compile }
|
// { dg-do compile }
|
// { dg-options "-da" }
|
// { dg-options "-da" }
|
|
|
extern "C" void _exit (int);
|
extern "C" void _exit (int);
|
|
|
int r = 1;
|
int r = 1;
|
|
|
struct A
|
struct A
|
{
|
{
|
void f(){};
|
void f(){};
|
A(){ ++r; }
|
A(){ ++r; }
|
~A(){ r -= 2; _exit (r); }
|
~A(){ r -= 2; _exit (r); }
|
};
|
};
|
|
|
template
|
template
|
struct C
|
struct C
|
{
|
{
|
C(){ a.f(); }
|
C(){ a.f(); }
|
static A a;
|
static A a;
|
};
|
};
|
|
|
template A C::a;
|
template A C::a;
|
typedef C B;
|
typedef C B;
|
|
|
int main()
|
int main()
|
{
|
{
|
C c;
|
C c;
|
return r;
|
return r;
|
}
|
}
|
|
|
// { dg-final { cleanup-rtl-dump "*" } }
|
// { dg-final { cleanup-rtl-dump "*" } }
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.