aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/pr99492.c
blob: 37a1d0782da3b5a87e20b06e8989a88a81d9c86a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* { dg-do run { target { powerpc*-ibm-aix* } } } */
/* { dg-options "" } */

extern void abort (void);

struct A {
    double _Complex a[64];
};

struct B {
    double b[64];
};

struct C {
    char c1;
    double _Complex c2;
};

struct D {
    char c1;
    double c2;
};

int main() {   
  if (__alignof(double _Complex) != 8)
    abort();

  if (__alignof(struct A) != 8)
    abort();

  if (__alignof(struct C) != 4)
    abort();

  if (__builtin_offsetof(struct C, c2) != 4)
    abort();

  if (__alignof(double) != 8)
    abort();

  if (__alignof(struct B) != 8)
    abort();

  if (__alignof(struct D) != 4)
    abort();

  if (__builtin_offsetof(struct D, c2) != 4)
    abort();

  return 0;
}