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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [tree-prof/] [partition1.C] - Rev 783

Compare with Previous | Blame | View Log

/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -freorder-blocks-and-partition" } */
/* { dg-skip-if "PR target/47683" { mips-sgi-irix* } } */

struct A { A () __attribute__((noinline)); ~A () __attribute__((noinline)); };
A::A () { asm volatile ("" : : : "memory"); }
A::~A () { asm volatile ("" : : : "memory"); }

int bar () __attribute__((noinline));
void foo () __attribute__((noinline));

volatile int k, l;

int bar (int i)
{
  void *p = __builtin_alloca (i);
  asm volatile ("" : : "r" (i), "r" (p) : "memory");
  if (k) throw 6;
  return ++l;
}

void foo ()
{
  A a;
  try {
    A b;
    int i = bar (5);
    try { throw 6; } catch (int) {}
    if (__builtin_expect (i < 4500, 0)) {
      bar (7);
      try { bar (8); } catch (long) {}
      bar (10);
      if (__builtin_expect (i < 0, 0)) {
        try { bar (12); } catch (...) {}
        bar (16);
        bar (122);
      } else {
        try { bar (bar (7)); } catch (int) {}
      }
    } else {
      try { bar (bar (bar (9))); } catch (...) {}
      bar (5);
    }
  } catch (...) {
  }
}

int
main ()
{
  int i;
  for (i = 0; i < 10000; i++)
    foo ();
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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