Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Preprocessor / predefined-macros.c
blob633ba4681ac52b0263d8501d24ea936fb0ee56f2
1 // This test verifies that the correct macros are predefined.
2 //
3 // RUN: %clang_cc1 %s -E -dM -triple i686-pc-win32 -fms-compatibility \
4 // RUN: -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS-STDINT
5 // CHECK-MS-STDINT:#define __INT16_MAX__ 32767
6 // CHECK-MS-STDINT:#define __INT32_MAX__ 2147483647
7 // CHECK-MS-STDINT:#define __INT64_MAX__ 9223372036854775807LL
8 // CHECK-MS-STDINT:#define __INT8_MAX__ 127
9 // CHECK-MS-STDINT:#define __INTPTR_MAX__ 2147483647
10 // CHECK-MS-STDINT:#define __INT_FAST16_MAX__ 32767
11 // CHECK-MS-STDINT:#define __INT_FAST16_TYPE__ short
12 // CHECK-MS-STDINT:#define __INT_FAST32_MAX__ 2147483647
13 // CHECK-MS-STDINT:#define __INT_FAST32_TYPE__ int
14 // CHECK-MS-STDINT:#define __INT_FAST64_MAX__ 9223372036854775807LL
15 // CHECK-MS-STDINT:#define __INT_FAST64_TYPE__ long long int
16 // CHECK-MS-STDINT:#define __INT_FAST8_MAX__ 127
17 // CHECK-MS-STDINT:#define __INT_FAST8_TYPE__ signed char
18 // CHECK-MS-STDINT:#define __INT_LEAST16_MAX__ 32767
19 // CHECK-MS-STDINT:#define __INT_LEAST16_TYPE__ short
20 // CHECK-MS-STDINT:#define __INT_LEAST32_MAX__ 2147483647
21 // CHECK-MS-STDINT:#define __INT_LEAST32_TYPE__ int
22 // CHECK-MS-STDINT:#define __INT_LEAST64_MAX__ 9223372036854775807LL
23 // CHECK-MS-STDINT:#define __INT_LEAST64_TYPE__ long long int
24 // CHECK-MS-STDINT:#define __INT_LEAST8_MAX__ 127
25 // CHECK-MS-STDINT:#define __INT_LEAST8_TYPE__ signed char
26 // CHECK-MS-STDINT-NOT:#define __UINT16_C_SUFFIX__ U
27 // CHECK-MS-STDINT:#define __UINT16_MAX__ 65535
28 // CHECK-MS-STDINT:#define __UINT16_TYPE__ unsigned short
29 // CHECK-MS-STDINT:#define __UINT32_C_SUFFIX__ U
30 // CHECK-MS-STDINT:#define __UINT32_MAX__ 4294967295U
31 // CHECK-MS-STDINT:#define __UINT32_TYPE__ unsigned int
32 // CHECK-MS-STDINT:#define __UINT64_C_SUFFIX__ ULL
33 // CHECK-MS-STDINT:#define __UINT64_MAX__ 18446744073709551615ULL
34 // CHECK-MS-STDINT:#define __UINT64_TYPE__ long long unsigned int
35 // CHECK-MS-STDINT-NOT:#define __UINT8_C_SUFFIX__ U
36 // CHECK-MS-STDINT:#define __UINT8_MAX__ 255
37 // CHECK-MS-STDINT:#define __UINT8_TYPE__ unsigned char
38 // CHECK-MS-STDINT:#define __UINTMAX_MAX__ 18446744073709551615ULL
39 // CHECK-MS-STDINT:#define __UINTPTR_MAX__ 4294967295U
40 // CHECK-MS-STDINT:#define __UINTPTR_TYPE__ unsigned int
41 // CHECK-MS-STDINT:#define __UINTPTR_WIDTH__ 32
42 // CHECK-MS-STDINT:#define __UINT_FAST16_MAX__ 65535
43 // CHECK-MS-STDINT:#define __UINT_FAST16_TYPE__ unsigned short
44 // CHECK-MS-STDINT:#define __UINT_FAST32_MAX__ 4294967295U
45 // CHECK-MS-STDINT:#define __UINT_FAST32_TYPE__ unsigned int
46 // CHECK-MS-STDINT:#define __UINT_FAST64_MAX__ 18446744073709551615ULL
47 // CHECK-MS-STDINT:#define __UINT_FAST64_TYPE__ long long unsigned int
48 // CHECK-MS-STDINT:#define __UINT_FAST8_MAX__ 255
49 // CHECK-MS-STDINT:#define __UINT_FAST8_TYPE__ unsigned char
50 // CHECK-MS-STDINT:#define __UINT_LEAST16_MAX__ 65535
51 // CHECK-MS-STDINT:#define __UINT_LEAST16_TYPE__ unsigned short
52 // CHECK-MS-STDINT:#define __UINT_LEAST32_MAX__ 4294967295U
53 // CHECK-MS-STDINT:#define __UINT_LEAST32_TYPE__ unsigned int
54 // CHECK-MS-STDINT:#define __UINT_LEAST64_MAX__ 18446744073709551615ULL
55 // CHECK-MS-STDINT:#define __UINT_LEAST64_TYPE__ long long unsigned int
56 // CHECK-MS-STDINT:#define __UINT_LEAST8_MAX__ 255
57 // CHECK-MS-STDINT:#define __UINT_LEAST8_TYPE__ unsigned char
59 // RUN: %clang_cc1 %s -E -dM -ffast-math -o - \
60 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FAST-MATH
61 // CHECK-FAST-MATH: #define __FAST_MATH__ 1
62 // CHECK-FAST-MATH: #define __FINITE_MATH_ONLY__ 1
63 // CHECK-FAST-MATH: #define __NO_MATH_ERRNO__ 1
65 // RUN: %clang_cc1 %s -E -dM -fmath-errno -o - \
66 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-MATH-ERRNO
67 // CHECK-MATH-ERRNO-NOT: __NO_MATH_ERRNO__
69 // RUN: %clang %s -E -dM -fno-math-errno -o - \
70 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-NO-MATH-ERRNO
71 // CHECK-NO-MATH-ERRNO: #define __NO_MATH_ERRNO__ 1
73 // RUN: %clang_cc1 %s -E -dM -menable-no-nans -menable-no-infs -o - \
74 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FINITE-MATH-ONLY
75 // CHECK-FINITE-MATH-ONLY: #define __FINITE_MATH_ONLY__ 1
77 // RUN: %clang %s -E -dM -fno-finite-math-only -o - \
78 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-NO-FINITE-MATH-ONLY
79 // CHECK-NO-FINITE-MATH-ONLY: #define __FINITE_MATH_ONLY__ 0
81 // RUN: %clang_cc1 %s -E -dM -o - \
82 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FINITE-MATH-FLAG-UNDEFINED
83 // CHECK-FINITE-MATH-FLAG-UNDEFINED: #define __FINITE_MATH_ONLY__ 0
85 // RUN: %clang_cc1 %s -E -dM -o - -triple i686 -target-cpu i386 \
86 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_I386
87 // CHECK-SYNC_CAS_I386-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP
89 // RUN: %clang_cc1 %s -E -dM -o - -triple i686 -target-cpu i486 \
90 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_I486
91 // CHECK-SYNC_CAS_I486: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
92 // CHECK-SYNC_CAS_I486: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
93 // CHECK-SYNC_CAS_I486: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
94 // CHECK-SYNC_CAS_I486-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
96 // RUN: %clang_cc1 %s -E -dM -o - -triple i686 -target-cpu i586 \
97 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_I586
98 // CHECK-SYNC_CAS_I586: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
99 // CHECK-SYNC_CAS_I586: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
100 // CHECK-SYNC_CAS_I586: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
101 // CHECK-SYNC_CAS_I586: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
103 // RUN: %clang_cc1 %s -E -dM -o - -triple armv6 -target-cpu arm1136j-s \
104 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_ARM
105 // CHECK-SYNC_CAS_ARM: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
106 // CHECK-SYNC_CAS_ARM: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
107 // CHECK-SYNC_CAS_ARM: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
108 // CHECK-SYNC_CAS_ARM: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
110 // RUN: %clang_cc1 %s -E -dM -o - -triple armv7 -target-cpu cortex-a8 \
111 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_ARMv7
112 // CHECK-SYNC_CAS_ARMv7: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
113 // CHECK-SYNC_CAS_ARMv7: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
114 // CHECK-SYNC_CAS_ARMv7: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
115 // CHECK-SYNC_CAS_ARMv7: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
117 // RUN: %clang_cc1 %s -E -dM -o - -triple armv6 -target-cpu cortex-m0 \
118 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_ARMv6
119 // CHECK-SYNC_CAS_ARMv6-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP
121 // RUN: %clang_cc1 %s -E -dM -o - -triple mips -target-cpu mips1 \
122 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_MIPS32_MIPS1
123 // RUN: %clang_cc1 %s -E -dM -o - -triple mips -target-cpu mips2 \
124 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_MIPS \
125 // RUN: --check-prefix=CHECK-SYNC_CAS_MIPS32
126 // RUN: %clang_cc1 %s -E -dM -o - -triple mips64 -target-cpu mips3 \
127 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_MIPS \
128 // RUN: --check-prefix=CHECK-SYNC_CAS_MIPS64
129 // CHECK-SYNC_CAS_MIPS32_MIPS1-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP
130 // CHECK-SYNC_CAS_MIPS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
131 // CHECK-SYNC_CAS_MIPS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
132 // CHECK-SYNC_CAS_MIPS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
133 // CHECK-SYNC_CAS_MIPS32-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
134 // CHECK-SYNC_CAS_MIPS64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
136 // RUN: %clang_cc1 %s -E -dM -o - -x cl \
137 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL12
138 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL1.0 \
139 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL10
140 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL1.1 \
141 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL11
142 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL1.2 \
143 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL12
144 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL2.0 \
145 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL20
146 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL3.0 \
147 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL30
148 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-fast-relaxed-math \
149 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FRM
150 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=clc++ \
151 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CLCPP10
152 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=clc++1.0 \
153 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CLCPP10
154 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=clc++2021 \
155 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CLCPP2021
156 // CHECK-CL10: #define CL_VERSION_1_0 100
157 // CHECK-CL10: #define CL_VERSION_1_1 110
158 // CHECK-CL10: #define CL_VERSION_1_2 120
159 // CHECK-CL10: #define CL_VERSION_2_0 200
160 // CHECK-CL10: #define CL_VERSION_3_0 300
161 // CHECK-CL10: #define __OPENCL_C_VERSION__ 100
162 // CHECK-CL10-NOT: #define __FAST_RELAXED_MATH__ 1
163 // CHECK-CL11: #define CL_VERSION_1_0 100
164 // CHECK-CL11: #define CL_VERSION_1_1 110
165 // CHECK-CL11: #define CL_VERSION_1_2 120
166 // CHECK-CL11: #define CL_VERSION_2_0 200
167 // CHECK-CL11: #define CL_VERSION_3_0 300
168 // CHECK-CL11: #define __OPENCL_C_VERSION__ 110
169 // CHECK-CL11-NOT: #define __FAST_RELAXED_MATH__ 1
170 // CHECK-CL12: #define CL_VERSION_1_0 100
171 // CHECK-CL12: #define CL_VERSION_1_1 110
172 // CHECK-CL12: #define CL_VERSION_1_2 120
173 // CHECK-CL12: #define CL_VERSION_2_0 200
174 // CHECK-CL12: #define CL_VERSION_3_0 300
175 // CHECK-CL12: #define __OPENCL_C_VERSION__ 120
176 // CHECK-CL12-NOT: #define __FAST_RELAXED_MATH__ 1
177 // CHECK-CL20: #define CL_VERSION_1_0 100
178 // CHECK-CL20: #define CL_VERSION_1_1 110
179 // CHECK-CL20: #define CL_VERSION_1_2 120
180 // CHECK-CL20: #define CL_VERSION_2_0 200
181 // CHECK-CL20: #define CL_VERSION_3_0 300
182 // CHECK-CL20: #define __OPENCL_C_VERSION__ 200
183 // CHECK-CL20-NOT: #define __FAST_RELAXED_MATH__ 1
184 // CHECK-CL30: #define CL_VERSION_1_0 100
185 // CHECK-CL30: #define CL_VERSION_1_1 110
186 // CHECK-CL30: #define CL_VERSION_1_2 120
187 // CHECK-CL30: #define CL_VERSION_2_0 200
188 // CHECK-CL30: #define CL_VERSION_3_0 300
189 // CHECK-CL30: #define __OPENCL_C_VERSION__ 300
190 // CHECK-CL30-NOT: #define __FAST_RELAXED_MATH__ 1
191 // CHECK-FRM: #define __FAST_RELAXED_MATH__ 1
192 // CHECK-CLCPP10: #define __CL_CPP_VERSION_1_0__ 100
193 // CHECK-CLCPP10: #define __CL_CPP_VERSION_2021__ 202100
194 // CHECK-CLCPP10: #define __OPENCL_CPP_VERSION__ 100
195 // CHECK-CLCPP10-NOT: #define __FAST_RELAXED_MATH__ 1
196 // CHECK-CLCPP10-NOT: #define __ENDIAN_LITTLE__ 1
197 // CHECK-CLCPP2021: #define __CL_CPP_VERSION_1_0__ 100
198 // CHECK-CLCPP2021: #define __CL_CPP_VERSION_2021__ 202100
199 // CHECK-CLCPP2021: #define __OPENCL_CPP_VERSION__ 202100
200 // CHECK-CLCPP2021-NOT: #define __FAST_RELAXED_MATH__ 1
201 // CHECK-CLCPP2021-NOT: #define __ENDIAN_LITTLE__ 1
203 // RUN: %clang_cc1 %s -E -dM -o - -x cl \
204 // RUN: | FileCheck %s --check-prefix=MSCOPE
205 // MSCOPE:#define __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES 3
206 // MSCOPE:#define __OPENCL_MEMORY_SCOPE_DEVICE 2
207 // MSCOPE:#define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
208 // MSCOPE:#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
209 // MSCOPE:#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
211 // RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spir-unknown-unknown \
212 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIR
213 // CHECK-SPIR-DAG: #define __IMAGE_SUPPORT__ 1
214 // CHECK-SPIR-DAG: #define __SPIR__ 1
215 // CHECK-SPIR-DAG: #define __SPIR32__ 1
216 // CHECK-SPIR-NOT: #define __SPIR64__ 1
218 // RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spir64-unknown-unknown \
219 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIR64
220 // CHECK-SPIR64-DAG: #define __IMAGE_SUPPORT__ 1
221 // CHECK-SPIR64-DAG: #define __SPIR__ 1
222 // CHECK-SPIR64-DAG: #define __SPIR64__ 1
223 // CHECK-SPIR64-NOT: #define __SPIR32__ 1
225 // RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spirv32-unknown-unknown \
226 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIRV32
227 // CHECK-SPIRV32-DAG: #define __IMAGE_SUPPORT__ 1
228 // CHECK-SPIRV32-DAG: #define __SPIRV__ 1
229 // CHECK-SPIRV32-DAG: #define __SPIRV32__ 1
230 // CHECK-SPIRV32-NOT: #define __SPIRV64__ 1
232 // RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spirv64-unknown-unknown \
233 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIRV64
234 // CHECK-SPIRV64-DAG: #define __IMAGE_SUPPORT__ 1
235 // CHECK-SPIRV64-DAG: #define __SPIRV__ 1
236 // CHECK-SPIRV64-DAG: #define __SPIRV64__ 1
237 // CHECK-SPIRV64-NOT: #define __SPIRV32__ 1
239 // RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spirv64-amd-amdhsa \
240 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIRV64-AMDGCN
241 // CHECK-SPIRV64-AMDGCN-DAG: #define __IMAGE_SUPPORT__ 1
242 // CHECK-SPIRV64-AMDGCN-DAG: #define __SPIRV__ 1
243 // CHECK-SPIRV64-AMDGCN-DAG: #define __SPIRV64__ 1
244 // CHECK-SPIRV64-AMDGCN-DAG: #define __AMD__ 1
245 // CHECK-SPIRV64-AMDGCN-DAG: #define __AMDGCN__ 1
246 // CHECK-SPIRV64-AMDGCN-DAG: #define __AMDGPU__ 1
247 // CHECK-SPIRV64-AMDGCN-NOT: #define __SPIRV32__ 1
249 // RUN: %clang_cc1 %s -E -dM -o - -x hip -triple x86_64-unknown-linux-gnu \
250 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-HIP
251 // CHECK-HIP: #define __HIPCC__ 1
252 // CHECK-HIP: #define __HIP__ 1
254 // RUN: %clang_cc1 %s -E -dM -o - -x cuda -triple x86_64-unknown-linux-gnu \
255 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CUDA-NEG
256 // CHECK-CUDA-NEG-NOT: #define __CLANG_RDC__ 1
258 // RUN: %clang_cc1 %s -E -dM -o - -x hip -triple x86_64-unknown-linux-gnu \
259 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-HIP-NEG
260 // CHECK-HIP-NEG-NOT: #define __CUDA_ARCH__
261 // CHECK-HIP-NEG-NOT: #define __HIP_DEVICE_COMPILE__ 1
262 // CHECK-HIP-NEG-NOT: #define __CLANG_RDC__ 1
263 // CHECK-HIP-NEG-NOT: #define HIP_API_PER_THREAD_DEFAULT_STREAM
265 // RUN: %clang_cc1 %s -E -dM -o - -x hip -triple amdgcn-amd-amdhsa \
266 // RUN: -fcuda-is-device \
267 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-HIP-DEV
268 // CHECK-HIP-DEV: #define __HIPCC__ 1
269 // CHECK-HIP-DEV: #define __HIP_DEVICE_COMPILE__ 1
270 // CHECK-HIP-DEV: #define __HIP__ 1
272 // RUN: %clang_cc1 %s -E -dM -o - -x cuda -triple nvptx \
273 // RUN: -fcuda-is-device \
274 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CUDA-DEV-NEG
275 // CHECK-CUDA-DEV-NEG-NOT: #define __CLANG_RDC__ 1
277 // RUN: %clang_cc1 %s -E -dM -o - -x hip -triple amdgcn-amd-amdhsa \
278 // RUN: -fcuda-is-device \
279 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-HIP-DEV-NEG
280 // CHECK-HIP-DEV-NEG-NOT: #define __CUDA_ARCH__
281 // CHECK-HIP-DEV-NEG-NOT: #define __CLANG_RDC__ 1
282 // CHECK-HIP-DEV-NEG-NOT: #define HIP_API_PER_THREAD_DEFAULT_STREAM
284 // RUN: %clang_cc1 %s -E -dM -o - -x cuda -triple x86_64-unknown-linux-gnu \
285 // RUN: -fgpu-rdc | FileCheck %s --check-prefix=CHECK-RDC
286 // RUN: %clang_cc1 %s -E -dM -o - -x cuda -triple nvptx \
287 // RUN: -fgpu-rdc -fcuda-is-device \
288 // RUN: | FileCheck %s --check-prefix=CHECK-RDC
289 // RUN: %clang_cc1 %s -E -dM -o - -x hip -triple x86_64-unknown-linux-gnu \
290 // RUN: -fgpu-rdc | FileCheck %s --check-prefix=CHECK-RDC
291 // RUN: %clang_cc1 %s -E -dM -o - -x hip -triple amdgcn-amd-amdhsa \
292 // RUN: -fgpu-rdc -fcuda-is-device \
293 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-RDC
294 // CHECK-RDC: #define __CLANG_RDC__ 1
296 // RUN: %clang_cc1 %s -E -dM -o - -x hip -triple x86_64-unknown-linux-gnu \
297 // RUN: -fgpu-default-stream=per-thread \
298 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-PTH
299 // RUN: %clang_cc1 %s -E -dM -o - -x hip -triple amdgcn-amd-amdhsa \
300 // RUN: -fcuda-is-device -fgpu-default-stream=per-thread \
301 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-PTH
302 // CHECK-PTH: #define HIP_API_PER_THREAD_DEFAULT_STREAM 1
304 // RUN: %clang_cc1 %s -E -dM -o - -x hip --hipstdpar -triple x86_64-unknown-linux-gnu \
305 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-HIPSTDPAR
306 // CHECK-HIPSTDPAR: #define __HIPSTDPAR__ 1
307 // CHECK-HIPSTDPAR-NOT: #define __HIPSTDPAR_INTERPOSE_ALLOC__ 1
309 // RUN: %clang_cc1 %s -E -dM -o - -x hip --hipstdpar --hipstdpar-interpose-alloc \
310 // RUN: -triple x86_64-unknown-linux-gnu | FileCheck -match-full-lines %s \
311 // RUN: --check-prefix=CHECK-HIPSTDPAR-INTERPOSE
312 // CHECK-HIPSTDPAR-INTERPOSE: #define __HIPSTDPAR_INTERPOSE_ALLOC__ 1
313 // CHECK-HIPSTDPAR-INTERPOSE: #define __HIPSTDPAR__ 1
315 // RUN: %clang_cc1 %s -E -dM -o - -x hip --hipstdpar --hipstdpar-interpose-alloc \
316 // RUN: -triple amdgcn-amd-amdhsa -fcuda-is-device | FileCheck -match-full-lines \
317 // RUN: %s --check-prefix=CHECK-HIPSTDPAR-INTERPOSE-DEV-NEG
318 // CHECK-HIPSTDPAR-INTERPOSE-DEV-NEG: #define __HIPSTDPAR__ 1
319 // CHECK-HIPSTDPAR-INTERPOSE-DEV-NEG-NOT: #define __HIPSTDPAR_INTERPOSE_ALLOC__ 1