URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// GROUPS passed ARM-compliance
|
// GROUPS passed ARM-compliance
|
// arm file
|
// arm file
|
// From: Johan Bengtsson
|
// From: Johan Bengtsson
|
// Date: Thu, 21 Oct 93 16:10:25 +0100
|
// Date: Thu, 21 Oct 93 16:10:25 +0100
|
// Subject: gcc 2.4.5 initializes base classes in mem-initializer order
|
// Subject: gcc 2.4.5 initializes base classes in mem-initializer order
|
// Message-ID: <9310211510.AA14943@holden.lulea.trab.se>
|
// Message-ID: <9310211510.AA14943@holden.lulea.trab.se>
|
|
|
#include
|
#include
|
#include
|
#include
|
|
|
int state = 0;
|
int state = 0;
|
|
|
class A { public:
|
class A { public:
|
A() {
|
A() {
|
if (state == 0)
|
if (state == 0)
|
state = 1;
|
state = 1;
|
else {
|
else {
|
printf ("FAIL\n");
|
printf ("FAIL\n");
|
exit (1);
|
exit (1);
|
}
|
}
|
}
|
}
|
};
|
};
|
|
|
class B { public:
|
class B { public:
|
B() {
|
B() {
|
if (state == 1)
|
if (state == 1)
|
state = 2;
|
state = 2;
|
else {
|
else {
|
printf ("FAIL\n");
|
printf ("FAIL\n");
|
exit (1);
|
exit (1);
|
}
|
}
|
}
|
}
|
};
|
};
|
|
|
class AB : public A, public B { public:
|
class AB : public A, public B { public:
|
AB() : B(), A() {
|
AB() : B(), A() {
|
if (state == 2)
|
if (state == 2)
|
state = 3;
|
state = 3;
|
else {
|
else {
|
printf ("FAIL\n");
|
printf ("FAIL\n");
|
exit (1);
|
exit (1);
|
}
|
}
|
}
|
}
|
};
|
};
|
|
|
int main()
|
int main()
|
{
|
{
|
AB ab;
|
AB ab;
|
if (state == 3)
|
if (state == 3)
|
printf("PASS\n");
|
printf("PASS\n");
|
else
|
else
|
printf("FAIL\n");
|
printf("FAIL\n");
|
exit (state != 3);
|
exit (state != 3);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.