URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do run }
|
// { dg-do run }
|
// check cleanup of template temporaries
|
// check cleanup of template temporaries
|
extern "C" void abort ();
|
extern "C" void abort ();
|
extern "C" void exit (int);
|
extern "C" void exit (int);
|
|
|
int ctor = 0;
|
int ctor = 0;
|
int dtor = 0;
|
int dtor = 0;
|
|
|
template struct A {
|
template struct A {
|
A() {ctor++;}
|
A() {ctor++;}
|
A(int) {ctor++;}
|
A(int) {ctor++;}
|
A(const A&) {ctor++;}
|
A(const A&) {ctor++;}
|
~A() {dtor++;}
|
~A() {dtor++;}
|
operator int() {return 0;}
|
operator int() {return 0;}
|
};
|
};
|
|
|
template void ff(T);
|
template void ff(T);
|
|
|
template void ff(T)
|
template void ff(T)
|
{
|
{
|
}
|
}
|
|
|
void g(int)
|
void g(int)
|
{
|
{
|
}
|
}
|
|
|
void f()
|
void f()
|
{
|
{
|
int x;
|
int x;
|
|
|
A a1;
|
A a1;
|
A a2(37);
|
A a2(37);
|
A a3 = A(47);
|
A a3 = A(47);
|
A a4 = 97;
|
A a4 = 97;
|
|
|
g(A());
|
g(A());
|
|
|
A();
|
A();
|
|
|
x ? A() : A();
|
x ? A() : A();
|
|
|
x = 47, A(), A(39), A(23), -17;
|
x = 47, A(), A(39), A(23), -17;
|
|
|
while (A())
|
while (A())
|
;
|
;
|
for (;A(3);)
|
for (;A(3);)
|
;
|
;
|
if (A >())
|
if (A >())
|
;
|
;
|
|
|
ff(A());
|
ff(A());
|
|
|
throw 59;
|
throw 59;
|
}
|
}
|
|
|
int
|
int
|
main()
|
main()
|
{
|
{
|
int flag = 0;
|
int flag = 0;
|
|
|
try {
|
try {
|
A();
|
A();
|
f();
|
f();
|
}
|
}
|
catch (int) {
|
catch (int) {
|
A(34);
|
A(34);
|
flag = 1;
|
flag = 1;
|
}
|
}
|
|
|
if (!flag)
|
if (!flag)
|
abort();
|
abort();
|
|
|
if (!ctor || ctor != dtor)
|
if (!ctor || ctor != dtor)
|
abort();
|
abort();
|
|
|
exit(0);
|
exit(0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.