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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [ext/] [label3.C] - Rev 154

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

// Bug: we were removing the p = q assignment in dce, and then reinserting
// it *after* the try/catch in out-of-ssa.  Oops.

// testcase reduced from libjava/interpret.cc.

// { dg-do run }
// { dg-options "-O2" }

extern "C" int printf (const char *, ...);

bool b;

int main()
{
  __label__ one, two, done;
  void *labs[] = { &&one, &&two, &&done };
  const void **q = (const void **)labs;
  const void **p = q;

  try
    {
    one:
      printf ("one!\n");
      if (b)
        throw 42;
      goto **p++;

    two:
      printf ("two!\n");
      goto **p++;

    done:
      printf ("done!\n");
    }
  catch (int)
    {
      printf ("caught!\n");
    }
}

Go to most recent revision | 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.