1 /* Verify that the limits defined in <stdint.h> are those GCC expects
2 internally to be defined and that they are usable in #if
4 /* { dg-do compile } */
5 /* { dg-options "-std=iso9899:1999 -fhosted" } */
9 /* Exact-width and pointer-holding types are optional. */
10 #if defined(INT8_MIN) != defined(__INT8_TYPE__)
11 #error "Unexpected INT8_MIN definedness"
13 #if defined(INT8_MAX) != defined(__INT8_TYPE__)
14 #error "Unexpected INT8_MAX definedness"
16 #if defined(UINT8_MAX) != defined(__UINT8_TYPE__)
17 #error "Unexpected UINT8_MAX definedness"
19 #if defined(INT16_MIN) != defined(__INT16_TYPE__)
20 #error "Unexpected INT16_MIN definedness"
22 #if defined(INT16_MAX) != defined(__INT16_TYPE__)
23 #error "Unexpected INT16_MAX definedness"
25 #if defined(UINT16_MAX) != defined(__UINT16_TYPE__)
26 #error "Unexpected UINT16_MAX definedness"
28 #if defined(INT32_MIN) != defined(__INT32_TYPE__)
29 #error "Unexpected INT32_MIN definedness"
31 #if defined(INT32_MAX) != defined(__INT32_TYPE__)
32 #error "Unexpected INT32_MAX definedness"
34 #if defined(UINT32_MAX) != defined(__UINT32_TYPE__)
35 #error "Unexpected UINT32_MAX definedness"
37 #if defined(INT64_MIN) != defined(__INT64_TYPE__)
38 #error "Unexpected INT64_MIN definedness"
40 #if defined(INT64_MAX) != defined(__INT64_TYPE__)
41 #error "Unexpected INT64_MAX definedness"
43 #if defined(UINT64_MAX) != defined(__UINT64_TYPE__)
44 #error "Unexpected UINT64_MAX definedness"
46 #if defined(INTPTR_MIN) != defined(__INTPTR_TYPE__)
47 #error "Unexpected INTPTR_MIN definedness"
49 #if defined(INTPTR_MAX) != defined(__INTPTR_TYPE__)
50 #error "Unexpected INTPTR_MAX definedness"
52 #if defined(UINTPTR_MAX) != defined(__UINTPTR_TYPE__)
53 #error "Unexpected UINTPTR_MAX definedness"
56 #if defined(INT8_MIN) && INT8_MIN != -__INT8_MAX__-1
57 #error "INT8_MIN not usable in #if or wrong value"
59 #if defined(INT8_MAX) && INT8_MAX != __INT8_MAX__
60 #error "INT8_MAX not usable in #if or wrong value"
62 #if defined(UINT8_MAX) && UINT8_MAX != __UINT8_MAX__
63 #error "UINT8_MAX not usable in #if or wrong value"
65 #if defined(INT16_MIN) && INT16_MIN != -__INT16_MAX__-1
66 #error "INT16_MIN not usable in #if or wrong value"
68 #if defined(INT16_MAX) && INT16_MAX != __INT16_MAX__
69 #error "INT16_MAX not usable in #if or wrong value"
71 #if defined(UINT16_MAX) && UINT16_MAX != __UINT16_MAX__
72 #error "UINT16_MAX not usable in #if or wrong value"
74 #if defined(INT32_MIN) && INT32_MIN != -__INT32_MAX__-1
75 #error "INT32_MIN not usable in #if or wrong value"
77 #if defined(INT32_MAX) && INT32_MAX != __INT32_MAX__
78 #error "INT32_MAX not usable in #if or wrong value"
80 #if defined(UINT32_MAX) && UINT32_MAX != __UINT32_MAX__
81 #error "UINT32_MAX not usable in #if or wrong value"
83 #if defined(INT64_MIN) && INT64_MIN != -__INT64_MAX__-1
84 #error "INT64_MIN not usable in #if or wrong value"
86 #if defined(INT64_MAX) && INT64_MAX != __INT64_MAX__
87 #error "INT64_MAX not usable in #if or wrong value"
89 #if defined(UINT64_MAX) && UINT64_MAX != __UINT64_MAX__
90 #error "UINT64_MAX not usable in #if or wrong value"
93 #if INT_LEAST8_MIN != -__INT_LEAST8_MAX__-1
94 #error "INT_LEAST8_MIN not usable in #if or wrong value"
96 #if INT_LEAST8_MAX != __INT_LEAST8_MAX__
97 #error "INT_LEAST8_MAX not usable in #if or wrong value"
99 #if UINT_LEAST8_MAX != __UINT_LEAST8_MAX__
100 #error "UINT_LEAST8_MAX not usable in #if or wrong value"
102 #if INT_LEAST16_MIN != -__INT_LEAST16_MAX__-1
103 #error "INT_LEAST16_MIN not usable in #if or wrong value"
105 #if INT_LEAST16_MAX != __INT_LEAST16_MAX__
106 #error "INT_LEAST16_MAX not usable in #if or wrong value"
108 #if UINT_LEAST16_MAX != __UINT_LEAST16_MAX__
109 #error "UINT_LEAST16_MAX not usable in #if or wrong value"
111 #if INT_LEAST32_MIN != -__INT_LEAST32_MAX__-1
112 #error "INT_LEAST32_MIN not usable in #if or wrong value"
114 #if INT_LEAST32_MAX != __INT_LEAST32_MAX__
115 #error "INT_LEAST32_MAX not usable in #if or wrong value"
117 #if UINT_LEAST32_MAX != __UINT_LEAST32_MAX__
118 #error "UINT_LEAST32_MAX not usable in #if or wrong value"
120 #if INT_LEAST64_MIN != -__INT_LEAST64_MAX__-1
121 #error "INT_LEAST64_MIN not usable in #if or wrong value"
123 #if INT_LEAST64_MAX != __INT_LEAST64_MAX__
124 #error "INT_LEAST64_MAX not usable in #if or wrong value"
126 #if UINT_LEAST64_MAX != __UINT_LEAST64_MAX__
127 #error "UINT_LEAST64_MAX not usable in #if or wrong value"
130 #if INT_FAST8_MIN != -__INT_FAST8_MAX__-1
131 #error "INT_FAST8_MIN not usable in #if or wrong value"
133 #if INT_FAST8_MAX != __INT_FAST8_MAX__
134 #error "INT_FAST8_MAX not usable in #if or wrong value"
136 #if UINT_FAST8_MAX != __UINT_FAST8_MAX__
137 #error "UINT_FAST8_MAX not usable in #if or wrong value"
139 #if INT_FAST16_MIN != -__INT_FAST16_MAX__-1
140 #error "INT_FAST16_MIN not usable in #if or wrong value"
142 #if INT_FAST16_MAX != __INT_FAST16_MAX__
143 #error "INT_FAST16_MAX not usable in #if or wrong value"
145 #if UINT_FAST16_MAX != __UINT_FAST16_MAX__
146 #error "UINT_FAST16_MAX not usable in #if or wrong value"
148 #if INT_FAST32_MIN != -__INT_FAST32_MAX__-1
149 #error "INT_FAST32_MIN not usable in #if or wrong value"
151 #if INT_FAST32_MAX != __INT_FAST32_MAX__
152 #error "INT_FAST32_MAX not usable in #if or wrong value"
154 #if UINT_FAST32_MAX != __UINT_FAST32_MAX__
155 #error "UINT_FAST32_MAX not usable in #if or wrong value"
157 #if INT_FAST64_MIN != -__INT_FAST64_MAX__-1
158 #error "INT_FAST64_MIN not usable in #if or wrong value"
160 #if INT_FAST64_MAX != __INT_FAST64_MAX__
161 #error "INT_FAST64_MAX not usable in #if or wrong value"
163 #if UINT_FAST64_MAX != __UINT_FAST64_MAX__
164 #error "UINT_FAST64_MAX not usable in #if or wrong value"
167 #if defined(INTPTR_MIN) && INTPTR_MIN != -__INTPTR_MAX__-1
168 #error "INTPTR_MIN not usable in #if or wrong value"
170 #if defined(INTPTR_MAX) && INTPTR_MAX != __INTPTR_MAX__
171 #error "INTPTR_MAX not usable in #if or wrong value"
173 #if defined(UINTPTR_MAX) && UINTPTR_MAX != __UINTPTR_MAX__
174 #error "UINTPTR_MAX not usable in #if or wrong value"
177 #if INTMAX_MIN != -__INTMAX_MAX__-1
178 #error "INTMAX_MIN not usable in #if or wrong value"
180 #if INTMAX_MAX != __INTMAX_MAX__
181 #error "INTMAX_MAX not usable in #if or wrong value"
183 #if UINTMAX_MAX != __UINTMAX_MAX__
184 #error "UINTMAX_MAX not usable in #if or wrong value"
187 #if PTRDIFF_MIN != -__PTRDIFF_MAX__-1
188 #error "PTRDIFF_MIN not usable in #if or wrong value"
190 #if PTRDIFF_MAX != __PTRDIFF_MAX__
191 #error "PTRDIFF_MAX not usable in #if or wrong value"
194 #if SIG_ATOMIC_MIN != __SIG_ATOMIC_MIN__
195 #error "SIG_ATOMIC_MIN not usable in #if or wrong value"
197 #if SIG_ATOMIC_MAX != __SIG_ATOMIC_MAX__
198 #error "SIG_ATOMIC_MAX not usable in #if or wrong value"
201 #if SIZE_MAX != __SIZE_MAX__
202 #error "SIZE_MAX not usable in #if or wrong value"
205 #if WCHAR_MIN != __WCHAR_MIN__
206 #error "WCHAR_MIN not usable in #if or wrong value"
208 #if WCHAR_MAX != __WCHAR_MAX__
209 #error "WCHAR_MAX not usable in #if or wrong value"
212 #if WINT_MIN != __WINT_MIN__
213 #error "WINT_MIN not usable in #if or wrong value"
215 #if WINT_MAX != __WINT_MAX__
216 #error "WINT_MAX not usable in #if or wrong value"