1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
2 | // expected-no-diagnostics |
3 | |
4 | struct B { |
5 | int x, y, z, w; |
6 | } b; |
7 | |
8 | struct __attribute__((packed)) A { |
9 | struct B b; |
10 | } a; |
11 | |
12 | typedef __typeof__(sizeof(int)) size_t; |
13 | |
14 | void *memcpy(void *dest, const void *src, size_t n); |
15 | int memcmp(const void *s1, const void *s2, size_t n); |
16 | void *memmove(void *dest, const void *src, size_t n); |
17 | void *memset(void *s, int c, size_t n); |
18 | |
19 | int x; |
20 | |
21 | void foo(void) { |
22 | memcpy(&a.b, &b, sizeof(b)); |
23 | memmove(&a.b, &b, sizeof(b)); |
24 | memset(&a.b, 0, sizeof(b)); |
25 | x = memcmp(&a.b, &b, sizeof(b)); |
26 | } |
27 | |