[libc] Switch to using the generic `<gpuintrin.h>` implementations (#121810)
[llvm-project.git] / clang / test / Preprocessor / predefined-win-macros.c
blob86708e02e8dc0960db6bc48d268f10c42edf75e2
1 // This test verifies that the correct macros are predefined.
2 //
3 // RUN: %clang_cc1 %s -x c++ -E -dM -triple x86_64-pc-win32 -fms-extensions -fms-compatibility \
4 // RUN: -fms-compatibility-version=19.00 -std=c++14 -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS64
5 // RUN: %clang_cc1 %s -x c++ -E -dM -triple x86_64-pc-win32 -fms-extensions -fms-compatibility \
6 // RUN: -fms-compatibility-version=19.00 -std=c++14 -o - | grep GCC | count 7
7 // CHECK-MS64: #define _INTEGRAL_MAX_BITS 64
8 // CHECK-MS64: #define _ISO_VOLATILE 1
9 // CHECK-MS64: #define _MSC_EXTENSIONS 1
10 // CHECK-MS64: #define _MSC_VER 1900
11 // CHECK-MS64: #define _MSVC_LANG 201402L
12 // CHECK-MS64: #define _M_AMD64 100
13 // CHECK-MS64: #define _M_X64 100
14 // CHECK-MS64: #define _WIN64 1
15 // CHECK-MS64-NOT: #define __STRICT_ANSI__
16 // CHECK-MS64-NOT: GNU
17 // CHECK-MS64-NOT: GXX
18 // CHECK-MS64: #define __GCC_ASM_FLAG_OUTPUTS__ 1
19 // CHECK-MS64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
20 // CHECK-MS64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
21 // CHECK-MS64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
22 // CHECK-MS64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
23 // CHECK-MS64-NOT: GNU
24 // CHECK-MS64-NOT: GXX
26 // RUN: %clang_cc1 %s -x c++ -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \
27 // RUN: -fms-compatibility-version=19.00 -std=c++17 -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS
28 // RUN: %clang_cc1 %s -x c++ -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \
29 // RUN: -fms-compatibility-version=19.00 -std=c++17 -o - | grep GCC | count 7
30 // CHECK-MS: #define _INTEGRAL_MAX_BITS 64
31 // CHECK-MS: #define _ISO_VOLATILE 1
32 // CHECK-MS: #define _MSC_EXTENSIONS 1
33 // CHECK-MS: #define _MSC_VER 1900
34 // CHECK-MS: #define _MSVC_LANG 201703L
35 // CHECK-MS: #define _M_IX86 600
36 // CHECK-MS: #define _M_IX86_FP 0
37 // CHECK-MS: #define _WIN32 1
38 // CHECK-MS-NOT: #define __STRICT_ANSI__
39 // CHECK-MS-NOT: GNU
40 // CHECK-MS-NOT: GXX
41 // CHECK-MS: #define __GCC_ASM_FLAG_OUTPUTS__ 1
42 // CHECK-MS: #define __GCC_CONSTRUCTIVE_SIZE {{.+}}
43 // CHECK-MS: #define __GCC_DESTRUCTIVE_SIZE {{.+}}
44 // CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
45 // CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
46 // CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
47 // CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
48 // CHECK-MS-NOT: GNU
49 // CHECK-MS-NOT: GXX
51 // RUN: %clang_cc1 %s -x c++ -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \
52 // RUN: -fms-compatibility-version=19.00 -std=c++20 -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS-CPP20
53 // CHECK-MS-CPP20: #define _MSC_VER 1900
54 // CHECK-MS-CPP20: #define _MSVC_LANG 202002L
56 // RUN: %clang_cc1 %s -x c++ -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \
57 // RUN: -fms-compatibility-version=19.00 -std=c++23 -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS-CPP2B
58 // CHECK-MS-CPP2B: #define _MSC_VER 1900
59 // CHECK-MS-CPP2B: #define _MSVC_LANG 202302L
61 // RUN: %clang_cc1 %s -x c++ -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \
62 // RUN: -fms-compatibility-version=19.00 -std=c++26 -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS-CPP2C
63 // CHECK-MS-CPP2C: #define _MSC_VER 1900
64 // CHECK-MS-CPP2C: #define _MSVC_LANG 202400L
66 // RUN: %clang_cc1 -triple i386-windows %s -E -dM -o - \
67 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-X86-WIN
69 // CHECK-X86-WIN-NOT: #define WIN32 1
70 // CHECK-X86-WIN-NOT: #define WIN64 1
71 // CHECK-X86-WIN-NOT: #define WINNT 1
72 // CHECK-X86-WIN: #define _WIN32 1
73 // CHECK-X86-WIN-NOT: #define _WIN64 1
75 // RUN: %clang_cc1 -triple thumbv7-windows %s -E -dM -o - \
76 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM-WIN
78 // CHECK-ARM-WIN-NOT: #define WIN32 1
79 // CHECK-ARM-WIN-NOT: #define WIN64 1
80 // CHECK-ARM-WIN-NOT: #define WINNT 1
81 // CHECK-ARM-WIN: #define _WIN32 1
82 // CHECK-ARM-WIN-NOT: #define _WIN64 1
84 // RUN: %clang_cc1 -triple x86_64-windows %s -E -dM -o - \
85 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-AMD64-WIN
87 // CHECK-AMD64-WIN-NOT: #define WIN32 1
88 // CHECK-AMD64-WIN-NOT: #define WIN64 1
89 // CHECK-AMD64-WIN-NOT: #define WINNT 1
90 // CHECK-AMD64-WIN: #define _WIN32 1
91 // CHECK-AMD64-WIN: #define _WIN64 1
93 // RUN: %clang_cc1 -triple aarch64-windows %s -E -dM -o - \
94 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64-WIN
96 // CHECK-ARM64-WIN-NOT: #define WIN32 1
97 // CHECK-ARM64-WIN-NOT: #define WIN64 1
98 // CHECK-ARM64-WIN-NOT: #define WINNT 1
99 // CHECK-ARM64-WIN: #define _M_ARM64 1
100 // CHECK-ARM64-WIN: #define _WIN32 1
101 // CHECK-ARM64-WIN: #define _WIN64 1
103 // RUN: %clang_cc1 -triple arm64ec-windows %s -E -dM -o - \
104 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64EC-WIN
106 // CHECK-ARM64EC-WIN-NOT: #define WIN32 1
107 // CHECK-ARM64EC-WIN-NOT: #define WIN64 1
108 // CHECK-ARM64EC-WIN-NOT: #define WINNT 1
109 // CHECK-ARM64EC-WIN-NOT: #define _M_ARM64 1
110 // CHECK-ARM64EC-WIN: #define _M_AMD64 100
111 // CHECK-ARM64EC-WIN: #define _M_ARM64EC 1
112 // CHECK-ARM64EC-WIN: #define _M_X64 100
113 // CHECK-ARM64EC-WIN: #define _WIN32 1
114 // CHECK-ARM64EC-WIN: #define _WIN64 1
116 // RUN: %clang_cc1 -triple mipsel-windows %s -E -dM -o - \
117 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-MIPSEL-WIN
119 // CHECK-MIPSEL-WIN: #define _M_MRX000 4000
120 // CHECK-MIPSEL-WIN: #define _WIN32 1
121 // CHECK-MIPSEL-WIN-NOT: #define _MIPS_ 1
123 // RUN: %clang_cc1 -triple i686-windows-gnu %s -E -dM -o - \
124 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-X86-MINGW
126 // CHECK-X86-MINGW: #define WIN32 1
127 // CHECK-X86-MINGW-NOT: #define WIN64 1
128 // CHECK-X86-MINGW: #define WINNT 1
129 // CHECK-X86-MINGW: #define _WIN32 1
130 // CHECK-X86-MINGW-NOT: #define _WIN64 1
131 // CHECK-X86-MINGW: #define __GXX_TYPEINFO_EQUALITY_INLINE 0
133 // RUN: %clang_cc1 -triple thumbv7-windows-gnu %s -E -dM -o - \
134 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM-MINGW
136 // CHECK-ARM-MINGW: #define WIN32 1
137 // CHECK-ARM-MINGW-NOT: #define WIN64 1
138 // CHECK-ARM-MINGW: #define WINNT 1
139 // CHECK-ARM-MINGW: #define _WIN32 1
140 // CHECK-ARM-MINGW-NOT: #define _WIN64 1
141 // CHECK-ARM-MINGW: #define __GXX_TYPEINFO_EQUALITY_INLINE 0
143 // RUN: %clang_cc1 -triple x86_64-windows-gnu %s -E -dM -o - \
144 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-AMD64-MINGW
146 // CHECK-AMD64-MINGW: #define WIN32 1
147 // CHECK-AMD64-MINGW: #define WIN64 1
148 // CHECK-AMD64-MINGW: #define WINNT 1
149 // CHECK-AMD64-MINGW: #define _WIN32 1
150 // CHECK-AMD64-MINGW: #define _WIN64 1
151 // CHECK-AMD64-MINGW: #define __GXX_TYPEINFO_EQUALITY_INLINE 0
153 // RUN: %clang_cc1 -triple aarch64-windows-gnu %s -E -dM -o - \
154 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64-MINGW
156 // CHECK-ARM64-MINGW-NOT: #define _M_ARM64 1
157 // CHECK-ARM64-MINGW: #define WIN32 1
158 // CHECK-ARM64-MINGW: #define WIN64 1
159 // CHECK-ARM64-MINGW: #define WINNT 1
160 // CHECK-ARM64-MINGW: #define _WIN32 1
161 // CHECK-ARM64-MINGW: #define _WIN64 1
162 // CHECK-ARM64-MINGW: #define __GCC_ASM_FLAG_OUTPUTS__ 1
163 // CHECK-ARM64-MINGW: #define __GXX_TYPEINFO_EQUALITY_INLINE 0
164 // CHECK-ARM64-MINGW: #define __aarch64__ 1
166 // RUN: %clang_cc1 -triple arm64ec-windows-gnu %s -E -dM -o - \
167 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64EC-MINGW
169 // CHECK-ARM64EC-MINGW-NOT: #define _M_ARM64EC 1
170 // CHECK-ARM64EC-MINGW: #define WIN32 1
171 // CHECK-ARM64EC-MINGW: #define WIN64 1
172 // CHECK-ARM64EC-MINGW: #define WINNT 1
173 // CHECK-ARM64EC-MINGW: #define _WIN32 1
174 // CHECK-ARM64EC-MINGW: #define _WIN64 1
175 // CHECK-ARM64EC-MINGW: #define __GCC_ASM_FLAG_OUTPUTS__ 1
176 // CHECK-ARM64EC-MINGW: #define __GXX_TYPEINFO_EQUALITY_INLINE 0
177 // CHECK-ARM64EC-MINGW-NOT: #define __aarch64__ 1
178 // CHECK-ARM64EC-MINGW: #define __amd64 1
179 // CHECK-ARM64EC-MINGW: #define __amd64__ 1
180 // CHECK-ARM64EC-MINGW: #define __arm64ec__ 1
181 // CHECK-ARM64EC-MINGW: #define __x86_64 1
182 // CHECK-ARM64EC-MINGW: #define __x86_64__ 1
184 // RUN: %clang_cc1 -triple mipsel-windows-gnu %s -E -dM -o - \
185 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-MIPSEL-MINGW
187 // CHECK-MIPSEL-MINGW-NOT: #define _M_MRX000 4000
188 // CHECK-MIPSEL-MINGW: #define _MIPS_ 1
189 // CHECK-MIPSEL-MINGW: #define _WIN32 1
190 // CHECK-MIPSEL-MINGW: #define __mips 32
191 // CHECK-MIPSEL-MINGW: #define __mips__ 1