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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [init/] [copy7.C] - Blame information for rev 307

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

Line No. Rev Author Line
1 301 jeremybenn
// PR c++/39480
2
// It isn't always safe to call memcpy with identical arguments.
3
// { dg-do run }
4
 
5
extern "C" void abort();
6
extern "C" void *
7
memcpy(void *dest, void *src, __SIZE_TYPE__ n)
8
{
9
  if (dest == src)
10
    abort();
11
  else
12
    {
13
      __SIZE_TYPE__ i;
14
      for (i = 0; i < n; i++)
15
        ((char *)dest)[i] = ((const char*)src)[i];
16
    }
17
}
18
 
19
struct A
20
{
21
  double d[10];
22
};
23
 
24
struct B: public A
25
{
26
  char bc;
27
};
28
 
29
B b;
30
 
31
void f(B *a1, B* a2)
32
{
33
  *a1 = *a2;
34
}
35
 
36
int main()
37
{
38
  f(&b,&b);
39
}

powered by: WebSVN 2.1.0

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