PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / memcpy-5.c
blob92788a5969334399e66111a823a1409c1587dcba
1 /* { dg-options "-O -fdump-tree-optimized" } */
2 /* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
4 extern void *memcpy (void *, const void *, __SIZE_TYPE__);
6 #define TEST(NAME, TYPE) \
7 TYPE NAME##x; \
8 char NAME##y[sizeof (NAME##x)] __attribute__((aligned (__alignof__ (NAME##x)))); \
9 void NAME (void) { memcpy (&NAME##x, &NAME##y, sizeof (NAME##x)); }
11 TEST (f, float);
12 TEST (d, double);
13 TEST (ld, long double);
14 TEST (cf, _Complex float);
15 TEST (cd, _Complex double);
16 TEST (cld, _Complex long double);
17 TEST (d8f, float __attribute__((vector_size (8))));
18 TEST (d16f, float __attribute__((vector_size (16))));
19 TEST (d32f, float __attribute__((vector_size (32))));
20 TEST (d64f, float __attribute__((vector_size (64))));
21 TEST (d128f, float __attribute__((vector_size (128))));
22 TEST (d16d, double __attribute__((vector_size (16))));
23 TEST (d32d, double __attribute__((vector_size (32))));
24 TEST (d64d, double __attribute__((vector_size (64))));
25 TEST (d128d, double __attribute__((vector_size (128))));
27 /* { dg-final { scan-tree-dump-not "memcpy" "optimized" { target i?86-*-* x86_64-*-* } } } */