URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 384 |
// { dg-do run }
|
// { dg-do run }
|
// Bug: g++ crashed on empty initializers for unions.
|
// Bug: g++ crashed on empty initializers for unions.
|
// Bug: gcc and g++ didn't zero unions with empty initializers.
|
// Bug: gcc and g++ didn't zero unions with empty initializers.
|
// Submitted by J"orn Rennecke
|
// Submitted by J"orn Rennecke
|
|
|
extern "C" void exit (int);
|
extern "C" void exit (int);
|
|
|
typedef union u
|
typedef union u
|
{
|
{
|
union u *up;
|
union u *up;
|
void *vp;
|
void *vp;
|
} u;
|
} u;
|
|
|
static u v = {};
|
static u v = {};
|
|
|
void bar (u);
|
void bar (u);
|
void baz (u);
|
void baz (u);
|
|
|
void foo()
|
void foo()
|
{
|
{
|
u w = {};
|
u w = {};
|
u x = { &v };
|
u x = { &v };
|
baz (x);
|
baz (x);
|
bar (w);
|
bar (w);
|
}
|
}
|
|
|
void baz (u w) { }
|
void baz (u w) { }
|
|
|
void bar (u w)
|
void bar (u w)
|
{
|
{
|
if (w.up)
|
if (w.up)
|
exit (1);
|
exit (1);
|
}
|
}
|
|
|
int main ()
|
int main ()
|
{
|
{
|
foo ();
|
foo ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.