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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [loop1.C] - Diff between revs 149 and 154

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
// { dg-do run  }
// { dg-do run  }
// { dg-options "-O2" }
// { dg-options "-O2" }
// Test for bad loop optimization of goto fixups.
// Test for bad loop optimization of goto fixups.
typedef bool (*ftype) ();
typedef bool (*ftype) ();
int c, d;
int c, d;
struct A {
struct A {
  A() { ++c; }
  A() { ++c; }
  A(const A&) { ++c; }
  A(const A&) { ++c; }
  ~A() { ++d; }
  ~A() { ++d; }
};
};
void f (ftype func)
void f (ftype func)
{
{
  A a;
  A a;
  do {
  do {
    if ((*func)()) return;
    if ((*func)()) return;
  } while (true);
  } while (true);
}
}
bool test ()
bool test ()
{
{
  return true;
  return true;
}
}
main ()
main ()
{
{
  f (test);
  f (test);
  return (c != d);
  return (c != d);
}
}
 
 

powered by: WebSVN 2.1.0

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