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++.jason/] [new.C] - Diff between revs 149 and 154

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

Rev 149 Rev 154
// { 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.