URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
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);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.