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] - Blame information for rev 764

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

Line No. Rev Author Line
1 693 jeremybenn
// PR tree-optimization/42508
2
// { dg-do run }
3
// { dg-options "-O1 -fipa-sra" }
4
 
5
extern "C" void abort ();
6
 
7
int v[10], vidx;
8
 
9
struct A
10
{
11
  A *prev;
12
  int i;
13
  ~A()
14
  {
15
    v[vidx++] = i;
16
    delete prev;
17
  }
18
};
19
 
20
int
21
main ()
22
{
23
  A *a1 = new A ();
24
  A *a2 = new A ();
25
  a1->prev = 0;
26
  a1->i = 1;
27
  a2->prev = a1;
28
  a2->i = 2;
29
  delete a2;
30
  if (vidx != 2 || v[0] != 2 || v[1] != 1)
31
    abort ();
32
  return 0;
33
}

powered by: WebSVN 2.1.0

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