URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
// PR c++/32992
|
// PR c++/32992
|
// { dg-do run }
|
// { dg-do run }
|
// { dg-options "-O2" }
|
// { dg-options "-O2" }
|
|
|
extern "C" void abort (void);
|
extern "C" void abort (void);
|
|
|
struct A
|
struct A
|
{
|
{
|
long int a1;
|
long int a1;
|
long int a2;
|
long int a2;
|
long int a3;
|
long int a3;
|
};
|
};
|
|
|
struct B
|
struct B
|
{
|
{
|
long int f[3];
|
long int f[3];
|
operator A ()
|
operator A ()
|
{
|
{
|
union
|
union
|
{
|
{
|
long int t[3];
|
long int t[3];
|
A a;
|
A a;
|
};
|
};
|
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
t[i] = f[i];
|
t[i] = f[i];
|
return a;
|
return a;
|
}
|
}
|
};
|
};
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
B b = { {1, 3, 5} };
|
B b = { {1, 3, 5} };
|
A a = b;
|
A a = b;
|
|
|
if (a.a1 != b.f[0] || a.a2 != b.f[1] || a.a3 != b.f[2])
|
if (a.a1 != b.f[0] || a.a2 != b.f[1] || a.a3 != b.f[2])
|
abort ();
|
abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.