libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gcc.dg / c99-stdint-7.c
blob777e895b506795c8a36749b66530943743a0828b
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
3 conditions. */
4 /* { dg-do compile } */
5 /* { dg-options "-std=iso9899:1999 -fhosted" } */
7 #include <stdint.h>
9 /* Exact-width and pointer-holding types are optional. */
10 #if defined(INT8_MIN) != defined(__INT8_TYPE__)
11 #error "Unexpected INT8_MIN definedness"
12 #endif
13 #if defined(INT8_MAX) != defined(__INT8_TYPE__)
14 #error "Unexpected INT8_MAX definedness"
15 #endif
16 #if defined(UINT8_MAX) != defined(__UINT8_TYPE__)
17 #error "Unexpected UINT8_MAX definedness"
18 #endif
19 #if defined(INT16_MIN) != defined(__INT16_TYPE__)
20 #error "Unexpected INT16_MIN definedness"
21 #endif
22 #if defined(INT16_MAX) != defined(__INT16_TYPE__)
23 #error "Unexpected INT16_MAX definedness"
24 #endif
25 #if defined(UINT16_MAX) != defined(__UINT16_TYPE__)
26 #error "Unexpected UINT16_MAX definedness"
27 #endif
28 #if defined(INT32_MIN) != defined(__INT32_TYPE__)
29 #error "Unexpected INT32_MIN definedness"
30 #endif
31 #if defined(INT32_MAX) != defined(__INT32_TYPE__)
32 #error "Unexpected INT32_MAX definedness"
33 #endif
34 #if defined(UINT32_MAX) != defined(__UINT32_TYPE__)
35 #error "Unexpected UINT32_MAX definedness"
36 #endif
37 #if defined(INT64_MIN) != defined(__INT64_TYPE__)
38 #error "Unexpected INT64_MIN definedness"
39 #endif
40 #if defined(INT64_MAX) != defined(__INT64_TYPE__)
41 #error "Unexpected INT64_MAX definedness"
42 #endif
43 #if defined(UINT64_MAX) != defined(__UINT64_TYPE__)
44 #error "Unexpected UINT64_MAX definedness"
45 #endif
46 #if defined(INTPTR_MIN) != defined(__INTPTR_TYPE__)
47 #error "Unexpected INTPTR_MIN definedness"
48 #endif
49 #if defined(INTPTR_MAX) != defined(__INTPTR_TYPE__)
50 #error "Unexpected INTPTR_MAX definedness"
51 #endif
52 #if defined(UINTPTR_MAX) != defined(__UINTPTR_TYPE__)
53 #error "Unexpected UINTPTR_MAX definedness"
54 #endif
56 #if defined(INT8_MIN) && INT8_MIN != -__INT8_MAX__-1
57 #error "INT8_MIN not usable in #if or wrong value"
58 #endif
59 #if defined(INT8_MAX) && INT8_MAX != __INT8_MAX__
60 #error "INT8_MAX not usable in #if or wrong value"
61 #endif
62 #if defined(UINT8_MAX) && UINT8_MAX != __UINT8_MAX__
63 #error "UINT8_MAX not usable in #if or wrong value"
64 #endif
65 #if defined(INT16_MIN) && INT16_MIN != -__INT16_MAX__-1
66 #error "INT16_MIN not usable in #if or wrong value"
67 #endif
68 #if defined(INT16_MAX) && INT16_MAX != __INT16_MAX__
69 #error "INT16_MAX not usable in #if or wrong value"
70 #endif
71 #if defined(UINT16_MAX) && UINT16_MAX != __UINT16_MAX__
72 #error "UINT16_MAX not usable in #if or wrong value"
73 #endif
74 #if defined(INT32_MIN) && INT32_MIN != -__INT32_MAX__-1
75 #error "INT32_MIN not usable in #if or wrong value"
76 #endif
77 #if defined(INT32_MAX) && INT32_MAX != __INT32_MAX__
78 #error "INT32_MAX not usable in #if or wrong value"
79 #endif
80 #if defined(UINT32_MAX) && UINT32_MAX != __UINT32_MAX__
81 #error "UINT32_MAX not usable in #if or wrong value"
82 #endif
83 #if defined(INT64_MIN) && INT64_MIN != -__INT64_MAX__-1
84 #error "INT64_MIN not usable in #if or wrong value"
85 #endif
86 #if defined(INT64_MAX) && INT64_MAX != __INT64_MAX__
87 #error "INT64_MAX not usable in #if or wrong value"
88 #endif
89 #if defined(UINT64_MAX) && UINT64_MAX != __UINT64_MAX__
90 #error "UINT64_MAX not usable in #if or wrong value"
91 #endif
93 #if INT_LEAST8_MIN != -__INT_LEAST8_MAX__-1
94 #error "INT_LEAST8_MIN not usable in #if or wrong value"
95 #endif
96 #if INT_LEAST8_MAX != __INT_LEAST8_MAX__
97 #error "INT_LEAST8_MAX not usable in #if or wrong value"
98 #endif
99 #if UINT_LEAST8_MAX != __UINT_LEAST8_MAX__
100 #error "UINT_LEAST8_MAX not usable in #if or wrong value"
101 #endif
102 #if INT_LEAST16_MIN != -__INT_LEAST16_MAX__-1
103 #error "INT_LEAST16_MIN not usable in #if or wrong value"
104 #endif
105 #if INT_LEAST16_MAX != __INT_LEAST16_MAX__
106 #error "INT_LEAST16_MAX not usable in #if or wrong value"
107 #endif
108 #if UINT_LEAST16_MAX != __UINT_LEAST16_MAX__
109 #error "UINT_LEAST16_MAX not usable in #if or wrong value"
110 #endif
111 #if INT_LEAST32_MIN != -__INT_LEAST32_MAX__-1
112 #error "INT_LEAST32_MIN not usable in #if or wrong value"
113 #endif
114 #if INT_LEAST32_MAX != __INT_LEAST32_MAX__
115 #error "INT_LEAST32_MAX not usable in #if or wrong value"
116 #endif
117 #if UINT_LEAST32_MAX != __UINT_LEAST32_MAX__
118 #error "UINT_LEAST32_MAX not usable in #if or wrong value"
119 #endif
120 #if INT_LEAST64_MIN != -__INT_LEAST64_MAX__-1
121 #error "INT_LEAST64_MIN not usable in #if or wrong value"
122 #endif
123 #if INT_LEAST64_MAX != __INT_LEAST64_MAX__
124 #error "INT_LEAST64_MAX not usable in #if or wrong value"
125 #endif
126 #if UINT_LEAST64_MAX != __UINT_LEAST64_MAX__
127 #error "UINT_LEAST64_MAX not usable in #if or wrong value"
128 #endif
130 #if INT_FAST8_MIN != -__INT_FAST8_MAX__-1
131 #error "INT_FAST8_MIN not usable in #if or wrong value"
132 #endif
133 #if INT_FAST8_MAX != __INT_FAST8_MAX__
134 #error "INT_FAST8_MAX not usable in #if or wrong value"
135 #endif
136 #if UINT_FAST8_MAX != __UINT_FAST8_MAX__
137 #error "UINT_FAST8_MAX not usable in #if or wrong value"
138 #endif
139 #if INT_FAST16_MIN != -__INT_FAST16_MAX__-1
140 #error "INT_FAST16_MIN not usable in #if or wrong value"
141 #endif
142 #if INT_FAST16_MAX != __INT_FAST16_MAX__
143 #error "INT_FAST16_MAX not usable in #if or wrong value"
144 #endif
145 #if UINT_FAST16_MAX != __UINT_FAST16_MAX__
146 #error "UINT_FAST16_MAX not usable in #if or wrong value"
147 #endif
148 #if INT_FAST32_MIN != -__INT_FAST32_MAX__-1
149 #error "INT_FAST32_MIN not usable in #if or wrong value"
150 #endif
151 #if INT_FAST32_MAX != __INT_FAST32_MAX__
152 #error "INT_FAST32_MAX not usable in #if or wrong value"
153 #endif
154 #if UINT_FAST32_MAX != __UINT_FAST32_MAX__
155 #error "UINT_FAST32_MAX not usable in #if or wrong value"
156 #endif
157 #if INT_FAST64_MIN != -__INT_FAST64_MAX__-1
158 #error "INT_FAST64_MIN not usable in #if or wrong value"
159 #endif
160 #if INT_FAST64_MAX != __INT_FAST64_MAX__
161 #error "INT_FAST64_MAX not usable in #if or wrong value"
162 #endif
163 #if UINT_FAST64_MAX != __UINT_FAST64_MAX__
164 #error "UINT_FAST64_MAX not usable in #if or wrong value"
165 #endif
167 #if defined(INTPTR_MIN) && INTPTR_MIN != -__INTPTR_MAX__-1
168 #error "INTPTR_MIN not usable in #if or wrong value"
169 #endif
170 #if defined(INTPTR_MAX) && INTPTR_MAX != __INTPTR_MAX__
171 #error "INTPTR_MAX not usable in #if or wrong value"
172 #endif
173 #if defined(UINTPTR_MAX) && UINTPTR_MAX != __UINTPTR_MAX__
174 #error "UINTPTR_MAX not usable in #if or wrong value"
175 #endif
177 #if INTMAX_MIN != -__INTMAX_MAX__-1
178 #error "INTMAX_MIN not usable in #if or wrong value"
179 #endif
180 #if INTMAX_MAX != __INTMAX_MAX__
181 #error "INTMAX_MAX not usable in #if or wrong value"
182 #endif
183 #if UINTMAX_MAX != __UINTMAX_MAX__
184 #error "UINTMAX_MAX not usable in #if or wrong value"
185 #endif
187 #if PTRDIFF_MIN != -__PTRDIFF_MAX__-1
188 #error "PTRDIFF_MIN not usable in #if or wrong value"
189 #endif
190 #if PTRDIFF_MAX != __PTRDIFF_MAX__
191 #error "PTRDIFF_MAX not usable in #if or wrong value"
192 #endif
194 #if SIG_ATOMIC_MIN != __SIG_ATOMIC_MIN__
195 #error "SIG_ATOMIC_MIN not usable in #if or wrong value"
196 #endif
197 #if SIG_ATOMIC_MAX != __SIG_ATOMIC_MAX__
198 #error "SIG_ATOMIC_MAX not usable in #if or wrong value"
199 #endif
201 #if SIZE_MAX != __SIZE_MAX__
202 #error "SIZE_MAX not usable in #if or wrong value"
203 #endif
205 #if WCHAR_MIN != __WCHAR_MIN__
206 #error "WCHAR_MIN not usable in #if or wrong value"
207 #endif
208 #if WCHAR_MAX != __WCHAR_MAX__
209 #error "WCHAR_MAX not usable in #if or wrong value"
210 #endif
212 #if WINT_MIN != __WINT_MIN__
213 #error "WINT_MIN not usable in #if or wrong value"
214 #endif
215 #if WINT_MAX != __WINT_MAX__
216 #error "WINT_MAX not usable in #if or wrong value"
217 #endif