URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do run }
|
// { dg-do run }
|
// GROUPS passed construct-destruct
|
// GROUPS passed construct-destruct
|
/* g++ constructs j 13 times, and destructs it once. */
|
/* g++ constructs j 13 times, and destructs it once. */
|
|
|
extern "C" {
|
extern "C" {
|
int printf (const char *, ...);
|
int printf (const char *, ...);
|
void exit(int);
|
void exit(int);
|
}
|
}
|
|
|
void foo() {
|
void foo() {
|
}
|
}
|
|
|
class C {
|
class C {
|
int val;
|
int val;
|
public:
|
public:
|
static int count;
|
static int count;
|
C(int ii) {
|
C(int ii) {
|
val = ii;
|
val = ii;
|
++count;
|
++count;
|
printf("up\n");
|
printf("up\n");
|
}
|
}
|
~C() {
|
~C() {
|
--count;
|
--count;
|
printf("down\n");
|
printf("down\n");
|
}
|
}
|
int operator ++() {
|
int operator ++() {
|
return ++val;
|
return ++val;
|
}
|
}
|
operator int() {
|
operator int() {
|
return val;
|
return val;
|
}
|
}
|
};
|
};
|
|
|
int C::count = 0;
|
int C::count = 0;
|
|
|
void bar() {
|
void bar() {
|
for (int ii=0; ii<13; ++ii)
|
for (int ii=0; ii<13; ++ii)
|
for (C j=1; j<9; ++j)
|
for (C j=1; j<9; ++j)
|
foo();
|
foo();
|
}
|
}
|
|
|
int main() {
|
int main() {
|
bar();
|
bar();
|
if (C::count)
|
if (C::count)
|
{
|
{
|
printf("FAIL\n");
|
printf("FAIL\n");
|
exit(1);
|
exit(1);
|
}
|
}
|
else
|
else
|
{
|
{
|
printf("PASS\n");
|
printf("PASS\n");
|
}
|
}
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.