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__ 1
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 __MEMORY_SCOPE_DEVICE 1
181 // LA32: #define __MEMORY_SCOPE_SINGLE 4
182 // LA32: #define __MEMORY_SCOPE_SYSTEM 0
183 // LA32: #define __MEMORY_SCOPE_WRKGRP 2
184 // LA32: #define __MEMORY_SCOPE_WVFRNT 3
185 // LA32: #define __NO_INLINE__ 1
186 // LA32: #define __NO_MATH_ERRNO__ 1
187 // LA32: #define __OBJC_BOOL_IS_BOOL 0
188 // LA32: #define __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES 3
189 // LA32: #define __OPENCL_MEMORY_SCOPE_DEVICE 2
190 // LA32: #define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
191 // LA32: #define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
192 // LA32: #define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
193 // LA32: #define __POINTER_WIDTH__ 32
194 // LA32: #define __PRAGMA_REDEFINE_EXTNAME 1
195 // LA32: #define __PTRDIFF_FMTd__ "d"
196 // LA32: #define __PTRDIFF_FMTi__ "i"
197 // LA32: #define __PTRDIFF_MAX__ 2147483647
198 // LA32: #define __PTRDIFF_TYPE__ int
199 // LA32: #define __PTRDIFF_WIDTH__ 32
200 // LA32: #define __SCHAR_MAX__ 127
201 // LA32: #define __SHRT_MAX__ 32767
202 // LA32: #define __SHRT_WIDTH__ 16
203 // LA32: #define __SIG_ATOMIC_MAX__ 2147483647
204 // LA32: #define __SIG_ATOMIC_WIDTH__ 32
205 // LA32: #define __SIZEOF_DOUBLE__ 8
206 // LA32: #define __SIZEOF_FLOAT__ 4
207 // LA32-INT128: #define __SIZEOF_INT128__ 16
208 // LA32: #define __SIZEOF_INT__ 4
209 // LA32: #define __SIZEOF_LONG_DOUBLE__ 16
210 // LA32: #define __SIZEOF_LONG_LONG__ 8
211 // LA32: #define __SIZEOF_LONG__ 4
212 // LA32: #define __SIZEOF_POINTER__ 4
213 // LA32: #define __SIZEOF_PTRDIFF_T__ 4
214 // LA32: #define __SIZEOF_SHORT__ 2
215 // LA32: #define __SIZEOF_SIZE_T__ 4
216 // LA32: #define __SIZEOF_WCHAR_T__ 4
217 // LA32: #define __SIZEOF_WINT_T__ 4
218 // LA32: #define __SIZE_FMTX__ "X"
219 // LA32: #define __SIZE_FMTo__ "o"
220 // LA32: #define __SIZE_FMTu__ "u"
221 // LA32: #define __SIZE_FMTx__ "x"
222 // LA32: #define __SIZE_MAX__ 4294967295U
223 // LA32: #define __SIZE_TYPE__ unsigned int
224 // LA32: #define __SIZE_WIDTH__ 32
225 // LA32: #define __STDC_HOSTED__ 0
226 // LA32: #define __STDC_UTF_16__ 1
227 // LA32: #define __STDC_UTF_32__ 1
228 // LA32: #define __STDC_VERSION__ 201710L
229 // LA32: #define __STDC__ 1
230 // LA32: #define __UINT16_C_SUFFIX__
231 // LA32: #define __UINT16_FMTX__ "hX"
232 // LA32: #define __UINT16_FMTo__ "ho"
233 // LA32: #define __UINT16_FMTu__ "hu"
234 // LA32: #define __UINT16_FMTx__ "hx"
235 // LA32: #define __UINT16_MAX__ 65535
236 // LA32: #define __UINT16_TYPE__ unsigned short
237 // LA32: #define __UINT32_C_SUFFIX__ U
238 // LA32: #define __UINT32_FMTX__ "X"
239 // LA32: #define __UINT32_FMTo__ "o"
240 // LA32: #define __UINT32_FMTu__ "u"
241 // LA32: #define __UINT32_FMTx__ "x"
242 // LA32: #define __UINT32_MAX__ 4294967295U
243 // LA32: #define __UINT32_TYPE__ unsigned int
244 // LA32: #define __UINT64_C_SUFFIX__ ULL
245 // LA32: #define __UINT64_FMTX__ "llX"
246 // LA32: #define __UINT64_FMTo__ "llo"
247 // LA32: #define __UINT64_FMTu__ "llu"
248 // LA32: #define __UINT64_FMTx__ "llx"
249 // LA32: #define __UINT64_MAX__ 18446744073709551615ULL
250 // LA32: #define __UINT64_TYPE__ long long unsigned int
251 // LA32: #define __UINT8_C_SUFFIX__
252 // LA32: #define __UINT8_FMTX__ "hhX"
253 // LA32: #define __UINT8_FMTo__ "hho"
254 // LA32: #define __UINT8_FMTu__ "hhu"
255 // LA32: #define __UINT8_FMTx__ "hhx"
256 // LA32: #define __UINT8_MAX__ 255
257 // LA32: #define __UINT8_TYPE__ unsigned char
258 // LA32: #define __UINTMAX_C_SUFFIX__ ULL
259 // LA32: #define __UINTMAX_FMTX__ "llX"
260 // LA32: #define __UINTMAX_FMTo__ "llo"
261 // LA32: #define __UINTMAX_FMTu__ "llu"
262 // LA32: #define __UINTMAX_FMTx__ "llx"
263 // LA32: #define __UINTMAX_MAX__ 18446744073709551615ULL
264 // LA32: #define __UINTMAX_TYPE__ long long unsigned int
265 // LA32: #define __UINTMAX_WIDTH__ 64
266 // LA32: #define __UINTPTR_FMTX__ "X"
267 // LA32: #define __UINTPTR_FMTo__ "o"
268 // LA32: #define __UINTPTR_FMTu__ "u"
269 // LA32: #define __UINTPTR_FMTx__ "x"
270 // LA32: #define __UINTPTR_MAX__ 4294967295U
271 // LA32: #define __UINTPTR_TYPE__ unsigned int
272 // LA32: #define __UINTPTR_WIDTH__ 32
273 // LA32: #define __UINT_FAST16_FMTX__ "hX"
274 // LA32: #define __UINT_FAST16_FMTo__ "ho"
275 // LA32: #define __UINT_FAST16_FMTu__ "hu"
276 // LA32: #define __UINT_FAST16_FMTx__ "hx"
277 // LA32: #define __UINT_FAST16_MAX__ 65535
278 // TODO: LoongArch GCC defines UINT_FAST16 to be long unsigned int
279 // LA32: #define __UINT_FAST16_TYPE__ unsigned short
280 // LA32: #define __UINT_FAST32_FMTX__ "X"
281 // LA32: #define __UINT_FAST32_FMTo__ "o"
282 // LA32: #define __UINT_FAST32_FMTu__ "u"
283 // LA32: #define __UINT_FAST32_FMTx__ "x"
284 // LA32: #define __UINT_FAST32_MAX__ 4294967295U
285 // LA32: #define __UINT_FAST32_TYPE__ unsigned int
286 // LA32: #define __UINT_FAST64_FMTX__ "llX"
287 // LA32: #define __UINT_FAST64_FMTo__ "llo"
288 // LA32: #define __UINT_FAST64_FMTu__ "llu"
289 // LA32: #define __UINT_FAST64_FMTx__ "llx"
290 // LA32: #define __UINT_FAST64_MAX__ 18446744073709551615ULL
291 // LA32: #define __UINT_FAST64_TYPE__ long long unsigned int
292 // LA32: #define __UINT_FAST8_FMTX__ "hhX"
293 // LA32: #define __UINT_FAST8_FMTo__ "hho"
294 // LA32: #define __UINT_FAST8_FMTu__ "hhu"
295 // LA32: #define __UINT_FAST8_FMTx__ "hhx"
296 // LA32: #define __UINT_FAST8_MAX__ 255
297 // LA32: #define __UINT_FAST8_TYPE__ unsigned char
298 // LA32: #define __UINT_LEAST16_FMTX__ "hX"
299 // LA32: #define __UINT_LEAST16_FMTo__ "ho"
300 // LA32: #define __UINT_LEAST16_FMTu__ "hu"
301 // LA32: #define __UINT_LEAST16_FMTx__ "hx"
302 // LA32: #define __UINT_LEAST16_MAX__ 65535
303 // LA32: #define __UINT_LEAST16_TYPE__ unsigned short
304 // LA32: #define __UINT_LEAST32_FMTX__ "X"
305 // LA32: #define __UINT_LEAST32_FMTo__ "o"
306 // LA32: #define __UINT_LEAST32_FMTu__ "u"
307 // LA32: #define __UINT_LEAST32_FMTx__ "x"
308 // LA32: #define __UINT_LEAST32_MAX__ 4294967295U
309 // LA32: #define __UINT_LEAST32_TYPE__ unsigned int
310 // LA32: #define __UINT_LEAST64_FMTX__ "llX"
311 // LA32: #define __UINT_LEAST64_FMTo__ "llo"
312 // LA32: #define __UINT_LEAST64_FMTu__ "llu"
313 // LA32: #define __UINT_LEAST64_FMTx__ "llx"
314 // LA32: #define __UINT_LEAST64_MAX__ 18446744073709551615ULL
315 // LA32: #define __UINT_LEAST64_TYPE__ long long unsigned int
316 // LA32: #define __UINT_LEAST8_FMTX__ "hhX"
317 // LA32: #define __UINT_LEAST8_FMTo__ "hho"
318 // LA32: #define __UINT_LEAST8_FMTu__ "hhu"
319 // LA32: #define __UINT_LEAST8_FMTx__ "hhx"
320 // LA32: #define __UINT_LEAST8_MAX__ 255
321 // LA32: #define __UINT_LEAST8_TYPE__ unsigned char
322 // LA32: #define __USER_LABEL_PREFIX__
323 // LA32: #define __WCHAR_MAX__ 2147483647
324 // LA32: #define __WCHAR_TYPE__ int
325 // LA32: #define __WCHAR_WIDTH__ 32
326 // LA32: #define __WINT_MAX__ 4294967295U
327 // LA32: #define __WINT_TYPE__ unsigned int
328 // LA32: #define __WINT_UNSIGNED__ 1
329 // LA32: #define __WINT_WIDTH__ 32
330 // LA32-LINUX: #define __gnu_linux__ 1
331 // LA32-LINUX: #define __linux 1
332 // LA32-LINUX: #define __linux__ 1
333 // LA32-NOT: #define __loongarch64 1
334 // LA32: #define __loongarch__ 1
335 // LA32-LINUX: #define __unix 1
336 // LA32-LINUX: #define __unix__ 1
337 // LA32-LINUX: #define linux 1
338 // LA32-LINUX: #define unix 1
340 // LA64: #define _LP64 1
341 // LA64: #define __ATOMIC_ACQUIRE 2
342 // LA64-NEXT: #define __ATOMIC_ACQ_REL 4
343 // LA64-NEXT: #define __ATOMIC_CONSUME 1
344 // LA64-NEXT: #define __ATOMIC_RELAXED 0
345 // LA64-NEXT: #define __ATOMIC_RELEASE 3
346 // LA64-NEXT: #define __ATOMIC_SEQ_CST 5
347 // LA64: #define __BIGGEST_ALIGNMENT__ 16
348 // LA64: #define __BITINT_MAXWIDTH__ 128
349 // LA64: #define __BOOL_WIDTH__ 1
350 // LA64: #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
351 // LA64: #define __CHAR16_TYPE__ unsigned short
352 // LA64: #define __CHAR32_TYPE__ unsigned int
353 // LA64: #define __CHAR_BIT__ 8
354 // LA64: #define __CLANG_ATOMIC_BOOL_LOCK_FREE 2
355 // LA64: #define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 2
356 // LA64: #define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 2
357 // LA64: #define __CLANG_ATOMIC_CHAR_LOCK_FREE 2
358 // LA64: #define __CLANG_ATOMIC_INT_LOCK_FREE 2
359 // LA64: #define __CLANG_ATOMIC_LLONG_LOCK_FREE 2
360 // LA64: #define __CLANG_ATOMIC_LONG_LOCK_FREE 2
361 // LA64: #define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
362 // LA64: #define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
363 // LA64: #define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
364 // LA64: #define __DBL_DECIMAL_DIG__ 17
365 // LA64: #define __DBL_DENORM_MIN__ 4.9406564584124654e-324
366 // LA64: #define __DBL_DIG__ 15
367 // LA64: #define __DBL_EPSILON__ 2.2204460492503131e-16
368 // LA64: #define __DBL_HAS_DENORM__ 1
369 // LA64: #define __DBL_HAS_INFINITY__ 1
370 // LA64: #define __DBL_HAS_QUIET_NAN__ 1
371 // LA64: #define __DBL_MANT_DIG__ 53
372 // LA64: #define __DBL_MAX_10_EXP__ 308
373 // LA64: #define __DBL_MAX_EXP__ 1024
374 // LA64: #define __DBL_MAX__ 1.7976931348623157e+308
375 // LA64: #define __DBL_MIN_10_EXP__ (-307)
376 // LA64: #define __DBL_MIN_EXP__ (-1021)
377 // LA64: #define __DBL_MIN__ 2.2250738585072014e-308
378 // LA64: #define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
379 // LA64: #define __FLT_DECIMAL_DIG__ 9
380 // LA64: #define __FLT_DENORM_MIN__ 1.40129846e-45F
381 // LA64: #define __FLT_DIG__ 6
382 // LA64: #define __FLT_EPSILON__ 1.19209290e-7F
383 // LA64: #define __FLT_HAS_DENORM__ 1
384 // LA64: #define __FLT_HAS_INFINITY__ 1
385 // LA64: #define __FLT_HAS_QUIET_NAN__ 1
386 // LA64: #define __FLT_MANT_DIG__ 24
387 // LA64: #define __FLT_MAX_10_EXP__ 38
388 // LA64: #define __FLT_MAX_EXP__ 128
389 // LA64: #define __FLT_MAX__ 3.40282347e+38F
390 // LA64: #define __FLT_MIN_10_EXP__ (-37)
391 // LA64: #define __FLT_MIN_EXP__ (-125)
392 // LA64: #define __FLT_MIN__ 1.17549435e-38F
393 // LA64: #define __FLT_RADIX__ 2
394 // LA64: #define __GCC_ATOMIC_BOOL_LOCK_FREE 2
395 // LA64: #define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
396 // LA64: #define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
397 // LA64: #define __GCC_ATOMIC_CHAR_LOCK_FREE 2
398 // LA64: #define __GCC_ATOMIC_INT_LOCK_FREE 2
399 // LA64: #define __GCC_ATOMIC_LLONG_LOCK_FREE 2
400 // LA64: #define __GCC_ATOMIC_LONG_LOCK_FREE 2
401 // LA64: #define __GCC_ATOMIC_POINTER_LOCK_FREE 2
402 // LA64: #define __GCC_ATOMIC_SHORT_LOCK_FREE 2
403 // LA64: #define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
404 // LA64: #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
405 // LA64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
406 // LA64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
407 // LA64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
408 // LA64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
409 // LA64: #define __INT16_C_SUFFIX__
410 // LA64: #define __INT16_FMTd__ "hd"
411 // LA64: #define __INT16_FMTi__ "hi"
412 // LA64: #define __INT16_MAX__ 32767
413 // LA64: #define __INT16_TYPE__ short
414 // LA64: #define __INT32_C_SUFFIX__
415 // LA64: #define __INT32_FMTd__ "d"
416 // LA64: #define __INT32_FMTi__ "i"
417 // LA64: #define __INT32_MAX__ 2147483647
418 // LA64: #define __INT32_TYPE__ int
419 // LA64: #define __INT64_C_SUFFIX__ L
420 // LA64: #define __INT64_FMTd__ "ld"
421 // LA64: #define __INT64_FMTi__ "li"
422 // LA64: #define __INT64_MAX__ 9223372036854775807L
423 // LA64: #define __INT64_TYPE__ long int
424 // LA64: #define __INT8_C_SUFFIX__
425 // LA64: #define __INT8_FMTd__ "hhd"
426 // LA64: #define __INT8_FMTi__ "hhi"
427 // LA64: #define __INT8_MAX__ 127
428 // LA64: #define __INT8_TYPE__ signed char
429 // LA64: #define __INTMAX_C_SUFFIX__ L
430 // LA64: #define __INTMAX_FMTd__ "ld"
431 // LA64: #define __INTMAX_FMTi__ "li"
432 // LA64: #define __INTMAX_MAX__ 9223372036854775807L
433 // LA64: #define __INTMAX_TYPE__ long int
434 // LA64: #define __INTMAX_WIDTH__ 64
435 // LA64: #define __INTPTR_FMTd__ "ld"
436 // LA64: #define __INTPTR_FMTi__ "li"
437 // LA64: #define __INTPTR_MAX__ 9223372036854775807L
438 // LA64: #define __INTPTR_TYPE__ long int
439 // LA64: #define __INTPTR_WIDTH__ 64
440 // LA64: #define __INT_FAST16_FMTd__ "hd"
441 // LA64: #define __INT_FAST16_FMTi__ "hi"
442 // LA64: #define __INT_FAST16_MAX__ 32767
443 // LA64: #define __INT_FAST16_TYPE__ short
444 // LA64: #define __INT_FAST16_WIDTH__ 16
445 // LA64: #define __INT_FAST32_FMTd__ "d"
446 // LA64: #define __INT_FAST32_FMTi__ "i"
447 // LA64: #define __INT_FAST32_MAX__ 2147483647
448 // LA64: #define __INT_FAST32_TYPE__ int
449 // LA64: #define __INT_FAST32_WIDTH__ 32
450 // LA64: #define __INT_FAST64_FMTd__ "ld"
451 // LA64: #define __INT_FAST64_FMTi__ "li"
452 // LA64: #define __INT_FAST64_MAX__ 9223372036854775807L
453 // LA64: #define __INT_FAST64_TYPE__ long int
454 // LA64: #define __INT_FAST64_WIDTH__ 64
455 // LA64: #define __INT_FAST8_FMTd__ "hhd"
456 // LA64: #define __INT_FAST8_FMTi__ "hhi"
457 // LA64: #define __INT_FAST8_MAX__ 127
458 // LA64: #define __INT_FAST8_TYPE__ signed char
459 // LA64: #define __INT_FAST8_WIDTH__ 8
460 // LA64: #define __INT_LEAST16_FMTd__ "hd"
461 // LA64: #define __INT_LEAST16_FMTi__ "hi"
462 // LA64: #define __INT_LEAST16_MAX__ 32767
463 // LA64: #define __INT_LEAST16_TYPE__ short
464 // LA64: #define __INT_LEAST16_WIDTH__ 16
465 // LA64: #define __INT_LEAST32_FMTd__ "d"
466 // LA64: #define __INT_LEAST32_FMTi__ "i"
467 // LA64: #define __INT_LEAST32_MAX__ 2147483647
468 // LA64: #define __INT_LEAST32_TYPE__ int
469 // LA64: #define __INT_LEAST32_WIDTH__ 32
470 // LA64: #define __INT_LEAST64_FMTd__ "ld"
471 // LA64: #define __INT_LEAST64_FMTi__ "li"
472 // LA64: #define __INT_LEAST64_MAX__ 9223372036854775807L
473 // LA64: #define __INT_LEAST64_TYPE__ long int
474 // LA64: #define __INT_LEAST64_WIDTH__ 64
475 // LA64: #define __INT_LEAST8_FMTd__ "hhd"
476 // LA64: #define __INT_LEAST8_FMTi__ "hhi"
477 // LA64: #define __INT_LEAST8_MAX__ 127
478 // LA64: #define __INT_LEAST8_TYPE__ signed char
479 // LA64: #define __INT_LEAST8_WIDTH__ 8
480 // LA64: #define __INT_MAX__ 2147483647
481 // LA64: #define __INT_WIDTH__ 32
482 // LA64: #define __LDBL_DECIMAL_DIG__ 36
483 // LA64: #define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
484 // LA64: #define __LDBL_DIG__ 33
485 // LA64: #define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L
486 // LA64: #define __LDBL_HAS_DENORM__ 1
487 // LA64: #define __LDBL_HAS_INFINITY__ 1
488 // LA64: #define __LDBL_HAS_QUIET_NAN__ 1
489 // LA64: #define __LDBL_MANT_DIG__ 113
490 // LA64: #define __LDBL_MAX_10_EXP__ 4932
491 // LA64: #define __LDBL_MAX_EXP__ 16384
492 // LA64: #define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L
493 // LA64: #define __LDBL_MIN_10_EXP__ (-4931)
494 // LA64: #define __LDBL_MIN_EXP__ (-16381)
495 // LA64: #define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
496 // LA64: #define __LITTLE_ENDIAN__ 1
497 // LA64: #define __LLONG_WIDTH__ 64
498 // LA64: #define __LONG_LONG_MAX__ 9223372036854775807LL
499 // LA64: #define __LONG_MAX__ 9223372036854775807L
500 // LA64: #define __LONG_WIDTH__ 64
501 // LA64: #define __LP64__ 1
502 // LA64: #define __MEMORY_SCOPE_DEVICE 1
503 // LA64: #define __MEMORY_SCOPE_SINGLE 4
504 // LA64: #define __MEMORY_SCOPE_SYSTEM 0
505 // LA64: #define __MEMORY_SCOPE_WRKGRP 2
506 // LA64: #define __MEMORY_SCOPE_WVFRNT 3
507 // LA64: #define __NO_INLINE__ 1
508 // LA64: #define __NO_MATH_ERRNO__ 1
509 // LA64: #define __OBJC_BOOL_IS_BOOL 0
510 // LA64: #define __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES 3
511 // LA64: #define __OPENCL_MEMORY_SCOPE_DEVICE 2
512 // LA64: #define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
513 // LA64: #define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
514 // LA64: #define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
515 // LA64: #define __POINTER_WIDTH__ 64
516 // LA64: #define __PRAGMA_REDEFINE_EXTNAME 1
517 // LA64: #define __PTRDIFF_FMTd__ "ld"
518 // LA64: #define __PTRDIFF_FMTi__ "li"
519 // LA64: #define __PTRDIFF_MAX__ 9223372036854775807L
520 // LA64: #define __PTRDIFF_TYPE__ long int
521 // LA64: #define __PTRDIFF_WIDTH__ 64
522 // LA64: #define __SCHAR_MAX__ 127
523 // LA64: #define __SHRT_MAX__ 32767
524 // LA64: #define __SHRT_WIDTH__ 16
525 // LA64: #define __SIG_ATOMIC_MAX__ 2147483647
526 // LA64: #define __SIG_ATOMIC_WIDTH__ 32
527 // LA64: #define __SIZEOF_DOUBLE__ 8
528 // LA64: #define __SIZEOF_FLOAT__ 4
529 // LA64-INT128: #define __SIZEOF_INT128__ 16
530 // LA64: #define __SIZEOF_INT__ 4
531 // LA64: #define __SIZEOF_LONG_DOUBLE__ 16
532 // LA64: #define __SIZEOF_LONG_LONG__ 8
533 // LA64: #define __SIZEOF_LONG__ 8
534 // LA64: #define __SIZEOF_POINTER__ 8
535 // LA64: #define __SIZEOF_PTRDIFF_T__ 8
536 // LA64: #define __SIZEOF_SHORT__ 2
537 // LA64: #define __SIZEOF_SIZE_T__ 8
538 // LA64: #define __SIZEOF_WCHAR_T__ 4
539 // LA64: #define __SIZEOF_WINT_T__ 4
540 // LA64: #define __SIZE_FMTX__ "lX"
541 // LA64: #define __SIZE_FMTo__ "lo"
542 // LA64: #define __SIZE_FMTu__ "lu"
543 // LA64: #define __SIZE_FMTx__ "lx"
544 // LA64: #define __SIZE_MAX__ 18446744073709551615UL
545 // LA64: #define __SIZE_TYPE__ long unsigned int
546 // LA64: #define __SIZE_WIDTH__ 64
547 // LA64: #define __STDC_HOSTED__ 0
548 // LA64: #define __STDC_UTF_16__ 1
549 // LA64: #define __STDC_UTF_32__ 1
550 // LA64: #define __STDC_VERSION__ 201710L
551 // LA64: #define __STDC__ 1
552 // LA64: #define __UINT16_C_SUFFIX__
553 // LA64: #define __UINT16_FMTX__ "hX"
554 // LA64: #define __UINT16_FMTo__ "ho"
555 // LA64: #define __UINT16_FMTu__ "hu"
556 // LA64: #define __UINT16_FMTx__ "hx"
557 // LA64: #define __UINT16_MAX__ 65535
558 // LA64: #define __UINT16_TYPE__ unsigned short
559 // LA64: #define __UINT32_C_SUFFIX__ U
560 // LA64: #define __UINT32_FMTX__ "X"
561 // LA64: #define __UINT32_FMTo__ "o"
562 // LA64: #define __UINT32_FMTu__ "u"
563 // LA64: #define __UINT32_FMTx__ "x"
564 // LA64: #define __UINT32_MAX__ 4294967295U
565 // LA64: #define __UINT32_TYPE__ unsigned int
566 // LA64: #define __UINT64_C_SUFFIX__ UL
567 // LA64: #define __UINT64_FMTX__ "lX"
568 // LA64: #define __UINT64_FMTo__ "lo"
569 // LA64: #define __UINT64_FMTu__ "lu"
570 // LA64: #define __UINT64_FMTx__ "lx"
571 // LA64: #define __UINT64_MAX__ 18446744073709551615UL
572 // LA64: #define __UINT64_TYPE__ long unsigned int
573 // LA64: #define __UINT8_C_SUFFIX__
574 // LA64: #define __UINT8_FMTX__ "hhX"
575 // LA64: #define __UINT8_FMTo__ "hho"
576 // LA64: #define __UINT8_FMTu__ "hhu"
577 // LA64: #define __UINT8_FMTx__ "hhx"
578 // LA64: #define __UINT8_MAX__ 255
579 // LA64: #define __UINT8_TYPE__ unsigned char
580 // LA64: #define __UINTMAX_C_SUFFIX__ UL
581 // LA64: #define __UINTMAX_FMTX__ "lX"
582 // LA64: #define __UINTMAX_FMTo__ "lo"
583 // LA64: #define __UINTMAX_FMTu__ "lu"
584 // LA64: #define __UINTMAX_FMTx__ "lx"
585 // LA64: #define __UINTMAX_MAX__ 18446744073709551615UL
586 // LA64: #define __UINTMAX_TYPE__ long unsigned int
587 // LA64: #define __UINTMAX_WIDTH__ 64
588 // LA64: #define __UINTPTR_FMTX__ "lX"
589 // LA64: #define __UINTPTR_FMTo__ "lo"
590 // LA64: #define __UINTPTR_FMTu__ "lu"
591 // LA64: #define __UINTPTR_FMTx__ "lx"
592 // LA64: #define __UINTPTR_MAX__ 18446744073709551615UL
593 // LA64: #define __UINTPTR_TYPE__ long unsigned int
594 // LA64: #define __UINTPTR_WIDTH__ 64
595 // LA64: #define __UINT_FAST16_FMTX__ "hX"
596 // LA64: #define __UINT_FAST16_FMTo__ "ho"
597 // LA64: #define __UINT_FAST16_FMTu__ "hu"
598 // LA64: #define __UINT_FAST16_FMTx__ "hx"
599 // LA64: #define __UINT_FAST16_MAX__ 65535
600 // TODO: LoongArch GCC defines UINT_FAST16 to be long unsigned int
601 // LA64: #define __UINT_FAST16_TYPE__ unsigned short
602 // LA64: #define __UINT_FAST32_FMTX__ "X"
603 // LA64: #define __UINT_FAST32_FMTo__ "o"
604 // LA64: #define __UINT_FAST32_FMTu__ "u"
605 // LA64: #define __UINT_FAST32_FMTx__ "x"
606 // LA64: #define __UINT_FAST32_MAX__ 4294967295U
607 // LA64: #define __UINT_FAST32_TYPE__ unsigned int
608 // LA64: #define __UINT_FAST64_FMTX__ "lX"
609 // LA64: #define __UINT_FAST64_FMTo__ "lo"
610 // LA64: #define __UINT_FAST64_FMTu__ "lu"
611 // LA64: #define __UINT_FAST64_FMTx__ "lx"
612 // LA64: #define __UINT_FAST64_MAX__ 18446744073709551615UL
613 // LA64: #define __UINT_FAST64_TYPE__ long unsigned int
614 // LA64: #define __UINT_FAST8_FMTX__ "hhX"
615 // LA64: #define __UINT_FAST8_FMTo__ "hho"
616 // LA64: #define __UINT_FAST8_FMTu__ "hhu"
617 // LA64: #define __UINT_FAST8_FMTx__ "hhx"
618 // LA64: #define __UINT_FAST8_MAX__ 255
619 // LA64: #define __UINT_FAST8_TYPE__ unsigned char
620 // LA64: #define __UINT_LEAST16_FMTX__ "hX"
621 // LA64: #define __UINT_LEAST16_FMTo__ "ho"
622 // LA64: #define __UINT_LEAST16_FMTu__ "hu"
623 // LA64: #define __UINT_LEAST16_FMTx__ "hx"
624 // LA64: #define __UINT_LEAST16_MAX__ 65535
625 // LA64: #define __UINT_LEAST16_TYPE__ unsigned short
626 // LA64: #define __UINT_LEAST32_FMTX__ "X"
627 // LA64: #define __UINT_LEAST32_FMTo__ "o"
628 // LA64: #define __UINT_LEAST32_FMTu__ "u"
629 // LA64: #define __UINT_LEAST32_FMTx__ "x"
630 // LA64: #define __UINT_LEAST32_MAX__ 4294967295U
631 // LA64: #define __UINT_LEAST32_TYPE__ unsigned int
632 // LA64: #define __UINT_LEAST64_FMTX__ "lX"
633 // LA64: #define __UINT_LEAST64_FMTo__ "lo"
634 // LA64: #define __UINT_LEAST64_FMTu__ "lu"
635 // LA64: #define __UINT_LEAST64_FMTx__ "lx"
636 // LA64: #define __UINT_LEAST64_MAX__ 18446744073709551615UL
637 // LA64: #define __UINT_LEAST64_TYPE__ long unsigned int
638 // LA64: #define __UINT_LEAST8_FMTX__ "hhX"
639 // LA64: #define __UINT_LEAST8_FMTo__ "hho"
640 // LA64: #define __UINT_LEAST8_FMTu__ "hhu"
641 // LA64: #define __UINT_LEAST8_FMTx__ "hhx"
642 // LA64: #define __UINT_LEAST8_MAX__ 255
643 // LA64: #define __UINT_LEAST8_TYPE__ unsigned char
644 // LA64: #define __USER_LABEL_PREFIX__
645 // LA64: #define __WCHAR_MAX__ 2147483647
646 // LA64: #define __WCHAR_TYPE__ int
647 // LA64: #define __WCHAR_WIDTH__ 32
648 // LA64: #define __WINT_MAX__ 4294967295U
649 // LA64: #define __WINT_TYPE__ unsigned int
650 // LA64: #define __WINT_UNSIGNED__ 1
651 // LA64: #define __WINT_WIDTH__ 32
652 // LA64-LINUX: #define __gnu_linux__ 1
653 // LA64-LINUX: #define __linux 1
654 // LA64-LINUX: #define __linux__ 1
655 // LA64: #define __loongarch64 1
656 // LA64: #define __loongarch__ 1
657 // LA64-LINUX: #define __unix 1
658 // LA64-LINUX: #define __unix__ 1
659 // LA64-LINUX: #define linux 1
660 // LA64-LINUX: #define unix 1
663 /// Check __loongarch_{double,single,hard,soft}_float, __loongarch_{gr,fr}len, __loongarch_lp64.
665 // RUN: %clang --target=loongarch32 -mfpu=64 -mabi=ilp32d -x c -E -dM %s -o - \
666 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU64-ILP32D %s
667 // RUN: %clang --target=loongarch32 -mdouble-float -x c -E -dM %s -o - \
668 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU64-ILP32D %s
669 // LA32-FPU64-ILP32D: #define __loongarch_double_float 1
670 // LA32-FPU64-ILP32D: #define __loongarch_frlen 64
671 // LA32-FPU64-ILP32D: #define __loongarch_grlen 32
672 // LA32-FPU64-ILP32D: #define __loongarch_hard_float 1
673 // LA32-FPU64-ILP32D-NOT: #define __loongarch_lp64
674 // LA32-FPU64-ILP32D-NOT: #define __loongarch_single_float
675 // LA32-FPU64-ILP32D-NOT: #define __loongarch_soft_float
677 // RUN: %clang --target=loongarch32 -mfpu=64 -mabi=ilp32f -x c -E -dM %s -o - \
678 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU64-ILP32F %s
679 // LA32-FPU64-ILP32F-NOT: #define __loongarch_double_float
680 // LA32-FPU64-ILP32F: #define __loongarch_frlen 64
681 // LA32-FPU64-ILP32F: #define __loongarch_grlen 32
682 // LA32-FPU64-ILP32F: #define __loongarch_hard_float 1
683 // LA32-FPU64-ILP32F-NOT: #define __loongarch_lp64
684 // LA32-FPU64-ILP32F: #define __loongarch_single_float 1
685 // LA32-FPU64-ILP32F-NOT: #define __loongarch_soft_float
687 // RUN: %clang --target=loongarch32 -mfpu=64 -mabi=ilp32s -x c -E -dM %s -o - \
688 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU64-ILP32S %s
689 // LA32-FPU64-ILP32S-NOT: #define __loongarch_double_float
690 // LA32-FPU64-ILP32S: #define __loongarch_frlen 64
691 // LA32-FPU64-ILP32S: #define __loongarch_grlen 32
692 // LA32-FPU64-ILP32S-NOT: #define __loongarch_hard_float
693 // LA32-FPU64-ILP32S-NOT: #define __loongarch_lp64
694 // LA32-FPU64-ILP32S-NOT: #define __loongarch_single_float
695 // LA32-FPU64-ILP32S: #define __loongarch_soft_float 1
697 // RUN: %clang --target=loongarch32 -mfpu=32 -mabi=ilp32f -x c -E -dM %s -o - \
698 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU32-ILP32F %s
699 // RUN: %clang --target=loongarch32 -msingle-float -x c -E -dM %s -o - \
700 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU32-ILP32F %s
701 // LA32-FPU32-ILP32F-NOT: #define __loongarch_double_float
702 // LA32-FPU32-ILP32F: #define __loongarch_frlen 32
703 // LA32-FPU32-ILP32F: #define __loongarch_grlen 32
704 // LA32-FPU32-ILP32F: #define __loongarch_hard_float 1
705 // LA32-FPU32-ILP32F-NOT: #define __loongarch_lp64
706 // LA32-FPU32-ILP32F: #define __loongarch_single_float 1
707 // LA32-FPU32-ILP32F-NOT: #define __loongarch_soft_float
709 // RUN: %clang --target=loongarch32 -mfpu=32 -mabi=ilp32s -x c -E -dM %s -o - \
710 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU32-ILP32S %s
711 // LA32-FPU32-ILP32S-NOT: #define __loongarch_double_float
712 // LA32-FPU32-ILP32S: #define __loongarch_frlen 32
713 // LA32-FPU32-ILP32S: #define __loongarch_grlen 32
714 // LA32-FPU32-ILP32S-NOT: #define __loongarch_hard_float
715 // LA32-FPU32-ILP32S-NOT: #define __loongarch_lp64
716 // LA32-FPU32-ILP32S-NOT: #define __loongarch_single_float
717 // LA32-FPU32-ILP32S: #define __loongarch_soft_float 1
719 // RUN: %clang --target=loongarch32 -mfpu=0 -mabi=ilp32s -x c -E -dM %s -o - \
720 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU0-ILP32S %s
721 // RUN: %clang --target=loongarch32 -mfpu=none -mabi=ilp32s -x c -E -dM %s -o - \
722 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU0-ILP32S %s
723 // RUN: %clang --target=loongarch32 -msoft-float -x c -E -dM %s -o - \
724 // RUN: | FileCheck --match-full-lines --check-prefix=LA32-FPU0-ILP32S %s
725 // LA32-FPU0-ILP32S-NOT: #define __loongarch_double_float
726 // LA32-FPU0-ILP32S: #define __loongarch_frlen 0
727 // LA32-FPU0-ILP32S: #define __loongarch_grlen 32
728 // LA32-FPU0-ILP32S-NOT: #define __loongarch_hard_float
729 // LA32-FPU0-ILP32S-NOT: #define __loongarch_lp64
730 // LA32-FPU0-ILP32S-NOT: #define __loongarch_single_float
731 // LA32-FPU0-ILP32S: #define __loongarch_soft_float 1
733 // RUN: %clang --target=loongarch64 -mfpu=64 -mabi=lp64d -x c -E -dM %s -o - \
734 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU64-LP64D %s
735 // RUN: %clang --target=loongarch64 -mdouble-float -x c -E -dM %s -o - \
736 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU64-LP64D %s
737 // LA64-FPU64-LP64D: #define __loongarch_double_float 1
738 // LA64-FPU64-LP64D: #define __loongarch_frlen 64
739 // LA64-FPU64-LP64D: #define __loongarch_grlen 64
740 // LA64-FPU64-LP64D: #define __loongarch_hard_float 1
741 // LA64-FPU64-LP64D: #define __loongarch_lp64 1
742 // LA64-FPU64-LP64D-NOT: #define __loongarch_single_float
743 // LA64-FPU64-LP64D-NOT: #define __loongarch_soft_float
745 // RUN: %clang --target=loongarch64 -mfpu=64 -mabi=lp64f -x c -E -dM %s -o - \
746 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU64-LP64F %s
747 // LA64-FPU64-LP64F-NOT: #define __loongarch_double_float
748 // LA64-FPU64-LP64F: #define __loongarch_frlen 64
749 // LA64-FPU64-LP64F: #define __loongarch_grlen 64
750 // LA64-FPU64-LP64F: #define __loongarch_hard_float 1
751 // LA64-FPU64-LP64F: #define __loongarch_lp64 1
752 // LA64-FPU64-LP64F: #define __loongarch_single_float 1
753 // LA64-FPU64-LP64F-NOT: #define __loongarch_soft_float
755 // RUN: %clang --target=loongarch64 -mfpu=64 -mabi=lp64s -x c -E -dM %s -o - \
756 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU64-LP64S %s
757 // LA64-FPU64-LP64S-NOT: #define __loongarch_double_float
758 // LA64-FPU64-LP64S: #define __loongarch_frlen 64
759 // LA64-FPU64-LP64S: #define __loongarch_grlen 64
760 // LA64-FPU64-LP64S-NOT: #define __loongarch_hard_float
761 // LA64-FPU64-LP64S: #define __loongarch_lp64 1
762 // LA64-FPU64-LP64S-NOT: #define __loongarch_single_float
763 // LA64-FPU64-LP64S: #define __loongarch_soft_float 1
765 // RUN: %clang --target=loongarch64 -mfpu=32 -mabi=lp64f -x c -E -dM %s -o - \
766 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU32-LP64F %s
767 // RUN: %clang --target=loongarch64 -msingle-float -x c -E -dM %s -o - \
768 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU32-LP64F %s
769 // LA64-FPU32-LP64F-NOT: #define __loongarch_double_float
770 // LA64-FPU32-LP64F: #define __loongarch_frlen 32
771 // LA64-FPU32-LP64F: #define __loongarch_grlen 64
772 // LA64-FPU32-LP64F: #define __loongarch_hard_float 1
773 // LA64-FPU32-LP64F: #define __loongarch_lp64 1
774 // LA64-FPU32-LP64F: #define __loongarch_single_float 1
775 // LA64-FPU32-LP64F-NOT: #define __loongarch_soft_float
777 // RUN: %clang --target=loongarch64 -mfpu=32 -mabi=lp64s -x c -E -dM %s -o - \
778 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU32-LP64S %s
779 // LA64-FPU32-LP64S-NOT: #define __loongarch_double_float
780 // LA64-FPU32-LP64S: #define __loongarch_frlen 32
781 // LA64-FPU32-LP64S: #define __loongarch_grlen 64
782 // LA64-FPU32-LP64S-NOT: #define __loongarch_hard_float
783 // LA64-FPU32-LP64S: #define __loongarch_lp64 1
784 // LA64-FPU32-LP64S-NOT: #define __loongarch_single_float
785 // LA64-FPU32-LP64S: #define __loongarch_soft_float 1
787 // RUN: %clang --target=loongarch64 -mfpu=0 -mabi=lp64s -x c -E -dM %s -o - \
788 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU0-LP64S %s
789 // RUN: %clang --target=loongarch64 -mfpu=none -mabi=lp64s -x c -E -dM %s -o - \
790 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU0-LP64S %s
791 // RUN: %clang --target=loongarch64 -msoft-float -x c -E -dM %s -o - \
792 // RUN: | FileCheck --match-full-lines --check-prefix=LA64-FPU0-LP64S %s
793 // LA64-FPU0-LP64S-NOT: #define __loongarch_double_float
794 // LA64-FPU0-LP64S: #define __loongarch_frlen 0
795 // LA64-FPU0-LP64S: #define __loongarch_grlen 64
796 // LA64-FPU0-LP64S-NOT: #define __loongarch_hard_float
797 // LA64-FPU0-LP64S: #define __loongarch_lp64 1
798 // LA64-FPU0-LP64S-NOT: #define __loongarch_single_float
799 // LA64-FPU0-LP64S: #define __loongarch_soft_float 1
801 /// Check __loongarch_arch{_tune/_frecipe/_lam_bh/_lamcas/_ld_seq_sa/_div32}.
803 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - | \
804 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=la64v1.0 -DTUNE=loongarch64 %s
805 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 | \
806 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=loongarch64 -DTUNE=loongarch64 %s
807 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la464 | \
808 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=la464 -DTUNE=la464 %s
809 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -mtune=loongarch64 | \
810 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=la64v1.0 -DTUNE=loongarch64 %s
811 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -mtune=la464 | \
812 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=la64v1.0 -DTUNE=la464 %s
813 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -mtune=la464 | \
814 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=loongarch64 -DTUNE=la464 %s
815 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la464 -mtune=loongarch64 | \
816 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=la464 -DTUNE=loongarch64 %s
817 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.0 | \
818 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=la64v1.0 -DTUNE=loongarch64 %s
819 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.0 -Xclang -target-feature -Xclang -lsx | \
820 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=loongarch64 -DTUNE=loongarch64 %s
821 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.0 -Xclang -target-feature -Xclang +frecipe | \
822 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE -DARCH=la64v1.0 -DTUNE=loongarch64 %s
823 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +lsx | \
824 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=la64v1.0 -DTUNE=loongarch64 %s
825 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.1 | \
826 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE,LAM-BH,LAMCAS,LD-SEQ-SA,DIV32 -DARCH=la64v1.1 -DTUNE=loongarch64 %s
827 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.1 -Xclang -target-feature -Xclang -frecipe | \
828 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,LAM-BH,LAMCAS,LD-SEQ-SA,DIV32 -DARCH=la64v1.0 -DTUNE=loongarch64 %s
829 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.1 -Xclang -target-feature -Xclang -lsx | \
830 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE,LAM-BH,LAMCAS,LD-SEQ-SA,DIV32 -DARCH=loongarch64 -DTUNE=loongarch64 %s
831 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +frecipe | \
832 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE -DARCH=loongarch64 -DTUNE=loongarch64 %s
833 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +lsx -Xclang -target-feature -Xclang +frecipe | \
834 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE -DARCH=la64v1.0 -DTUNE=loongarch64 %s
835 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.0 -Xclang -target-feature -Xclang +lam-bh | \
836 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,LAM-BH -DARCH=la64v1.0 -DTUNE=loongarch64 %s
837 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.1 -Xclang -target-feature -Xclang -lam-bh | \
838 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE,LAMCAS,LD-SEQ-SA,DIV32 -DARCH=la64v1.0 -DTUNE=loongarch64 %s
839 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +lam-bh | \
840 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,LAM-BH -DARCH=loongarch64 -DTUNE=loongarch64 %s
841 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +lsx -Xclang -target-feature -Xclang +lam-bh | \
842 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,LAM-BH -DARCH=la64v1.0 -DTUNE=loongarch64 %s
843 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.0 -Xclang -target-feature -Xclang +lamcas | \
844 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,LAMCAS -DARCH=la64v1.0 -DTUNE=loongarch64 %s
845 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.1 -Xclang -target-feature -Xclang -lamcas | \
846 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE,LAM-BH,LD-SEQ-SA,DIV32 -DARCH=la64v1.0 -DTUNE=loongarch64 %s
847 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +lamcas | \
848 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,LAMCAS -DARCH=loongarch64 -DTUNE=loongarch64 %s
849 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +lsx -Xclang -target-feature -Xclang +lamcas | \
850 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,LAMCAS -DARCH=la64v1.0 -DTUNE=loongarch64 %s
851 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.0 -Xclang -target-feature -Xclang +ld-seq-sa | \
852 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,LD-SEQ-SA -DARCH=la64v1.0 -DTUNE=loongarch64 %s
853 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.1 -Xclang -target-feature -Xclang -ld-seq-sa | \
854 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE,LAM-BH,LAMCAS,DIV32 -DARCH=la64v1.0 -DTUNE=loongarch64 %s
855 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +ld-seq-sa | \
856 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,LD-SEQ-SA -DARCH=loongarch64 -DTUNE=loongarch64 %s
857 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +lsx -Xclang -target-feature -Xclang +ld-seq-sa | \
858 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,LD-SEQ-SA -DARCH=la64v1.0 -DTUNE=loongarch64 %s
859 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.0 -Xclang -target-feature -Xclang +div32 | \
860 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,DIV32 -DARCH=la64v1.0 -DTUNE=loongarch64 %s
861 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.1 -Xclang -target-feature -Xclang -div32| \
862 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE,LAM-BH,LAMCAS,LD-SEQ-SA -DARCH=la64v1.0 -DTUNE=loongarch64 %s
863 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +div32 | \
864 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,DIV32 -DARCH=loongarch64 -DTUNE=loongarch64 %s
865 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -Xclang -target-feature -Xclang +lsx -Xclang -target-feature -Xclang +div32 | \
866 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,DIV32 -DARCH=la64v1.0 -DTUNE=loongarch64 %s
867 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la64v1.0 -Xclang -target-feature -Xclang +frecipe -Xclang -target-feature -Xclang +lam-bh -Xclang -target-feature -Xclang +lamcas -Xclang -target-feature -Xclang +ld-seq-sa -Xclang -target-feature -Xclang +div32 | \
868 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE -DARCH=la64v1.1 -DTUNE=loongarch64 %s
869 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la664 | \
870 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE,LAM-BH,LAMCAS,LD-SEQ-SA,DIV32 -DARCH=la664 -DTUNE=la664 %s
871 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -mtune=la664 | \
872 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=la64v1.0 -DTUNE=la664 %s
873 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=loongarch64 -mtune=la664 | \
874 // RUN: FileCheck --match-full-lines --check-prefix=ARCH-TUNE -DARCH=loongarch64 -DTUNE=la664 %s
875 // RUN: %clang --target=loongarch64 -x c -E -dM %s -o - -march=la664 -mtune=loongarch64 | \
876 // RUN: FileCheck --match-full-lines --check-prefixes=ARCH-TUNE,FRECIPE,LAM-BH,LAMCAS,LD-SEQ-SA,DIV32 -DARCH=la664 -DTUNE=loongarch64 %s
878 // ARCH-TUNE: #define __loongarch_arch "[[ARCH]]"
879 // DIV32: #define __loongarch_div32 1
880 // FRECIPE: #define __loongarch_frecipe 1
881 // LAM-BH: #define __loongarch_lam_bh 1
882 // LAMCAS: #define __loongarch_lamcas 1
883 // LD-SEQ-SA: #define __loongarch_ld_seq_sa 1
884 // ARCH-TUNE: #define __loongarch_tune "[[TUNE]]"
886 // RUN: %clang --target=loongarch64 -mlsx -x c -E -dM %s -o - \
887 // RUN: | FileCheck --match-full-lines --check-prefix=MLSX %s
888 // RUN: %clang --target=loongarch64 -mno-lsx -mlsx -x c -E -dM %s -o - \
889 // RUN: | FileCheck --match-full-lines --check-prefix=MLSX %s
890 // RUN: %clang --target=loongarch64 -mlsx -mno-lasx -x c -E -dM %s -o - \
891 // RUN: | FileCheck --match-full-lines --check-prefix=MLSX %s
892 // RUN: %clang --target=loongarch64 -mno-lasx -x c -E -dM %s -o - \
893 // RUN: | FileCheck --match-full-lines --check-prefix=MLSX %s
894 // RUN: %clang --target=loongarch64 -mno-lasx -mlsx -x c -E -dM %s -o - \
895 // RUN: | FileCheck --match-full-lines --check-prefix=MLSX %s
896 // MLSX-NOT: #define __loongarch_asx
897 // MLSX: #define __loongarch_simd_width 128
898 // MLSX: #define __loongarch_sx 1
900 // RUN: %clang --target=loongarch64 -mlasx -x c -E -dM %s -o - \
901 // RUN: | FileCheck --match-full-lines --check-prefix=MLASX %s
902 // RUN: %clang --target=loongarch64 -mlsx -mlasx -x c -E -dM %s -o - \
903 // RUN: | FileCheck --match-full-lines --check-prefix=MLASX %s
904 // RUN: %clang --target=loongarch64 -mlasx -mlsx -x c -E -dM %s -o - \
905 // RUN: | FileCheck --match-full-lines --check-prefix=MLASX %s
906 // RUN: %clang --target=loongarch64 -mno-lasx -mlasx -x c -E -dM %s -o - \
907 // RUN: | FileCheck --match-full-lines --check-prefix=MLASX %s
908 // MLASX: #define __loongarch_asx 1
909 // MLASX: #define __loongarch_simd_width 256
910 // MLASX: #define __loongarch_sx 1
912 // RUN: %clang --target=loongarch64 -mno-lsx -x c -E -dM %s -o - \
913 // RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
914 // RUN: %clang --target=loongarch64 -mlsx -mno-lsx -x c -E -dM %s -o - \
915 // RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
916 // RUN: %clang --target=loongarch64 -mno-lsx -mno-lasx -x c -E -dM %s -o - \
917 // RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
918 // RUN: %clang --target=loongarch64 -mno-lasx -mno-lsx -x c -E -dM %s -o - \
919 // RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
920 // MNO-LSX-NOT: #define __loongarch_asx
921 // MNO-LSX-NOT: #define __loongarch_simd_width
922 // MNO-LSX-NOT: #define __loongarch_sx