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.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [new.C] - Diff between revs 305 and 338

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do assemble  }
// { dg-do assemble  }
// Bug: new doesn't make sure that the count is an integral value.
// Bug: new doesn't make sure that the count is an integral value.
#include 
#include 
extern "C" int printf (const char *, ...);
extern "C" int printf (const char *, ...);
extern "C" void *malloc (size_t);
extern "C" void *malloc (size_t);
size_t s;
size_t s;
void * operator new (size_t siz) throw (std::bad_alloc) {
void * operator new (size_t siz) throw (std::bad_alloc) {
  if (s == 0)
  if (s == 0)
    s = siz;
    s = siz;
  else
  else
    s = (s != siz);
    s = (s != siz);
  return malloc (siz);
  return malloc (siz);
}
}
int main()
int main()
{
{
  s = 0;
  s = 0;
  float f = 3;
  float f = 3;
  int* b1 = new int[(int)f];
  int* b1 = new int[(int)f];
  int* b2 = new int[f];         // { dg-error "" } new requires integral size
  int* b2 = new int[f];         // { dg-error "" } new requires integral size
  return s;
  return s;
}
}
 
 

powered by: WebSVN 2.1.0

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