1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // Test that limits macros are available when <stdint.h> is included 10 // with or without macro _XOPEN_SOURCE=700. 11 // 12 // https://reviews.llvm.org/D59253 13 14 // ADDITIONAL_COMPILE_FLAGS: -D_XOPEN_SOURCE=700 15 16 #include <stdint.h> 17 18 #ifndef INT8_MIN 19 #error INT8_MIN not defined 20 #endif 21 22 #ifndef INT16_MIN 23 #error INT16_MIN not defined 24 #endif 25 26 #ifndef INT32_MIN 27 #error INT32_MIN not defined 28 #endif 29 30 #ifndef INT64_MIN 31 #error INT64_MIN not defined 32 #endif 33 34 #ifndef INT8_MAX 35 #error INT8_MAX not defined 36 #endif 37 38 #ifndef INT16_MAX 39 #error INT16_MAX not defined 40 #endif 41 42 #ifndef INT32_MAX 43 #error INT32_MAX not defined 44 #endif 45 46 #ifndef INT64_MAX 47 #error INT64_MAX not defined 48 #endif 49 50 #ifndef UINT8_MAX 51 #error UINT8_MAX not defined 52 #endif 53 54 #ifndef UINT16_MAX 55 #error UINT16_MAX not defined 56 #endif 57 58 #ifndef UINT32_MAX 59 #error UINT32_MAX not defined 60 #endif 61 62 #ifndef UINT64_MAX 63 #error UINT64_MAX not defined 64 #endif 65 66 #ifndef INT_LEAST8_MIN 67 #error INT_LEAST8_MIN not defined 68 #endif 69 70 #ifndef INT_LEAST16_MIN 71 #error INT_LEAST16_MIN not defined 72 #endif 73 74 #ifndef INT_LEAST32_MIN 75 #error INT_LEAST32_MIN not defined 76 #endif 77 78 #ifndef INT_LEAST64_MIN 79 #error INT_LEAST64_MIN not defined 80 #endif 81 82 #ifndef INT_LEAST8_MAX 83 #error INT_LEAST8_MAX not defined 84 #endif 85 86 #ifndef INT_LEAST16_MAX 87 #error INT_LEAST16_MAX not defined 88 #endif 89 90 #ifndef INT_LEAST32_MAX 91 #error INT_LEAST32_MAX not defined 92 #endif 93 94 #ifndef INT_LEAST64_MAX 95 #error INT_LEAST64_MAX not defined 96 #endif 97 98 #ifndef UINT_LEAST8_MAX 99 #error UINT_LEAST8_MAX not defined 100 #endif 101 102 #ifndef UINT_LEAST16_MAX 103 #error UINT_LEAST16_MAX not defined 104 #endif 105 106 #ifndef UINT_LEAST32_MAX 107 #error UINT_LEAST32_MAX not defined 108 #endif 109 110 #ifndef UINT_LEAST64_MAX 111 #error UINT_LEAST64_MAX not defined 112 #endif 113 114 #ifndef INT_FAST8_MIN 115 #error INT_FAST8_MIN not defined 116 #endif 117 118 #ifndef INT_FAST16_MIN 119 #error INT_FAST16_MIN not defined 120 #endif 121 122 #ifndef INT_FAST32_MIN 123 #error INT_FAST32_MIN not defined 124 #endif 125 126 #ifndef INT_FAST64_MIN 127 #error INT_FAST64_MIN not defined 128 #endif 129 130 #ifndef INT_FAST8_MAX 131 #error INT_FAST8_MAX not defined 132 #endif 133 134 #ifndef INT_FAST16_MAX 135 #error INT_FAST16_MAX not defined 136 #endif 137 138 #ifndef INT_FAST32_MAX 139 #error INT_FAST32_MAX not defined 140 #endif 141 142 #ifndef INT_FAST64_MAX 143 #error INT_FAST64_MAX not defined 144 #endif 145 146 #ifndef UINT_FAST8_MAX 147 #error UINT_FAST8_MAX not defined 148 #endif 149 150 #ifndef UINT_FAST16_MAX 151 #error UINT_FAST16_MAX not defined 152 #endif 153 154 #ifndef UINT_FAST32_MAX 155 #error UINT_FAST32_MAX not defined 156 #endif 157 158 #ifndef UINT_FAST64_MAX 159 #error UINT_FAST64_MAX not defined 160 #endif 161 162 #ifndef INTPTR_MIN 163 #error INTPTR_MIN not defined 164 #endif 165 166 #ifndef INTPTR_MAX 167 #error INTPTR_MAX not defined 168 #endif 169 170 #ifndef UINTPTR_MAX 171 #error UINTPTR_MAX not defined 172 #endif 173 174 #ifndef INTMAX_MIN 175 #error INTMAX_MIN not defined 176 #endif 177 178 #ifndef INTMAX_MAX 179 #error INTMAX_MAX not defined 180 #endif 181 182 #ifndef UINTMAX_MAX 183 #error UINTMAX_MAX not defined 184 #endif 185 186 #ifndef PTRDIFF_MIN 187 #error PTRDIFF_MIN not defined 188 #endif 189 190 #ifndef PTRDIFF_MAX 191 #error PTRDIFF_MAX not defined 192 #endif 193 194 #ifndef SIG_ATOMIC_MIN 195 #error SIG_ATOMIC_MIN not defined 196 #endif 197 198 #ifndef SIG_ATOMIC_MAX 199 #error SIG_ATOMIC_MAX not defined 200 #endif 201 202 #ifndef SIZE_MAX 203 #error SIZE_MAX not defined 204 #endif 205 206 #ifndef WCHAR_MIN 207 #error WCHAR_MIN not defined 208 #endif 209 210 #ifndef WCHAR_MAX 211 #error WCHAR_MAX not defined 212 #endif 213 214 #ifndef WINT_MIN 215 #error WINT_MIN not defined 216 #endif 217 218 #ifndef WINT_MAX 219 #error WINT_MAX not defined 220 #endif 221 222 #ifndef INT8_C 223 #error INT8_C not defined 224 #endif 225 226 #ifndef INT16_C 227 #error INT16_C not defined 228 #endif 229 230 #ifndef INT32_C 231 #error INT32_C not defined 232 #endif 233 234 #ifndef INT64_C 235 #error INT64_C not defined 236 #endif 237 238 #ifndef UINT8_C 239 #error UINT8_C not defined 240 #endif 241 242 #ifndef UINT16_C 243 #error UINT16_C not defined 244 #endif 245 246 #ifndef UINT32_C 247 #error UINT32_C not defined 248 #endif 249 250 #ifndef UINT64_C 251 #error UINT64_C not defined 252 #endif 253 254 #ifndef INTMAX_C 255 #error INTMAX_C not defined 256 #endif 257 258 #ifndef UINTMAX_C 259 #error UINTMAX_C not defined 260 #endif 261