blob: 6614626ae65cb41d8c045bc8445ebdf8d80e1ee3 [file] [log] [blame]
Roger Ferrer Ibanezf7b9f312016-08-17 06:52:15 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2// expected-no-diagnostics
3
4struct B {
5 int x, y, z, w;
6} b;
7
8struct __attribute__((packed)) A {
9 struct B b;
10} a;
11
12typedef __typeof__(sizeof(int)) size_t;
13
14extern "C" {
15void *memcpy(void *dest, const void *src, size_t n);
16int memcmp(const void *s1, const void *s2, size_t n);
17void *memmove(void *dest, const void *src, size_t n);
18void *memset(void *s, int c, size_t n);
19}
20
21int x;
22
23void foo() {
24 memcpy(&a.b, &b, sizeof(b));
25 memmove(&a.b, &b, sizeof(b));
26 memset(&a.b, 0, sizeof(b));
27 x = memcmp(&a.b, &b, sizeof(b));
28}