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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [new23.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/33025
2
// { dg-do run }
3
// { dg-options "-O2" }
4
 
5
typedef __SIZE_TYPE__ size_t;
6
inline void *operator new (size_t, void *p) throw () { return p; }
7
extern "C" void abort ();
8
 
9
int
10
main()
11
{
12
  const unsigned num = 10;
13
  unsigned *data = new unsigned[2 * num];
14
  unsigned *ptr = data;
15
  for (unsigned i = 0; i < 2 * num; ++i)
16
    (i % 2 == 0) ? new (ptr) unsigned (2) : new (ptr++) unsigned (1);
17
  if (ptr - data != num)
18
    abort ();
19
  return 0;
20
}

powered by: WebSVN 2.1.0

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