Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Preprocessor / predefined-win-macros.c
blobb830dc39d477dd1582c21dd5f3cfc6550ee13be3
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 5
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 5
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_HAVE_SYNC_COMPARE_AND_SWAP_1 1
43 // CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
44 // CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
45 // CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
46 // CHECK-MS-NOT: GNU
47 // CHECK-MS-NOT: GXX
49 // RUN: %clang_cc1 %s -x c++ -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \
50 // RUN: -fms-compatibility-version=19.00 -std=c++20 -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS-CPP20
51 // CHECK-MS-CPP20: #define _MSC_VER 1900
52 // CHECK-MS-CPP20: #define _MSVC_LANG 202002L
54 // RUN: %clang_cc1 %s -x c++ -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \
55 // RUN: -fms-compatibility-version=19.00 -std=c++23 -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS-CPP2B
56 // CHECK-MS-CPP2B: #define _MSC_VER 1900
57 // CHECK-MS-CPP2B: #define _MSVC_LANG 202004L
59 // RUN: %clang_cc1 -triple i386-windows %s -E -dM -o - \
60 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-X86-WIN
62 // CHECK-X86-WIN-NOT: #define WIN32 1
63 // CHECK-X86-WIN-NOT: #define WIN64 1
64 // CHECK-X86-WIN-NOT: #define WINNT 1
65 // CHECK-X86-WIN: #define _WIN32 1
66 // CHECK-X86-WIN-NOT: #define _WIN64 1
68 // RUN: %clang_cc1 -triple thumbv7-windows %s -E -dM -o - \
69 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM-WIN
71 // CHECK-ARM-WIN-NOT: #define WIN32 1
72 // CHECK-ARM-WIN-NOT: #define WIN64 1
73 // CHECK-ARM-WIN-NOT: #define WINNT 1
74 // CHECK-ARM-WIN: #define _WIN32 1
75 // CHECK-ARM-WIN-NOT: #define _WIN64 1
77 // RUN: %clang_cc1 -triple x86_64-windows %s -E -dM -o - \
78 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-AMD64-WIN
80 // CHECK-AMD64-WIN-NOT: #define WIN32 1
81 // CHECK-AMD64-WIN-NOT: #define WIN64 1
82 // CHECK-AMD64-WIN-NOT: #define WINNT 1
83 // CHECK-AMD64-WIN: #define _WIN32 1
84 // CHECK-AMD64-WIN: #define _WIN64 1
86 // RUN: %clang_cc1 -triple aarch64-windows %s -E -dM -o - \
87 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64-WIN
89 // CHECK-ARM64-WIN-NOT: #define WIN32 1
90 // CHECK-ARM64-WIN-NOT: #define WIN64 1
91 // CHECK-ARM64-WIN-NOT: #define WINNT 1
92 // CHECK-ARM64-WIN: #define _M_ARM64 1
93 // CHECK-ARM64-WIN: #define _WIN32 1
94 // CHECK-ARM64-WIN: #define _WIN64 1
96 // RUN: %clang_cc1 -triple arm64ec-windows %s -E -dM -o - \
97 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64EC-WIN
99 // CHECK-ARM64EC-WIN-NOT: #define WIN32 1
100 // CHECK-ARM64EC-WIN-NOT: #define WIN64 1
101 // CHECK-ARM64EC-WIN-NOT: #define WINNT 1
102 // CHECK-ARM64EC-WIN-NOT: #define _M_ARM64 1
103 // CHECK-ARM64EC-WIN: #define _M_AMD64 100
104 // CHECK-ARM64EC-WIN: #define _M_ARM64EC 1
105 // CHECK-ARM64EC-WIN: #define _M_X64 100
106 // CHECK-ARM64EC-WIN: #define _WIN32 1
107 // CHECK-ARM64EC-WIN: #define _WIN64 1
109 // RUN: %clang_cc1 -triple i686-windows-gnu %s -E -dM -o - \
110 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-X86-MINGW
112 // CHECK-X86-MINGW: #define WIN32 1
113 // CHECK-X86-MINGW-NOT: #define WIN64 1
114 // CHECK-X86-MINGW: #define WINNT 1
115 // CHECK-X86-MINGW: #define _WIN32 1
116 // CHECK-X86-MINGW-NOT: #define _WIN64 1
118 // RUN: %clang_cc1 -triple thumbv7-windows-gnu %s -E -dM -o - \
119 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM-MINGW
121 // CHECK-ARM-MINGW: #define WIN32 1
122 // CHECK-ARM-MINGW-NOT: #define WIN64 1
123 // CHECK-ARM-MINGW: #define WINNT 1
124 // CHECK-ARM-MINGW: #define _WIN32 1
125 // CHECK-ARM-MINGW-NOT: #define _WIN64 1
127 // RUN: %clang_cc1 -triple x86_64-windows-gnu %s -E -dM -o - \
128 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-AMD64-MINGW
130 // CHECK-AMD64-MINGW: #define WIN32 1
131 // CHECK-AMD64-MINGW: #define WIN64 1
132 // CHECK-AMD64-MINGW: #define WINNT 1
133 // CHECK-AMD64-MINGW: #define _WIN32 1
134 // CHECK-AMD64-MINGW: #define _WIN64 1
136 // RUN: %clang_cc1 -triple aarch64-windows-gnu %s -E -dM -o - \
137 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64-MINGW
139 // CHECK-ARM64-MINGW-NOT: #define _M_ARM64 1
140 // CHECK-ARM64-MINGW: #define WIN32 1
141 // CHECK-ARM64-MINGW: #define WIN64 1
142 // CHECK-ARM64-MINGW: #define WINNT 1
143 // CHECK-ARM64-MINGW: #define _WIN32 1
144 // CHECK-ARM64-MINGW: #define _WIN64 1
145 // CHECK-ARM64-MINGW: #define __GCC_ASM_FLAG_OUTPUTS__ 1
146 // CHECK-ARM64-MINGW: #define __aarch64__ 1
148 // RUN: %clang_cc1 -triple arm64ec-windows-gnu %s -E -dM -o - \
149 // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64EC-MINGW
151 // CHECK-ARM64EC-MINGW-NOT: #define _M_ARM64EC 1
152 // CHECK-ARM64EC-MINGW: #define WIN32 1
153 // CHECK-ARM64EC-MINGW: #define WIN64 1
154 // CHECK-ARM64EC-MINGW: #define WINNT 1
155 // CHECK-ARM64EC-MINGW: #define _WIN32 1
156 // CHECK-ARM64EC-MINGW: #define _WIN64 1
157 // CHECK-ARM64EC-MINGW: #define __GCC_ASM_FLAG_OUTPUTS__ 1
158 // CHECK-ARM64EC-MINGW-NOT: #define __aarch64__ 1
159 // CHECK-ARM64EC-MINGW: #define __amd64 1
160 // CHECK-ARM64EC-MINGW: #define __amd64__ 1
161 // CHECK-ARM64EC-MINGW: #define __arm64ec__ 1
162 // CHECK-ARM64EC-MINGW: #define __x86_64 1
163 // CHECK-ARM64EC-MINGW: #define __x86_64__ 1