| 1 |
/* This checks alignment of basic types. */ |
| 2 |
|
| 3 |
#include "defines.h" |
| 4 |
#include "macros.h" |
| 5 |
|
| 6 |
|
| 7 |
int |
| 8 |
main (void) |
| 9 |
{ |
| 10 |
/* Integral types. */ |
| 11 |
run_signed_tests2(check_align, char, TYPE_ALIGN_CHAR); |
| 12 |
run_signed_tests2(check_align, short, TYPE_ALIGN_SHORT); |
| 13 |
run_signed_tests2(check_align, int, TYPE_ALIGN_INT); |
| 14 |
run_signed_tests2(check_align, long, TYPE_ALIGN_LONG); |
| 15 |
run_signed_tests2(check_align, long long, TYPE_ALIGN_LONG_LONG); |
| 16 |
#ifdef CHECK_INT128 |
| 17 |
run_signed_tests2(check_align, __int128, TYPE_ALIGN_INT128); |
| 18 |
#endif |
| 19 |
check_align(enumtype, TYPE_ALIGN_ENUM); |
| 20 |
|
| 21 |
/* Floating point types. */ |
| 22 |
check_align(float, TYPE_ALIGN_FLOAT); |
| 23 |
check_align(double, TYPE_ALIGN_DOUBLE); |
| 24 |
#ifdef CHECK_LONG_DOUBLE |
| 25 |
check_align(long double, TYPE_ALIGN_LONG_DOUBLE); |
| 26 |
#endif |
| 27 |
#ifdef CHECK_FLOAT128 |
| 28 |
check_align(__float128, TYPE_ALIGN_FLOAT128); |
| 29 |
#endif |
| 30 |
|
| 31 |
/* Packed types - MMX, 3DNow!, SSE and SSE2. */ |
| 32 |
#ifdef CHECK_M64_M128 |
| 33 |
check_align(__m64, TYPE_ALIGN_M64); |
| 34 |
check_align(__m128, TYPE_ALIGN_M128); |
| 35 |
#endif |
| 36 |
|
| 37 |
/* _Float16 point types. */ |
| 38 |
check_align(_Float16, TYPE_ALIGN_FLOAT16); |
| 39 |
|
| 40 |
/* Pointer types. */ |
| 41 |
check_align(void *, TYPE_ALIGN_POINTER); |
| 42 |
check_align(void (*)(), TYPE_ALIGN_POINTER); |
| 43 |
|
| 44 |
return 0; |
| 45 |
} |