1#ifndef DEFINED_DEFINES_H 2#define DEFINED_DEFINES_H 3 4typedef unsigned long ulong; 5typedef 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 __int128. */ 12/* #define CHECK_INT128 */ 13 14/* Scalar type long double. */ 15#define CHECK_LONG_DOUBLE 16 17/* Scalar type __float128. */ 18/* #define CHECK_FLOAT128 */ 19 20/* Scalar types __m64 and __m128. */ 21/* #define CHECK_M64_M128 */ 22 23/* Returning of complex type. */ 24#define CHECK_COMPLEX 25 26/* Structs with size >= 16. */ 27#define CHECK_LARGER_STRUCTS 28 29/* Checks for passing floats and doubles. */ 30#define CHECK_FLOAT_DOUBLE_PASSING 31 32/* Union passing with not-extremely-simple unions. */ 33#define CHECK_LARGER_UNION_PASSING 34 35/* Variable args. */ 36#define CHECK_VARARGS 37 38/* Check argument passing and returning for scalar types with sizeof = 16. */ 39/* TODO: Implement these tests. Don't activate them for now. */ 40#define CHECK_LARGE_SCALAR_PASSING 41 42/* Defines for sizing and alignment. */ 43 44#define TYPE_SIZE_CHAR 1 45#define TYPE_SIZE_SHORT 2 46#define TYPE_SIZE_INT 4 47#define TYPE_SIZE_LONG 8 48#define TYPE_SIZE_LONG_LONG 8 49#define TYPE_SIZE_INT128 16 50#define TYPE_SIZE_FLOAT 4 51#define TYPE_SIZE_DOUBLE 8 52#define TYPE_SIZE_LONG_DOUBLE 16 53#define TYPE_SIZE_FLOAT128 16 54#define TYPE_SIZE_M64 8 55#define TYPE_SIZE_M128 16 56#define TYPE_SIZE_ENUM 4 57#define TYPE_SIZE_POINTER 8 58 59#define TYPE_ALIGN_CHAR 1 60#define TYPE_ALIGN_SHORT 2 61#define TYPE_ALIGN_INT 4 62#define TYPE_ALIGN_LONG 8 63#define TYPE_ALIGN_LONG_LONG 8 64#define TYPE_ALIGN_INT128 16 65#define TYPE_ALIGN_FLOAT 4 66#define TYPE_ALIGN_DOUBLE 8 67#define TYPE_ALIGN_LONG_DOUBLE 16 68#define TYPE_ALIGN_FLOAT128 16 69#define TYPE_ALIGN_M64 8 70#define TYPE_ALIGN_M128 16 71#define TYPE_ALIGN_ENUM 4 72#define TYPE_ALIGN_POINTER 8 73 74/* These defines control the building of the list of types to check. There 75 is a string identifying the type (with a comma after), a size of the type 76 (also with a comma and an integer for adding to the total amount of types) 77 and an alignment of the type (which is currently not really needed since 78 the abi specifies that alignof == sizeof for all scalar types). */ 79#ifdef CHECK_INT128 80#define CI128_STR "__int128", 81#define CI128_SIZ TYPE_SIZE_INT128, 82#define CI128_ALI TYPE_ALIGN_INT128, 83#define CI128_RET "???", 84#else 85#define CI128_STR 86#define CI128_SIZ 87#define CI128_ALI 88#define CI128_RET 89#endif 90#ifdef CHECK_LONG_DOUBLE 91#define CLD_STR "long double", 92#define CLD_SIZ TYPE_SIZE_LONG_DOUBLE, 93#define CLD_ALI TYPE_ALIGN_LONG_DOUBLE, 94#define CLD_RET "x87_regs[0]._ldouble", 95#else 96#define CLD_STR 97#define CLD_SIZ 98#define CLD_ALI 99#define CLD_RET 100#endif 101#ifdef CHECK_FLOAT128 102#define CF128_STR "__float128", 103#define CF128_SIZ TYPE_SIZE_FLOAT128, 104#define CF128_ALI TYPE_ALIGN_FLOAT128, 105#define CF128_RET "???", 106#else 107#define CF128_STR 108#define CF128_SIZ 109#define CF128_ALI 110#define CF128_RET 111#endif 112#ifdef CHECK_M64_M128 113#define CMM_STR "__m64", "__m128", 114#define CMM_SIZ TYPE_SIZE_M64, TYPE_SIZE_M128, 115#define CMM_ALI TYPE_ALIGN_M64, TYPE_ALIGN_M128, 116#define CMM_RET "???", "???", 117#else 118#define CMM_STR 119#define CMM_SIZ 120#define CMM_ALI 121#define CMM_RET 122#endif 123 124/* Used in size and alignment tests. */ 125enum dummytype { enumtype }; 126 127extern void abort (void); 128 129/* Assertion macro. */ 130#define assert(test) if (!(test)) abort() 131 132#ifdef __GNUC__ 133#define ATTRIBUTE_UNUSED __attribute__((__unused__)) 134#else 135#define ATTRIBUTE_UNUSED 136#endif 137 138#ifdef __GNUC__ 139#define PACKED __attribute__((__packed__)) 140#else 141#warning Some tests will fail due to missing __packed__ support 142#define PACKED 143#endif 144 145#endif /* DEFINED_DEFINES_H */ 146