Skip to content

Commit

Permalink
[LoongArch64] supporting src/tests/run.sh on LA64. (#74470)
Browse files Browse the repository at this point in the history
* [LoongArch64] supporting `src/tests/run.sh` on LA64.

* amend getting the `arch` for CR.
  • Loading branch information
shushanhf authored Aug 27, 2022
1 parent 51f7639 commit acfd683
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 48 deletions.
8 changes: 4 additions & 4 deletions eng/native/init-os-and-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ FreeBSD|Linux|NetBSD|OpenBSD|SunOS|Android)
Darwin)
os=OSX ;;
*)
echo "Unsupported OS $OSName detected, configuring as if for Linux"
os=Linux ;;
echo "Unsupported OS $OSName detected!"
exit 1 ;;
esac

# On Solaris, `uname -m` is discouraged, see https://docs.oracle.com/cd/E36784_01/html/E36870/uname-1.html
Expand Down Expand Up @@ -74,7 +74,7 @@ case "$CPUName" in
arch=ppc64le
;;
*)
echo "Unknown CPU $CPUName detected, configuring as if for x64"
arch=x64
echo "Unknown CPU $CPUName detected!"
exit 1
;;
esac
2 changes: 1 addition & 1 deletion src/coreclr/scripts/coreclr_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self,
self.require_built_core_root = require_built_core_root
self.require_built_test_dir = require_built_test_dir

self.valid_arches = ["x64", "x86", "arm", "arm64", "wasm"]
self.valid_arches = ["x64", "x86", "arm", "arm64", "loongarch64", "wasm"]
self.valid_build_types = ["Debug", "Checked", "Release"]
self.valid_host_os = ["windows", "OSX", "Linux", "illumos", "Solaris", "Browser", "Android"]

Expand Down
48 changes: 5 additions & 43 deletions src/tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,55 +39,14 @@ function print_usage {
echo ' --limitedDumpGeneration : '
}

function check_cpu_architecture {
local CPUName=$(uname -m)
local __arch=

if [[ "$(uname -s)" == "SunOS" ]]; then
CPUName=$(isainfo -n)
fi

case $CPUName in
i686)
__arch=x86
;;
amd64|x86_64)
__arch=x64
;;
armv7l)
__arch=arm
;;
aarch64|arm64)
__arch=arm64
;;
loongarch64)
__arch=loongarch64
;;
riscv64)
__arch=riscv64
;;
*)
echo "Unknown CPU $CPUName detected, configuring as if for x64"
__arch=x64
;;
esac

echo "$__arch"
}

################################################################################
# Handle Arguments
################################################################################

ARCH=$(check_cpu_architecture)

# Exit code constants
readonly EXIT_CODE_SUCCESS=0 # Script ran normally.
readonly EXIT_CODE_EXCEPTION=1 # Script exited because something exceptional happened (e.g. bad arguments, Ctrl-C interrupt).
readonly EXIT_CODE_TEST_FAILURE=2 # Script completed successfully, but one or more tests failed.

# Argument variables
buildArch=$ARCH
source "$repoRootDir/eng/native/init-os-and-arch.sh"
buildArch="$arch"
buildOS=
buildConfiguration="Debug"
testRootDir=
Expand Down Expand Up @@ -129,6 +88,9 @@ do
arm64)
buildArch="arm64"
;;
loongarch64)
buildArch="loongarch64"
;;
wasm)
buildArch="wasm"
;;
Expand Down

0 comments on commit acfd683

Please sign in to comment.