URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// Bug: g++ initializes both B::i and B::j before destroying any temps.
|
// Bug: g++ initializes both B::i and B::j before destroying any temps.
|
|
|
extern "C" int printf (const char *, ...);
|
extern "C" int printf (const char *, ...);
|
|
|
int c = 0;
|
int c = 0;
|
int d = 0;
|
int d = 0;
|
int r = 0;
|
int r = 0;
|
|
|
struct A {
|
struct A {
|
A() { if (c != d) r = 1; ++c; }
|
A() { if (c != d) r = 1; ++c; }
|
A(const A&); // declare so g++ returns A on the stack
|
A(const A&); // declare so g++ returns A on the stack
|
~A() { ++d; }
|
~A() { ++d; }
|
operator int () { return 0; }
|
operator int () { return 0; }
|
};
|
};
|
|
|
A foo ()
|
A foo ()
|
{
|
{
|
return A();
|
return A();
|
}
|
}
|
|
|
struct B {
|
struct B {
|
int i;
|
int i;
|
int j;
|
int j;
|
B(): i(foo()), j(foo()) { }
|
B(): i(foo()), j(foo()) { }
|
};
|
};
|
|
|
int main()
|
int main()
|
{
|
{
|
B b;
|
B b;
|
return r;
|
return r;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.