summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/builtin-memfns.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
committerdim <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
commit056abd2059c65a3e908193aeae16fad98017437c (patch)
tree2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/CodeGen/builtin-memfns.c
parentcc73504950eb7b5dff2dded9bedd67bc36d64641 (diff)
downloadFreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip
FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
Diffstat (limited to 'test/CodeGen/builtin-memfns.c')
-rw-r--r--test/CodeGen/builtin-memfns.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/builtin-memfns.c b/test/CodeGen/builtin-memfns.c
index 72d3406..4a06160 100644
--- a/test/CodeGen/builtin-memfns.c
+++ b/test/CodeGen/builtin-memfns.c
@@ -63,3 +63,23 @@ int test7(int *p) {
__builtin_memset(hwparams, 0, 256); // No crash alignment = 1
// CHECK: call void @llvm.memset{{.*}}256, i32 1, i1 false)
}
+
+// <rdar://problem/11314941>
+// Make sure we don't over-estimate the alignment of fields of
+// packed structs.
+struct PS {
+ int modes[4];
+} __attribute__((packed));
+struct PS ps;
+void test8(int *arg) {
+ // CHECK: @test8
+ // CHECK: call void @llvm.memcpy{{.*}} 16, i32 1, i1 false)
+ __builtin_memcpy(arg, ps.modes, sizeof(struct PS));
+}
+
+__attribute((aligned(16))) int x[4], y[4];
+void test9() {
+ // CHECK: @test9
+ // CHECK: call void @llvm.memcpy{{.*}} 16, i32 16, i1 false)
+ __builtin_memcpy(x, y, sizeof(y));
+}
OpenPOWER on IntegriCloud