diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ec7d70b8f2..827c678af9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,16 +101,14 @@ add_compile_definitions( _WIN32_WINNT=0x0A00 NTDDI_VERSION=NTDDI_WIN10_NI) if(STL_USE_ANALYZE) - # TRANSITION OS-40109504: Windows SDK: incorrect SAL annotations on functions the STL uses - # warning C6553: The annotation for function 'LCMapStringEx' on _Param_(9) - # does not apply to a value type. - # There's a bug in the declaration for LCMapStringEx - it applies _In_opt_ to an LPARAM. - # LPARAM is a LONG_PTR (intptr_t), and it's invalid to apply _In_opt_ to a non-pointer. - # As of the Windows 11 SDK (10.0.22621.0), there are 5 total occurrences of warning C6553 affecting the STL's build. + # TRANSITION, Windows SDK 10.0.22621.0 emits + # "warning C6553: The annotation for function 'LCMapStringEx' on _Param_(9) does not apply to a value type." + # Reported as OS-40109504 "Windows SDK: incorrect SAL annotations on functions the STL uses". add_compile_options("$<$:/analyze:autolog-;/wd6553>") if(VCLIBS_TARGET_ARCHITECTURE STREQUAL "arm64ec") - # TRANSITION, the Windows SDK emits "warning C28301: No annotations for first declaration of 'meow'" + # TRANSITION, Windows SDK 10.0.22621.0 emits + # "warning C28301: No annotations for first declaration of 'meow'" # for various intrinsics when building for ARM64EC. add_compile_options("$<$:/wd28301>") endif() diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1f8c6505343..973387da76a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -160,3 +160,17 @@ stages: targetArch: arm64 targetPlatform: arm64 testsBuildOnly: true + + - stage: Build_And_Test_ARM64EC + dependsOn: Build_And_Test_x64 + displayName: 'Build and Test ARM64EC' + pool: + name: ${{ variables.poolName }} + demands: ${{ variables.poolDemands }} + jobs: + - template: azure-devops/build-and-test.yml + parameters: + hostArch: x64 + targetArch: arm64 + targetPlatform: arm64ec + testsBuildOnly: true diff --git a/tests/std/tests/GH_001103_countl_zero_correctness/test.cpp b/tests/std/tests/GH_001103_countl_zero_correctness/test.cpp index b2465871e13..d9b156c5f87 100644 --- a/tests/std/tests/GH_001103_countl_zero_correctness/test.cpp +++ b/tests/std/tests/GH_001103_countl_zero_correctness/test.cpp @@ -12,7 +12,7 @@ using namespace std; int main() { // This test is applicable only to x86 and x64 platforms -#if defined(_M_IX86) || defined(_M_X64) +#if (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC)) assert(_Countl_zero_bsr(static_cast(0x00)) == 8); assert(_Countl_zero_bsr(static_cast(0x13)) == 3); assert(_Countl_zero_bsr(static_cast(0x83)) == 0); @@ -67,5 +67,5 @@ int main() { assert(_Countr_zero_bsf(static_cast(0x8000'0000'0000'0002)) == 1); assert(_Countr_zero_bsf(static_cast(0x8000'0000'0000'0000)) == 63); assert(_Countr_zero_bsf(static_cast(0xF000'0000'0000'0008)) == 3); -#endif // ^^^ defined(_M_IX86) || defined(_M_X64) ^^^ +#endif // ^^^ (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC)) ^^^ } diff --git a/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp b/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp index 302200fc3ef..754a28a48e0 100644 --- a/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp +++ b/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp @@ -32,10 +32,15 @@ // Also test GH-2645: : Conformance issue on [[msvc::known_semantics]] #define msvc 1 #define known_semantics 2 -#define intrinsic 3 -#define lifetimebound 4 -#define noop_dtor 5 -#define empty_bases 6 + +#ifndef _M_ARM64EC // TRANSITION, Windows SDK 10.0.22621.0 uses '#pragma intrinsic(fabsf)' for ARM64EC. + // This use is no longer present in Windows SDK 10.0.26100.0. +#define intrinsic 3 +#endif // ^^^ no workaround ^^^ + +#define lifetimebound 4 +#define noop_dtor 5 +#define empty_bases 6 #include <__msvc_all_public_headers.hpp> @@ -47,9 +52,11 @@ #error bad macro expansion #endif // known_semantics != 2 +#ifndef _M_ARM64EC // TRANSITION, Windows SDK 10.0.22621.0 #if intrinsic != 3 #error bad macro expansion #endif // intrinsic != 3 +#endif // ^^^ no workaround ^^^ #if lifetimebound != 4 #error bad macro expansion diff --git a/tests/std/tests/P1502R1_standard_library_header_units/custom_format.py b/tests/std/tests/P1502R1_standard_library_header_units/custom_format.py index bcb09e3ec35..6a2e45ade1e 100644 --- a/tests/std/tests/P1502R1_standard_library_header_units/custom_format.py +++ b/tests/std/tests/P1502R1_standard_library_header_units/custom_format.py @@ -124,6 +124,8 @@ def getBuildSteps(self, test, litConfig, shared): if noisyProgress: print('Creating library...') cmd = ['lib.exe', '/nologo', f'/out:{libFilename}', *objFilenames] + if litConfig.target_arch.casefold() == 'arm64ec'.casefold(): + cmd.append('/machine:arm64ec') yield TestStep(cmd, shared.execDir, shared.env, False) if compileTestCppWithEdg: diff --git a/tests/std/tests/P1502R1_standard_library_header_units/custombuild.pl b/tests/std/tests/P1502R1_standard_library_header_units/custombuild.pl index 458338d1c47..6f622a7edd8 100644 --- a/tests/std/tests/P1502R1_standard_library_header_units/custombuild.pl +++ b/tests/std/tests/P1502R1_standard_library_header_units/custombuild.pl @@ -173,6 +173,7 @@ () # For convenience, create a library file containing all of the object files that were produced. my $libFilename = "stl_header_units.lib"; Run::ExecuteCommand(join(" ", "lib.exe", "/nologo", "/out:$libFilename", @objFilenames)); + # TRANSITION, when we test ARM64EC internally, add "/machine:arm64ec" here to match custom_format.py. Run::ExecuteCL(join(" ", "test.cpp", "/Fe$cwd.exe", @consumeBuiltHeaderUnits, $libFilename)); } diff --git a/tests/std/tests/P1502R1_standard_library_header_units/test.cpp b/tests/std/tests/P1502R1_standard_library_header_units/test.cpp index a4e51a71043..cb9bb4cb64d 100644 --- a/tests/std/tests/P1502R1_standard_library_header_units/test.cpp +++ b/tests/std/tests/P1502R1_standard_library_header_units/test.cpp @@ -9,6 +9,11 @@ // This EXCLUDES the headers in: // [tab:headers.cpp.c]: "Table 22: C++ headers for C library facilities" +// TRANSITION, Windows SDK 10.0.22621.0 causes this test to fail for ARM64EC with: +// "error LNK2019: unresolved external symbol fabsf referenced in function #fabsf$exit_thunk (EC Symbol)" +// It passes when built with Windows SDK 10.0.26100.0. +// UNSUPPORTED: arm64ec + import ; import ; import ; diff --git a/tests/std/tests/P2465R3_standard_library_modules/test.cpp b/tests/std/tests/P2465R3_standard_library_modules/test.cpp index 06e295a6ef6..8ced3aa5137 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/test.cpp +++ b/tests/std/tests/P2465R3_standard_library_modules/test.cpp @@ -1,6 +1,11 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// TRANSITION, Windows SDK 10.0.22621.0 causes this test to fail for ARM64EC with: +// "error LNK2019: unresolved external symbol fabsf referenced in function #fabsf$exit_thunk (EC Symbol)" +// It passes when built with Windows SDK 10.0.26100.0. +// UNSUPPORTED: arm64ec + import std; #include // intentionally not diff --git a/tests/std/tests/VSO_1775715_user_defined_modules/test.cpp b/tests/std/tests/VSO_1775715_user_defined_modules/test.cpp index 599515d10bc..d09811eae53 100644 --- a/tests/std/tests/VSO_1775715_user_defined_modules/test.cpp +++ b/tests/std/tests/VSO_1775715_user_defined_modules/test.cpp @@ -3,6 +3,13 @@ // Note: To properly test the fix for VSO-1775715, don't include any headers here. +// TRANSITION, Windows SDK 10.0.22621.0 causes this test to fail for ARM64EC with: +// "error LNK2019: unresolved external symbol fabsf referenced in function #fabsf$exit_thunk (EC Symbol)" +// Windows SDK 10.0.26100.0 will avoid that error, but we'll need to investigate why user.ixx emits: +// "error C2678: binary '==': no operator found which takes a left-hand operand of type 'const std::string' +// (or there is no acceptable conversion)" +// UNSUPPORTED: arm64ec + import User; int main() { diff --git a/tests/utils/stl/test/features.py b/tests/utils/stl/test/features.py index f5a13551fc1..6510a36af6a 100644 --- a/tests/utils/stl/test/features.py +++ b/tests/utils/stl/test/features.py @@ -65,4 +65,7 @@ def getDefaultFeatures(config, litConfig): elif litConfig.target_arch.casefold() == 'arm64'.casefold(): DEFAULT_FEATURES.append(Feature(name='arm64')) + elif litConfig.target_arch.casefold() == 'arm64ec'.casefold(): + DEFAULT_FEATURES.append(Feature(name='arm64ec')) + return DEFAULT_FEATURES diff --git a/tests/utils/stl/test/tests.py b/tests/utils/stl/test/tests.py index ef51b790d4a..aa8a6acbc0d 100644 --- a/tests/utils/stl/test/tests.py +++ b/tests/utils/stl/test/tests.py @@ -232,11 +232,11 @@ def _handleEnvlst(self, litConfig): self.compileFlags.extend(self.envlstEntry.getEnvVal('PM_CL', '').split()) self.linkFlags.extend(self.envlstEntry.getEnvVal('PM_LINK', '').split()) + targetArch = litConfig.target_arch.casefold() if ('clang'.casefold() in os.path.basename(cxx).casefold()): self._addCustomFeature('clang') self._addCustomFeature('gcc-style-warnings') - targetArch = litConfig.target_arch.casefold() if (targetArch == 'x64'.casefold()): self.compileFlags.append('-m64') elif (targetArch == 'x86'.casefold()): @@ -245,6 +245,9 @@ def _handleEnvlst(self, litConfig): return Result(UNSUPPORTED, 'clang targeting arm is not supported') elif (targetArch == 'arm64'.casefold()): self.compileFlags.append('--target=arm64-pc-windows-msvc') + elif (targetArch == 'arm64ec'.casefold()): + # TRANSITION, LLVM-116256 (fixed in Clang 20) + return Result(UNSUPPORTED, 'clang targeting arm64ec is not supported') elif ('nvcc'.casefold() in os.path.basename(cxx).casefold()): self._addCustomFeature('nvcc') @@ -253,6 +256,15 @@ def _handleEnvlst(self, litConfig): else: self._addCustomFeature('cl-style-warnings') + if (targetArch == 'arm64ec'.casefold()): + self.compileFlags.append('/arm64EC') + self.linkFlags.append('/machine:arm64ec') + + # TRANSITION, Windows SDK 10.0.22621.0 emits + # "warning C28301: No annotations for first declaration of 'meow'" + # for various intrinsics when building for ARM64EC. + self.compileFlags.append('/wd28301') + self.cxx = os.path.normpath(cxx) return None