summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c')
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c b/gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c
new file mode 100644
index 000000000..da6001fcd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c
@@ -0,0 +1,21 @@
+/* { dg-do run { target powerpc*-*-eabi* powerpc*-*-elf* powerpc*-*-linux* } } */
+/* { dg-options "-O -mlong-double-128" } */
+
+#include <stdlib.h>
+
+/* SVR4 and EABI both specify that 'long double' is aligned to a 128-bit
+ boundary in structures. */
+
+struct {
+ int x;
+ long double d;
+} s;
+
+int main(void)
+{
+ if (sizeof (s) != 32)
+ abort ();
+ if ((char *)&s.d - (char *)&s != 16)
+ abort ();
+ exit (0);
+}