1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 // This code tests the consistency of architecture-specific predefined macros
8 // inherited from MSVC, before and after windows.h inclusion. See
9 // https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros for a
10 // list of such macros.
12 // If this test compiles, it is successful. See bug 1866562 for an example
13 // where mingwclang builds were failing to compile this code.
16 constexpr auto kIX86
= _M_IX86
;
20 constexpr auto kX64
= _M_X64
;
24 constexpr auto kAMD64
= _M_AMD64
;
28 constexpr auto kARM
= _M_ARM
;
32 constexpr auto kARM64
= _M_ARM64
;
38 static_assert(kIX86
== _M_IX86
);
42 static_assert(kX64
== _M_X64
);
46 static_assert(kAMD64
== _M_AMD64
);
50 static_assert(kARM
== _M_ARM
);
54 static_assert(kARM64
== _M_ARM64
);
57 // If this test compiles, it is successful.
58 int main() { return 0; }