aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/align-systemz.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/align-systemz.c')
-rw-r--r--test/CodeGen/align-systemz.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/align-systemz.c b/test/CodeGen/align-systemz.c
index 68a21e39ab36..eaa1de64d344 100644
--- a/test/CodeGen/align-systemz.c
+++ b/test/CodeGen/align-systemz.c
@@ -25,3 +25,19 @@ void func (void)
s = es;
}
+
+// Alignment should be respected for coerced argument loads
+
+struct arg { long y __attribute__((packed, aligned(4))); };
+
+extern struct arg x;
+void f(struct arg);
+
+void test (void)
+{
+ f(x);
+}
+
+// CHECK-LABEL: @test
+// CHECK: load i64, i64* getelementptr inbounds (%struct.arg, %struct.arg* @x, i32 0, i32 0), align 4
+