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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [new3.C] - Blame information for rev 772

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

Line No. Rev Author Line
1 699 jeremybenn
// This test fails on VxWorks in kernel mode because it depends on the
2
// library version of "::operator new[]" calling the "::operator new"
3
// defined in this module.  This doesn't work because the library version
4
// of "::operator new[]" is built into the kernel itself; library relocations
5
// are resolved when the kernel is linked.
6
// { dg-do run { xfail { powerpc-ibm-aix* || vxworks_kernel } } }
7
// { dg-options "-flat_namespace" { target *-*-darwin[67]* } }
8
// Avoid use of none-overridable new/delete operators in shared
9
// { dg-options "-static" { target *-*-mingw* } }
10
// GROUPS passed operator-new
11
#include 
12
#include 
13
#include 
14
 
15
int pass = 0;
16
 
17
void *operator new(size_t sz)
18
#if __cplusplus <= 199711L
19
  throw (std::bad_alloc)
20
#endif
21
{
22
 
23
  void *p;
24
 
25
  pass = 1;
26
  p = malloc(sz);
27
  return p;
28
}
29
 
30
class A {
31
public:
32
  A() {}
33
  ~A() {}
34
 
35
  int a;
36
  int b;
37
};
38
 
39
 
40
int main()
41
{
42
  A *bb = new A[10];
43
  delete [] bb;
44
 
45
  if (pass)
46
    printf ("PASS\n");
47
  else
48
    { printf ("FAIL\n"); return 1; }
49
}

powered by: WebSVN 2.1.0

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