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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [eh/] [loop1.C] - Blame information for rev 717

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 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.