Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/std/tests/GH_001103_countl_zero_correctness/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned char>(0x00)) == 8);
assert(_Countl_zero_bsr(static_cast<unsigned char>(0x13)) == 3);
assert(_Countl_zero_bsr(static_cast<unsigned char>(0x83)) == 0);
Expand Down Expand Up @@ -67,5 +67,5 @@ int main() {
assert(_Countr_zero_bsf(static_cast<unsigned long long>(0x8000'0000'0000'0002)) == 1);
assert(_Countr_zero_bsf(static_cast<unsigned long long>(0x8000'0000'0000'0000)) == 63);
assert(_Countr_zero_bsf(static_cast<unsigned long long>(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)) ^^^
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
#define noop_dtor 5
#define empty_bases 6

#ifdef _M_ARM64EC
// TRANSITION, Windows SDK 10.0.22621.0 uses '#pragma intrinsic(fabsf)' in corecrt_math.h when _M_ARM64EC is defined.
// This use is no longer present in Windows SDK 10.0.26100.0.
#undef intrinsic
#endif // ^^^ workaround ^^^

#include <__msvc_all_public_headers.hpp>

#if msvc != 1
Expand All @@ -47,9 +53,11 @@
#error bad macro expansion
#endif // known_semantics != 2

#ifndef _M_ARM64EC // TRANSITION, Windows SDK
#if intrinsic != 3
#error bad macro expansion
#endif // intrinsic != 3
#endif // ^^^ no workaround ^^^

#if lifetimebound != 4
#error bad macro expansion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
// This EXCLUDES the <cmeow> headers in:
// [tab:headers.cpp.c]: "Table 22: C++ headers for C library facilities"

// TRANSITION, this test fails for ARM64EC when built with Windows SDK 10.0.22621.0.
// "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 <algorithm>;
import <any>;
import <array>;
Expand Down
5 changes: 5 additions & 0 deletions tests/std/tests/P2465R3_standard_library_modules/test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// TRANSITION, this test fails for ARM64EC when built with Windows SDK 10.0.22621.0.
// "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 <assert.h> // intentionally not <cassert>
Expand Down
4 changes: 4 additions & 0 deletions tests/std/tests/VSO_1775715_user_defined_modules/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

// Note: To properly test the fix for VSO-1775715, don't include any headers here.

// TRANSITION, this test fails for ARM64EC when built with Windows SDK 10.0.22621.0.
// "error LNK2019: unresolved external symbol fabsf referenced in function #fabsf$exit_thunk (EC Symbol)"
// UNSUPPORTED: arm64ec

import User;

int main() {
Expand Down
3 changes: 3 additions & 0 deletions tests/utils/stl/test/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 12 additions & 1 deletion tests/utils/stl/test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()):
Expand All @@ -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')

Expand All @@ -253,6 +256,14 @@ def _handleEnvlst(self, litConfig):
else:
self._addCustomFeature('cl-style-warnings')

if (targetArch == 'arm64ec'.casefold()):
self.compileFlags.append('/arm64EC')
self.linkFlags.append('/machine:arm64ec')

# TRANSITION, the Windows SDK 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

Expand Down