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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [new11.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++/17670
2
// { dg-do run }
3
 
4
#include 
5
#include 
6
 
7
bool abort_new;
8
void *operator new[](size_t bytes)
9
#if __cplusplus <= 199711L
10
  throw (std::bad_alloc)
11
#endif
12
{
13
  if (abort_new)
14
    abort();
15
  return operator new (bytes);
16
}
17
 
18
 
19
struct X {};
20
int main () {
21
  // Do not abort until main is running in case startup code uses
22
  // operator new[].
23
  abort_new = true;
24
  new (X);
25
}

powered by: WebSVN 2.1.0

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