summaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/misaligned-param.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/misaligned-param.c')
-rw-r--r--clang/test/CodeGen/misaligned-param.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGen/misaligned-param.c b/clang/test/CodeGen/misaligned-param.c
new file mode 100644
index 0000000..53f1f29
--- /dev/null
+++ b/clang/test/CodeGen/misaligned-param.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -triple i386-apple-darwin -emit-llvm -o - | FileCheck %s
+// Misaligned parameter must be memcpy'd to correctly aligned temporary.
+
+struct s { int x; long double y; };
+long double foo(struct s x, int i, struct s y) {
+// CHECK: foo
+// CHECK: %x = alloca %struct.s, align 16
+// CHECK: %y = alloca %struct.s, align 16
+// CHECK: memcpy
+// CHECK: memcpy
+// CHECK: bar
+ return bar(&x, &y);
+}