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

Subversion Repositories openrisc

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

Compare with Previous | Blame | View Log

// PR tree-optimization/42508
// { dg-do run }
// { dg-options "-O1 -fipa-sra" }

extern "C" void abort ();

int v[10], vidx;

struct A
{
  A *prev;
  int i;
  ~A()
  {
    v[vidx++] = i;
    delete prev;
  }
};

int
main ()
{
  A *a1 = new A ();
  A *a2 = new A ();
  a1->prev = 0;
  a1->i = 1;
  a2->prev = a1;
  a2->i = 2;
  delete a2;
  if (vidx != 2 || v[0] != 2 || v[1] != 1)
    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.