1 #ifndef DEFINED_DEFINES_H
2 #define DEFINED_DEFINES_H
4 typedef unsigned long ulong
;
5 typedef long double ldouble
;
7 /* These defines determines what part of the test should be run. When
8 GCC implements these parts, the defines should be uncommented to
11 /* Scalar type __int128. */
12 /* #define CHECK_INT128 */
14 /* Scalar type long double. */
15 #define CHECK_LONG_DOUBLE
17 /* Scalar type __float128. */
18 /* #define CHECK_FLOAT128 */
20 /* Scalar types __m64 and __m128. */
21 /* #define CHECK_M64_M128 */
23 /* Returning of complex type. */
26 /* Structs with size >= 16. */
27 #define CHECK_LARGER_STRUCTS
29 /* Checks for passing floats and doubles. */
30 #define CHECK_FLOAT_DOUBLE_PASSING
32 /* Union passing with not-extremely-simple unions. */
33 #define CHECK_LARGER_UNION_PASSING
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
42 /* Defines for sizing and alignment. */
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
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
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). */
80 #define CI128_STR "__int128",
81 #define CI128_SIZ TYPE_SIZE_INT128,
82 #define CI128_ALI TYPE_ALIGN_INT128,
83 #define CI128_RET "???",
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",
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 "???",
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 "???", "???",
124 /* Used in size and alignment tests. */
125 enum dummytype
{ enumtype
};
127 extern void abort (void);
129 /* Assertion macro. */
130 #define assert(test) if (!(test)) abort()
133 #define ATTRIBUTE_UNUSED __attribute__((__unused__))
135 #define ATTRIBUTE_UNUSED
139 #define PACKED __attribute__((__packed__))
141 #warning Some tests will fail due to missing __packed__ support
145 #endif /* DEFINED_DEFINES_H */