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++.dg/] [eh/] [loop1.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// Verify that loop optimization takes into account the exception edge
2
// and does not increment I before the call.
3
// { dg-do run }
4
// { dg-options "-O2" }
5
 
6
extern "C" void abort();
7
static void bar(char *);
8
 
9
static void foo(unsigned long element_count, char *ptr)
10
{
11
  unsigned long i;
12
  try {
13
    for (i = 0; i != element_count; i++, ptr += 8)
14
      bar (ptr);
15
  }
16
  catch (...) {
17
    if (i)
18
      abort ();
19
  }
20
}
21
 
22
static void bar(char *)
23
{
24
  throw 1;
25
}
26
 
27
int main()
28
{
29
  foo(2, 0);
30
}

powered by: WebSVN 2.1.0

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