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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [eh/] [goto1.C] - Rev 693

Compare with Previous | Blame | View Log

extern "C" void abort ();

static int count;

struct S {
  S() { ++count; }
  ~S() { --count; }
};

int foo(int p)
{
  S s1;
  {
    S s2;
    if (p)
      goto L;
    else
      return 1;
  }
  foo (p);
 L:
  return 0;
}

int main()
{
  foo(0);
  if (count != 0)
    abort ();
  foo(1);
  if (count != 0)
    abort ();
  return 0;
}

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.