summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c
blob: ffb4264773fdf9b54ab4a7646b92cb0da1fe44cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do run { target powerpc*-*-eabi* powerpc*-*-elf* powerpc*-*-linux* powerpc*-*-rtems* } } */
/* { 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);
}