Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/memcpy-2.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* PR middle-end/38454 */ /* { dg-do compile } */ /* { dg-options "-O2 -fno-tree-dse" } */ typedef __SIZE_TYPE__ size_t; extern inline __attribute__((gnu_inline, always_inline, artificial)) void * memcpy (void *__restrict dest, const void *__restrict src, size_t len) { return __builtin___memcpy_chk (dest, /* { dg-warning "writing" } */ src, len, __builtin_object_size (dest, 0)); } struct S { char buf[10]; } s; void foo (void) { char buf[12]; char *p = buf + 4; struct S *q = (struct S *) p; memcpy (q, &s, sizeof (s)); } /* { dg-final { scan-assembler "__memcpy_chk" } } */