summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/aapcs/align2.c
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-07-16 11:40:25 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-07-16 11:40:25 +0000
commit8cd167a5ad8baf4988e07fcbc9c9cc338c02d3d1 (patch)
tree74fd60c507288ef44ed7f786fafeecbb5df0e160 /gcc/testsuite/gcc.target/arm/aapcs/align2.c
parentf80b5ea1605c9f9408c5aa386ba71c16d918ebbf (diff)
downloadgcc-tarball-8cd167a5ad8baf4988e07fcbc9c9cc338c02d3d1.tar.gz
gcc-5.2.0gcc-5.2.0
Diffstat (limited to 'gcc/testsuite/gcc.target/arm/aapcs/align2.c')
-rw-r--r--gcc/testsuite/gcc.target/arm/aapcs/align2.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arm/aapcs/align2.c b/gcc/testsuite/gcc.target/arm/aapcs/align2.c
new file mode 100644
index 0000000000..992da53c60
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/aapcs/align2.c
@@ -0,0 +1,30 @@
+/* Test AAPCS layout (alignment). */
+
+/* { dg-do run { target arm_eabi } } */
+/* { dg-require-effective-target arm32 } */
+/* { dg-options "-O" } */
+
+#ifndef IN_FRAMEWORK
+#define TESTFILE "align2.c"
+
+/* The underlying struct here has alignment 4. */
+typedef struct __attribute__((aligned (8)))
+ {
+ int x;
+ int y;
+ } overaligned;
+
+/* A couple of instances, at 8-byte-aligned memory locations. */
+overaligned a = { 2, 3 };
+overaligned b = { 5, 8 };
+
+#include "abitest.h"
+#else
+ ARG (int, 7, R0)
+ /* Alignment should be 4. */
+ ARG (overaligned, a, R1)
+ ARG (int, 9, R3)
+ ARG (int, 10, STACK)
+ /* Alignment should be 4. */
+ LAST_ARG (overaligned, b, STACK + 4)
+#endif