| 1 |
#ifndef DEFINED_DEFINES_H |
| 2 |
#define DEFINED_DEFINES_H |
| 3 |
|
| 4 |
typedef unsigned long long ulonglong; |
| 5 |
typedef long double ldouble; |
| 6 |
|
| 7 |
/* These defines determines what part of the test should be run. When |
| 8 |
GCC implements these parts, the defines should be uncommented to |
| 9 |
enable testing. */ |
| 10 |
|
| 11 |
/* Scalar type long double. */ |
| 12 |
#define CHECK_LONG_DOUBLE |
| 13 |
|
| 14 |
/* Scalar type __float128. */ |
| 15 |
#define CHECK_FLOAT128 |
| 16 |
|
| 17 |
/* Returning of complex type. */ |
| 18 |
#define CHECK_COMPLEX |
| 19 |
|
| 20 |
/* Structs with size > 8. */ |
| 21 |
#define CHECK_LARGER_STRUCTS |
| 22 |
|
| 23 |
/* Checks for passing floats and doubles. */ |
| 24 |
#define CHECK_FLOAT_DOUBLE_PASSING |
| 25 |
|
| 26 |
/* Union passing with not-extremely-simple unions. */ |
| 27 |
#define CHECK_LARGER_UNION_PASSING |
| 28 |
|
| 29 |
/* Variable args. */ |
| 30 |
#define CHECK_VARARGS |
| 31 |
|
| 32 |
/* Check argument passing and returning for scalar types with sizeof > 8. */ |
| 33 |
#define CHECK_LARGE_SCALAR_PASSING |
| 34 |
|
| 35 |
/* Defines for sizing and alignment. */ |
| 36 |
|
| 37 |
#define TYPE_SIZE_CHAR 1 |
| 38 |
#define TYPE_SIZE_SHORT 2 |
| 39 |
#define TYPE_SIZE_INT 4 |
| 40 |
#define TYPE_SIZE_LONG 4 |
| 41 |
#define TYPE_SIZE_LONG_LONG 8 |
| 42 |
#define TYPE_SIZE_FLOAT 4 |
| 43 |
#define TYPE_SIZE_DOUBLE 8 |
| 44 |
#define TYPE_SIZE_LONG_DOUBLE 8 |
| 45 |
#define TYPE_SIZE_FLOAT128 16 |
| 46 |
#define TYPE_SIZE_ENUM 4 |
| 47 |
#define TYPE_SIZE_POINTER 4 |
| 48 |
|
| 49 |
#define TYPE_ALIGN_CHAR 1 |
| 50 |
#define TYPE_ALIGN_SHORT 2 |
| 51 |
#define TYPE_ALIGN_INT 4 |
| 52 |
#define TYPE_ALIGN_LONG 4 |
| 53 |
#define TYPE_ALIGN_LONG_LONG 4 |
| 54 |
#define TYPE_ALIGN_FLOAT 4 |
| 55 |
#define TYPE_ALIGN_DOUBLE 4 |
| 56 |
#define TYPE_ALIGN_LONG_DOUBLE 4 |
| 57 |
#define TYPE_ALIGN_FLOAT128 4 |
| 58 |
#define TYPE_ALIGN_ENUM 4 |
| 59 |
#define TYPE_ALIGN_POINTER 4 |
| 60 |
|
| 61 |
/* These defines control the building of the list of types to check. There |
| 62 |
is a string identifying the type (with a comma after), a size of the type |
| 63 |
(also with a comma and an integer for adding to the total amount of types) |
| 64 |
and an alignment of the type (which is currently not really needed since |
| 65 |
the abi specifies that alignof == sizeof for all scalar types). */ |
| 66 |
#ifdef CHECK_LONG_DOUBLE |
| 67 |
#define CLD_STR "long double", |
| 68 |
#define CLD_SIZ TYPE_SIZE_LONG_DOUBLE, |
| 69 |
#define CLD_ALI TYPE_ALIGN_LONG_DOUBLE, |
| 70 |
#define CLD_RET "???", |
| 71 |
#else |
| 72 |
#define CLD_STR |
| 73 |
#define CLD_SIZ |
| 74 |
#define CLD_ALI |
| 75 |
#define CLD_RET |
| 76 |
#endif |
| 77 |
#ifdef CHECK_FLOAT128 |
| 78 |
#define CF128_STR "__float128", |
| 79 |
#define CF128_SIZ TYPE_SIZE_FLOAT128, |
| 80 |
#define CF128_ALI TYPE_ALIGN_FLOAT128, |
| 81 |
#define CF128_RET "???", |
| 82 |
#else |
| 83 |
#define CF128_STR |
| 84 |
#define CF128_SIZ |
| 85 |
#define CF128_ALI |
| 86 |
#define CF128_RET |
| 87 |
#endif |
| 88 |
|
| 89 |
/* Used in size and alignment tests. */ |
| 90 |
enum dummytype { enumtype }; |
| 91 |
|
| 92 |
extern void abort (void); |
| 93 |
|
| 94 |
/* Assertion macro. */ |
| 95 |
#define assert(test) if (!(test)) abort() |
| 96 |
|
| 97 |
#ifdef __GNUC__ |
| 98 |
#define ATTRIBUTE_UNUSED __attribute__((__unused__)) |
| 99 |
#else |
| 100 |
#define ATTRIBUTE_UNUSED |
| 101 |
#endif |
| 102 |
|
| 103 |
#ifdef __GNUC__ |
| 104 |
#define PACKED __attribute__((__packed__)) |
| 105 |
#else |
| 106 |
#warning Some tests will fail due to missing __packed__ support |
| 107 |
#define PACKED |
| 108 |
#endif |
| 109 |
|
| 110 |
#endif /* DEFINED_DEFINES_H */ |