OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [new3.C] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 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
// GROUPS passed operator-new
9
#include 
10
#include 
11
#include 
12
 
13
int pass = 0;
14
 
15
void *operator new(size_t sz) throw (std::bad_alloc) {
16
 
17
  void *p;
18
 
19
  pass = 1;
20
  p = malloc(sz);
21
  return p;
22
}
23
 
24
class A {
25
public:
26
  A() {}
27
  ~A() {}
28
 
29
  int a;
30
  int b;
31
};
32
 
33
 
34
int main()
35
{
36
  A *bb = new A[10];
37
  delete [] bb;
38
 
39
  if (pass)
40
    printf ("PASS\n");
41
  else
42
    { printf ("FAIL\n"); return 1; }
43
}

powered by: WebSVN 2.1.0

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