OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [groff1.C] - Diff between revs 305 and 338

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// PRMS Id: 3744
// PRMS Id: 3744
// Bug: unswitching a COND_EXPR initializer fails to set SIDE_EFFECTS on the
// Bug: unswitching a COND_EXPR initializer fails to set SIDE_EFFECTS on the
// result, so expand_expr ignores it.
// result, so expand_expr ignores it.
extern "C" {
extern "C" {
  int printf(const char *,...);
  int printf(const char *,...);
  void exit(int);
  void exit(int);
}
}
struct A {
struct A {
  int x;
  int x;
  int y;
  int y;
  A() : x(0), y(0) { }
  A() : x(0), y(0) { }
};
};
struct S {
struct S {
  S() : flags(0) { }
  S() : flags(0) { }
  unsigned flags;
  unsigned flags;
  A from;
  A from;
  void foo(const A &pos);
  void foo(const A &pos);
};
};
void S::foo(const A &pos)
void S::foo(const A &pos)
{
{
  A a = flags ? from : pos;
  A a = flags ? from : pos;
  printf("%d %d\n", a.x, a.y);
  printf("%d %d\n", a.x, a.y);
  if (a.x != 17 || a.y != 12)
  if (a.x != 17 || a.y != 12)
    exit (1);
    exit (1);
}
}
int main()
int main()
{
{
  A pos;
  A pos;
  pos.x = 17;
  pos.x = 17;
  pos.y = 12;
  pos.y = 12;
  S s;
  S s;
  s.foo(pos);
  s.foo(pos);
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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