192 lines · c
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-MS645// 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 77// CHECK-MS64: #define _INTEGRAL_MAX_BITS 648// CHECK-MS64: #define _ISO_VOLATILE 19// CHECK-MS64: #define _MSC_EXTENSIONS 110// CHECK-MS64: #define _MSC_VER 190011// CHECK-MS64: #define _MSVC_LANG 201402L12// CHECK-MS64: #define _M_AMD64 10013// CHECK-MS64: #define _M_X64 10014// CHECK-MS64: #define _WIN64 115// CHECK-MS64-NOT: #define __STRICT_ANSI__16// CHECK-MS64-NOT: GNU17// CHECK-MS64-NOT: GXX18// CHECK-MS64: #define __GCC_ASM_FLAG_OUTPUTS__ 119// CHECK-MS64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 120// CHECK-MS64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 121// CHECK-MS64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 122// CHECK-MS64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 123// CHECK-MS64-NOT: GNU24// CHECK-MS64-NOT: GXX25 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-MS28// 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 730// CHECK-MS: #define _INTEGRAL_MAX_BITS 6431// CHECK-MS: #define _ISO_VOLATILE 132// CHECK-MS: #define _MSC_EXTENSIONS 133// CHECK-MS: #define _MSC_VER 190034// CHECK-MS: #define _MSVC_LANG 201703L35// CHECK-MS: #define _M_IX86 60036// CHECK-MS: #define _M_IX86_FP 037// CHECK-MS: #define _WIN32 138// CHECK-MS-NOT: #define __STRICT_ANSI__39// CHECK-MS-NOT: GNU40// CHECK-MS-NOT: GXX41// CHECK-MS: #define __GCC_ASM_FLAG_OUTPUTS__ 142// CHECK-MS: #define __GCC_CONSTRUCTIVE_SIZE {{.+}}43// CHECK-MS: #define __GCC_DESTRUCTIVE_SIZE {{.+}}44// CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 145// CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 146// CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 147// CHECK-MS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 148// CHECK-MS-NOT: GNU49// CHECK-MS-NOT: GXX50 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-CPP2053// CHECK-MS-CPP20: #define _MSC_VER 190054// CHECK-MS-CPP20: #define _MSVC_LANG 202002L55 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-CPP2B58// CHECK-MS-CPP2B: #define _MSC_VER 190059// CHECK-MS-CPP2B: #define _MSVC_LANG 202302L60 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-CPP2C63// CHECK-MS-CPP2C: #define _MSC_VER 190064// CHECK-MS-CPP2C: #define _MSVC_LANG 202400L65 66// RUN: %clang_cc1 -triple i386-windows %s -E -dM -o - \67// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-X86-WIN68 69// CHECK-X86-WIN-NOT: #define WIN32 170// CHECK-X86-WIN-NOT: #define WIN64 171// CHECK-X86-WIN-NOT: #define WINNT 172// CHECK-X86-WIN: #define _WIN32 173// CHECK-X86-WIN-NOT: #define _WIN64 174 75// RUN: %clang_cc1 -triple thumbv7-windows %s -E -dM -o - \76// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM-WIN77 78// CHECK-ARM-WIN-NOT: #define WIN32 179// CHECK-ARM-WIN-NOT: #define WIN64 180// CHECK-ARM-WIN-NOT: #define WINNT 181// CHECK-ARM-WIN: #define _WIN32 182// CHECK-ARM-WIN-NOT: #define _WIN64 183 84// RUN: %clang_cc1 -triple x86_64-windows %s -E -dM -o - \85// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-AMD64-WIN86 87// CHECK-AMD64-WIN-NOT: #define WIN32 188// CHECK-AMD64-WIN-NOT: #define WIN64 189// CHECK-AMD64-WIN-NOT: #define WINNT 190// CHECK-AMD64-WIN: #define _WIN32 191// CHECK-AMD64-WIN: #define _WIN64 192 93// RUN: %clang_cc1 -triple aarch64-windows %s -E -dM -o - \94// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64-WIN95 96// CHECK-ARM64-WIN-NOT: #define WIN32 197// CHECK-ARM64-WIN-NOT: #define WIN64 198// CHECK-ARM64-WIN-NOT: #define WINNT 199// CHECK-ARM64-WIN: #define _M_ARM64 1100// CHECK-ARM64-WIN: #define _WIN32 1101// CHECK-ARM64-WIN: #define _WIN64 1102 103// RUN: %clang_cc1 -triple arm64ec-windows %s -E -dM -o - \104// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64EC-WIN105 106// CHECK-ARM64EC-WIN-NOT: #define WIN32 1107// CHECK-ARM64EC-WIN-NOT: #define WIN64 1108// CHECK-ARM64EC-WIN-NOT: #define WINNT 1109// CHECK-ARM64EC-WIN-NOT: #define _M_ARM64 1110// CHECK-ARM64EC-WIN: #define _M_AMD64 100111// CHECK-ARM64EC-WIN: #define _M_ARM64EC 1112// CHECK-ARM64EC-WIN: #define _M_X64 100113// CHECK-ARM64EC-WIN: #define _WIN32 1114// CHECK-ARM64EC-WIN: #define _WIN64 1115 116// RUN: %clang_cc1 -triple mipsel-windows %s -E -dM -o - \117// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-MIPSEL-WIN118 119// CHECK-MIPSEL-WIN: #define _M_MRX000 4000120// CHECK-MIPSEL-WIN: #define _WIN32 1121// CHECK-MIPSEL-WIN-NOT: #define _MIPS_ 1122 123// RUN: %clang_cc1 -triple i686-windows-gnu %s -E -dM -o - \124// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-X86-MINGW125 126// CHECK-X86-MINGW: #define WIN32 1127// CHECK-X86-MINGW-NOT: #define WIN64 1128// CHECK-X86-MINGW: #define WINNT 1129// CHECK-X86-MINGW: #define _WIN32 1130// CHECK-X86-MINGW-NOT: #define _WIN64 1131// CHECK-X86-MINGW: #define __GXX_TYPEINFO_EQUALITY_INLINE 0132 133// RUN: %clang_cc1 -triple thumbv7-windows-gnu %s -E -dM -o - \134// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM-MINGW135 136// CHECK-ARM-MINGW: #define WIN32 1137// CHECK-ARM-MINGW-NOT: #define WIN64 1138// CHECK-ARM-MINGW: #define WINNT 1139// CHECK-ARM-MINGW: #define _WIN32 1140// CHECK-ARM-MINGW-NOT: #define _WIN64 1141// CHECK-ARM-MINGW: #define __GXX_TYPEINFO_EQUALITY_INLINE 0142 143// RUN: %clang_cc1 -triple x86_64-windows-gnu %s -E -dM -o - \144// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-AMD64-MINGW145 146// CHECK-AMD64-MINGW: #define WIN32 1147// CHECK-AMD64-MINGW: #define WIN64 1148// CHECK-AMD64-MINGW: #define WINNT 1149// CHECK-AMD64-MINGW: #define _WIN32 1150// CHECK-AMD64-MINGW: #define _WIN64 1151// CHECK-AMD64-MINGW: #define __GXX_TYPEINFO_EQUALITY_INLINE 0152 153// RUN: %clang_cc1 -triple aarch64-windows-gnu %s -E -dM -o - \154// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64-MINGW155 156// CHECK-ARM64-MINGW-NOT: #define _M_ARM64 1157// CHECK-ARM64-MINGW: #define WIN32 1158// CHECK-ARM64-MINGW: #define WIN64 1159// CHECK-ARM64-MINGW: #define WINNT 1160// CHECK-ARM64-MINGW: #define _WIN32 1161// CHECK-ARM64-MINGW: #define _WIN64 1162// CHECK-ARM64-MINGW: #define __GCC_ASM_FLAG_OUTPUTS__ 1163// CHECK-ARM64-MINGW: #define __GXX_TYPEINFO_EQUALITY_INLINE 0164// CHECK-ARM64-MINGW: #define __aarch64__ 1165 166// RUN: %clang_cc1 -triple arm64ec-windows-gnu %s -E -dM -o - \167// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64EC-MINGW168 169// CHECK-ARM64EC-MINGW-NOT: #define _M_ARM64EC 1170// CHECK-ARM64EC-MINGW: #define WIN32 1171// CHECK-ARM64EC-MINGW: #define WIN64 1172// CHECK-ARM64EC-MINGW: #define WINNT 1173// CHECK-ARM64EC-MINGW: #define _WIN32 1174// CHECK-ARM64EC-MINGW: #define _WIN64 1175// CHECK-ARM64EC-MINGW: #define __GCC_ASM_FLAG_OUTPUTS__ 1176// CHECK-ARM64EC-MINGW: #define __GXX_TYPEINFO_EQUALITY_INLINE 0177// CHECK-ARM64EC-MINGW-NOT: #define __aarch64__ 1178// CHECK-ARM64EC-MINGW: #define __amd64 1179// CHECK-ARM64EC-MINGW: #define __amd64__ 1180// CHECK-ARM64EC-MINGW: #define __arm64ec__ 1181// CHECK-ARM64EC-MINGW: #define __x86_64 1182// CHECK-ARM64EC-MINGW: #define __x86_64__ 1183 184// RUN: %clang_cc1 -triple mipsel-windows-gnu %s -E -dM -o - \185// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-MIPSEL-MINGW186 187// CHECK-MIPSEL-MINGW-NOT: #define _M_MRX000 4000188// CHECK-MIPSEL-MINGW: #define _MIPS_ 1189// CHECK-MIPSEL-MINGW: #define _WIN32 1190// CHECK-MIPSEL-MINGW: #define __mips 32191// CHECK-MIPSEL-MINGW: #define __mips__ 1192