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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [new3.C] - Rev 199

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

// { dg-do run { xfail powerpc-ibm-aix* } }
// { dg-options "-flat_namespace" { target *-*-darwin[67]* } }
// GROUPS passed operator-new
#include <stdio.h>
#include <stdlib.h>
#include <new>

int pass = 0;

void *operator new(size_t sz) throw (std::bad_alloc) {

  void *p;

  pass = 1;
  p = malloc(sz);
  return p;
}

class A {
public:
  A() {}
  ~A() {}

  int a;
  int b;
};


int main()
{
  A *bb = new A[10];
  delete [] bb;

  if (pass)
    printf ("PASS\n");
  else
    { printf ("FAIL\n"); return 1; }
}

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

powered by: WebSVN 2.1.0

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