OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [union2.C] - Diff between revs 305 and 384

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;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.