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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [loop1.C] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do run  }
2
// { dg-options "-O2" }
3
// Test for bad loop optimization of goto fixups.
4
 
5
typedef bool (*ftype) ();
6
 
7
int c, d;
8
struct A {
9
  A() { ++c; }
10
  A(const A&) { ++c; }
11
  ~A() { ++d; }
12
};
13
 
14
void f (ftype func)
15
{
16
  A a;
17
  do {
18
    if ((*func)()) return;
19
  } while (true);
20
}
21
 
22
bool test ()
23
{
24
  return true;
25
}
26
 
27
main ()
28
{
29
  f (test);
30
  return (c != d);
31
}

powered by: WebSVN 2.1.0

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