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 constructors
|
// GROUPS passed constructors
|
// Check that sub-words sized class members are correctly set
|
// Check that sub-words sized class members are correctly set
|
// by constructors.
|
// by constructors.
|
|
|
extern "C" int printf (const char *, ...);
|
extern "C" int printf (const char *, ...);
|
|
|
struct base {
|
struct base {
|
int f1 : 8;
|
int f1 : 8;
|
int f2 : 8;
|
int f2 : 8;
|
base (int arg1, int arg2);
|
base (int arg1, int arg2);
|
};
|
};
|
|
|
|
|
base global_base(0x55, 0x7e);
|
base global_base(0x55, 0x7e);
|
|
|
int main ()
|
int main ()
|
{
|
{
|
if ((global_base.f1 != 0x55) || (global_base.f2 != 0x7e))
|
if ((global_base.f1 != 0x55) || (global_base.f2 != 0x7e))
|
{ printf ("FAIL\n"); return 1; }
|
{ printf ("FAIL\n"); return 1; }
|
else
|
else
|
printf ("PASS\n");
|
printf ("PASS\n");
|
}
|
}
|
|
|
base::base(int arg1, int arg2)
|
base::base(int arg1, int arg2)
|
{
|
{
|
f1 = arg1;
|
f1 = arg1;
|
f2 = arg2;
|
f2 = arg2;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.