1 // RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple loongarch32 /dev/null \
2 // RUN: | FileCheck --match-full-lines --check-prefix=LA32 %s
3 // RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple loongarch32-unknown-linux /dev/null \
4 // RUN: | FileCheck --match-full-lines --check-prefixes=LA32,LA32-LINUX %s
5 // RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple loongarch32 \
6 // RUN: -fforce-enable-int128 /dev/null | FileCheck --match-full-lines \
7 // RUN: --check-prefixes=LA32,LA32-INT128 %s
9 // RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple loongarch64 /dev/null \
10 // RUN: | FileCheck --match-full-lines --check-prefix=LA64 %s
11 // RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple loongarch64-unknown-linux /dev/null \
12 // RUN: | FileCheck --match-full-lines --check-prefixes=LA64,LA64-LINUX %s
13 // RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple loongarch64 \
14 // RUN: -fforce-enable-int128 /dev/null | FileCheck --match-full-lines \
15 // RUN: --check-prefixes=LA64,LA64-INT128 %s
17 //// Note that common macros are tested in init.c, such as __VERSION__. So they're not listed here.
19 // LA32: #define _ILP32 1
20 // LA32: #define __ATOMIC_ACQUIRE 2
21 // LA32-NEXT: #define __ATOMIC_ACQ_REL 4
22 // LA32-NEXT: #define __ATOMIC_CONSUME 1
23 // LA32-NEXT: #define __ATOMIC_RELAXED 0
24 // LA32-NEXT: #define __ATOMIC_RELEASE 3
25 // LA32-NEXT: #define __ATOMIC_SEQ_CST 5
26 // LA32: #define __BIGGEST_ALIGNMENT__ 16
27 // LA32: #define __BITINT_MAXWIDTH__ 128
28 // LA32: #define __BOOL_WIDTH__ 8
29 // LA32: #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
30 // LA32: #define __CHAR16_TYPE__ unsigned short
31 // LA32: #define __CHAR32_TYPE__ unsigned int
32 // LA32: #define __CHAR_BIT__ 8
33 // LA32: #define __CLANG_ATOMIC_BOOL_LOCK_FREE 2
34 // LA32: #define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 2
35 // LA32: #define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 2
36 // LA32: #define __CLANG_ATOMIC_CHAR_LOCK_FREE 2
37 // LA32: #define __CLANG_ATOMIC_INT_LOCK_FREE 2
38 // LA32: #define __CLANG_ATOMIC_LLONG_LOCK_FREE 1
39 // LA32: #define __CLANG_ATOMIC_LONG_LOCK_FREE 2
40 // LA32: #define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
41 // LA32: #define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
42 // LA32: #define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
43 // LA32: #define __DBL_DECIMAL_DIG__ 17
44 // LA32: #define __DBL_DENORM_MIN__ 4.9406564584124654e-324
45 // LA32: #define __DBL_DIG__ 15
46 // LA32: #define __DBL_EPSILON__ 2.2204460492503131e-16
47 // LA32: #define __DBL_HAS_DENORM__ 1
48 // LA32: #define __DBL_HAS_INFINITY__ 1
49 // LA32: #define __DBL_HAS_QUIET_NAN__ 1
50 // LA32: #define __DBL_MANT_DIG__ 53
51 // LA32: #define __DBL_MAX_10_EXP__ 308
52 // LA32: #define __DBL_MAX_EXP__ 1024
53 // LA32: #define __DBL_MAX__ 1.7976931348623157e+308
54 // LA32: #define __DBL_MIN_10_EXP__ (-307)
55 // LA32: #define __DBL_MIN_EXP__ (-1021)
56 // LA32: #define __DBL_MIN__ 2.2250738585072014e-308
57 // LA32: #define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
58 // LA32: #define __FLT_DECIMAL_DIG__ 9
59 // LA32: #define __FLT_DENORM_MIN__ 1.40129846e-45F
60 // LA32: #define __FLT_DIG__ 6
61 // LA32: #define __FLT_EPSILON__ 1.19209290e-7F
62 // LA32: #define __FLT_HAS_DENORM__ 1
63 // LA32: #define __FLT_HAS_INFINITY__ 1
64 // LA32: #define __FLT_HAS_QUIET_NAN__ 1
65 // LA32: #define __FLT_MANT_DIG__ 24
66 // LA32: #define __FLT_MAX_10_EXP__ 38
67 // LA32: #define __FLT_MAX_EXP__ 128
68 // LA32: #define __FLT_MAX__ 3.40282347e+38F
69 // LA32: #define __FLT_MIN_10_EXP__ (-37)
70 // LA32: #define __FLT_MIN_EXP__ (-125)
71 // LA32: #define __FLT_MIN__ 1.17549435e-38F
72 // LA32: #define __FLT_RADIX__ 2
73 // LA32: #define __GCC_ATOMIC_BOOL_LOCK_FREE 2
74 // LA32: #define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
75 // LA32: #define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
76 // LA32: #define __GCC_ATOMIC_CHAR_LOCK_FREE 2
77 // LA32: #define __GCC_ATOMIC_INT_LOCK_FREE 2
78 // LA32: #define __GCC_ATOMIC_LLONG_LOCK_FREE 1
79 // LA32: #define __GCC_ATOMIC_LONG_LOCK_FREE 2
80 // LA32: #define __GCC_ATOMIC_POINTER_LOCK_FREE 2
81 // LA32: #define __GCC_ATOMIC_SHORT_LOCK_FREE 2
82 // LA32: #define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
83 // LA32: #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
84 // LA32: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
85 // LA32: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
86 // LA32: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
87 // LA32: #define __ILP32__ 1
88 // LA32: #define __INT16_C_SUFFIX__
89 // LA32: #define __INT16_FMTd__ "hd"
90 // LA32: #define __INT16_FMTi__ "hi"
91 // LA32: #define __INT16_MAX__ 32767
92 // LA32: #define __INT16_TYPE__ short
93 // LA32: #define __INT32_C_SUFFIX__
94 // LA32: #define __INT32_FMTd__ "d"
95 // LA32: #define __INT32_FMTi__ "i"
96 // LA32: #define __INT32_MAX__ 2147483647
97 // LA32: #define __INT32_TYPE__ int
98 // LA32: #define __INT64_C_SUFFIX__ LL
99 // LA32: #define __INT64_FMTd__ "lld"
100 // LA32: #define __INT64_FMTi__ "lli"
101 // LA32: #define __INT64_MAX__ 9223372036854775807LL
102 // LA32: #define __INT64_TYPE__ long long int
103 // LA32: #define __INT8_C_SUFFIX__
104 // LA32: #define __INT8_FMTd__ "hhd"
105 // LA32: #define __INT8_FMTi__ "hhi"
106 // LA32: #define __INT8_MAX__ 127
107 // LA32: #define __INT8_TYPE__ signed char
108 // LA32: #define __INTMAX_C_SUFFIX__ LL
109 // LA32: #define __INTMAX_FMTd__ "lld"
110 // LA32: #define __INTMAX_FMTi__ "lli"
111 // LA32: #define __INTMAX_MAX__ 9223372036854775807LL
112 // LA32: #define __INTMAX_TYPE__ long long int
113 // LA32: #define __INTMAX_WIDTH__ 64
114 // LA32: #define __INTPTR_FMTd__ "d"
115 // LA32: #define __INTPTR_FMTi__ "i"
116 // LA32: #define __INTPTR_MAX__ 2147483647
117 // LA32: #define __INTPTR_TYPE__ int
118 // LA32: #define __INTPTR_WIDTH__ 32
119 // LA32: #define __INT_FAST16_FMTd__ "hd"
120 // LA32: #define __INT_FAST16_FMTi__ "hi"
121 // LA32: #define __INT_FAST16_MAX__ 32767
122 // LA32: #define __INT_FAST16_TYPE__ short
123 // LA32: #define __INT_FAST16_WIDTH__ 16
124 // LA32: #define __INT_FAST32_FMTd__ "d"
125 // LA32: #define __INT_FAST32_FMTi__ "i"
126 // LA32: #define __INT_FAST32_MAX__ 2147483647
127 // LA32: #define __INT_FAST32_TYPE__ int
128 // LA32: #define __INT_FAST32_WIDTH__ 32
129 // LA32: #define __INT_FAST64_FMTd__ "lld"
130 // LA32: #define __INT_FAST64_FMTi__ "lli"
131 // LA32: #define __INT_FAST64_MAX__ 9223372036854775807LL
132 // LA32: #define __INT_FAST64_TYPE__ long long int
133 // LA32: #define __INT_FAST64_WIDTH__ 64
134 // LA32: #define __INT_FAST8_FMTd__ "hhd"
135 // LA32: #define __INT_FAST8_FMTi__ "hhi"
136 // LA32: #define __INT_FAST8_MAX__ 127
137 // LA32: #define __INT_FAST8_TYPE__ signed char
138 // LA32: #define __INT_FAST8_WIDTH__ 8
139 // LA32: #define __INT_LEAST16_FMTd__ "hd"
140 // LA32: #define __INT_LEAST16_FMTi__ "hi"
141 // LA32: #define __INT_LEAST16_MAX__ 32767
142 // LA32: #define __INT_LEAST16_TYPE__ short
143 // LA32: #define __INT_LEAST16_WIDTH__ 16
144 // LA32: #define __INT_LEAST32_FMTd__ "d"
145 // LA32: #define __INT_LEAST32_FMTi__ "i"
146 // LA32: #define __INT_LEAST32_MAX__ 2147483647
147 // LA32: #define __INT_LEAST32_TYPE__ int
148 // LA32: #define __INT_LEAST32_WIDTH__ 32
149 // LA32: #define __INT_LEAST64_FMTd__ "lld"
150 // LA32: #define __INT_LEAST64_FMTi__ "lli"
151 // LA32: #define __INT_LEAST64_MAX__ 9223372036854775807LL
152 // LA32: #define __INT_LEAST64_TYPE__ long long int
153 // LA32: #define __INT_LEAST64_WIDTH__ 64
154 // LA32: #define __INT_LEAST8_FMTd__ "hhd"
155 // LA32: #define __INT_LEAST8_FMTi__ "hhi"
156 // LA32: #define __INT_LEAST8_MAX__ 127
157 // LA32: #define __INT_LEAST8_TYPE__ signed char
158 // LA32: #define __INT_LEAST8_WIDTH__ 8
159 // LA32: #define __INT_MAX__ 2147483647
160 // LA32: #define __INT_WIDTH__ 32
161 // LA32: #define __LDBL_DECIMAL_DIG__ 36
162 // LA32: #define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
163 // LA32: #define __LDBL_DIG__ 33
164 // LA32: #define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L
165 // LA32: #define __LDBL_HAS_DENORM__ 1
166 // LA32: #define __LDBL_HAS_INFINITY__ 1
167 // LA32: #define __LDBL_HAS_QUIET_NAN__ 1
168 // LA32: #define __LDBL_MANT_DIG__ 113
169 // LA32: #define __LDBL_MAX_10_EXP__ 4932
170 // LA32: #define __LDBL_MAX_EXP__ 16384
171 // LA32: #define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L
172 // LA32: #define __LDBL_MIN_10_EXP__ (-4931)
173 // LA32: #define __LDBL_MIN_EXP__ (-16381)
174 // LA32: #define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
175 // LA32: #define __LITTLE_ENDIAN__ 1
176 // LA32: #define __LLONG_WIDTH__ 64
177 // LA32: #define __LONG_LONG_MAX__ 9223372036854775807LL
178 // LA32: #define __LONG_MAX__ 2147483647L
179 // LA32: #define __LONG_WIDTH__ 32
180 // LA32: #define __NO_INLINE__ 1
181 // LA32: #define __NO_MATH_ERRNO__ 1
182 // LA32: #define __OBJC_BOOL_IS_BOOL 0
183 // LA32: #define __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES 3
184 // LA32: #define __OPENCL_MEMORY_SCOPE_DEVICE 2
185 // LA32: #define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
186 // LA32: #define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
187 // LA32: #define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
188 // LA32: #define __POINTER_WIDTH__ 32
189 // LA32: #define __PRAGMA_REDEFINE_EXTNAME 1
190 // LA32: #define __PTRDIFF_FMTd__ "d"
191 // LA32: #define __PTRDIFF_FMTi__ "i"
192 // LA32: #define __PTRDIFF_MAX__ 2147483647
193 // LA32: #define __PTRDIFF_TYPE__ int
194 // LA32: #define __PTRDIFF_WIDTH__ 32
195 // LA32: #define __SCHAR_MAX__ 127
196 // LA32: #define __SHRT_MAX__ 32767
197 // LA32: #define __SHRT_WIDTH__ 16
198 // LA32: #define __SIG_ATOMIC_MAX__ 2147483647
199 // LA32: #define __SIG_ATOMIC_WIDTH__ 32
200 // LA32: #define __SIZEOF_DOUBLE__ 8
201 // LA32: #define __SIZEOF_FLOAT__ 4
202 // LA32-INT128: #define __SIZEOF_INT128__ 16
203 // LA32: #define __SIZEOF_INT__ 4
204 // LA32: #define __SIZEOF_LONG_DOUBLE__ 16
205 // LA32: #define __SIZEOF_LONG_LONG__ 8
206 // LA32: #define __SIZEOF_LONG__ 4
207 // LA32: #define __SIZEOF_POINTER__ 4
208 // LA32: #define __SIZEOF_PTRDIFF_T__ 4
209 // LA32: #define __SIZEOF_SHORT__ 2
210 // LA32: #define __SIZEOF_SIZE_T__ 4
211 // LA32: #define __SIZEOF_WCHAR_T__ 4
212 // LA32: #define __SIZEOF_WINT_T__ 4
213 // LA32: #define __SIZE_FMTX__ "X"
214 // LA32: #define __SIZE_FMTo__ "o"
215 // LA32: #define __SIZE_FMTu__ "u"
216 // LA32: #define __SIZE_FMTx__ "x"
217 // LA32: #define __SIZE_MAX__ 4294967295U
218 // LA32: #define __SIZE_TYPE__ unsigned int
219 // LA32: #define __SIZE_WIDTH__ 32
220 // LA32: #define __STDC_HOSTED__ 0
221 // LA32: #define __STDC_UTF_16__ 1
222 // LA32: #define __STDC_UTF_32__ 1
223 // LA32: #define __STDC_VERSION__ 201710L
224 // LA32: #define __STDC__ 1
225 // LA32: #define __UINT16_C_SUFFIX__
226 // LA32: #define __UINT16_FMTX__ "hX"
227 // LA32: #define __UINT16_FMTo__ "ho"
228 // LA32: #define __UINT16_FMTu__ "hu"
229 // LA32: #define __UINT16_FMTx__ "hx"
230 // LA32: #define __UINT16_MAX__ 65535
231 // LA32: #define __UINT16_TYPE__ unsigned short
232 // LA32: #define __UINT32_C_SUFFIX__ U
233 // LA32: #define __UINT32_FMTX__ "X"
234 // LA32: #define __UINT32_FMTo__ "o"
235 // LA32: #define __UINT32_FMTu__ "u"
236 // LA32: #define __UINT32_FMTx__ "x"
237 // LA32: #define __UINT32_MAX__ 4294967295U
238 // LA32: #define __UINT32_TYPE__ unsigned int
239 // LA32: #define __UINT64_C_SUFFIX__ ULL
240 // LA32: #define __UINT64_FMTX__ "llX"
241 // LA32: #define __UINT64_FMTo__ "llo"
242 // LA32: #define __UINT64_FMTu__ "llu"
243 // LA32: #define __UINT64_FMTx__ "llx"
244 // LA32: #define __UINT64_MAX__ 18446744073709551615ULL
245 // LA32: #define __UINT64_TYPE__ long long unsigned int
246 // LA32: #define __UINT8_C_SUFFIX__
247 // LA32: #define __UINT8_FMTX__ "hhX"
248 // LA32: #define __UINT8_FMTo__ "hho"
249 // LA32: #define __UINT8_FMTu__ "hhu"
250 // LA32: #define __UINT8_FMTx__ "hhx"
251 // LA32: #define __UINT8_MAX__ 255
252 // LA32: #define __UINT8_TYPE__ unsigned char
253 // LA32: #define __UINTMAX_C_SUFFIX__ ULL
254 // LA32: #define __UINTMAX_FMTX__ "llX"
255 // LA32: #define __UINTMAX_FMTo__ "llo"
256 // LA32: #define __UINTMAX_FMTu__ "llu"
257 // LA32: #define __UINTMAX_FMTx__ "llx"
258 // LA32: #define __UINTMAX_MAX__ 18446744073709551615ULL
259 // LA32: #define __UINTMAX_TYPE__ long long unsigned int
260 // LA32: #define __UINTMAX_WIDTH__ 64
261 // LA32: #define __UINTPTR_FMTX__ "X"
262 // LA32: #define __UINTPTR_FMTo__ "o"
263 // LA32: #define __UINTPTR_FMTu__ "u"
264 // LA32: #define __UINTPTR_FMTx__ "x"
265 // LA32: #define __UINTPTR_MAX__ 4294967295U
266 // LA32: #define __UINTPTR_TYPE__ unsigned int
267 // LA32: #define __UINTPTR_WIDTH__ 32
268 // LA32: #define __UINT_FAST16_FMTX__ "hX"
269 // LA32: #define __UINT_FAST16_FMTo__ "ho"
270 // LA32: #define __UINT_FAST16_FMTu__ "hu"
271 // LA32: #define __UINT_FAST16_FMTx__ "hx"
272 // LA32: #define __UINT_FAST16_MAX__ 65535
273 // TODO: LoongArch GCC defines UINT_FAST16 to be long unsigned int
274 // LA32: #define __UINT_FAST16_TYPE__ unsigned short
275 // LA32: #define __UINT_FAST32_FMTX__ "X"
276 // LA32: #define __UINT_FAST32_FMTo__ "o"
277 // LA32: #define __UINT_FAST32_FMTu__ "u"
278 // LA32: #define __UINT_FAST32_FMTx__ "x"
279 // LA32: #define __UINT_FAST32_MAX__ 4294967295U
280 // LA32: #define __UINT_FAST32_TYPE__ unsigned int
281 // LA32: #define __UINT_FAST64_FMTX__ "llX"
282 // LA32: #define __UINT_FAST64_FMTo__ "llo"
283 // LA32: #define __UINT_FAST64_FMTu__ "llu"
284 // LA32: #define __UINT_FAST64_FMTx__ "llx"
285 // LA32: #define __UINT_FAST64_MAX__ 18446744073709551615ULL
286 // LA32: #define __UINT_FAST64_TYPE__ long long unsigned int
287 // LA32: #define __UINT_FAST8_FMTX__ "hhX"
288 // LA32: #define __UINT_FAST8_FMTo__ "hho"
289 // LA32: #define __UINT_FAST8_FMTu__ "hhu"
290 // LA32: #define __UINT_FAST8_FMTx__ "hhx"
291 // LA32: #define __UINT_FAST8_MAX__ 255
292 // LA32: #define __UINT_FAST8_TYPE__ unsigned char
293 // LA32: #define __UINT_LEAST16_FMTX__ "hX"
294 // LA32: #define __UINT_LEAST16_FMTo__ "ho"
295 // LA32: #define __UINT_LEAST16_FMTu__ "hu"
296 // LA32: #define __UINT_LEAST16_FMTx__ "hx"
297 // LA32: #define __UINT_LEAST16_MAX__ 65535
298 // LA32: #define __UINT_LEAST16_TYPE__ unsigned short
299 // LA32: #define __UINT_LEAST32_FMTX__ "X"
300 // LA32: #define __UINT_LEAST32_FMTo__ "o"
301 // LA32: #define __UINT_LEAST32_FMTu__ "u"
302 // LA32: #define __UINT_LEAST32_FMTx__ "x"
303 // LA32: #define __UINT_LEAST32_MAX__ 4294967295U
304 // LA32: #define __UINT_LEAST32_TYPE__ unsigned int
305 // LA32: #define __UINT_LEAST64_FMTX__ "llX"
306 // LA32: #define __UINT_LEAST64_FMTo__ "llo"
307 // LA32: #define __UINT_LEAST64_FMTu__ "llu"
308 // LA32: #define __UINT_LEAST64_FMTx__ "llx"
309 // LA32: #define __UINT_LEAST64_MAX__ 18446744073709551615ULL
310 // LA32: #define __UINT_LEAST64_TYPE__ long long unsigned int
311 // LA32: #define __UINT_LEAST8_FMTX__ "hhX"
312 // LA32: #define __UINT_LEAST8_FMTo__ "hho"
313 // LA32: #define __UINT_LEAST8_FMTu__ "hhu"
314 // LA32: #define __UINT_LEAST8_FMTx__ "hhx"
315 // LA32: #define __UINT_LEAST8_MAX__ 255
316 // LA32: #define __UINT_LEAST8_TYPE__ unsigned char
317 // LA32: #define __USER_LABEL_PREFIX__
318 // LA32: #define __WCHAR_MAX__ 2147483647
319 // LA32: #define __WCHAR_TYPE__ int
320 // LA32: #define __WCHAR_WIDTH__ 32
321 // LA32: #define __WINT_MAX__ 4294967295U
322 // LA32: #define __WINT_TYPE__ unsigned int
323 // LA32: #define __WINT_UNSIGNED__ 1
324 // LA32: #define __WINT_WIDTH__ 32
325 // LA32-LINUX: #define __gnu_linux__ 1
326 // LA32-LINUX: #define __linux 1
327 // LA32-LINUX: #define __linux__ 1
328 // LA32-NOT: #define __loongarch64 1
329 // LA32: #define __loongarch__ 1
330 // LA32-LINUX: #define __unix 1
331 // LA32-LINUX: #define __unix__ 1
332 // LA32-LINUX: #define linux 1
333 // LA32-LINUX: #define unix 1
335 // LA64: #define _LP64 1
336 // LA64: #define __ATOMIC_ACQUIRE 2
337 // LA64-NEXT: #define __ATOMIC_ACQ_REL 4
338 // LA64-NEXT: #define __ATOMIC_CONSUME 1
339 // LA64-NEXT: #define __ATOMIC_RELAXED 0
340 // LA64-NEXT: #define __ATOMIC_RELEASE 3
341 // LA64-NEXT: #define __ATOMIC_SEQ_CST 5
342 // LA64: #define __BIGGEST_ALIGNMENT__ 16
343 // LA64: #define __BITINT_MAXWIDTH__ 128
344 // LA64: #define __BOOL_WIDTH__ 8
345 // LA64: #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
346 // LA64: #define __CHAR16_TYPE__ unsigned short
347 // LA64: #define __CHAR32_TYPE__ unsigned int
348 // LA64: #define __CHAR_BIT__ 8
349 // LA64: #define __CLANG_ATOMIC_BOOL_LOCK_FREE 2
350 // LA64: #define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 2
351 // LA64: #define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 2
352 // LA64: #define __CLANG_ATOMIC_CHAR_LOCK_FREE 2
353 // LA64: #define __CLANG_ATOMIC_INT_LOCK_FREE 2
354 // LA64: #define __CLANG_ATOMIC_LLONG_LOCK_FREE 2
355 // LA64: #define __CLANG_ATOMIC_LONG_LOCK_FREE 2
356 // LA64: #define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
357 // LA64: #define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
358 // LA64: #define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
359 // LA64: #define __DBL_DECIMAL_DIG__ 17
360 // LA64: #define __DBL_DENORM_MIN__ 4.9406564584124654e-324
361 // LA64: #define __DBL_DIG__ 15
362 // LA64: #define __DBL_EPSILON__ 2.2204460492503131e-16
363 // LA64: #define __DBL_HAS_DENORM__ 1
364 // LA64: #define __DBL_HAS_INFINITY__ 1
365 // LA64: #define __DBL_HAS_QUIET_NAN__ 1
366 // LA64: #define __DBL_MANT_DIG__ 53
367 // LA64: #define __DBL_MAX_10_EXP__ 308
368 // LA64: #define __DBL_MAX_EXP__ 1024
369 // LA64: #define __DBL_MAX__ 1.7976931348623157e+308
370 // LA64: #define __DBL_MIN_10_EXP__ (-307)
371 // LA64: #define __DBL_MIN_EXP__ (-1021)
372 // LA64: #define __DBL_MIN__ 2.2250738585072014e-308
373 // LA64: #define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
374 // LA64: #define __FLT_DECIMAL_DIG__ 9
375 // LA64: #define __FLT_DENORM_MIN__ 1.40129846e-45F
376 // LA64: #define __FLT_DIG__ 6
377 // LA64: #define __FLT_EPSILON__ 1.19209290e-7F
378 // LA64: #define __FLT_HAS_DENORM__ 1
379 // LA64: #define __FLT_HAS_INFINITY__ 1
380 // LA64: #define __FLT_HAS_QUIET_NAN__ 1
381 // LA64: #define __FLT_MANT_DIG__ 24
382 // LA64: #define __FLT_MAX_10_EXP__ 38
383 // LA64: #define __FLT_MAX_EXP__ 128
384 // LA64: #define __FLT_MAX__ 3.40282347e+38F
385 // LA64: #define __FLT_MIN_10_EXP__ (-37)
386 // LA64: #define __FLT_MIN_EXP__ (-125)
387 // LA64: #define __FLT_MIN__ 1.17549435e-38F
388 // LA64: #define __FLT_RADIX__ 2
389 // LA64: #define __GCC_ATOMIC_BOOL_LOCK_FREE 2
390 // LA64: #define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
391 // LA64: #define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
392 // LA64: #define __GCC_ATOMIC_CHAR_LOCK_FREE 2
393 // LA64: #define __GCC_ATOMIC_INT_LOCK_FREE 2
394 // LA64: #define __GCC_ATOMIC_LLONG_LOCK_FREE 2
395 // LA64: #define __GCC_ATOMIC_LONG_LOCK_FREE 2
396 // LA64: #define __GCC_ATOMIC_POINTER_LOCK_FREE 2
397 // LA64: #define __GCC_ATOMIC_SHORT_LOCK_FREE 2
398 // LA64: #define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
399 // LA64: #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
400 // LA64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
401 // LA64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
402 // LA64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
403 // LA64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
404 // LA64: #define __INT16_C_SUFFIX__
405 // LA64: #define __INT16_FMTd__ "hd"
406 // LA64: #define __INT16_FMTi__ "hi"
407 // LA64: #define __INT16_MAX__ 32767
408 // LA64: #define __INT16_TYPE__ short
409 // LA64: #define __INT32_C_SUFFIX__
410 // LA64: #define __INT32_FMTd__ "d"
411 // LA64: #define __INT32_FMTi__ "i"
412 // LA64: #define __INT32_MAX__ 2147483647
413 // LA64: #define __INT32_TYPE__ int
414 // LA64: #define __INT64_C_SUFFIX__ L
415 // LA64: #define __INT64_FMTd__ "ld"
416 // LA64: #define __INT64_FMTi__ "li"
417 // LA64: #define __INT64_MAX__ 9223372036854775807L
418 // LA64: #define __INT64_TYPE__ long int
419 // LA64: #define __INT8_C_SUFFIX__
420 // LA64: #define __INT8_FMTd__ "hhd"
421 // LA64: #define __INT8_FMTi__ "hhi"
422 // LA64: #define __INT8_MAX__ 127
423 // LA64: #define __INT8_TYPE__ signed char
424 // LA64: #define __INTMAX_C_SUFFIX__ L
425 // LA64: #define __INTMAX_FMTd__ "ld"
426 // LA64: #define __INTMAX_FMTi__ "li"
427 // LA64: #define __INTMAX_MAX__ 9223372036854775807L
428 // LA64: #define __INTMAX_TYPE__ long int
429 // LA64: #define __INTMAX_WIDTH__ 64
430 // LA64: #define __INTPTR_FMTd__ "ld"
431 // LA64: #define __INTPTR_FMTi__ "li"
432 // LA64: #define __INTPTR_MAX__ 9223372036854775807L
433 // LA64: #define __INTPTR_TYPE__ long int
434 // LA64: #define __INTPTR_WIDTH__ 64
435 // LA64: #define __INT_FAST16_FMTd__ "hd"
436 // LA64: #define __INT_FAST16_FMTi__ "hi"
437 // LA64: #define __INT_FAST16_MAX__ 32767
438 // LA64: #define __INT_FAST16_TYPE__ short
439 // LA64: #define __INT_FAST16_WIDTH__ 16
440 // LA64: #define __INT_FAST32_FMTd__ "d"
441 // LA64: #define __INT_FAST32_FMTi__ "i"
442 // LA64: #define __INT_FAST32_MAX__ 2147483647
443 // LA64: #define __INT_FAST32_TYPE__ int
444 // LA64: #define __INT_FAST32_WIDTH__ 32
445 // LA64: #define __INT_FAST64_FMTd__ "ld"
446 // LA64: #define __INT_FAST64_FMTi__ "li"
447 // LA64: #define __INT_FAST64_MAX__ 9223372036854775807L
448 // LA64: #define __INT_FAST64_TYPE__ long int
449 // LA64: #define __INT_FAST64_WIDTH__ 64
450 // LA64: #define __INT_FAST8_FMTd__ "hhd"
451 // LA64: #define __INT_FAST8_FMTi__ "hhi"
452 // LA64: #define __INT_FAST8_MAX__ 127
453 // LA64: #define __INT_FAST8_TYPE__ signed char
454 // LA64: #define __INT_FAST8_WIDTH__ 8
455 // LA64: #define __INT_LEAST16_FMTd__ "hd"
456 // LA64: #define __INT_LEAST16_FMTi__ "hi"
457 // LA64: #define __INT_LEAST16_MAX__ 32767
458 // LA64: #define __INT_LEAST16_TYPE__ short
459 // LA64: #define __INT_LEAST16_WIDTH__ 16
460 // LA64: #define __INT_LEAST32_FMTd__ "d"
461 // LA64: #define __INT_LEAST32_FMTi__ "i"
462 // LA64: #define __INT_LEAST32_MAX__ 2147483647
463 // LA64: #define __INT_LEAST32_TYPE__ int
464 // LA64: #define __INT_LEAST32_WIDTH__ 32
465 // LA64: #define __INT_LEAST64_FMTd__ "ld"
466 // LA64: #define __INT_LEAST64_FMTi__ "li"
467 // LA64: #define __INT_LEAST64_MAX__ 9223372036854775807L
468 // LA64: #define __INT_LEAST64_TYPE__ long int
469 // LA64: #define __INT_LEAST64_WIDTH__ 64
470 // LA64: #define __INT_LEAST8_FMTd__ "hhd"
471 // LA64: #define __INT_LEAST8_FMTi__ "hhi"
472 // LA64: #define __INT_LEAST8_MAX__ 127
473 // LA64: #define __INT_LEAST8_TYPE__ signed char
474 // LA64: #define __INT_LEAST8_WIDTH__ 8
475 // LA64: #define __INT_MAX__ 2147483647
476 // LA64: #define __INT_WIDTH__ 32
477 // LA64: #define __LDBL_DECIMAL_DIG__ 36
478 // LA64: #define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
479 // LA64: #define __LDBL_DIG__ 33
480 // LA64: #define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L
481 // LA64: #define __LDBL_HAS_DENORM__ 1
482 // LA64: #define __LDBL_HAS_INFINITY__ 1
483 // LA64: #define __LDBL_HAS_QUIET_NAN__ 1
484 // LA64: #define __LDBL_MANT_DIG__ 113
485 // LA64: #define __LDBL_MAX_10_EXP__ 4932
486 // LA64: #define __LDBL_MAX_EXP__ 16384
487 // LA64: #define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L
488 // LA64: #define __LDBL_MIN_10_EXP__ (-4931)
489 // LA64: #define __LDBL_MIN_EXP__ (-16381)
490 // LA64: #define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
491 // LA64: #define __LITTLE_ENDIAN__ 1
492 // LA64: #define __LLONG_WIDTH__ 64
493 // LA64: #define __LONG_LONG_MAX__ 9223372036854775807LL
494 // LA64: #define __LONG_MAX__ 9223372036854775807L
495 // LA64: #define __LONG_WIDTH__ 64
496 // LA64: #define __LP64__ 1
497 // LA64: #define __NO_INLINE__ 1
498 // LA64: #define __NO_MATH_ERRNO__ 1
499 // LA64: #define __OBJC_BOOL_IS_BOOL 0
500 // LA64: #define __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES 3
501 // LA64: #define __OPENCL_MEMORY_SCOPE_DEVICE 2
502 // LA64: #define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
503 // LA64: #define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
504 // LA64: #define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
505 // LA64: #define __POINTER_WIDTH__ 64
506 // LA64: #define __PRAGMA_REDEFINE_EXTNAME 1
507 // LA64: #define __PTRDIFF_FMTd__ "ld"
508 // LA64: #define __PTRDIFF_FMTi__ "li"
509 // LA64: #define __PTRDIFF_MAX__ 9223372036854775807L
510 // LA64: #define __PTRDIFF_TYPE__ long int
511 // LA64: #define __PTRDIFF_WIDTH__ 64
512 // LA64: #define __SCHAR_MAX__ 127
513 // LA64: #define __SHRT_MAX__ 32767
514 // LA64: #define __SHRT_WIDTH__ 16
515 // LA64: #define __SIG_ATOMIC_MAX__ 2147483647
516 // LA64: #define __SIG_ATOMIC_WIDTH__ 32
517 // LA64: #define __SIZEOF_DOUBLE__ 8
518 // LA64: #define __SIZEOF_FLOAT__ 4
519 // LA64-INT128: #define __SIZEOF_INT128__ 16
520 // LA64: #define __SIZEOF_INT__ 4
521 // LA64: #define __SIZEOF_LONG_DOUBLE__ 16
522 // LA64: #define __SIZEOF_LONG_LONG__ 8
523 // LA64: #define __SIZEOF_LONG__ 8
524 // LA64: #define __SIZEOF_POINTER__ 8
525 // LA64: #define __SIZEOF_PTRDIFF_T__ 8
526 // LA64: #define __SIZEOF_SHORT__ 2
527 // LA64: #define __SIZEOF_SIZE_T__ 8
528 // LA64: #define __SIZEOF_WCHAR_T__ 4
529 // LA64: #define __SIZEOF_WINT_T__ 4
530 // LA64: #define __SIZE_FMTX__ "lX"
531 // LA64: #define __SIZE_FMTo__ "lo"
532 // LA64: #define __SIZE_FMTu__ "lu"
533 // LA64: #define __SIZE_FMTx__ "lx"
534 // LA64: #define __SIZE_MAX__ 18446744073709551615UL
535 // LA64: #define __SIZE_TYPE__ long unsigned int
536 // LA64: #define __SIZE_WIDTH__ 64
537 // LA64: #define __STDC_HOSTED__ 0
538 // LA64: #define __STDC_UTF_16__ 1
539 // LA64: #define __STDC_UTF_32__ 1
540 // LA64: #define __STDC_VERSION__ 201710L
541 // LA64: #define __STDC__ 1
542 // LA64: #define __UINT16_C_SUFFIX__
543 // LA64: #define __UINT16_FMTX__ "hX"
544 // LA64: #define __UINT16_FMTo__ "ho"
545 // LA64: #define __UINT16_FMTu__ "hu"
546 // LA64: #define __UINT16_FMTx__ "hx"
547 // LA64: #define __UINT16_MAX__ 65535
548 // LA64: #define __UINT16_TYPE__ unsigned short
549 // LA64: #define __UINT32_C_SUFFIX__ U
550 // LA64: #define __UINT32_FMTX__ "X"
551 // LA64: #define __UINT32_FMTo__ "o"
552 // LA64: #define __UINT32_FMTu__ "u"
553 // LA64: #define __UINT32_FMTx__ "x"
554 // LA64: #define __UINT32_MAX__ 4294967295U
555 // LA64: #define __UINT32_TYPE__ unsigned int
556 // LA64: #define __UINT64_C_SUFFIX__ UL
557 // LA64: #define __UINT64_FMTX__ "lX"
558 // LA64: #define __UINT64_FMTo__ "lo"
559 // LA64: #define __UINT64_FMTu__ "lu"
560 // LA64: #define __UINT64_FMTx__ "lx"
561 // LA64: #define __UINT64_MAX__ 18446744073709551615UL
562 // LA64: #define __UINT64_TYPE__ long unsigned int
563 // LA64: #define __UINT8_C_SUFFIX__
564 // LA64: #define __UINT8_FMTX__ "hhX"
565 // LA64: #define __UINT8_FMTo__ "hho"
566 // LA64: #define __UINT8_FMTu__ "hhu"
567 // LA64: #define __UINT8_FMTx__ "hhx"
568 // LA64: #define __UINT8_MAX__ 255
569 // LA64: #define __UINT8_TYPE__ unsigned char
570 // LA64: #define __UINTMAX_C_SUFFIX__ UL
571 // LA64: #define __UINTMAX_FMTX__ "lX"
572 // LA64: #define __UINTMAX_FMTo__ "lo"
573 // LA64: #define __UINTMAX_FMTu__ "lu"
574 // LA64: #define __UINTMAX_FMTx__ "lx"
575 // LA64: #define __UINTMAX_MAX__ 18446744073709551615UL
576 // LA64: #define __UINTMAX_TYPE__ long unsigned int
577 // LA64: #define __UINTMAX_WIDTH__ 64
578 // LA64: #define __UINTPTR_FMTX__ "lX"
579 // LA64: #define __UINTPTR_FMTo__ "lo"
580 // LA64: #define __UINTPTR_FMTu__ "lu"
581 // LA64: #define __UINTPTR_FMTx__ "lx"
582 // LA64: #define __UINTPTR_MAX__ 18446744073709551615UL
583 // LA64: #define __UINTPTR_TYPE__ long unsigned int
584 // LA64: #define __UINTPTR_WIDTH__ 64
585 // LA64: #define __UINT_FAST16_FMTX__ "hX"
586 // LA64: #define __UINT_FAST16_FMTo__ "ho"
587 // LA64: #define __UINT_FAST16_FMTu__ "hu"
588 // LA64: #define __UINT_FAST16_FMTx__ "hx"
589 // LA64: #define __UINT_FAST16_MAX__ 65535
590 // TODO: LoongArch GCC defines UINT_FAST16 to be long unsigned int
591 // LA64: #define __UINT_FAST16_TYPE__ unsigned short
592 // LA64: #define __UINT_FAST32_FMTX__ "X"
593 // LA64: #define __UINT_FAST32_FMTo__ "o"
594 // LA64: #define __UINT_FAST32_FMTu__ "u"
595 // LA64: #define __UINT_FAST32_FMTx__ "x"
596 // LA64: #define __UINT_FAST32_MAX__ 4294967295U
597 // LA64: #define __UINT_FAST32_TYPE__ unsigned int
598 // LA64: #define __UINT_FAST64_FMTX__ "lX"
599 // LA64: #define __UINT_FAST64_FMTo__ "lo"
600 // LA64: #define __UINT_FAST64_FMTu__ "lu"
601 // LA64: #define __UINT_FAST64_FMTx__ "lx"
602 // LA64: #define __UINT_FAST64_MAX__ 18446744073709551615UL
603 // LA64: #define __UINT_FAST64_TYPE__ long unsigned int
604 // LA64: #define __UINT_FAST8_FMTX__ "hhX"
605 // LA64: #define __UINT_FAST8_FMTo__ "hho"
606 // LA64: #define __UINT_FAST8_FMTu__ "hhu"
607 // LA64: #define __UINT_FAST8_FMTx__ "hhx"
608 // LA64: #define __UINT_FAST8_MAX__ 255
609 // LA64: #define __UINT_FAST8_TYPE__ unsigned char
610 // LA64: #define __UINT_LEAST16_FMTX__ "hX"
611 // LA64: #define __UINT_LEAST16_FMTo__ "ho"
612 // LA64: #define __UINT_LEAST16_FMTu__ "hu"
613 // LA64: #define __UINT_LEAST16_FMTx__ "hx"
614 // LA64: #define __UINT_LEAST16_MAX__ 65535
615 // LA64: #define __UINT_LEAST16_TYPE__ unsigned short
616 // LA64: #define __UINT_LEAST32_FMTX__ "X"
617 // LA64: #define __UINT_LEAST32_FMTo__ "o"
618 // LA64: #define __UINT_LEAST32_FMTu__ "u"
619 // LA64: #define __UINT_LEAST32_FMTx__ "x"
620 // LA64: #define __UINT_LEAST32_MAX__ 4294967295U
621 // LA64: #define __UINT_LEAST32_TYPE__ unsigned int
622 // LA64: #define __UINT_LEAST64_FMTX__ "lX"
623 // LA64: #define __UINT_LEAST64_FMTo__ "lo"
624 // LA64: #define __UINT_LEAST64_FMTu__ "lu"
625 // LA64: #define __UINT_LEAST64_FMTx__ "lx"
626 // LA64: #define __UINT_LEAST64_MAX__ 18446744073709551615UL
627 // LA64: #define __UINT_LEAST64_TYPE__ long unsigned int
628 // LA64: #define __UINT_LEAST8_FMTX__ "hhX"
629 // LA64: #define __UINT_LEAST8_FMTo__ "hho"
630 // LA64: #define __UINT_LEAST8_FMTu__ "hhu"
631 // LA64: #define __UINT_LEAST8_FMTx__ "hhx"
632 // LA64: #define __UINT_LEAST8_MAX__ 255
633 // LA64: #define __UINT_LEAST8_TYPE__ unsigned char
634 // LA64: #define __USER_LABEL_PREFIX__
635 // LA64: #define __WCHAR_MAX__ 2147483647
636 // LA64: #define __WCHAR_TYPE__ int
637 // LA64: #define __WCHAR_WIDTH__ 32
638 // LA64: #define __WINT_MAX__ 4294967295U
639 // LA64: #define __WINT_TYPE__ unsigned int
640 // LA64: #define __WINT_UNSIGNED__ 1
641 // LA64: #define __WINT_WIDTH__ 32
642 // LA64-LINUX: #define __gnu_linux__ 1
643 // LA64-LINUX: #define __linux 1
644 // LA64-LINUX: #define __linux__ 1
645 // LA64: #define __loongarch64 1
646 // LA64: #define __loongarch__ 1
647 // LA64-LINUX: #define __unix 1
648 // LA64-LINUX: #define __unix__ 1
649 // LA64-LINUX: #define linux 1
650 // LA64-LINUX: #define unix 1
653 /// Check __loongarch_{double,single,hard,soft}_float, __loongarch_{gr,fr}len, __loongarch_lp64.
655 // RUN: %clang --target=loongarch32 -mfpu=64 -mabi=ilp32d -x c -E -dM %s -o - \
656 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU64-ILP32D %s
657 // RUN: %clang --target=loongarch32 -mdouble-float -x c -E -dM %s -o - \
658 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU64-ILP32D %s
659 // LA32-FPU64-ILP32D: #define __loongarch_double_float 1
660 // LA32-FPU64-ILP32D: #define __loongarch_frlen 64
661 // LA32-FPU64-ILP32D: #define __loongarch_grlen 32
662 // LA32-FPU64-ILP32D: #define __loongarch_hard_float 1
663 // LA32-FPU64-ILP32D-NOT: #define __loongarch_lp64
664 // LA32-FPU64-ILP32D-NOT: #define __loongarch_single_float
665 // LA32-FPU64-ILP32D-NOT: #define __loongarch_soft_float
667 // RUN: %clang --target=loongarch32 -mfpu=64 -mabi=ilp32f -x c -E -dM %s -o - \
668 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU64-ILP32F %s
669 // LA32-FPU64-ILP32F-NOT: #define __loongarch_double_float
670 // LA32-FPU64-ILP32F: #define __loongarch_frlen 64
671 // LA32-FPU64-ILP32F: #define __loongarch_grlen 32
672 // LA32-FPU64-ILP32F: #define __loongarch_hard_float 1
673 // LA32-FPU64-ILP32F-NOT: #define __loongarch_lp64
674 // LA32-FPU64-ILP32F: #define __loongarch_single_float 1
675 // LA32-FPU64-ILP32F-NOT: #define __loongarch_soft_float
677 // RUN: %clang --target=loongarch32 -mfpu=64 -mabi=ilp32s -x c -E -dM %s -o - \
678 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU64-ILP32S %s
679 // LA32-FPU64-ILP32S-NOT: #define __loongarch_double_float
680 // LA32-FPU64-ILP32S: #define __loongarch_frlen 64
681 // LA32-FPU64-ILP32S: #define __loongarch_grlen 32
682 // LA32-FPU64-ILP32S-NOT: #define __loongarch_hard_float
683 // LA32-FPU64-ILP32S-NOT: #define __loongarch_lp64
684 // LA32-FPU64-ILP32S-NOT: #define __loongarch_single_float
685 // LA32-FPU64-ILP32S: #define __loongarch_soft_float 1
687 // RUN: %clang --target=loongarch32 -mfpu=32 -mabi=ilp32f -x c -E -dM %s -o - \
688 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU32-ILP32F %s
689 // RUN: %clang --target=loongarch32 -msingle-float -x c -E -dM %s -o - \
690 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU32-ILP32F %s
691 // LA32-FPU32-ILP32F-NOT: #define __loongarch_double_float
692 // LA32-FPU32-ILP32F: #define __loongarch_frlen 32
693 // LA32-FPU32-ILP32F: #define __loongarch_grlen 32
694 // LA32-FPU32-ILP32F: #define __loongarch_hard_float 1
695 // LA32-FPU32-ILP32F-NOT: #define __loongarch_lp64
696 // LA32-FPU32-ILP32F: #define __loongarch_single_float 1
697 // LA32-FPU32-ILP32F-NOT: #define __loongarch_soft_float
699 // RUN: %clang --target=loongarch32 -mfpu=32 -mabi=ilp32s -x c -E -dM %s -o - \
700 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU32-ILP32S %s
701 // LA32-FPU32-ILP32S-NOT: #define __loongarch_double_float
702 // LA32-FPU32-ILP32S: #define __loongarch_frlen 32
703 // LA32-FPU32-ILP32S: #define __loongarch_grlen 32
704 // LA32-FPU32-ILP32S-NOT: #define __loongarch_hard_float
705 // LA32-FPU32-ILP32S-NOT: #define __loongarch_lp64
706 // LA32-FPU32-ILP32S-NOT: #define __loongarch_single_float
707 // LA32-FPU32-ILP32S: #define __loongarch_soft_float 1
709 // RUN: %clang --target=loongarch32 -mfpu=0 -mabi=ilp32s -x c -E -dM %s -o - \
710 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU0-ILP32S %s
711 // RUN: %clang --target=loongarch32 -mfpu=none -mabi=ilp32s -x c -E -dM %s -o - \
712 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU0-ILP32S %s
713 // RUN: %clang --target=loongarch32 -msoft-float -x c -E -dM %s -o - \
714 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU0-ILP32S %s
715 // LA32-FPU0-ILP32S-NOT: #define __loongarch_double_float
716 // LA32-FPU0-ILP32S: #define __loongarch_frlen 0
717 // LA32-FPU0-ILP32S: #define __loongarch_grlen 32
718 // LA32-FPU0-ILP32S-NOT: #define __loongarch_hard_float
719 // LA32-FPU0-ILP32S-NOT: #define __loongarch_lp64
720 // LA32-FPU0-ILP32S-NOT: #define __loongarch_single_float
721 // LA32-FPU0-ILP32S: #define __loongarch_soft_float 1
723 // RUN: %clang --target=loongarch64 -mfpu=64 -mabi=lp64d -x c -E -dM %s -o - \
724 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU64-LP64D %s
725 // RUN: %clang --target=loongarch64 -mdouble-float -x c -E -dM %s -o - \
726 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU64-LP64D %s
727 // LA64-FPU64-LP64D: #define __loongarch_double_float 1
728 // LA64-FPU64-LP64D: #define __loongarch_frlen 64
729 // LA64-FPU64-LP64D: #define __loongarch_grlen 64
730 // LA64-FPU64-LP64D: #define __loongarch_hard_float 1
731 // LA64-FPU64-LP64D: #define __loongarch_lp64 1
732 // LA64-FPU64-LP64D-NOT: #define __loongarch_single_float
733 // LA64-FPU64-LP64D-NOT: #define __loongarch_soft_float
735 // RUN: %clang --target=loongarch64 -mfpu=64 -mabi=lp64f -x c -E -dM %s -o - \
736 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU64-LP64F %s
737 // LA64-FPU64-LP64F-NOT: #define __loongarch_double_float
738 // LA64-FPU64-LP64F: #define __loongarch_frlen 64
739 // LA64-FPU64-LP64F: #define __loongarch_grlen 64
740 // LA64-FPU64-LP64F: #define __loongarch_hard_float 1
741 // LA64-FPU64-LP64F: #define __loongarch_lp64 1
742 // LA64-FPU64-LP64F: #define __loongarch_single_float 1
743 // LA64-FPU64-LP64F-NOT: #define __loongarch_soft_float
745 // RUN: %clang --target=loongarch64 -mfpu=64 -mabi=lp64s -x c -E -dM %s -o - \
746 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU64-LP64S %s
747 // LA64-FPU64-LP64S-NOT: #define __loongarch_double_float
748 // LA64-FPU64-LP64S: #define __loongarch_frlen 64
749 // LA64-FPU64-LP64S: #define __loongarch_grlen 64
750 // LA64-FPU64-LP64S-NOT: #define __loongarch_hard_float
751 // LA64-FPU64-LP64S: #define __loongarch_lp64 1
752 // LA64-FPU64-LP64S-NOT: #define __loongarch_single_float
753 // LA64-FPU64-LP64S: #define __loongarch_soft_float 1
755 // RUN: %clang --target=loongarch64 -mfpu=32 -mabi=lp64f -x c -E -dM %s -o - \
756 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU32-LP64F %s
757 // RUN: %clang --target=loongarch64 -msingle-float -x c -E -dM %s -o - \
758 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU32-LP64F %s
759 // LA64-FPU32-LP64F-NOT: #define __loongarch_double_float
760 // LA64-FPU32-LP64F: #define __loongarch_frlen 32
761 // LA64-FPU32-LP64F: #define __loongarch_grlen 64
762 // LA64-FPU32-LP64F: #define __loongarch_hard_float 1
763 // LA64-FPU32-LP64F: #define __loongarch_lp64 1
764 // LA64-FPU32-LP64F: #define __loongarch_single_float 1
765 // LA64-FPU32-LP64F-NOT: #define __loongarch_soft_float
767 // RUN: %clang --target=loongarch64 -mfpu=32 -mabi=lp64s -x c -E -dM %s -o - \
768 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU32-LP64S %s
769 // LA64-FPU32-LP64S-NOT: #define __loongarch_double_float
770 // LA64-FPU32-LP64S: #define __loongarch_frlen 32
771 // LA64-FPU32-LP64S: #define __loongarch_grlen 64
772 // LA64-FPU32-LP64S-NOT: #define __loongarch_hard_float
773 // LA64-FPU32-LP64S: #define __loongarch_lp64 1
774 // LA64-FPU32-LP64S-NOT: #define __loongarch_single_float
775 // LA64-FPU32-LP64S: #define __loongarch_soft_float 1
777 // RUN: %clang --target=loongarch64 -mfpu=0 -mabi=lp64s -x c -E -dM %s -o - \
778 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU0-LP64S %s
779 // RUN: %clang --target=loongarch64 -mfpu=none -mabi=lp64s -x c -E -dM %s -o - \
780 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU0-LP64S %s
781 // RUN: %clang --target=loongarch64 -msoft-float -x c -E -dM %s -o - \
782 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU0-LP64S %s
783 // LA64-FPU0-LP64S-NOT: #define __loongarch_double_float
784 // LA64-FPU0-LP64S: #define __loongarch_frlen 0
785 // LA64-FPU0-LP64S: #define __loongarch_grlen 64
786 // LA64-FPU0-LP64S-NOT: #define __loongarch_hard_float
787 // LA64-FPU0-LP64S: #define __loongarch_lp64 1
788 // LA64-FPU0-LP64S-NOT: #define __loongarch_single_float
789 // LA64-FPU0-LP64S: #define __loongarch_soft_float 1
791 /// Check __loongarch_arch and __loongarch_tune.
793 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - | \
794 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=loongarch64 -DTUNE=loongarch64 %s
795 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 | \
796 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=loongarch64 -DTUNE=loongarch64 %s
797 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la464 | \
798 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=la464 -DTUNE=la464 %s
799 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -mtune=loongarch64 | \
800 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=loongarch64 -DTUNE=loongarch64 %s
801 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -mtune=la464 | \
802 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=loongarch64 -DTUNE=la464 %s
803 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -mtune=la464 | \
804 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=loongarch64 -DTUNE=la464 %s
805 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la464 -mtune=loongarch64 | \
806 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=la464 -DTUNE=loongarch64 %s
808 // ARCH-TUNE: #define __loongarch_arch "[[ARCH]]"
809 // ARCH-TUNE: #define __loongarch_tune "[[TUNE]]"
811 // RUN: %clang --target=loongarch64 -mlsx -x c -E -dM %s -o - \
812 // RUN: | FileCheck --match-full-lines --check-prefix=MLSX %s
813 // RUN: %clang --target=loongarch64 -mno-lsx -mlsx -x c -E -dM %s -o - \
814 // RUN: | FileCheck --match-full-lines --check-prefix=MLSX %s
815 // RUN: %clang --target=loongarch64 -mlsx -mno-lasx -x c -E -dM %s -o - \
816 // RUN: | FileCheck --match-full-lines --check-prefix=MLSX %s
817 // RUN: %clang --target=loongarch64 -mno-lasx -mlsx -x c -E -dM %s -o - \
818 // RUN: | FileCheck --match-full-lines --check-prefix=MLSX %s
819 // MLSX-NOT: #define __loongarch_asx
820 // MLSX: #define __loongarch_sx 1
822 // RUN: %clang --target=loongarch64 -mlasx -x c -E -dM %s -o - \
823 // RUN: | FileCheck --match-full-lines --check-prefix=MLASX %s
824 // RUN: %clang --target=loongarch64 -mno-lasx -mlasx -x c -E -dM %s -o - \
825 // RUN: | FileCheck --match-full-lines --check-prefix=MLASX %s
826 // RUN: %clang --target=loongarch64 -mlsx -mlasx -x c -E -dM %s -o - \
827 // RUN: | FileCheck --match-full-lines --check-prefix=MLASX %s
828 // RUN: %clang --target=loongarch64 -mlasx -mlsx -x c -E -dM %s -o - \
829 // RUN: | FileCheck --match-full-lines --check-prefix=MLASX %s
830 // MLASX: #define __loongarch_asx 1
831 // MLASX: #define __loongarch_sx 1
833 // RUN: %clang --target=loongarch64 -mno-lsx -x c -E -dM %s -o - \
834 // RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
835 // RUN: %clang --target=loongarch64 -mlsx -mno-lsx -x c -E -dM %s -o - \
836 // RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
837 // RUN: %clang --target=loongarch64 -mno-lsx -mno-lasx -x c -E -dM %s -o - \
838 // RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
839 // RUN: %clang --target=loongarch64 -mno-lasx -mno-lsx -x c -E -dM %s -o - \
840 // RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
841 // RUN: %clang --target=loongarch64 -mno-lasx -x c -E -dM %s -o - \
842 // RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
843 // MNO-LSX-NOT: #define __loongarch_asx
844 // MNO-LSX-NOT: #define __loongarch_sx