1 // { dg-do run { target i?86-*-linux* x86_64-*-linux* i?86-*-freebsd* i?86-*-darwin* } }
2 // { dg-require-effective-target ilp32 }
3 // { dg-options "-malign-double" }
4 // Origin: Alex Samuel <samuel@codesourcery.com>
6 /* Test the size and alignment of fundamental C types for compliance
19 return (unsigned) & ((S *) 0)->object_;
22 /* Computes the alignment, in bytes, of TYPE. */
24 #define alignof(type) (alignmentof<type> ())
31 if (sizeof (char) != 1)
33 if (alignof (char) != 1)
35 if (sizeof (signed char) != 1)
37 if (alignof (signed char) != 1)
39 if (sizeof (unsigned char) != 1)
41 if (alignof (unsigned char) != 1)
43 if (sizeof (short) != 2)
45 if (alignof (short) != 2)
47 if (sizeof (signed short) != 2)
49 if (alignof (signed short) != 2)
51 if (sizeof (unsigned short) != 2)
53 if (alignof (unsigned short) != 2)
55 if (sizeof (int) != 4)
57 if (alignof (int) != 4)
59 if (sizeof (signed int) != 4)
61 if (alignof (signed int) != 4)
63 if (sizeof (unsigned int) != 4)
65 if (alignof (unsigned int) != 4)
67 if (sizeof (enum A) != 4)
69 if (alignof (enum A) != 4)
71 #ifdef HAVE_IA64_TYPES
72 if (sizeof (__int64) != 8)
74 if (alignof (__int64) != 8)
76 if (sizeof (signed __int64) != 8)
78 if (alignof (signed ___int64) != 8)
80 if (sizeof (unsigned __int64) != 8)
82 if (alignof (unsigned __int64) != 8)
84 if (sizeof (__int128) != 16)
86 if (alignof (__int128) != 16)
88 if (sizeof (signed __int128) != 16)
90 if (alignof (signed ___int128) != 16)
92 if (sizeof (unsigned __int128) != 16)
94 if (alignof (unsigned ___int128) != 16)
96 #endif /* HAVE_IA64_TYPES */
97 if (sizeof (void *) != 4)
99 if (alignof (void *) != 4)
101 if (sizeof (void (*) ()) != 4)
103 if (alignof (void (*) ()) != 4)
105 if (sizeof (float) != 4)
107 if (alignof (float) != 4)
109 if (sizeof (double) != 8)
111 if (alignof (double) != 8)
113 #ifdef HAVE_IA64_TYPES
114 if (sizeof (__float80) != 16)
116 if (alignof (__float80) != 16)
118 if (sizeof (__float128) != 16)
120 if (alignof (__float128) != 16)
122 #endif /* HAVE_IA64_TYPES */