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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [init/] [copy7.C] - Rev 301

Compare with Previous | Blame | View Log

// PR c++/39480
// It isn't always safe to call memcpy with identical arguments.
// { dg-do run }

extern "C" void abort();
extern "C" void *
memcpy(void *dest, void *src, __SIZE_TYPE__ n)
{
  if (dest == src)
    abort();
  else
    {
      __SIZE_TYPE__ i;
      for (i = 0; i < n; i++)
        ((char *)dest)[i] = ((const char*)src)[i];
    }
}

struct A
{
  double d[10];
};

struct B: public A
{
  char bc;
};

B b;

void f(B *a1, B* a2)
{
  *a1 = *a2;
}

int main()
{
  f(&b,&b);
}

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.