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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.dg/] [opt/] [pr15054.C] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
// PR middle-end/15054
2
// This used to abort due to overlapping stack temporaries.
3
 
4
// { dg-do run }
5
// { dg-options "-O" }
6
 
7
extern "C" void abort (void);
8
 
9
struct pointer
10
{
11
  void* ptr;
12
 
13
  pointer(void* x = 0) : ptr(x) {}
14
  pointer(const pointer& x) : ptr(x.ptr) {}
15
};
16
 
17
struct element
18
{
19
  int canary;
20
 
21
  element() : canary(123) { }
22
  ~element() { pointer(); if (canary != 123) abort (); }
23
};
24
 
25
inline pointer
26
insert(const element& x)
27
{
28
  return pointer(new element(x));
29
}
30
 
31
int
32
main (void)
33
{
34
  insert(element());
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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