summaryrefslogtreecommitdiff
path: root/test/Sema/address-packed-member-memops.c
diff options
context:
space:
mode:
authorRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-08-17 06:52:15 +0000
committerRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-08-17 06:52:15 +0000
commit0fc13f413b301f30a33772d9220e7222a5f43d79 (patch)
tree8541eefb13356c63f8a77cc65989be09586dd988 /test/Sema/address-packed-member-memops.c
parent3219c702c08600877d5dba950629ee97809e32e9 (diff)
downloadclang-0fc13f413b301f30a33772d9220e7222a5f43d79.tar.gz
Add missing tests
Change r278483 was missing the tests Differential Revision: https://reviews.llvm.org/D20561 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/address-packed-member-memops.c')
-rw-r--r--test/Sema/address-packed-member-memops.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Sema/address-packed-member-memops.c b/test/Sema/address-packed-member-memops.c
new file mode 100644
index 0000000000..220132f332
--- /dev/null
+++ b/test/Sema/address-packed-member-memops.c
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+struct B {
+ int x, y, z, w;
+} b;
+
+struct __attribute__((packed)) A {
+ struct B b;
+} a;
+
+typedef __typeof__(sizeof(int)) size_t;
+
+void *memcpy(void *dest, const void *src, size_t n);
+int memcmp(const void *s1, const void *s2, size_t n);
+void *memmove(void *dest, const void *src, size_t n);
+void *memset(void *s, int c, size_t n);
+
+int x;
+
+void foo(void) {
+ memcpy(&a.b, &b, sizeof(b));
+ memmove(&a.b, &b, sizeof(b));
+ memset(&a.b, 0, sizeof(b));
+ x = memcmp(&a.b, &b, sizeof(b));
+}