diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index bf4b3b1b55de81..1a9c9ed1ca0650 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,8 +1,57 @@ # Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths. # See https://help.github.com/articles/about-code-owners/ -/src/libraries/Common/src/System/Net/Http/Http2/ @dotnet/http2 -/src/libraries/Common/tests/Tests/System/Net/Http2/ @dotnet/http2 +/src/libraries/Common/src/System/Net/Http/aspnetcore/ @dotnet/http +/src/libraries/Common/tests/Tests/System/Net/aspnetcore/ @dotnet/http /src/libraries/System.Text.Json/ @ahsonkhan @steveharter @layomia @Jozkee /src/libraries/System.Buffers/ @ahsonkhan -/src/libraries/System.Memory/ @ahsonkhan \ No newline at end of file +/src/libraries/System.Memory/ @ahsonkhan + +# Mono Code Owners + +/src/mono @marek-safar + +/src/mono/llvm @vargaz @SamMonoRT @imhameed @EgorBo + +/src/mono/mono/arch @vargaz @lewurm +/src/mono/mono/benchmark @SamMonoRT @lewurm +/src/mono/mono/btls @baulig @marek-safar +/src/mono/mono/dis @lambdageek @vargaz +/src/mono/mono/eglib @vargaz @lambdageek @CoffeeFlux @lewurm + +/src/mono/mono/metadata @vargaz @lambdageek @thaystg @CoffeeFlux @lewurm @alexischr +/src/mono/mono/metadata/*-win* @lateralusX @lambdageek @CoffeeFlux +/src/mono/mono/metadata/handle* @lambdageek @vargaz +/src/mono/mono/metadata/monitor* @brzvlad @vargaz +/src/mono/mono/metadata/sgen* @brzvlad @vargaz @naricc +/src/mono/mono/metadata/thread* @lateralusX @lambdageek +/src/mono/mono/metadata/w32* @lateralusX @lambdageek @CoffeeFlux + +/src/mono/mono/mini @vargaz @lewurm @lambdageek @SamMonoRT @CoffeeFlux @alexischr +/src/mono/mono/mini/*cfgdump* @lewurm @vargaz +/src/mono/mono/mini/*exceptions* @lewurm @vargaz @BrzVlad +/src/mono/mono/mini/*llvm* @vargaz @imhameed @EgorBo +/src/mono/mono/mini/*ppc* @lewurm @vargaz +/src/mono/mono/mini/*profiler* @BrzVlad @lambdageek +/src/mono/mono/mini/*riscv* @alexrp @lewurm +/src/mono/mono/mini/*type-check* @lewurm @lambdageek +/src/mono/mono/mini/debugger-agent.c @vargaz @thaystg @DavidKarlas @lambdageek +/src/mono/mono/mini/interp/* @lewurm @BrzVlad + +/src/mono/mono/native @baulig @egorbo @alexischr @marek-safar +/src/mono/mono/profiler @BrzVlad @lambdageek +/src/mono/mono/sgen @BrzVlad @lambdageek + +/src/mono/mono/utils @vargaz @lewurm @lambdageek @CoffeeFlux @alexischr +/src/mono/mono/utils/*-win* @lateralusX @lambdageek @CoffeeFlux +/src/mono/mono/utils/atomic* @lewurm @vargaz +/src/mono/mono/utils/mono-hwcap* @lewurm @vargaz +/src/mono/mono/utils/mono-mem* @lewurm @vargaz +/src/mono/mono/utils/mono-merp* @alexischr @lambdageek +/src/mono/mono/utils/mono-state* @alexischr @lambdageek +/src/mono/mono/utils/mono-threads* @lambdageek @vargaz + +/src/mono/msvc @lateralusX @kg @akoeplinger +/src/mono/msvc/scripts @akoeplinger @kg + +/src/mono/netcore @marek-safar @akoeplinger @egorbo @vargaz @steveisok diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f5aa864b7e3ce..51116d4b192da7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ You can contribute to .NET Runtime with issues and PRs. Simply filing issues for ## Contribution "Bar" -Project maintainers will merge changes that improve the product significantly and broadly and that align with the [.NET Core roadmap](https://github.com/dotnet/core/blob/master/roadmap.md). +Project maintainers will merge changes that improve the product significantly and broadly and that align with the [.NET Roadmap](https://github.com/dotnet/core/blob/master/roadmap.md). Maintainers will not merge changes that have narrowly-defined benefits, due to compatibility risk. The .NET Core codebase is used by several Microsoft products (for example, ASP.NET Core, .NET Framework 4.x, Windows Universal Apps) to enable execution of managed code. Other companies are building products on top of .NET, too. We may revert changes if they are found to be breaking. @@ -74,14 +74,6 @@ Note: It is OK to create your PR as "[WIP]" on the upstream repo before the impl The team marks the most straightforward issues as [up for grabs](https://github.com/dotnet/runtime/labels/up-for-grabs). This set of issues is the place to start if you are interested in contributing but new to the codebase. -Some issues have not yet been migrated here from our "old" repos. You can find those here: - -[CoreFX up for grabs](https://github.com/dotnet/corefx/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs) - -[CoreCLR up for grabs](https://github.com/dotnet/coreclr/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs) - -Even for these issues, the pull request should go to this repo. - ## Commit Messages Please format commit messages as follows (based on [A Note About Git Commit Messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)): diff --git a/README.md b/README.md index 7ac97954a3d6a4..8e18075c3a8281 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ This repo should contain issues that are tied to the runtime, the class librarie For other issues, please use the following repos: - For overall .NET Core SDK issues, file in the [dotnet/toolset](https://github.com/dotnet/toolset) repo -- For ASP.NET issues, file in the [aspnet/aspnetcore](http://github.com/aspnet/aspnetcore) repo. +- For ASP.NET issues, file in the [dotnet/aspnetcore](https://github.com/dotnet/aspnetcore) repo. ## Useful Links @@ -47,829 +47,6 @@ For other issues, please use the following repos: * [.NET API Catalog](http://apisof.net) (incl. APIs from daily builds and API usage info) * [API docs writing guidelines](https://github.com/dotnet/dotnet-api-docs/wiki) - useful when writing /// comments -## Daily Builds - - - - -| Platform | Master | Release/3.0.X | Release/2.2.X | Release/2.1.X | -| --- | :---: | :---: | :---: | :---: | -| **Windows (x64)** | [![][win-x64-badge-master]][win-x64-version-master]
[Installer][win-x64-installer-master] ([Checksum][win-x64-installer-checksum-master])
[zip][win-x64-zip-master] ([Checksum][win-x64-zip-checksum-master])
[NetHost (zip)][win-x64-nethost-zip-master]
[Symbols (zip)][win-x64-symbols-zip-master] | [![][win-x64-badge-3.0.X]][win-x64-version-3.0.X]
[Installer][win-x64-installer-3.0.X] ([Checksum][win-x64-installer-checksum-3.0.X])
[zip][win-x64-zip-3.0.X] ([Checksum][win-x64-zip-checksum-3.0.X])
[NetHost (zip)][win-x64-nethost-zip-3.0.X]
[Symbols (zip)][win-x64-symbols-zip-3.0.X] | [![][win-x64-badge-2.2.X]][win-x64-version-2.2.X]
[Installer][win-x64-installer-2.2.X] ([Checksum][win-x64-installer-checksum-2.2.X])
[zip][win-x64-zip-2.2.X] ([Checksum][win-x64-zip-checksum-2.2.X])
[Symbols (zip)][win-x64-symbols-zip-2.2.X] | [![][win-x64-badge-2.1.X]][win-x64-version-2.1.X]
[Installer][win-x64-installer-2.1.X] ([Checksum][win-x64-installer-checksum-2.1.X])
[zip][win-x64-zip-2.1.X] ([Checksum][win-x64-zip-checksum-2.1.X])
[Symbols (zip)][win-x64-symbols-zip-2.1.X] | -| **Windows (x86)** | [![][win-x86-badge-master]][win-x86-version-master]
[Installer][win-x86-installer-master] ([Checksum][win-x86-installer-checksum-master])
[zip][win-x86-zip-master] ([Checksum][win-x86-zip-checksum-master])
[NetHost (zip)][win-x86-nethost-zip-master]
[Symbols (zip)][win-x86-symbols-zip-master] | [![][win-x86-badge-3.0.X]][win-x86-version-3.0.X]
[Installer][win-x86-installer-3.0.X] ([Checksum][win-x86-installer-checksum-3.0.X])
[zip][win-x86-zip-3.0.X] ([Checksum][win-x86-zip-checksum-3.0.X])
[NetHost (zip)][win-x86-nethost-zip-3.0.X]
[Symbols (zip)][win-x86-symbols-zip-3.0.X] | [![][win-x86-badge-2.2.X]][win-x86-version-2.2.X]
[Installer][win-x86-installer-2.2.X] ([Checksum][win-x86-installer-checksum-2.2.X])
[zip][win-x86-zip-2.2.X] ([Checksum][win-x86-zip-checksum-2.2.X])
[Symbols (zip)][win-x86-symbols-zip-2.2.X] | [![][win-x86-badge-2.1.X]][win-x86-version-2.1.X]
[Installer][win-x86-installer-2.1.X] ([Checksum][win-x86-installer-checksum-2.1.X])
[zip][win-x86-zip-2.1.X] ([Checksum][win-x86-zip-checksum-2.1.X])
[Symbols (zip)][win-x86-symbols-zip-2.1.X] | -| **Windows (arm32)** | [![][win-arm-badge-master]][win-arm-version-master]
[zip][win-arm-zip-master] ([Checksum][win-arm-zip-checksum-master])
[NetHost (zip)][win-arm-nethost-zip-master]
[Symbols (zip)][win-arm-symbols-zip-master] | [![][win-arm-badge-3.0.X]][win-arm-version-3.0.X]
[zip][win-arm-zip-3.0.X] ([Checksum][win-arm-zip-checksum-3.0.X])
[NetHost (zip)][win-arm-nethost-zip-3.0.X]
[Symbols (zip)][win-arm-symbols-zip-3.0.X] | [![][win-arm-badge-2.2.X]][win-arm-version-2.2.X]
[zip][win-arm-zip-2.2.X] ([Checksum][win-arm-zip-checksum-2.2.X])
[Symbols (zip)][win-arm-symbols-zip-2.2.X] | [![][win-arm-badge-2.1.X]][win-arm-version-2.1.X]
[zip][win-arm-zip-2.1.X] ([Checksum][win-arm-zip-checksum-2.1.X])
[Symbols (zip)][win-arm-symbols-zip-2.1.X] | -| **Windows (arm64)** | [![][win-arm64-badge-master]][win-arm64-version-master]
[zip][win-arm64-zip-master] ([Checksum][win-arm64-zip-checksum-master])
[NetHost (zip)][win-arm64-nethost-zip-master]
[Symbols (zip)][win-arm64-symbols-zip-master] | [![][win-arm64-badge-3.0.X]][win-arm64-version-3.0.X]
[zip][win-arm64-zip-3.0.X] ([Checksum][win-arm64-zip-checksum-3.0.X])
[NetHost (zip)][win-arm64-nethost-zip-3.0.X]
[Symbols (zip)][win-arm64-symbols-zip-3.0.X] | [![][win-arm64-badge-2.2.X]][win-arm64-version-2.2.X]
[zip][win-arm64-zip-2.2.X] ([Checksum][win-arm64-zip-checksum-2.2.X])
[Symbols (zip)][win-arm64-symbols-zip-2.2.X] | [![][win-arm64-badge-2.1.X]][win-arm64-version-2.1.X]
[zip][win-arm64-zip-2.1.X] ([Checksum][win-arm64-zip-checksum-2.1.X])
[Symbols (zip)][win-arm64-symbols-zip-2.1.X] | -| **Mac OS X (x64)** | [![][osx-badge-master]][osx-version-master]
[Installer][osx-installer-master] ([Checksum][osx-installer-checksum-master])
[tar.gz][osx-targz-master] ([Checksum][osx-targz-checksum-master])
[NetHost (tar.gz)][osx-nethost-targz-master]
[Symbols (tar.gz)][osx-symbols-targz-master] | [![][osx-badge-3.0.X]][osx-version-3.0.X]
[Installer][osx-installer-3.0.X] ([Checksum][osx-installer-checksum-3.0.X])
[tar.gz][osx-targz-3.0.X] ([Checksum][osx-targz-checksum-3.0.X])
[NetHost (tar.gz)][osx-nethost-targz-3.0.X]
[Symbols (tar.gz)][osx-symbols-targz-3.0.X] | [![][osx-badge-2.2.X]][osx-version-2.2.X]
[Installer][osx-installer-2.2.X] ([Checksum][osx-installer-checksum-2.2.X])
[tar.gz][osx-targz-2.2.X] ([Checksum][osx-targz-checksum-2.2.X])
[Symbols (tar.gz)][osx-symbols-targz-2.2.X] | [![][osx-badge-2.1.X]][osx-version-2.1.X]
[Installer][osx-installer-2.1.X] ([Checksum][osx-installer-checksum-2.1.X])
[tar.gz][osx-targz-2.1.X] ([Checksum][osx-targz-checksum-2.1.X])
[Symbols (tar.gz)][osx-symbols-targz-2.1.X] | -| **Linux (x64)** (for glibc based OS) | [![][linux-x64-badge-master]][linux-x64-version-master]
[tar.gz][linux-x64-targz-master] ([Checksum][linux-x64-targz-checksum-master])
[NetHost (tar.gz)][linux-x64-nethost-targz-master]
[Symbols (tar.gz)][linux-x64-symbols-targz-master] | [![][linux-x64-badge-3.0.X]][linux-x64-version-3.0.X]
[tar.gz][linux-x64-targz-3.0.X] ([Checksum][linux-x64-targz-checksum-3.0.X])
[NetHost (tar.gz)][linux-x64-nethost-targz-3.0.X]
[Symbols (tar.gz)][linux-x64-symbols-targz-3.0.X] | [![][linux-x64-badge-2.2.X]][linux-x64-version-2.2.X]
[tar.gz][linux-x64-targz-2.2.X] ([Checksum][linux-x64-targz-checksum-2.2.X])
[Symbols (tar.gz)][linux-x64-symbols-targz-2.2.X] | [![][linux-x64-badge-2.1.X]][linux-x64-version-2.1.X]
[tar.gz][linux-x64-targz-2.1.X] ([Checksum][linux-x64-targz-checksum-2.1.X])
[Symbols (tar.gz)][linux-x64-symbols-targz-2.1.X] | -| **Linux (armhf)** (for glibc based OS) | [![][linux-arm-badge-master]][linux-arm-version-master]
[tar.gz][linux-arm-targz-master] ([Checksum][linux-arm-targz-checksum-master])
[NetHost (tar.gz)][linux-arm-nethost-targz-master]
[Symbols (tar.gz)][linux-arm-symbols-targz-master] | [![][linux-arm-badge-3.0.X]][linux-arm-version-3.0.X]
[tar.gz][linux-arm-targz-3.0.X] ([Checksum][linux-arm-targz-checksum-3.0.X])
[NetHost (tar.gz)][linux-arm-nethost-targz-3.0.X]
[Symbols (tar.gz)][linux-arm-symbols-targz-3.0.X] | [![][linux-arm-badge-2.2.X]][linux-arm-version-2.2.X]
[tar.gz][linux-arm-targz-2.2.X] ([Checksum][linux-arm-targz-checksum-2.2.X])
[Symbols (tar.gz)][linux-arm-symbols-targz-2.2.X] | [![][linux-arm-badge-2.1.X]][linux-arm-version-2.1.X]
[tar.gz][linux-arm-targz-2.1.X] ([Checksum][linux-arm-targz-checksum-2.1.X])
[Symbols (tar.gz)][linux-arm-symbols-targz-2.1.X] | -| **Linux (arm64)** (for glibc based OS) | [![][linux-arm64-badge-master]][linux-arm64-version-master]
[tar.gz][linux-arm64-targz-master] ([Checksum][linux-arm64-targz-checksum-master])
[NetHost (tar.gz)][linux-arm64-nethost-targz-master]
[Symbols (tar.gz)][linux-arm64-symbols-targz-master] | [![][linux-arm64-badge-3.0.X]][linux-arm64-version-3.0.X]
[tar.gz][linux-arm64-targz-3.0.X] ([Checksum][linux-arm64-targz-checksum-3.0.X])
[NetHost (tar.gz)][linux-arm64-nethost-targz-3.0.X]
[Symbols (tar.gz)][linux-arm64-symbols-targz-3.0.X] | [![][linux-arm64-badge-2.2.X]][linux-arm64-version-2.2.X]
[tar.gz][linux-arm64-targz-2.2.X] ([Checksum][linux-arm64-targz-checksum-2.2.X])
[Symbols (tar.gz)][linux-arm64-symbols-targz-2.2.X] | [![][linux-arm64-badge-2.1.X]][linux-arm64-version-2.1.X]
[tar.gz][linux-arm64-targz-2.1.X] ([Checksum][linux-arm64-targz-checksum-2.1.X])
[Symbols (tar.gz)][linux-arm64-symbols-targz-2.1.X] | -| **Ubuntu 14.04 (x64)** | [![][ubuntu-14.04-badge-master]][ubuntu-14.04-version-master]
[Runtime-Deps][ubuntu-14.04-runtime-deps-master] ([Checksum][ubuntu-14.04-runtime-deps-checksum-master])
[Host][ubuntu-14.04-host-master] ([Checksum][ubuntu-14.04-host-checksum-master])
[Host FX Resolver][ubuntu-14.04-hostfxr-master] ([Checksum][ubuntu-14.04-hostfxr-checksum-master])
[Shared Framework][ubuntu-14.04-sharedfx-master] ([Checksum][ubuntu-14.04-sharedfx-checksum-master]) | [![][ubuntu-14.04-badge-3.0.X]][ubuntu-14.04-version-3.0.X]
[Runtime-Deps][ubuntu-14.04-runtime-deps-3.0.X] ([Checksum][ubuntu-14.04-runtime-deps-checksum-3.0.X])
[Host][ubuntu-14.04-host-3.0.X] ([Checksum][ubuntu-14.04-host-checksum-3.0.X])
[Host FX Resolver][ubuntu-14.04-hostfxr-3.0.X] ([Checksum][ubuntu-14.04-hostfxr-checksum-3.0.X])
[Shared Framework][ubuntu-14.04-sharedfx-3.0.X] ([Checksum][ubuntu-14.04-sharedfx-checksum-3.0.X]) | [![][ubuntu-14.04-badge-2.2.X]][ubuntu-14.04-version-2.2.X]
[Host][ubuntu-14.04-host-2.2.X] ([Checksum][ubuntu-14.04-host-checksum-2.2.X])
[Host FX Resolver][ubuntu-14.04-hostfxr-2.2.X] ([Checksum][ubuntu-14.04-hostfxr-checksum-2.2.X])
[Shared Framework][ubuntu-14.04-sharedfx-2.2.X] ([Checksum][ubuntu-14.04-sharedfx-checksum-2.2.X]) | [![][ubuntu-14.04-badge-2.1.X]][ubuntu-14.04-version-2.1.X]
[Host][ubuntu-14.04-host-2.1.X] ([Checksum][ubuntu-14.04-host-checksum-2.1.X])
[Host FX Resolver][ubuntu-14.04-hostfxr-2.1.X] ([Checksum][ubuntu-14.04-hostfxr-checksum-2.1.X])
[Shared Framework][ubuntu-14.04-sharedfx-2.1.X] ([Checksum][ubuntu-14.04-sharedfx-checksum-2.1.X]) | -| **Ubuntu 16.04 (x64)** | [![][ubuntu-16.04-badge-master]][ubuntu-16.04-version-master]
[Runtime-Deps][ubuntu-16.04-runtime-deps-master] ([Checksum][ubuntu-16.04-runtime-deps-checksum-master])
[Host][ubuntu-16.04-host-master] ([Checksum][ubuntu-16.04-host-checksum-master])
[Host FX Resolver][ubuntu-16.04-hostfxr-master] ([Checksum][ubuntu-16.04-hostfxr-checksum-master])
[Shared Framework][ubuntu-16.04-sharedfx-master] ([Checksum][ubuntu-16.04-sharedfx-checksum-master]) | [![][ubuntu-16.04-badge-3.0.X]][ubuntu-16.04-version-3.0.X]
[Runtime-Deps][ubuntu-16.04-runtime-deps-3.0.X] ([Checksum][ubuntu-16.04-runtime-deps-checksum-3.0.X])
[Host][ubuntu-16.04-host-3.0.X] ([Checksum][ubuntu-16.04-host-checksum-3.0.X])
[Host FX Resolver][ubuntu-16.04-hostfxr-3.0.X] ([Checksum][ubuntu-16.04-hostfxr-checksum-3.0.X])
[Shared Framework][ubuntu-16.04-sharedfx-3.0.X] ([Checksum][ubuntu-16.04-sharedfx-checksum-3.0.X]) | [![][ubuntu-16.04-badge-2.2.X]][ubuntu-16.04-version-2.2.X]
[Host][ubuntu-16.04-host-2.2.X] ([Checksum][ubuntu-16.04-host-checksum-2.2.X])
[Host FX Resolver][ubuntu-16.04-hostfxr-2.2.X] ([Checksum][ubuntu-16.04-hostfxr-checksum-2.2.X])
[Shared Framework][ubuntu-16.04-sharedfx-2.2.X] ([Checksum][ubuntu-16.04-sharedfx-checksum-2.2.X]) | [![][ubuntu-16.04-badge-2.1.X]][ubuntu-16.04-version-2.1.X]
[Host][ubuntu-16.04-host-2.1.X] ([Checksum][ubuntu-16.04-host-checksum-2.1.X])
[Host FX Resolver][ubuntu-16.04-hostfxr-2.1.X] ([Checksum][ubuntu-16.04-hostfxr-checksum-2.1.X])
[Shared Framework][ubuntu-16.04-sharedfx-2.1.X] ([Checksum][ubuntu-16.04-sharedfx-checksum-2.1.X]) | -| **Ubuntu 18.04 (x64)** | [![][ubuntu-18.04-badge-master]][ubuntu-18.04-version-master]
[Runtime-Deps][ubuntu-18.04-runtime-deps-master] ([Checksum][ubuntu-18.04-runtime-deps-checksum-master])
[Host][ubuntu-18.04-host-master] ([Checksum][ubuntu-18.04-host-checksum-master])
[Host FX Resolver][ubuntu-18.04-hostfxr-master] ([Checksum][ubuntu-18.04-hostfxr-checksum-master])
[Shared Framework][ubuntu-18.04-sharedfx-master] ([Checksum][ubuntu-18.04-sharedfx-checksum-master]) | [![][ubuntu-18.04-badge-3.0.X]][ubuntu-18.04-version-3.0.X]
[Runtime-Deps][ubuntu-18.04-runtime-deps-3.0.X] ([Checksum][ubuntu-18.04-runtime-deps-checksum-3.0.X])
[Host][ubuntu-18.04-host-3.0.X] ([Checksum][ubuntu-18.04-host-checksum-3.0.X])
[Host FX Resolver][ubuntu-18.04-hostfxr-3.0.X] ([Checksum][ubuntu-18.04-hostfxr-checksum-3.0.X])
[Shared Framework][ubuntu-18.04-sharedfx-3.0.X] ([Checksum][ubuntu-18.04-sharedfx-checksum-3.0.X]) | [![][ubuntu-18.04-badge-2.2.X]][ubuntu-18.04-version-2.2.X]
[Runtime-Deps][ubuntu-18.04-runtime-deps-2.2.X] ([Checksum][ubuntu-18.04-runtime-deps-checksum-2.2.X])
[Host][ubuntu-18.04-host-2.2.X] ([Checksum][ubuntu-18.04-host-checksum-2.2.X])
[Host FX Resolver][ubuntu-18.04-hostfxr-2.2.X] ([Checksum][ubuntu-18.04-hostfxr-checksum-2.2.X])
[Shared Framework][ubuntu-18.04-sharedfx-2.2.X] ([Checksum][ubuntu-18.04-sharedfx-checksum-2.2.X]) | [![][ubuntu-18.04-badge-2.1.X]][ubuntu-18.04-version-2.1.X]
[Runtime-Deps][ubuntu-18.04-runtime-deps-2.1.X] ([Checksum][ubuntu-18.04-runtime-deps-checksum-2.1.X])
[Host][ubuntu-18.04-host-2.1.X] ([Checksum][ubuntu-18.04-host-checksum-2.1.X])
[Host FX Resolver][ubuntu-18.04-hostfxr-2.1.X] ([Checksum][ubuntu-18.04-hostfxr-checksum-2.1.X])
[Shared Framework][ubuntu-18.04-sharedfx-2.1.X] ([Checksum][ubuntu-18.04-sharedfx-checksum-2.1.X]) | -| **Ubuntu 19.04 (x64)** | [![][ubuntu-19.04-badge-master]][ubuntu-19.04-version-master]
[Runtime-Deps][ubuntu-19.04-runtime-deps-master] ([Checksum][ubuntu-19.04-runtime-deps-checksum-master])
[Host][ubuntu-19.04-host-master] ([Checksum][ubuntu-19.04-host-checksum-master])
[Host FX Resolver][ubuntu-19.04-hostfxr-master] ([Checksum][ubuntu-19.04-hostfxr-checksum-master])
[Shared Framework][ubuntu-19.04-sharedfx-master] ([Checksum][ubuntu-19.04-sharedfx-checksum-master]) | [![][ubuntu-19.04-badge-3.0.X]][ubuntu-19.04-version-3.0.X]
[Runtime-Deps][ubuntu-19.04-runtime-deps-3.0.X] ([Checksum][ubuntu-19.04-runtime-deps-checksum-3.0.X])
[Host][ubuntu-19.04-host-3.0.X] ([Checksum][ubuntu-19.04-host-checksum-3.0.X])
[Host FX Resolver][ubuntu-19.04-hostfxr-3.0.X] ([Checksum][ubuntu-19.04-hostfxr-checksum-3.0.X])
[Shared Framework][ubuntu-19.04-sharedfx-3.0.X] ([Checksum][ubuntu-19.04-sharedfx-checksum-3.0.X]) | [![][ubuntu-19.04-badge-2.2.X]][ubuntu-19.04-version-2.2.X]
[Runtime-Deps][ubuntu-19.04-runtime-deps-2.2.X] ([Checksum][ubuntu-19.04-runtime-deps-checksum-2.2.X])
[Host][ubuntu-19.04-host-2.2.X] ([Checksum][ubuntu-19.04-host-checksum-2.2.X])
[Host FX Resolver][ubuntu-19.04-hostfxr-2.2.X] ([Checksum][ubuntu-19.04-hostfxr-checksum-2.2.X])
[Shared Framework][ubuntu-19.04-sharedfx-2.2.X] ([Checksum][ubuntu-19.04-sharedfx-checksum-2.2.X]) | [![][ubuntu-19.04-badge-2.1.X]][ubuntu-19.04-version-2.1.X]
[Runtime-Deps][ubuntu-19.04-runtime-deps-2.1.X] ([Checksum][ubuntu-19.04-runtime-deps-checksum-2.1.X])
[Host][ubuntu-19.04-host-2.1.X] ([Checksum][ubuntu-19.04-host-checksum-2.1.X])
[Host FX Resolver][ubuntu-19.04-hostfxr-2.1.X] ([Checksum][ubuntu-19.04-hostfxr-checksum-2.1.X])
[Shared Framework][ubuntu-19.04-sharedfx-2.1.X] ([Checksum][ubuntu-19.04-sharedfx-checksum-2.1.X]) | -| **Debian 8.2 (x64)** | [![][debian-8.2-badge-master]][debian-8.2-version-master]
[Runtime-Deps][debian-8.2-runtime-deps-master] ([Checksum][debian-8.2-runtime-deps-checksum-master])
[Host][debian-8.2-host-master] ([Checksum][debian-8.2-host-checksum-master])
[Host FX Resolver][debian-8.2-hostfxr-master] ([Checksum][debian-8.2-hostfxr-checksum-master])
[Shared Framework][debian-8.2-sharedfx-master] ([Checksum][debian-8.2-sharedfx-checksum-master]) | [![][debian-8.2-badge-3.0.X]][debian-8.2-version-3.0.X]
[Runtime-Deps][debian-8.2-runtime-deps-3.0.X] ([Checksum][debian-8.2-runtime-deps-checksum-3.0.X])
[Host][debian-8.2-host-3.0.X] ([Checksum][debian-8.2-host-checksum-3.0.X])
[Host FX Resolver][debian-8.2-hostfxr-3.0.X] ([Checksum][debian-8.2-hostfxr-checksum-3.0.X])
[Shared Framework][debian-8.2-sharedfx-3.0.X] ([Checksum][debian-8.2-sharedfx-checksum-3.0.X]) | [![][debian-8.2-badge-2.2.X]][debian-8.2-version-2.2.X]
[Runtime-Deps][debian-8.2-runtime-deps-2.2.X] ([Checksum][debian-8.2-runtime-deps-checksum-2.2.X])
[Host][debian-8.2-host-2.2.X] ([Checksum][debian-8.2-host-checksum-2.2.X])
[Host FX Resolver][debian-8.2-hostfxr-2.2.X] ([Checksum][debian-8.2-hostfxr-checksum-2.2.X])
[Shared Framework][debian-8.2-sharedfx-2.2.X] ([Checksum][debian-8.2-sharedfx-checksum-2.2.X]) | [![][debian-8.2-badge-2.1.X]][debian-8.2-version-2.1.X]
[Runtime-Deps][debian-8.2-runtime-deps-2.1.X] ([Checksum][debian-8.2-runtime-deps-checksum-2.1.X])
[Host][debian-8.2-host-2.1.X] ([Checksum][debian-8.2-host-checksum-2.1.X])
[Host FX Resolver][debian-8.2-hostfxr-2.1.X] ([Checksum][debian-8.2-hostfxr-checksum-2.1.X])
[Shared Framework][debian-8.2-sharedfx-2.1.X] ([Checksum][debian-8.2-sharedfx-checksum-2.1.X]) | -| **Debian 9 (x64)** | [![][debian-9-badge-master]][debian-9-version-master]
[Runtime-Deps][debian-9-runtime-deps-master] ([Checksum][debian-9-runtime-deps-checksum-master])
[Host][debian-9-host-master] ([Checksum][debian-9-host-checksum-master])
[Host FX Resolver][debian-9-hostfxr-master] ([Checksum][debian-9-hostfxr-checksum-master])
[Shared Framework][debian-9-sharedfx-master] ([Checksum][debian-9-sharedfx-checksum-master]) | [![][debian-9-badge-3.0.X]][debian-9-version-3.0.X]
[Runtime-Deps][debian-9-runtime-deps-3.0.X] ([Checksum][debian-9-runtime-deps-checksum-3.0.X])
[Host][debian-9-host-3.0.X] ([Checksum][debian-9-host-checksum-3.0.X])
[Host FX Resolver][debian-9-hostfxr-3.0.X] ([Checksum][debian-9-hostfxr-checksum-3.0.X])
[Shared Framework][debian-9-sharedfx-3.0.X] ([Checksum][debian-9-sharedfx-checksum-3.0.X]) | [![][debian-9-badge-2.2.X]][debian-9-version-2.2.X]
[Runtime-Deps][debian-9-runtime-deps-2.2.X] ([Checksum][debian-9-runtime-deps-checksum-2.2.X])
[Host][debian-9-host-2.2.X] ([Checksum][debian-9-host-checksum-2.2.X])
[Host FX Resolver][debian-9-hostfxr-2.2.X] ([Checksum][debian-9-hostfxr-checksum-2.2.X])
[Shared Framework][debian-9-sharedfx-2.2.X] ([Checksum][debian-9-sharedfx-checksum-2.2.X]) | [![][debian-9-badge-2.1.X]][debian-9-version-2.1.X]
[Runtime-Deps][debian-9-runtime-deps-2.1.X] ([Checksum][debian-9-runtime-deps-checksum-2.1.X])
[Host][debian-9-host-2.1.X] ([Checksum][debian-9-host-checksum-2.1.X])
[Host FX Resolver][debian-9-hostfxr-2.1.X] ([Checksum][debian-9-hostfxr-checksum-2.1.X])
[Shared Framework][debian-9-sharedfx-2.1.X] ([Checksum][debian-9-sharedfx-checksum-2.1.X]) | -| **CentOS 7 (x64)** | [![][centos-7-badge-master]][centos-7-version-master]
[Runtime-Deps][centos-7-runtime-deps-master] ([Checksum][centos-7-runtime-deps-checksum-master])
[Host][centos-7-host-master] ([Checksum][centos-7-host-checksum-master])
[Host FX Resolver][centos-7-hostfxr-master] ([Checksum][centos-7-hostfxr-checksum-master])
[Shared Framework][centos-7-sharedfx-master] ([Checksum][centos-7-sharedfx-checksum-master]) | [![][centos-7-badge-3.0.X]][centos-7-version-3.0.X]
[Runtime-Deps][centos-7-runtime-deps-3.0.X] ([Checksum][centos-7-runtime-deps-checksum-3.0.X])
[Host][centos-7-host-3.0.X] ([Checksum][centos-7-host-checksum-3.0.X])
[Host FX Resolver][centos-7-hostfxr-3.0.X] ([Checksum][centos-7-hostfxr-checksum-3.0.X])
[Shared Framework][centos-7-sharedfx-3.0.X] ([Checksum][centos-7-sharedfx-checksum-3.0.X]) | [![][centos-7-badge-2.2.X]][centos-7-version-2.2.X]
[Runtime-Deps][centos-7-runtime-deps-2.2.X] ([Checksum][centos-7-runtime-deps-checksum-2.2.X])
[Host][centos-7-host-2.2.X] ([Checksum][centos-7-host-checksum-2.2.X])
[Host FX Resolver][centos-7-hostfxr-2.2.X] ([Checksum][centos-7-hostfxr-checksum-2.2.X])
[Shared Framework][centos-7-sharedfx-2.2.X] ([Checksum][centos-7-sharedfx-checksum-2.2.X]) | [![][centos-7-badge-2.1.X]][centos-7-version-2.1.X]
[Runtime-Deps][centos-7-runtime-deps-2.1.X] ([Checksum][centos-7-runtime-deps-checksum-2.1.X])
[Host][centos-7-host-2.1.X] ([Checksum][centos-7-host-checksum-2.1.X])
[Host FX Resolver][centos-7-hostfxr-2.1.X] ([Checksum][centos-7-hostfxr-checksum-2.1.X])
[Shared Framework][centos-7-sharedfx-2.1.X] ([Checksum][centos-7-sharedfx-checksum-2.1.X]) | -| **RHEL 6** | [![][rhel-6-badge-master]][rhel-6-version-master]
[tar.gz][rhel-6-targz-master] | [![][rhel-6-badge-3.0.X]][rhel-6-version-3.0.X]
[tar.gz][rhel-6-targz-3.0.X] | [![][rhel-6-badge-2.2.X]][rhel-6-version-2.2.X]
[tar.gz][rhel-6-targz-2.2.X] | [![][rhel-6-badge-2.1.X]][rhel-6-version-2.1.X]
[tar.gz][rhel-6-targz-2.1.X] | -| **RHEL 7.2 (x64)** | [![][rhel7-badge-master]][rhel7-version-master]
[Host][rhel7-host-master] ([Checksum][rhel7-host-checksum-master])
[Host FX Resolver][rhel7-hostfxr-master] ([Checksum][rhel7-hostfxr-checksum-master])
[Shared Framework][rhel7-sharedfx-master] ([Checksum][rhel7-sharedfx-checksum-master]) | [![][rhel7-badge-3.0.X]][rhel7-version-3.0.X]
[Host][rhel7-host-3.0.X] ([Checksum][rhel7-host-checksum-3.0.X])
[Host FX Resolver][rhel7-hostfxr-3.0.X] ([Checksum][rhel7-hostfxr-checksum-3.0.X])
[Shared Framework][rhel7-sharedfx-3.0.X] ([Checksum][rhel7-sharedfx-checksum-3.0.X]) | [![][rhel7-badge-2.2.X]][rhel7-version-2.2.X]
[Host][rhel7-host-2.2.X] ([Checksum][rhel7-host-checksum-2.2.X])
[Host FX Resolver][rhel7-hostfxr-2.2.X] ([Checksum][rhel7-hostfxr-checksum-2.2.X])
[Shared Framework][rhel7-sharedfx-2.2.X] ([Checksum][rhel7-sharedfx-checksum-2.2.X]) | [![][rhel7-badge-2.1.X]][rhel7-version-2.1.X]
[Host][rhel7-host-2.1.X] ([Checksum][rhel7-host-checksum-2.1.X])
[Host FX Resolver][rhel7-hostfxr-2.1.X] ([Checksum][rhel7-hostfxr-checksum-2.1.X])
[Shared Framework][rhel7-sharedfx-2.1.X] ([Checksum][rhel7-sharedfx-checksum-2.1.X]) | -| **Fedora 27 (x64)** | [![][fedora-27-badge-master]][fedora-27-version-master]
[Runtime-Deps][fedora-27-runtime-deps-master] ([Checksum][fedora-27-runtime-deps-checksum-master])
[Host][fedora-27-host-master] ([Checksum][fedora-27-host-checksum-master])
[Host FX Resolver][fedora-27-hostfxr-master] ([Checksum][fedora-27-hostfxr-checksum-master])
[Shared Framework][fedora-27-sharedfx-master] ([Checksum][fedora-27-sharedfx-checksum-master]) | [![][fedora-27-badge-3.0.X]][fedora-27-version-3.0.X]
[Runtime-Deps][fedora-27-runtime-deps-3.0.X] ([Checksum][fedora-27-runtime-deps-checksum-3.0.X])
[Host][fedora-27-host-3.0.X] ([Checksum][fedora-27-host-checksum-3.0.X])
[Host FX Resolver][fedora-27-hostfxr-3.0.X] ([Checksum][fedora-27-hostfxr-checksum-3.0.X])
[Shared Framework][fedora-27-sharedfx-3.0.X] ([Checksum][fedora-27-sharedfx-checksum-3.0.X]) | [![][fedora-27-badge-2.2.X]][fedora-27-version-2.2.X]
[Runtime-Deps][fedora-27-runtime-deps-2.2.X] ([Checksum][fedora-27-runtime-deps-checksum-2.2.X])
[Host][fedora-27-host-2.2.X] ([Checksum][fedora-27-host-checksum-2.2.X])
[Host FX Resolver][fedora-27-hostfxr-2.2.X] ([Checksum][fedora-27-hostfxr-checksum-2.2.X])
[Shared Framework][fedora-27-sharedfx-2.2.X] ([Checksum][fedora-27-sharedfx-checksum-2.2.X]) | [![][fedora-27-badge-2.1.X]][fedora-27-version-2.1.X]
[Runtime-Deps][fedora-27-runtime-deps-2.1.X] ([Checksum][fedora-27-runtime-deps-checksum-2.1.X])
[Host][fedora-27-host-2.1.X] ([Checksum][fedora-27-host-checksum-2.1.X])
[Host FX Resolver][fedora-27-hostfxr-2.1.X] ([Checksum][fedora-27-hostfxr-checksum-2.1.X])
[Shared Framework][fedora-27-sharedfx-2.1.X] ([Checksum][fedora-27-sharedfx-checksum-2.1.X]) | -| **SLES 12 (x64)** | [![][sles-12-badge-master]][sles-12-version-master]
[Runtime-Deps][sles-12-runtime-deps-master] ([Checksum][sles-12-runtime-deps-checksum-master])
[Host][sles-12-host-master] ([Checksum][sles-12-host-checksum-master])
[Host FX Resolver][sles-12-hostfxr-master] ([Checksum][sles-12-hostfxr-checksum-master])
[Shared Framework][sles-12-sharedfx-master] ([Checksum][sles-12-sharedfx-checksum-master]) | [![][sles-12-badge-3.0.X]][sles-12-version-3.0.X]
[Runtime-Deps][sles-12-runtime-deps-3.0.X] ([Checksum][sles-12-runtime-deps-checksum-3.0.X])
[Host][sles-12-host-3.0.X] ([Checksum][sles-12-host-checksum-3.0.X])
[Host FX Resolver][sles-12-hostfxr-3.0.X] ([Checksum][sles-12-hostfxr-checksum-3.0.X])
[Shared Framework][sles-12-sharedfx-3.0.X] ([Checksum][sles-12-sharedfx-checksum-3.0.X]) | [![][sles-12-badge-2.2.X]][sles-12-version-2.2.X]
[Runtime-Deps][sles-12-runtime-deps-2.2.X] ([Checksum][sles-12-runtime-deps-checksum-2.2.X])
[Host][sles-12-host-2.2.X] ([Checksum][sles-12-host-checksum-2.2.X])
[Host FX Resolver][sles-12-hostfxr-2.2.X] ([Checksum][sles-12-hostfxr-checksum-2.2.X])
[Shared Framework][sles-12-sharedfx-2.2.X] ([Checksum][sles-12-sharedfx-checksum-2.2.X]) | [![][sles-12-badge-2.1.X]][sles-12-version-2.1.X]
[Runtime-Deps][sles-12-runtime-deps-2.1.X] ([Checksum][sles-12-runtime-deps-checksum-2.1.X])
[Host][sles-12-host-2.1.X] ([Checksum][sles-12-host-checksum-2.1.X])
[Host FX Resolver][sles-12-hostfxr-2.1.X] ([Checksum][sles-12-hostfxr-checksum-2.1.X])
[Shared Framework][sles-12-sharedfx-2.1.X] ([Checksum][sles-12-sharedfx-checksum-2.1.X]) | -| **OpenSUSE 42 (x64)** | [![][OpenSUSE-42-badge-master]][OpenSUSE-42-version-master]
[Runtime-Deps][OpenSUSE-42-runtime-deps-master] ([Checksum][OpenSUSE-42-runtime-deps-checksum-master])
[Host][OpenSUSE-42-host-master] ([Checksum][OpenSUSE-42-host-checksum-master])
[Host FX Resolver][OpenSUSE-42-hostfxr-master] ([Checksum][OpenSUSE-42-hostfxr-checksum-master])
[Shared Framework][OpenSUSE-42-sharedfx-master] ([Checksum][OpenSUSE-42-sharedfx-checksum-master]) | [![][OpenSUSE-42-badge-3.0.X]][OpenSUSE-42-version-3.0.X]
[Runtime-Deps][OpenSUSE-42-runtime-deps-3.0.X] ([Checksum][OpenSUSE-42-runtime-deps-checksum-3.0.X])
[Host][OpenSUSE-42-host-3.0.X] ([Checksum][OpenSUSE-42-host-checksum-3.0.X])
[Host FX Resolver][OpenSUSE-42-hostfxr-3.0.X] ([Checksum][OpenSUSE-42-hostfxr-checksum-3.0.X])
[Shared Framework][OpenSUSE-42-sharedfx-3.0.X] ([Checksum][OpenSUSE-42-sharedfx-checksum-3.0.X]) | [![][OpenSUSE-42-badge-2.2.X]][OpenSUSE-42-version-2.2.X]
[Runtime-Deps][OpenSUSE-42-runtime-deps-2.2.X] ([Checksum][OpenSUSE-42-runtime-deps-checksum-2.2.X])
[Host][OpenSUSE-42-host-2.2.X] ([Checksum][OpenSUSE-42-host-checksum-2.2.X])
[Host FX Resolver][OpenSUSE-42-hostfxr-2.2.X] ([Checksum][OpenSUSE-42-hostfxr-checksum-2.2.X])
[Shared Framework][OpenSUSE-42-sharedfx-2.2.X] ([Checksum][OpenSUSE-42-sharedfx-checksum-2.2.X]) | [![][OpenSUSE-42-badge-2.1.X]][OpenSUSE-42-version-2.1.X]
[Runtime-Deps][OpenSUSE-42-runtime-deps-2.1.X] ([Checksum][OpenSUSE-42-runtime-deps-checksum-2.1.X])
[Host][OpenSUSE-42-host-2.1.X] ([Checksum][OpenSUSE-42-host-checksum-2.1.X])
[Host FX Resolver][OpenSUSE-42-hostfxr-2.1.X] ([Checksum][OpenSUSE-42-hostfxr-checksum-2.1.X])
[Shared Framework][OpenSUSE-42-sharedfx-2.1.X] ([Checksum][OpenSUSE-42-sharedfx-checksum-2.1.X]) | -| **Linux-musl (x64)** | [![][linux-musl-x64-badge-master]][linux-musl-x64-version-master]
[tar.gz][linux-musl-x64-targz-master] ([Checksum][linux-musl-x64-targz-checksum-master])
[NetHost (tar.gz)][linux-musl-x64-nethost-targz-master]
[Symbols (tar.gz)][linux-musl-x64-symbols-targz-master] | [![][linux-musl-x64-badge-3.0.X]][linux-musl-x64-version-3.0.X]
[tar.gz][linux-musl-x64-targz-3.0.X] ([Checksum][linux-musl-x64-targz-checksum-3.0.X])
[NetHost (tar.gz)][linux-musl-x64-nethost-targz-3.0.X]
[Symbols (tar.gz)][linux-musl-x64-symbols-targz-3.0.X] | [![][linux-musl-x64-badge-2.2.X]][linux-musl-x64-version-2.2.X]
[tar.gz][linux-musl-x64-targz-2.2.X] ([Checksum][linux-musl-x64-targz-checksum-2.2.X])
[Symbols (tar.gz)][linux-musl-x64-symbols-targz-2.2.X] | [![][linux-musl-x64-badge-2.1.X]][linux-musl-x64-version-2.1.X]
[tar.gz][linux-musl-x64-targz-2.1.X] ([Checksum][linux-musl-x64-targz-checksum-2.1.X])
[Symbols (tar.gz)][linux-musl-x64-symbols-targz-2.1.X] | -| **Linux-musl (arm64)** | [![][linux-musl-arm64-badge-master]][linux-musl-arm64-version-master]
[tar.gz][linux-musl-arm64-targz-master] ([Checksum][linux-musl-arm64-targz-checksum-master])
[NetHost (tar.gz)][linux-musl-arm64-nethost-targz-master]
[Symbols (tar.gz)][linux-musl-arm64-symbols-targz-master] | [![][linux-musl-arm64-badge-3.0.X]][linux-musl-arm64-version-3.0.X]
[tar.gz][linux-musl-arm64-targz-3.0.X] ([Checksum][linux-musl-arm64-targz-checksum-3.0.X])
[NetHost (tar.gz)][linux-musl-arm64-nethost-targz-3.0.X]
[Symbols (tar.gz)][linux-musl-arm64-symbols-targz-3.0.X] | N/A | N/A | - - - -*Note: Our Linux packages (.deb and .rpm) are put together slightly differently than the Windows and Mac specific installers. Instead of combining everything, we have separate component packages that depend on each other. If you're installing these directly from the installer files (via dpkg or similar), then you'll need to install them in the order presented above.* - - - -[win-x64-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_win-x64_Release_version_badge.svg -[win-x64-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[win-x64-installer-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-x64.exe -[win-x64-installer-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-x64.exe.sha512 -[win-x64-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-x64.zip -[win-x64-zip-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-x64.zip.sha512 -[win-x64-nethost-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-nethost-latest-win-x64.zip -[win-x64-symbols-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-symbols-latest-win-x64.zip - -[win-x64-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_win-x64_Release_version_badge.svg -[win-x64-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[win-x64-installer-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-x64.exe -[win-x64-installer-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-x64.exe.sha512 -[win-x64-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-x64.zip -[win-x64-zip-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-x64.zip.sha512 -[win-x64-nethost-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-nethost-latest-win-x64.zip -[win-x64-symbols-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-symbols-latest-win-x64.zip - -[win-x64-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_win-x64_Release_version_badge.svg -[win-x64-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[win-x64-installer-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-x64.exe -[win-x64-installer-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-x64.exe.sha512 -[win-x64-zip-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-x64.zip -[win-x64-zip-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-x64.zip.sha512 -[win-x64-symbols-zip-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-symbols-latest-win-x64.zip - -[win-x64-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_win-x64_Release_version_badge.svg -[win-x64-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[win-x64-installer-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-x64.exe -[win-x64-installer-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-x64.exe.sha512 -[win-x64-zip-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-x64.zip -[win-x64-zip-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-x64.zip.sha512 -[win-x64-symbols-zip-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-symbols-latest-win-x64.zip - - -[win-x86-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_win-x86_Release_version_badge.svg -[win-x86-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[win-x86-installer-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-x86.exe -[win-x86-installer-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-x86.exe.sha512 -[win-x86-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-x86.zip -[win-x86-zip-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-x86.zip.sha512 -[win-x86-nethost-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-nethost-latest-win-x86.zip -[win-x86-symbols-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-symbols-latest-win-x86.zip - -[win-x86-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_win-x86_Release_version_badge.svg -[win-x86-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[win-x86-installer-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-x86.exe -[win-x86-installer-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-x86.exe.sha512 -[win-x86-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-x86.zip -[win-x86-zip-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-x86.zip.sha512 -[win-x86-nethost-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-nethost-latest-win-x86.zip -[win-x86-symbols-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-symbols-latest-win-x86.zip - -[win-x86-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_win-x86_Release_version_badge.svg -[win-x86-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[win-x86-installer-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-x86.exe -[win-x86-installer-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-x86.exe.sha512 -[win-x86-zip-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-x86.zip -[win-x86-zip-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-x86.zip.sha512 -[win-x86-symbols-zip-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-symbols-latest-win-x86.zip - -[win-x86-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_win-x86_Release_version_badge.svg -[win-x86-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[win-x86-installer-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-x86.exe -[win-x86-installer-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-x86.exe.sha512 -[win-x86-zip-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-x86.zip -[win-x86-zip-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-x86.zip.sha512 -[win-x86-symbols-zip-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-symbols-latest-win-x86.zip - - -[win-arm-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_win-arm_Release_version_badge.svg -[win-arm-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[win-arm-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-arm.zip -[win-arm-zip-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-arm.zip.sha512 -[win-arm-nethost-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-nethost-latest-win-arm.zip -[win-arm-symbols-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-symbols-latest-win-arm.zip - -[win-arm-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_win-arm_Release_version_badge.svg -[win-arm-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[win-arm-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-arm.zip -[win-arm-zip-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-arm.zip.sha512 -[win-arm-nethost-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-nethost-latest-win-arm.zip -[win-arm-symbols-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-symbols-latest-win-arm.zip - -[win-arm-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_win-arm_Release_version_badge.svg -[win-arm-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[win-arm-zip-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-arm.zip -[win-arm-zip-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-arm.zip.sha512 -[win-arm-symbols-zip-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-symbols-latest-win-arm.zip - -[win-arm-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_win-arm_Release_version_badge.svg -[win-arm-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[win-arm-zip-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-arm.zip -[win-arm-zip-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-arm.zip.sha512 -[win-arm-symbols-zip-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-symbols-latest-win-arm.zip - - -[win-arm64-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_win-arm64_Release_version_badge.svg -[win-arm64-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[win-arm64-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-arm64.zip -[win-arm64-zip-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-win-arm64.zip.sha512 -[win-arm64-nethost-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-nethost-latest-win-arm64.zip -[win-arm64-symbols-zip-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-symbols-latest-win-arm64.zip - -[win-arm64-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_win-arm64_Release_version_badge.svg -[win-arm64-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[win-arm64-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-arm64.zip -[win-arm64-zip-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-win-arm64.zip.sha512 -[win-arm64-nethost-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-nethost-latest-win-arm64.zip -[win-arm64-symbols-zip-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-symbols-latest-win-arm64.zip - -[win-arm64-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_win-arm64_Release_version_badge.svg -[win-arm64-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[win-arm64-zip-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-arm64.zip -[win-arm64-zip-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-win-arm64.zip.sha512 -[win-arm64-symbols-zip-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-symbols-latest-win-arm64.zip - -[win-arm64-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_win-arm64_Release_version_badge.svg -[win-arm64-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[win-arm64-zip-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-arm64.zip -[win-arm64-zip-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-win-arm64.zip.sha512 -[win-arm64-symbols-zip-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-symbols-latest-win-arm64.zip - - -[osx-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_osx-x64_Release_version_badge.svg -[osx-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[osx-installer-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-osx-x64.pkg -[osx-installer-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-osx-x64.pkg.sha512 -[osx-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-osx-x64.tar.gz -[osx-targz-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-osx-x64.tar.gz.sha512 -[osx-nethost-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-nethost-latest-osx-x64.tar.gz -[osx-symbols-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-symbols-latest-osx-x64.tar.gz - -[osx-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_osx-x64_Release_version_badge.svg -[osx-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[osx-installer-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-osx-x64.pkg -[osx-installer-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-osx-x64.pkg.sha512 -[osx-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-osx-x64.tar.gz -[osx-targz-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-osx-x64.tar.gz.sha512 -[osx-nethost-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-nethost-latest-osx-x64.tar.gz -[osx-symbols-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-symbols-latest-osx-x64.tar.gz - -[osx-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_osx-x64_Release_version_badge.svg -[osx-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[osx-installer-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-osx-x64.pkg -[osx-installer-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-osx-x64.pkg.sha512 -[osx-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-osx-x64.tar.gz -[osx-targz-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-osx-x64.tar.gz.sha512 -[osx-symbols-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-symbols-latest-osx-x64.tar.gz - -[osx-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_osx-x64_Release_version_badge.svg -[osx-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[osx-installer-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-osx-x64.pkg -[osx-installer-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-osx-x64.pkg.sha512 -[osx-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-osx-x64.tar.gz -[osx-targz-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-osx-x64.tar.gz.sha512 -[osx-symbols-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-symbols-latest-osx-x64.tar.gz - - -[linux-x64-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_linux-x64_Release_version_badge.svg -[linux-x64-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[linux-x64-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-x64.tar.gz -[linux-x64-targz-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-x64.tar.gz.sha512 -[linux-x64-nethost-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-nethost-latest-linux-x64.tar.gz -[linux-x64-symbols-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-symbols-latest-linux-x64.tar.gz - -[linux-x64-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_linux-x64_Release_version_badge.svg -[linux-x64-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[linux-x64-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-linux-x64.tar.gz -[linux-x64-targz-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-linux-x64.tar.gz.sha512 -[linux-x64-nethost-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-nethost-latest-linux-x64.tar.gz -[linux-x64-symbols-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-symbols-latest-linux-x64.tar.gz - -[linux-x64-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_linux-x64_Release_version_badge.svg -[linux-x64-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[linux-x64-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-linux-x64.tar.gz -[linux-x64-targz-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-linux-x64.tar.gz.sha512 -[linux-x64-symbols-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-symbols-latest-linux-x64.tar.gz - -[linux-x64-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_linux-x64_Release_version_badge.svg -[linux-x64-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[linux-x64-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-linux-x64.tar.gz -[linux-x64-targz-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-linux-x64.tar.gz.sha512 -[linux-x64-symbols-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-symbols-latest-linux-x64.tar.gz - - -[linux-arm-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_linux-arm_Release_version_badge.svg -[linux-arm-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[linux-arm-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-arm.tar.gz -[linux-arm-targz-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-arm.tar.gz.sha512 -[linux-arm-nethost-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-nethost-latest-linux-arm.tar.gz -[linux-arm-symbols-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-symbols-latest-linux-arm.tar.gz - -[linux-arm-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_linux-arm_Release_version_badge.svg -[linux-arm-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[linux-arm-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-linux-arm.tar.gz -[linux-arm-targz-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-linux-arm.tar.gz.sha512 -[linux-arm-nethost-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-nethost-latest-linux-arm.tar.gz -[linux-arm-symbols-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-symbols-latest-linux-arm.tar.gz - -[linux-arm-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_linux-arm_Release_version_badge.svg -[linux-arm-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[linux-arm-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-linux-arm.tar.gz -[linux-arm-targz-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-linux-arm.tar.gz.sha512 -[linux-arm-symbols-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-symbols-latest-linux-arm.tar.gz - -[linux-arm-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_linux-arm_Release_version_badge.svg -[linux-arm-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[linux-arm-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-linux-arm.tar.gz -[linux-arm-targz-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-linux-arm.tar.gz.sha512 -[linux-arm-symbols-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-symbols-latest-linux-arm.tar.gz - - -[linux-arm64-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_linux-arm64_Release_version_badge.svg -[linux-arm64-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[linux-arm64-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-arm64.tar.gz -[linux-arm64-targz-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-arm64.tar.gz.sha512 -[linux-arm64-nethost-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-nethost-latest-linux-arm64.tar.gz -[linux-arm64-symbols-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-symbols-latest-linux-arm64.tar.gz - -[linux-arm64-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_linux-arm64_Release_version_badge.svg -[linux-arm64-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[linux-arm64-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-linux-arm64.tar.gz -[linux-arm64-targz-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-linux-arm64.tar.gz.sha512 -[linux-arm64-nethost-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-nethost-latest-linux-arm64.tar.gz -[linux-arm64-symbols-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-symbols-latest-linux-arm64.tar.gz - -[linux-arm64-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_linux-arm64_Release_version_badge.svg -[linux-arm64-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[linux-arm64-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-linux-arm64.tar.gz -[linux-arm64-targz-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-linux-arm64.tar.gz.sha512 -[linux-arm64-symbols-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-symbols-latest-linux-arm64.tar.gz - -[linux-arm64-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_linux-arm64_Release_version_badge.svg -[linux-arm64-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[linux-arm64-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-linux-arm64.tar.gz -[linux-arm64-targz-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-linux-arm64.tar.gz.sha512 -[linux-arm64-symbols-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-symbols-latest-linux-arm64.tar.gz - - -[ubuntu-14.04-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_ubuntu.14.04-x64_Release_version_badge.svg -[ubuntu-14.04-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[ubuntu-14.04-runtime-deps-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb -[ubuntu-14.04-runtime-deps-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb.sha512 -[ubuntu-14.04-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb -[ubuntu-14.04-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb.sha512 -[ubuntu-14.04-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb -[ubuntu-14.04-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-14.04-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb -[ubuntu-14.04-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-14.04-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_ubuntu.14.04-x64_Release_version_badge.svg -[ubuntu-14.04-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[ubuntu-14.04-runtime-deps-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb -[ubuntu-14.04-runtime-deps-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb.sha512 -[ubuntu-14.04-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb -[ubuntu-14.04-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb.sha512 -[ubuntu-14.04-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb -[ubuntu-14.04-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-14.04-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb -[ubuntu-14.04-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-14.04-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_ubuntu.14.04-x64_Release_version_badge.svg -[ubuntu-14.04-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[ubuntu-14.04-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb -[ubuntu-14.04-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb.sha512 -[ubuntu-14.04-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb -[ubuntu-14.04-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-14.04-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb -[ubuntu-14.04-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-14.04-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_ubuntu.14.04-x64_Release_version_badge.svg -[ubuntu-14.04-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[ubuntu-14.04-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb -[ubuntu-14.04-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb.sha512 -[ubuntu-14.04-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb -[ubuntu-14.04-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-14.04-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb -[ubuntu-14.04-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb.sha512 - - -[ubuntu-16.04-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_ubuntu.16.04-x64_Release_version_badge.svg -[ubuntu-16.04-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[ubuntu-16.04-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb -[ubuntu-16.04-runtime-deps-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb -[ubuntu-16.04-runtime-deps-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb.sha512 -[ubuntu-16.04-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb.sha512 -[ubuntu-16.04-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb -[ubuntu-16.04-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-16.04-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb -[ubuntu-16.04-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-16.04-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_ubuntu.16.04-x64_Release_version_badge.svg -[ubuntu-16.04-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[ubuntu-16.04-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb -[ubuntu-16.04-runtime-deps-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb -[ubuntu-16.04-runtime-deps-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb.sha512 -[ubuntu-16.04-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb.sha512 -[ubuntu-16.04-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb -[ubuntu-16.04-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-16.04-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb -[ubuntu-16.04-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-16.04-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_ubuntu.16.04-x64_Release_version_badge.svg -[ubuntu-16.04-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[ubuntu-16.04-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb -[ubuntu-16.04-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb.sha512 -[ubuntu-16.04-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb -[ubuntu-16.04-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-16.04-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb -[ubuntu-16.04-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-16.04-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_ubuntu.16.04-x64_Release_version_badge.svg -[ubuntu-16.04-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[ubuntu-16.04-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb -[ubuntu-16.04-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb.sha512 -[ubuntu-16.04-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb -[ubuntu-16.04-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-16.04-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb -[ubuntu-16.04-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb.sha512 - - -[ubuntu-18.04-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_ubuntu.18.04-x64_Release_version_badge.svg -[ubuntu-18.04-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[ubuntu-18.04-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb -[ubuntu-18.04-runtime-deps-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb -[ubuntu-18.04-runtime-deps-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb.sha512 -[ubuntu-18.04-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb.sha512 -[ubuntu-18.04-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb -[ubuntu-18.04-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-18.04-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb -[ubuntu-18.04-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-18.04-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_ubuntu.18.04-x64_Release_version_badge.svg -[ubuntu-18.04-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[ubuntu-18.04-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb -[ubuntu-18.04-runtime-deps-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb -[ubuntu-18.04-runtime-deps-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb.sha512 -[ubuntu-18.04-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb.sha512 -[ubuntu-18.04-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb -[ubuntu-18.04-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-18.04-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb -[ubuntu-18.04-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-18.04-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_ubuntu.18.04-x64_Release_version_badge.svg -[ubuntu-18.04-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[ubuntu-18.04-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb -[ubuntu-18.04-runtime-deps-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-ubuntu.18.04-x64.deb -[ubuntu-18.04-runtime-deps-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-ubuntu.18.04-x64.deb.sha512 -[ubuntu-18.04-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb.sha512 -[ubuntu-18.04-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb -[ubuntu-18.04-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-18.04-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb -[ubuntu-18.04-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-18.04-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_ubuntu.18.04-x64_Release_version_badge.svg -[ubuntu-18.04-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[ubuntu-18.04-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb -[ubuntu-18.04-runtime-deps-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-ubuntu.18.04-x64.deb -[ubuntu-18.04-runtime-deps-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-ubuntu.18.04-x64.deb.sha512 -[ubuntu-18.04-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb.sha512 -[ubuntu-18.04-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb -[ubuntu-18.04-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-18.04-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb -[ubuntu-18.04-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb.sha512 - - -[ubuntu-19.04-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_ubuntu.19.04-x64_Release_version_badge.svg -[ubuntu-19.04-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[ubuntu-19.04-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb -[ubuntu-19.04-runtime-deps-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb -[ubuntu-19.04-runtime-deps-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb.sha512 -[ubuntu-19.04-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb.sha512 -[ubuntu-19.04-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb -[ubuntu-19.04-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-19.04-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb -[ubuntu-19.04-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-19.04-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_ubuntu.19.04-x64_Release_version_badge.svg -[ubuntu-19.04-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[ubuntu-19.04-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb -[ubuntu-19.04-runtime-deps-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb -[ubuntu-19.04-runtime-deps-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb.sha512 -[ubuntu-19.04-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb.sha512 -[ubuntu-19.04-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb -[ubuntu-19.04-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-19.04-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb -[ubuntu-19.04-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-19.04-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_ubuntu.19.04-x64_Release_version_badge.svg -[ubuntu-19.04-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[ubuntu-19.04-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb -[ubuntu-19.04-runtime-deps-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-ubuntu.19.04-x64.deb -[ubuntu-19.04-runtime-deps-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-ubuntu.19.04-x64.deb.sha512 -[ubuntu-19.04-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb.sha512 -[ubuntu-19.04-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb -[ubuntu-19.04-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-19.04-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb -[ubuntu-19.04-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb.sha512 - -[ubuntu-19.04-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_ubuntu.19.04-x64_Release_version_badge.svg -[ubuntu-19.04-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[ubuntu-19.04-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb -[ubuntu-19.04-runtime-deps-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-ubuntu.19.04-x64.deb -[ubuntu-19.04-runtime-deps-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-ubuntu.19.04-x64.deb.sha512 -[ubuntu-19.04-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb.sha512 -[ubuntu-19.04-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb -[ubuntu-19.04-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb.sha512 -[ubuntu-19.04-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb -[ubuntu-19.04-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb.sha512 - - -[debian-8.2-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_debian.8-x64_Release_version_badge.svg -[debian-8.2-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[debian-8.2-runtime-deps-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb -[debian-8.2-runtime-deps-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb.sha512 -[debian-8.2-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb -[debian-8.2-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb.sha512 -[debian-8.2-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb -[debian-8.2-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb.sha512 -[debian-8.2-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb -[debian-8.2-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb.sha512 - -[debian-8.2-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_debian.8-x64_Release_version_badge.svg -[debian-8.2-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[debian-8.2-runtime-deps-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb -[debian-8.2-runtime-deps-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb.sha512 -[debian-8.2-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb -[debian-8.2-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb.sha512 -[debian-8.2-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb -[debian-8.2-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb.sha512 -[debian-8.2-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb -[debian-8.2-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb.sha512 - -[debian-8.2-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_debian.8-x64_Release_version_badge.svg -[debian-8.2-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[debian-8.2-runtime-deps-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-debian.8-x64.deb -[debian-8.2-runtime-deps-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-debian.8-x64.deb.sha512 -[debian-8.2-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb -[debian-8.2-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb.sha512 -[debian-8.2-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb -[debian-8.2-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb.sha512 -[debian-8.2-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb -[debian-8.2-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb.sha512 - -[debian-8.2-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_debian.8-x64_Release_version_badge.svg -[debian-8.2-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[debian-8.2-runtime-deps-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-debian.8-x64.deb -[debian-8.2-runtime-deps-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-debian.8-x64.deb.sha512 -[debian-8.2-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb -[debian-8.2-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb.sha512 -[debian-8.2-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb -[debian-8.2-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb.sha512 -[debian-8.2-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb -[debian-8.2-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb.sha512 - - -[debian-9-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_debian.9-x64_Release_version_badge.svg -[debian-9-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[debian-9-runtime-deps-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb -[debian-9-runtime-deps-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-x64.deb.sha512 -[debian-9-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb -[debian-9-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.deb.sha512 -[debian-9-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb -[debian-9-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.deb.sha512 -[debian-9-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb -[debian-9-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.deb.sha512 - -[debian-9-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_debian.9-x64_Release_version_badge.svg -[debian-9-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[debian-9-runtime-deps-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb -[debian-9-runtime-deps-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-x64.deb.sha512 -[debian-9-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb -[debian-9-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.deb.sha512 -[debian-9-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb -[debian-9-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.deb.sha512 -[debian-9-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb -[debian-9-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.deb.sha512 - -[debian-9-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_debian.9-x64_Release_version_badge.svg -[debian-9-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[debian-9-runtime-deps-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-debian.9-x64.deb -[debian-9-runtime-deps-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-debian.9-x64.deb.sha512 -[debian-9-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb -[debian-9-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.deb.sha512 -[debian-9-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb -[debian-9-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.deb.sha512 -[debian-9-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb -[debian-9-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.deb.sha512 - -[debian-9-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_debian.9-x64_Release_version_badge.svg -[debian-9-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[debian-9-runtime-deps-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-debian.9-x64.deb -[debian-9-runtime-deps-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-debian.9-x64.deb.sha512 -[debian-9-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb -[debian-9-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.deb.sha512 -[debian-9-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb -[debian-9-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.deb.sha512 -[debian-9-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb -[debian-9-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.deb.sha512 - - -[centos-7-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_centos.7-x64_Release_version_badge.svg -[centos-7-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[centos-7-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.rpm -[centos-7-runtime-deps-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-centos.7-x64.rpm -[centos-7-runtime-deps-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-centos.7-x64.rpm.sha512 -[centos-7-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.rpm.sha512 -[centos-7-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.rpm -[centos-7-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.rpm.sha512 -[centos-7-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.rpm -[centos-7-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.rpm.sha512 - -[centos-7-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_centos.7-x64_Release_version_badge.svg -[centos-7-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[centos-7-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.rpm -[centos-7-runtime-deps-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-centos.7-x64.rpm -[centos-7-runtime-deps-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-centos.7-x64.rpm.sha512 -[centos-7-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.rpm.sha512 -[centos-7-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.rpm -[centos-7-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.rpm.sha512 -[centos-7-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.rpm -[centos-7-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.rpm.sha512 - -[centos-7-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_centos.7-x64_Release_version_badge.svg -[centos-7-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[centos-7-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.rpm -[centos-7-runtime-deps-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-centos.7-x64.rpm -[centos-7-runtime-deps-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-centos.7-x64.rpm.sha512 -[centos-7-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.rpm.sha512 -[centos-7-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.rpm -[centos-7-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.rpm.sha512 -[centos-7-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.rpm -[centos-7-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.rpm.sha512 - -[centos-7-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_centos.7-x64_Release_version_badge.svg -[centos-7-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[centos-7-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.rpm -[centos-7-runtime-deps-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-centos.7-x64.rpm -[centos-7-runtime-deps-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-centos.7-x64.rpm.sha512 -[centos-7-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.rpm.sha512 -[centos-7-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.rpm -[centos-7-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.rpm.sha512 -[centos-7-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.rpm -[centos-7-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.rpm.sha512 - - -[rhel-6-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_rhel.6-x64_Release_version_badge.svg -[rhel-6-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[rhel-6-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-rhel.6-x64.tar.gz - -[rhel-6-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_rhel.6-x64_Release_version_badge.svg -[rhel-6-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[rhel-6-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-rhel.6-x64.tar.gz - -[rhel-6-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_rhel.6-x64_Release_version_badge.svg -[rhel-6-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[rhel-6-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-rhel.6-x64.tar.gz - -[rhel-6-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_rhel.6-x64_Release_version_badge.svg -[rhel-6-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[rhel-6-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-rhel.6-x64.tar.gz - -[rhel-6-badge-2.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.0.0/sharedfx_rhel.6-x64_Release_version_badge.svg -[rhel-6-version-2.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.0.0/latest.version -[rhel-6-targz-2.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.0.0/dotnet-runtime-latest-rhel.6-x64.tar.gz - - -[rhel7-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_rhel.7-x64_Release_version_badge.svg -[rhel7-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[rhel7-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-rhel.7-x64.rpm -[rhel7-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-rhel.7-x64.rpm.sha512 -[rhel7-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-rhel.7-x64.rpm -[rhel7-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-rhel.7-x64.rpm.sha512 -[rhel7-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-rhel.7-x64.rpm -[rhel7-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-rhel.7-x64.rpm.sha512 - -[rhel7-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_rhel.7-x64_Release_version_badge.svg -[rhel7-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[rhel7-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-rhel.7-x64.rpm -[rhel7-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-rhel.7-x64.rpm.sha512 -[rhel7-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-rhel.7-x64.rpm -[rhel7-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-rhel.7-x64.rpm.sha512 -[rhel7-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-rhel.7-x64.rpm -[rhel7-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-rhel.7-x64.rpm.sha512 - -[rhel7-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_rhel.7-x64_Release_version_badge.svg -[rhel7-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[rhel7-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-rhel.7-x64.rpm -[rhel7-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-rhel.7-x64.rpm.sha512 -[rhel7-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-rhel.7-x64.rpm -[rhel7-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-rhel.7-x64.rpm.sha512 -[rhel7-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-rhel.7-x64.rpm -[rhel7-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-rhel.7-x64.rpm.sha512 - -[rhel7-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_rhel.7-x64_Release_version_badge.svg -[rhel7-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[rhel7-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-rhel.7-x64.rpm -[rhel7-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-rhel.7-x64.rpm.sha512 -[rhel7-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-rhel.7-x64.rpm -[rhel7-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-rhel.7-x64.rpm.sha512 -[rhel7-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-rhel.7-x64.rpm -[rhel7-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-rhel.7-x64.rpm.sha512 - - -[fedora-27-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_fedora.27-x64_Release_version_badge.svg -[fedora-27-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[fedora-27-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.rpm -[fedora-27-runtime-deps-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-fedora.27-x64.rpm -[fedora-27-runtime-deps-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-fedora.27-x64.rpm.sha512 -[fedora-27-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.rpm.sha512 -[fedora-27-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.rpm -[fedora-27-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.rpm.sha512 -[fedora-27-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.rpm -[fedora-27-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.rpm.sha512 - -[fedora-27-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_fedora.27-x64_Release_version_badge.svg -[fedora-27-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[fedora-27-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.rpm -[fedora-27-runtime-deps-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-fedora.27-x64.rpm -[fedora-27-runtime-deps-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-fedora.27-x64.rpm.sha512 -[fedora-27-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.rpm.sha512 -[fedora-27-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.rpm -[fedora-27-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.rpm.sha512 -[fedora-27-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.rpm -[fedora-27-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.rpm.sha512 - -[fedora-27-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_fedora.27-x64_Release_version_badge.svg -[fedora-27-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[fedora-27-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.rpm -[fedora-27-runtime-deps-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-fedora.27-x64.rpm -[fedora-27-runtime-deps-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-fedora.27-x64.rpm.sha512 -[fedora-27-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.rpm.sha512 -[fedora-27-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.rpm -[fedora-27-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.rpm.sha512 -[fedora-27-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.rpm -[fedora-27-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.rpm.sha512 - -[fedora-27-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_fedora.27-x64_Release_version_badge.svg -[fedora-27-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[fedora-27-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.rpm -[fedora-27-runtime-deps-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-fedora.27-x64.rpm -[fedora-27-runtime-deps-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-fedora.27-x64.rpm.sha512 -[fedora-27-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.rpm.sha512 -[fedora-27-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.rpm -[fedora-27-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.rpm.sha512 -[fedora-27-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.rpm -[fedora-27-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.rpm.sha512 - - -[sles-12-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_sles.12-x64_Release_version_badge.svg -[sles-12-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[sles-12-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.rpm -[sles-12-runtime-deps-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-sles.12-x64.rpm -[sles-12-runtime-deps-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-sles.12-x64.rpm.sha512 -[sles-12-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-x64.rpm.sha512 -[sles-12-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.rpm -[sles-12-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-x64.rpm.sha512 -[sles-12-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.rpm -[sles-12-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-x64.rpm.sha512 - -[sles-12-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_sles.12-x64_Release_version_badge.svg -[sles-12-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[sles-12-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.rpm -[sles-12-runtime-deps-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-sles.12-x64.rpm -[sles-12-runtime-deps-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-sles.12-x64.rpm.sha512 -[sles-12-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-x64.rpm.sha512 -[sles-12-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.rpm -[sles-12-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-x64.rpm.sha512 -[sles-12-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.rpm -[sles-12-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-x64.rpm.sha512 - -[sles-12-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_sles.12-x64_Release_version_badge.svg -[sles-12-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[sles-12-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.rpm -[sles-12-runtime-deps-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-sles.12-x64.rpm -[sles-12-runtime-deps-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-sles.12-x64.rpm.sha512 -[sles-12-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-x64.rpm.sha512 -[sles-12-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.rpm -[sles-12-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-x64.rpm.sha512 -[sles-12-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.rpm -[sles-12-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-x64.rpm.sha512 - -[sles-12-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_sles.12-x64_Release_version_badge.svg -[sles-12-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[sles-12-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.rpm -[sles-12-runtime-deps-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-sles.12-x64.rpm -[sles-12-runtime-deps-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-sles.12-x64.rpm.sha512 -[sles-12-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-x64.rpm.sha512 -[sles-12-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.rpm -[sles-12-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-x64.rpm.sha512 -[sles-12-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.rpm -[sles-12-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-x64.rpm.sha512 - - -[OpenSUSE-42-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_opensuse.42-x64_Release_version_badge.svg -[OpenSUSE-42-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[OpenSUSE-42-runtime-deps-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-opensuse.42-x64.rpm -[OpenSUSE-42-runtime-deps-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-deps-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-host-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-opensuse.42-x64.rpm -[OpenSUSE-42-host-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-host-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-hostfxr-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-opensuse.42-x64.rpm -[OpenSUSE-42-hostfxr-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-hostfxr-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-sharedfx-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-opensuse.42-x64.rpm -[OpenSUSE-42-sharedfx-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-opensuse.42-x64.rpm.sha512 - -[OpenSUSE-42-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_opensuse.42-x64_Release_version_badge.svg -[OpenSUSE-42-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[OpenSUSE-42-runtime-deps-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-opensuse.42-x64.rpm -[OpenSUSE-42-runtime-deps-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-deps-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-host-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-opensuse.42-x64.rpm -[OpenSUSE-42-host-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-host-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-hostfxr-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-opensuse.42-x64.rpm -[OpenSUSE-42-hostfxr-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-hostfxr-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-sharedfx-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-opensuse.42-x64.rpm -[OpenSUSE-42-sharedfx-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-opensuse.42-x64.rpm.sha512 - -[OpenSUSE-42-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_opensuse.42-x64_Release_version_badge.svg -[OpenSUSE-42-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[OpenSUSE-42-runtime-deps-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-opensuse.42-x64.rpm -[OpenSUSE-42-runtime-deps-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-deps-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-host-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-opensuse.42-x64.rpm -[OpenSUSE-42-host-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-host-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-hostfxr-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-opensuse.42-x64.rpm -[OpenSUSE-42-hostfxr-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-hostfxr-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-sharedfx-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-opensuse.42-x64.rpm -[OpenSUSE-42-sharedfx-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-opensuse.42-x64.rpm.sha512 - -[OpenSUSE-42-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_opensuse.42-x64_Release_version_badge.svg -[OpenSUSE-42-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[OpenSUSE-42-runtime-deps-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-opensuse.42-x64.rpm -[OpenSUSE-42-runtime-deps-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-deps-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-host-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-opensuse.42-x64.rpm -[OpenSUSE-42-host-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-host-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-hostfxr-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-opensuse.42-x64.rpm -[OpenSUSE-42-hostfxr-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-hostfxr-latest-opensuse.42-x64.rpm.sha512 -[OpenSUSE-42-sharedfx-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-opensuse.42-x64.rpm -[OpenSUSE-42-sharedfx-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-opensuse.42-x64.rpm.sha512 - - -[linux-musl-x64-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_linux-musl-x64_Release_version_badge.svg -[linux-musl-x64-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[linux-musl-x64-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-musl-x64.tar.gz -[linux-musl-x64-targz-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-musl-x64.tar.gz.sha512 -[linux-musl-x64-nethost-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-nethost-latest-linux-musl-x64.tar.gz -[linux-musl-x64-symbols-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-symbols-latest-linux-musl-x64.tar.gz - -[linux-musl-x64-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_linux-musl-x64_Release_version_badge.svg -[linux-musl-x64-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[linux-musl-x64-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-linux-musl-x64.tar.gz -[linux-musl-x64-targz-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-linux-musl-x64.tar.gz.sha512 -[linux-musl-x64-nethost-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-nethost-latest-linux-musl-x64.tar.gz -[linux-musl-x64-symbols-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-symbols-latest-linux-musl-x64.tar.gz - -[linux-musl-x64-badge-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/sharedfx_linux-musl-x64_Release_version_badge.svg -[linux-musl-x64-version-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/latest.version -[linux-musl-x64-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-linux-musl-x64.tar.gz -[linux-musl-x64-targz-checksum-2.2.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-latest-linux-musl-x64.tar.gz.sha512 -[linux-musl-x64-symbols-targz-2.2.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.2/dotnet-runtime-symbols-latest-linux-musl-x64.tar.gz - -[linux-musl-x64-badge-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/sharedfx_linux-musl-x64_Release_version_badge.svg -[linux-musl-x64-version-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/latest.version -[linux-musl-x64-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-linux-musl-x64.tar.gz -[linux-musl-x64-targz-checksum-2.1.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-latest-linux-musl-x64.tar.gz.sha512 -[linux-musl-x64-symbols-targz-2.1.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.1/dotnet-runtime-symbols-latest-linux-musl-x64.tar.gz - - -[linux-musl-arm64-badge-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/sharedfx_linux-musl-arm64_Release_version_badge.svg -[linux-musl-arm64-version-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/latest.version -[linux-musl-arm64-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-musl-arm64.tar.gz -[linux-musl-arm64-targz-checksum-master]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-musl-arm64.tar.gz.sha512 -[linux-musl-arm64-nethost-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-nethost-latest-linux-musl-arm64.tar.gz -[linux-musl-arm64-symbols-targz-master]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-symbols-latest-linux-musl-arm64.tar.gz - -[linux-musl-arm64-badge-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/sharedfx_linux-musl-arm64_Release_version_badge.svg -[linux-musl-arm64-version-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/latest.version -[linux-musl-arm64-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-linux-musl-arm64.tar.gz -[linux-musl-arm64-targz-checksum-3.0.X]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-latest-linux-musl-arm64.tar.gz.sha512 -[linux-musl-arm64-nethost-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-nethost-latest-linux-musl-arm64.tar.gz -[linux-musl-arm64-symbols-targz-3.0.X]: https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/3.0/dotnet-runtime-symbols-latest-linux-musl-arm64.tar.gz - - - ## .NET Foundation .NET Core is a [.NET Foundation](https://www.dotnetfoundation.org/projects) project. @@ -877,7 +54,7 @@ For other issues, please use the following repos: There are many .NET related projects on GitHub. - [.NET home repo](https://github.com/Microsoft/dotnet) - links to 100s of .NET projects, from Microsoft and the community. -- [ASP.NET Core home](https://github.com/aspnet/home) - the best place to start learning about ASP.NET Core. +- [ASP.NET Core home](https://docs.microsoft.com/aspnet/core/?view=aspnetcore-3.0) - the best place to start learning about ASP.NET Core. This project has adopted the code of conduct defined by the [Contributor Covenant](http://contributor-covenant.org/) to clarify expected behavior in our community. For more information, see the [.NET Foundation Code of Conduct](http://www.dotnetfoundation.org/code-of-conduct). diff --git a/docs/coding-guidelines/clr-code-guide.md b/docs/coding-guidelines/clr-code-guide.md index 73ee775aac0ec4..5a00afef022ef0 100644 --- a/docs/coding-guidelines/clr-code-guide.md +++ b/docs/coding-guidelines/clr-code-guide.md @@ -1028,14 +1028,14 @@ Here are some immediate tips for working well with the managed-debugging service - Do not change behavior when under the debugger. An app should behave identically when run outside or under the debugger. This is absolutely necessary else we get complaints like "my program only crashes when run under the debugger". This is also necessary because somebody may attach a debugger to an app after the fact. Specific examples of this: - Don't assume that just because an app is under the debugger that somebody is trying to debug it. - Don't add additional run-time error checks when under the debugger. For example, avoid code like: if ((IsDebuggerPresent() && (argument == null)) { throw MyException(); } - - Avoid massive perf changes when under the debugger. For example, don't use an interpreted stub just because you're under the debugger. We then get bugs like [my app is 100x slower when under a debugger](http://blogs.msdn.com/b/jmstall/archive/2006/01/17/pinvoke-100x-slower.aspx). + - Avoid massive perf changes when under the debugger. For example, don't use an interpreted stub just because you're under the debugger. We then get bugs like [my app is 100x slower when under a debugger](https://docs.microsoft.com/en-us/archive/blogs/jmstall/psa-pinvokes-may-be-100x-slower-under-the-debugger). - Avoid algorithmic changes. For example, do not make the JIT generate non-optimized code just because an app is under the debugger. Do not make the loader policy resolve to a debuggable-ngen image just because an app is under the debugger. - Separate your code into a) side-effect-free (non-mutating) read-only accessors and b) functions that change state. The motivation is that the debugger needs to be able to read-state in a non-invasive way. For example, don't just have GetFoo() that will lazily create a Foo if it's not available. Instead, split it out like so: - GetFoo() - fails if a Foo does not exist. Being non-mutating, this should also be GC_NOTRIGGER. Non-mutating will also make it much easier to DAC-ize. This is what the debugger will call. - and GetOrCreateFoo() that is built around GetFoo(). The rest of the runtime can call this. - The debugger can then just call GetFoo(), and deal with the failure accordingly. - If you add a new stub (or way to call managed code), make sure that you can source-level step-in (F11) it under the debugger. The debugger is not psychic. A source-level step-in needs to be able to go from the source-line before a call to the source-line after the call, or managed code developers will be very confused. If you make that call transition be a giant 500 line stub, you must cooperate with the debugger for it to know how to step-through it. (This is what StubManagers are all about. See [src\vm\stubmgr.h](https://github.com/dotnet/coreclr/blob/master/src/vm/stubmgr.h)). Try doing a step-in through your new codepath under the debugger. -- **Beware of timeouts** : The debugger may completely suspend your process at arbitrary points. In most cases, the debugger will do the right thing (and suspend your timeout too), but not always. For example, if you have some other process waiting for info from the debuggee, it [may hit a timeout](http://blogs.msdn.com/b/jmstall/archive/2005/11/11/contextswitchdeadlock.aspx). +- **Beware of timeouts** : The debugger may completely suspend your process at arbitrary points. In most cases, the debugger will do the right thing (and suspend your timeout too), but not always. For example, if you have some other process waiting for info from the debuggee, it [may hit a timeout](https://docs.microsoft.com/en-us/archive/blogs/jmstall/why-you-sometimes-get-a-bogus-contextswitchdeadlock-mda-under-the-debugger). - **Use CLR synchronization primitives (like Crst)**. In addition to all the reasons listed in the synchronization section, the CLR-aware primitives can cooperate with the debugging services. For example: - The debugger needs to know when threads are modifying sensitive data (which correlates to when the threads lock that data). - Timeouts for CLR synchronization primitives may operate better in the face of being debugged. diff --git a/docs/coding-guidelines/framework-design-guidelines-digest.md b/docs/coding-guidelines/framework-design-guidelines-digest.md index 71a15036746609..337acdd0b76246 100644 --- a/docs/coding-guidelines/framework-design-guidelines-digest.md +++ b/docs/coding-guidelines/framework-design-guidelines-digest.md @@ -307,5 +307,5 @@ conformance to the [Framework Design Guidelines][FDG] (also see [MSDN](https://m ## Presentations -* [Overview of the Framework Design Guidelines](http://blogs.msdn.com/kcwalina/archive/2007/03/29/1989896.aspx) -* [TechEd 2007 Presentation about framework engineering](http://blogs.msdn.com/kcwalina/archive/2008/01/08/FrameworkEngineering.aspx) +* [Overview of the Framework Design Guidelines](https://docs.microsoft.com/en-us/archive/blogs/kcwalina/online-lecture-on-api-design) +* [TechEd 2007 Presentation about framework engineering](https://docs.microsoft.com/en-us/archive/blogs/kcwalina/video-recording-of-framework-engineering-architecting-designing-and-developing-reusable-libraries) diff --git a/docs/coding-guidelines/interop-pinvokes.md b/docs/coding-guidelines/interop-pinvokes.md index 35e58cfe713205..5f0fe879e9ac90 100644 --- a/docs/coding-guidelines/interop-pinvokes.md +++ b/docs/coding-guidelines/interop-pinvokes.md @@ -257,6 +257,6 @@ Other References ---------------- [MarshalAs Attribute](http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx) -[GetLastError and managed code](http://blogs.msdn.com/b/adam_nathan/archive/2003/04/25/56643.aspx) +[GetLastError and managed code](https://docs.microsoft.com/en-us/archive/blogs/adam_nathan/getlasterror-and-managed-code) [Copying and Pinning](https://msdn.microsoft.com/en-us/library/23acw07k.aspx) [Marshalling between Managed and Unmanaged Code (MSDN Magazine January 2008)](http://download.microsoft.com/download/3/A/7/3A7FA450-1F33-41F7-9E6D-3AA95B5A6AEA/MSDNMagazineJanuary2008en-us.chm) *This is a .chm download* diff --git a/docs/coding-guidelines/performance-guidelines.md b/docs/coding-guidelines/performance-guidelines.md index 469dbe0cdd53e2..07ec6d1c1f351b 100644 --- a/docs/coding-guidelines/performance-guidelines.md +++ b/docs/coding-guidelines/performance-guidelines.md @@ -9,7 +9,7 @@ You can read [CoreCLR Performance Requirements](../project/performance-guideline # Memory Management -* **Avoiding delegate and closure allocations for lambdas**. The code generated by the C# compiler for anonymous methods and lambdas may involve one or more allocations. Certain patterns in APIs can help to avoid these allocations. See [Know Thine Implicit Allocations](http://blogs.msdn.com/b/pfxteam/archive/2012/02/03/10263921.aspx) for more information. +* **Avoiding delegate and closure allocations for lambdas**. The code generated by the C# compiler for anonymous methods and lambdas may involve one or more allocations. Certain patterns in APIs can help to avoid these allocations. See [Know Thine Implicit Allocations](https://devblogs.microsoft.com/pfxteam/know-thine-implicit-allocations/) for more information. # Asynchrony diff --git a/docs/design/coreclr/botr/readytorun-format.md b/docs/design/coreclr/botr/readytorun-format.md index 78d99518b65bc7..7d73e68bbb4ef2 100644 --- a/docs/design/coreclr/botr/readytorun-format.md +++ b/docs/design/coreclr/botr/readytorun-format.md @@ -34,7 +34,12 @@ by the well-known export symbol `RTR_HEADER` and has the `READYTORUN_FLAG_COMPOS Input MSIL metadata and IL streams can be either embedded in the composite R2R file or left as separate files on disk. In case of embedded MSIL, the "actual" metadata for the individual -component assemblies is accessed via the R2R section `READYTORUN_SECTION_ASSEMBLIES`. +component assemblies is accessed via the R2R section `ComponentAssemblies`. + +**Standalone MSIL files** used as the source of IL and metadata for composite R2R executables +without MSIL embedding are copied to the output folder next to the composite R2R executable +and are rewritten by the compiler to include a formal ReadyToRun header with forwarding +information pointing to the owner composite R2R executable (section `OwnerCompositeExecutable`). ## Future Improvements @@ -59,7 +64,7 @@ envelope. For single-file R2R executables, there's just one header representing all image sections. For composite and single exe, the global `READYTORUN_HEADER` includes a section of the type -`READYTORUN_SECTION_ASSEMBLIES` representing the component assemblies comprising the composite +`ComponentAssemblies` representing the component assemblies comprising the composite R2R image. This table is parallel to (it used the same indexing as) the table `READYTORUN_MANIFEST_METADATA`. Each `READYTORUN_SECTION_ASSEMBLIES_ENTRY` record points to a `READYTORUN_CORE_HEADER` variable-length structure representing sections specific to the @@ -136,33 +141,34 @@ and execute the ready to run file. The following section types are defined and described later in this document: -| ReadyToRunSectionType | Value | Scope (component assembly / entire image) -|:-----------------------------------------------|------:|:----------- -| READYTORUN_SECTION_COMPILER_IDENTIFIER | 100 | Image -| READYTORUN_SECTION_IMPORT_SECTIONS | 101 | Image -| READYTORUN_SECTION_RUNTIME_FUNCTIONS | 102 | Image -| READYTORUN_SECTION_METHODDEF_ENTRYPOINTS | 103 | Assembly -| READYTORUN_SECTION_EXCEPTION_INFO | 104 | Assembly -| READYTORUN_SECTION_DEBUG_INFO | 105 | Assembly -| READYTORUN_SECTION_DELAYLOAD_METHODCALL_THUNKS | 106 | Assembly -| ~~READYTORUN_SECTION_AVAILABLE_TYPES~~ | 107 | (obsolete - used by an older format) -| READYTORUN_SECTION_AVAILABLE_TYPES | 108 | Assembly -| READYTORUN_SECTION_INSTANCE_METHOD_ENTRYPOINTS | 109 | Image -| READYTORUN_SECTION_INLINING_INFO | 110 | Assembly (added in V2.1) -| READYTORUN_SECTION_PROFILEDATA_INFO | 111 | Image (added in V2.2) -| READYTORUN_SECTION_MANIFEST_METADATA | 112 | Image (added in V2.3) -| READYTORUN_SECTION_ATTRIBUTEPRESENCE | 113 | Assembly (added in V3.1) -| READYTORUN_SECTION_INLINING_INFO2 | 114 | Image (added in V4.1) -| READYTORUN_SECTION_ASSEMBLIES | 115 | Image (added in V4.1) - -## READYTORUN_SECTION_COMPILER_IDENTIFIER +| ReadyToRunSectionType | Value | Scope (component assembly / entire image) +|:--------------------------|------:|:----------- +| CompilerIdentifier | 100 | Image +| ImportSections | 101 | Image +| RuntimeFunctions | 102 | Image +| MethodDefEntryPoints | 103 | Assembly +| ExceptionInfo | 104 | Assembly +| DebugInfo | 105 | Assembly +| DelayLoadMethodCallThunks | 106 | Assembly +| ~~AvailableTypes~~ | 107 | (obsolete - used by an older format) +| AvailableTypes | 108 | Assembly +| InstanceMethodEntryPoints | 109 | Image +| InliningInfo | 110 | Assembly (added in V2.1) +| ProfileDataInfo | 111 | Image (added in V2.2) +| ManifestMetadata | 112 | Image (added in V2.3) +| AttributePresence | 113 | Assembly (added in V3.1) +| InliningInfo2 | 114 | Image (added in V4.1) +| ComponentAssemblies | 115 | Image (added in V4.1) +| OwnerCompositeExecutable | 116 | Image (added in V4.1) + +## ReadyToRunSectionType.CompilerIdentifier This section contains zero terminated ASCII string that identifies the compiler used to produce the image. **Example**: `CoreCLR 4.6.22727.0 PROJECTK` -## READYTORUN_SECTION_IMPORT_SECTIONS +## ReadyToRunSectionType.ImportSections This section contains array of READYTORUN_IMPORT_SECTION structures. Each entry describes range of slots that had to be filled with the value from outside the module (typically lazily). The initial values of @@ -310,12 +316,13 @@ The position values are calculated in `size_t` aka `IntPtr` units (4 bytes for 3 * For x86, the encoding starts with size of the callee popped stack. The size is encoded using the same mechanism as above (two bit basic encoding, with extended encoding for large values). -## READYTORUN_SECTION_RUNTIME_FUNCTIONS +## ReadyToRunSectionType.RuntimeFunctions -This section contains sorted array of `RUNTIME_FUNCTION` entries that describe all functions in the -image with pointers to their unwind info. The standard Windows xdata/pdata format is used. -ARM format is used for x86 to compensate for lack of x86 unwind info standard. -The unwind info blob is immediately followed by GC info blob. The encoding slightly differs for amd64 +This section contains sorted array of `RUNTIME_FUNCTION` entries that describe all code blocks in the image with pointers to their unwind info. +Despite the name, these code block might represent a method body, or it could be just a part of it (e.g. a funclet) that requires its own unwind data. +The standard Windows xdata/pdata format is used. +ARM format is used for x86 to compensate for the lack of x86 unwind info standard. +The unwind info blob is immediately followed by the GC info blob. The encoding slightly differs for amd64 which encodes an extra 4-byte representing the end RVA of the unwind info blob. ### RUNTIME_FUNCTION (x86, arm, arm64, size = 8 bytes) @@ -333,12 +340,12 @@ which encodes an extra 4-byte representing the end RVA of the unwind info blob. | 4 | 4 | Unwind info end RVA (1 plus RVA of last byte) | 8 | 4 | GC info start RVA -## READYTORUN_SECTION_METHODDEF_ENTRYPOINTS +## ReadyToRunSectionType.MethodDefEntryPoints This section contains a native format sparse array (see 4 Native Format) that maps methoddef rows to method entrypoints. Methoddef is used as index into the array. The element of the array is index of the -method in `READYTORUN_SECTION_RUNTIME_FUNCTIONS`, followed by list of slots that need to be -filled before the method can start executing. +method in `RuntimeFunctions`, followed by list of slots that need to be filled before the method +can start executing. The index of the method is left-shifted by 1 bit with the low bit indicating whether a list of slots to fix up follows. The list of slots is encoded as follows (same encoding as used by NGen): @@ -378,7 +385,7 @@ The list is terminated by a 0 (0 is not meaningful as valid delta). main R2R header; in composite R2R files, each component module has its own entrypoint section pointed to by the `READYTORUN_SECTION_ASSEMBLIES_ENTRY` core header structure. -## READYTORUN_SECTION_EXCEPTION_INFO +## ReadyToRunSectionType.ExceptionInfo Exception handling information. This section contains array of `READYTORUN_EXCEPTION_LOOKUP_TABLE_ENTRY` sorted by `MethodStart` RVA. `ExceptionInfo` is RVA of @@ -408,20 +415,20 @@ struct READYTORUN_EXCEPTION_CLAUSE Same encoding is as used by NGen. -## READYTORUN_SECTION_DEBUG_INFO +## ReadyToRunSectionType.DebugInfo This section contains information to support debugging: native offset and local variable maps. **TODO**: Document the debug info encoding. It is the same encoding as used by NGen. It should not be required when debuggers are able to handle debug info stored separately. -## READYTORUN_SECTION_DELAYLOAD_METHODCALL_THUNKS +## ReadyToRunSectionType.DelayLoadMethodCallThunks This section marks region that contains thunks for `READYTORUN_HELPER_DelayLoad_MethodCall` helper. It is used by debugger for step-in into lazily resolved calls. It should not be required when debuggers are able to handle debug info stored separately. -## READYTORUN_SECTION_AVAILABLE_TYPES +## ReadyToRunSectionType.AvailableTypes This section contains a native hashtable of all defined & export types within the compilation module. The key is the full type name, the value is the exported type or defined type token row ID left-shifted by one and or-ed with bit 0 defining the token type: @@ -437,7 +444,7 @@ The version-resilient hashing algorithm used for hashing the type names is imple main R2R header; in composite R2R files, each component module has its own available type section pointed to by the `READYTORUN_SECTION_ASSEMBLIES_ENTRY` core header structure. -## READYTORUN_SECTION_INSTANCE_METHOD_ENTRYPOINTS +## ReadyToRunSectionType.InstanceMethodEntryPoints This section contains a native hashtable of all generic method instantiations compiled into the R2R executable. The key is the method instance signature; the appropriate version-resilient @@ -451,15 +458,15 @@ composite R2R images. It represents all generics needed by all assemblies within executable. As mentioned elsewhere in this document, CoreCLR runtime requires changes to properly look up methods stored in this section in the composite R2R case. -## READYTORUN_SECTION_INLINING_INFO +## ReadyToRunSectionType.InliningInfo (v2.1+) **TODO**: document inlining info encoding -## READYTORUN_SECTION_PROFILEDATA_INFO +## ReadyToRunSectionType.ProfileDataInfo (v2.2+) **TODO**: document profile data encoding -## READYTORUN_SECTION_MANIFEST_METADATA +## ReadyToRunSectionType.ManifestMetadata (v2.3+) Manifest metadata is an [ECMA-335] metadata blob containing extra reference assemblies within the version bubble introduced by inlining on top of assembly references stored in the input MSIL. @@ -482,7 +489,7 @@ The module override index translation algorithm is as follows (**ILAR** = *the n **Note:** This means that the entry corresponding to *i* = **ILAR** + 1 is actually undefined as it corresponds to the `NULL` entry (ROWID #0) in the manifest metadata AssemblyRef table. The first meaningful index into the manifest metadata, *i* = **ILAR** + 2, corresponding to ROWID #1, is historically filled in by Crossgen with the input assembly info but this shouldn't be depended upon, in fact the input assembly is useless in the manifest metadata as the module override to it can be encoded by using the special index 0. -## READYTORUN_SECTION_ATTRIBUTEPRESENCE +## ReadyToRunSectionType.AttributePresence (v3.1+) **TODO**: document attribute presence encoding @@ -490,7 +497,7 @@ The module override index translation algorithm is as follows (**ILAR** = *the n main R2R header; in composite R2R files, each component module has its own attribute presence section pointed to by the `READYTORUN_SECTION_ASSEMBLIES_ENTRY` core header structure. -## READYTORUN_SECTION_INLINING_INFO2 +## ReadyToRunSectionType.InliningInfo2 (v4.1+) The inlining information section captures what methods got inlined into other methods. It consists of a single _Native Format Hashtable_ (described below). @@ -503,10 +510,10 @@ The entry of the hashtable is a counted sequence of compressed unsigned integers Foreign RIDs are only present if a fragile inlining was allowed at compile time. -**TODO:** It remains to be seen whether `READYTORUN_SECTION_METHODCALL_THUNKS` and / or -`READYTORUN_SECTION_INLINING_INFO` also require changes specific to the composite R2R file format. +**TODO:** It remains to be seen whether `DelayLoadMethodCallThunks` and / or +`InliningInfo` also require changes specific to the composite R2R file format. -## READYTORUN_SECTION_ASSEMBLIES (v4.1+) +## ReadyToRunSectionType.ComponentAssemblies (v4.1+) This image-wide section is only present in the main R2R header of composite R2R files. It is an array of the entries `READYTORUN_SECTION_ASSEMBLIES_ENTRY` parallel to the indices in the manifest metadata @@ -522,6 +529,15 @@ struct READYTORUN_SECTION_ASSEMBLIES_ENTRY }; ``` +## ReadyToRunSectionType.OwnerCompositeExecutable (v4.1+) + +For composite R2R executables with standalone MSIL, the MSIL files are rewritten during compilation +by receiving a formal ReadyToRun header with the appropriate signature and major / minor version +pair; in `Flags`, it has the `READYTORUN_FLAG_COMPONENT` bit set and its section list only contains +the `OwnerCompositeExecutable` section that contains a UTF-8 string encoding the file name of the +composite R2R executable this MSIL belongs to with extension (without path). Runtime uses this +information to locate the composite R2R executable with the compiled native code when loading the MSIL. + # Native Format Native format is set of encoding patterns that allow persisting type system data in a binary format that is diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Attach.md b/docs/design/coreclr/profiling/davbr-blog-archive/Attach.md index e4874ba9cdb9c8..93335dd51fecbd 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Attach.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Attach.md @@ -88,7 +88,7 @@ To understand limitations around the GC modes, here's a quick review of the GC m - **Workstation Concurrent / Background mode (the default)**. Concurrent GC (V1 & V2) allows portions of a full GC to execute while other threads are allowed to run. Background GC (its replacement in V4) takes it one step further, and also allows an ephemeral GC (i.e., gen 0 or gen 1) to execute while a gen 2 GC is executing. - **Server mode**. Hosts like ASP.NET may choose to enable server mode which creates a heap + dedicated GC thread per CPU. This allows GCs to be fanned out to multiple threads. -Of course, [Maoni's blog](http://blogs.msdn.com/maoni/) is required reading for anyone who wants to understand how the GC works. +Of course, [Maoni's blog](https://devblogs.microsoft.com/dotnet/author/maoni/) is required reading for anyone who wants to understand how the GC works. The profiling API is able to work against workstation blocking mode and server mode, but not concurrent / background mode. This has been the case in V1 & V2, and remains the case in V4. When the app starts up, if a profiler is configured to load, then the CLR forcibly turns off concurrent / background mode, and you end up in workstation blocking mode (or you end up in server mode if the host requested that instead). Again, this has been the case in V1 & V2, and remains true in V4. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - Activation.md b/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - Activation.md index 04b943e98bfb64..79ee3e1d291a09 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - Activation.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - Activation.md @@ -1,7 +1,7 @@ *This blog post originally appeared on David Broman's blog on 12/11/2007* -This is the first of some tips to help you debug your profiler. Note that these tips assume you're using CLR 2.x (see [this entry](http://blogs.msdn.com/davbr/archive/2007/12/06/versions-of-microsoft-net-framework-clr-and-your-profiler.aspx) for info on how CLR version numbers map to .NET Framework version numbers). In today's post, I address a frequent question from profiler developers and users: "Why didn't my profiler load?". +This is the first of some tips to help you debug your profiler. Note that these tips assume you're using CLR 2.x (see [this entry](https://docs.microsoft.com/en-us/archive/blogs/davbr/versions-of-microsoft-net-framework-clr-and-your-profiler) for info on how CLR version numbers map to .NET Framework version numbers). In today's post, I address a frequent question from profiler developers and users: "Why didn't my profiler load?". ## Event log (Windows only) diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - tail calls.md b/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - tail calls.md index ef41fad34a04e1..f24ce3bc145008 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - tail calls.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - tail calls.md @@ -55,7 +55,7 @@ When you're dealing with languages managed by the CLR, there are two kinds of co ### When does the JIT make tail calls? -I asked Fei Chen and [Grant Richins](http://blogs.msdn.com/grantri), neighbors down the hall from me who happen to work on the JIT, under what conditions the various JITs will employ the tail call optimization. The full answer is rather detailed. The quick summary is that the JITs try to use the tail call optimization whenever they can, but there are lots of reasons why the tail call optimization can't be used. Some reasons why tail calling is a non-option: +I asked Fei Chen and [Grant Richins](https://docs.microsoft.com/en-us/archive/blogs/grantri/), neighbors down the hall from me who happen to work on the JIT, under what conditions the various JITs will employ the tail call optimization. The full answer is rather detailed. The quick summary is that the JITs try to use the tail call optimization whenever they can, but there are lots of reasons why the tail call optimization can't be used. Some reasons why tail calling is a non-option: - Caller doesn't return immediately after the call (duh :-)) - Stack arguments between caller and callee are incompatible in a way that would require shifting things around in the caller's frame before the callee could execute diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Generics and Your Profiler.md b/docs/design/coreclr/profiling/davbr-blog-archive/Generics and Your Profiler.md index 21c748d9863b4e..149a0c0a7888cc 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Generics and Your Profiler.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Generics and Your Profiler.md @@ -85,7 +85,7 @@ typeArgs: This is the array of type arguments used to instantiate classId, which You may have noticed I ignored this parameter in my description of GetFunctionInfo2. You can pass NULL if you want, and nothing really bad will happen to you, but you’ll often get some incomplete results: you won’t get very useful typeArgs coming back, and you’ll often see NULL returned in \*pClassId. -To understand why, it’s necessary to understand an internal optimization the CLR uses around sharing code for generics: If two instantiations of the same generic function would result in identical JITted code, then why not have them share one copy of that code? The CLR chooses to share code if all of the type parameters are instantiated with reference types. If you want to read more about this, [here’s](http://blogs.msdn.com/carlos/archive/2009/11/09/net-generics-and-code-bloat-or-its-lack-thereof.aspx) a place to go. +To understand why, it’s necessary to understand an internal optimization the CLR uses around sharing code for generics: If two instantiations of the same generic function would result in identical JITted code, then why not have them share one copy of that code? The CLR chooses to share code if all of the type parameters are instantiated with reference types. If you want to read more about this, [here’s](https://docs.microsoft.com/en-us/archive/blogs/carlos/net-generics-and-code-bloat-or-its-lack-thereof) a place to go. For now, the important point is that, once we’re inside JITted code that is shared across different generic instantiations, how can one know which instantiation is the actual one that caused the current invocation? Well, in many cases, the CLR may not have that data readily lying around. However, as a profiler, you can capture this information and pass it back to the CLR when it needs it. This is done through a COR\_PRF\_FRAME\_INFO. There are two ways your profiler can get a COR\_PRF\_FRAME\_INFO: @@ -114,7 +114,7 @@ CLR’s generics sharing optimization complicates this somewhat. You’ll reall So that covers JIT notifications—what about ClassLoad\* notifications in the same example? Although the CLR shares _JITted code_ across reference-type instantiations, the CLR still maintains separate loaded _types_ for each generic instantiation of a generic class. So in the example from the paragraph above you will see separate ClassLoad\* notifications with different ClassIDs for MyClass\ and MyClass\. In fact, you will also see a separate ClassLoad\* notification (with yet another ClassID) for MyClass\. -If you got curious, and ran such a profiler under the debugger, you could use the SOS !dumpmt command with those different ClassIDs to see what you get. By doing so, you’ll notice something interesting. !dumpmt shows many values, including “Name”, which will correctly be the specific, fully-instantiated name of the type (different for all three ClassIDs). !dumpmt also shows a thing called “EEClass”. And you’ll notice this “EEClass” value is actually the _same_ for all 3 types. (Remember from this [post](http://blogs.msdn.com/davbr/archive/2007/12/18/debugging-your-profiler-ii-sos-and-ids.aspx) that EEClass is NOT the same thing as ClassID!) That gives you a little window into some additional data sharing optimizations the CLR uses. Stuff that remains the same across different generic instantiations of a class can be stored in a single place (the EEClass) and that single place can be referenced by the different generic instantiations of the class. Note that if you also use a value type as the type argument when instantiating MyClass\ (e.g., MyClass\), and then run !dumpmt on that ClassID, you’ll see an entirely different EEClass value in the output, as the CLR will not be sharing that subset of type data across generic instantiations that use type arguments that are value types. +If you got curious, and ran such a profiler under the debugger, you could use the SOS !dumpmt command with those different ClassIDs to see what you get. By doing so, you’ll notice something interesting. !dumpmt shows many values, including “Name”, which will correctly be the specific, fully-instantiated name of the type (different for all three ClassIDs). !dumpmt also shows a thing called “EEClass”. And you’ll notice this “EEClass” value is actually the _same_ for all 3 types. (Remember from this [post](https://docs.microsoft.com/en-us/archive/blogs/davbr/debugging-your-profiler-ii-sos-and-ids) that EEClass is NOT the same thing as ClassID!) That gives you a little window into some additional data sharing optimizations the CLR uses. Stuff that remains the same across different generic instantiations of a class can be stored in a single place (the EEClass) and that single place can be referenced by the different generic instantiations of the class. Note that if you also use a value type as the type argument when instantiating MyClass\ (e.g., MyClass\), and then run !dumpmt on that ClassID, you’ll see an entirely different EEClass value in the output, as the CLR will not be sharing that subset of type data across generic instantiations that use type arguments that are value types. ## Instrumenting Generic Functions diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Sample A Signature Blob Parser for your Profiler.md b/docs/design/coreclr/profiling/davbr-blog-archive/Sample A Signature Blob Parser for your Profiler.md index 928092fbe61697..34be8594412d4d 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Sample A Signature Blob Parser for your Profiler.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Sample A Signature Blob Parser for your Profiler.md @@ -1,7 +1,7 @@ *This blog post originally appeared on David Broman's blog on 10/13/2005* -If your profiler plays with metadata, you've undoubtedly come across signature blobs. They’re used to encode type information for method definitions & references, local variables, and a whole lot more. They’re wonderfully compact, recursively versatile, and sometimes, well, challenging to parse. Fortunately, [Rico Mariani](http://blogs.msdn.com/ricom/) was feeling generous one day, and churned out a simple parser that can read these types of signatures: +If your profiler plays with metadata, you've undoubtedly come across signature blobs. They’re used to encode type information for method definitions & references, local variables, and a whole lot more. They’re wonderfully compact, recursively versatile, and sometimes, well, challenging to parse. Fortunately, [Rico Mariani](https://docs.microsoft.com/en-us/archive/blogs/ricom/) was feeling generous one day, and churned out a simple parser that can read these types of signatures: MethodDefSig MethodRefSig diff --git a/docs/design/features/StringDeduplication.md b/docs/design/features/StringDeduplication.md new file mode 100644 index 00000000000000..edd3d0abd9a70b --- /dev/null +++ b/docs/design/features/StringDeduplication.md @@ -0,0 +1,226 @@ +# String Deduplication + +## **Problem Space** + +Duplicated strings have been frequently observed in managed heaps. In some user scenarios they can take up most of the heap. Folks have been doing their own string deduplication. One of our first party customers did their own deduplication and were able to reduce the heap size by >70% but they could not do this for all workloads they have; only when they can find a feasible place to do so. + +A general opt in solution in the runtime would help reduce the heap size significantly for scenarios with a large percentage taken up by duplicated strings. + +## **Glossary** + +Dedup - string deduplication is often shortened to dedup in this document. + +## **Design goals** + +This is an opt-in feature and should have no performance penalty when it’s off. And by default it’s off. + +When it’s on, we aim to – + +- Only deduplicate strings in old generations of the GC heap. +- Not increase the STW pauses for ephemeral GCs. +- Not regress string allocation speed. +- Provide static analysis and runtime checks to detect patterns incompatible with string deduping. This is required to enable customers to opt-in into this feature with confidence. + +## Details + +#### **History** + +The string deduplication feature has been brought up before. See [runtime issue #9022](https://github.com/dotnet/runtime/issues/9022) for discussion. + +And a proof of concept was gracefully [attempted](https://github.com/dotnet/coreclr/pull/15135) by [@Rattenkrieg](https://github.com/Rattenkrieg) before. But it was incomplete and the design didn’t have the kind of perf characteristics desired – it had most of the logic in GC vs outside GC. + +An example of a user implemented string deduplication is Roslyn’s [StringTable utility](https://github.com/dotnet/roslyn/blob/master/src/Compilers/Core/Portable/InternalUtilities/StringTable.cs). + +#### **Customer impact estimation and validation** + +As a general rule we want to have this for all features we add to the runtime. + +Issue #[9022](https://github.com/dotnet/runtime/issues/9022) It mentioned some general data: + +“The expectation is that typical apps have 20% of their GC heap be strings. Some measurements we have seen is that for at least some applications, 10-30% of strings all may be duplicated, so this might save 2-3% of the GC heap. Not huge, but the feature is not that difficult either.” + +But keep in mind that this is an *average* - specific scenarios could have much higher percentage of duplicated strings. I have heard from customers who had much more dramatic heap reduction when they eliminated duplicated strings. Those are scenarios that would benefit from this feature the most. + +There are 2 sources of data we could get – + +- Our dump database. We can ask the TI team to help us look at the general percent of duplicated strings on the GC heap. It would be useful to also provide tooling to help users to check how much space duplicated strings take. Some internal folks have written tooling for this but it requires work to ship. +- We already know of teams that can benefit from deduping. We should start a conversation with them to collect some data to have a rough idea about the baseline and make sure we have a way to verify private builds with them. + +#### **Design outline** + +This is an opt in feature. When the runtime detects it’s turned on, it creates a dedup thread to do the work. + +Detection of duplicated strings is done by looking into a hash table. The key into this hash table is the hash code of the content of a string. Detailed description of this detection is later in this doc. + +As the dedup thread goes through the old generations linearly, it looks for references to a string object (denoted by the method table) and either calculates or looks up the hash code of that string to see if it already exists in the hash table. If so it will attempt to change the reference to point to that string with a CAS operation. If this fails, which means some other thread changed the reference at the mean time, we simply ignore this and move on. We expect the CAS failure rate to be very low. + +Since the new string reference we will write to the heap has the exact same type info, it means BGC can read either the old or the new reference and will get the same size info so deduping would not conflict with BGC concurrent mark. It does not conflict with BGC sweep because BGC sweep does not read references inside an object. + +The dedup hash table acts as weak references to the strings. Depending on the scenario we might choose to null out these weak references or not (if it’s more performant to rebuild the hash table). If we we do the former these weak references would be treated as short weak handles so the following will happen before we scan for finalization - + +- During BGC final mark phase we will need to null out the strings that are not marked in the hash table. This can be made concurrent. + +- During a full blocking GC we will need to null out the strings that are not marked in the hash table, and relocate the ones that got promoted if we are doing a compacting GC. + +**Alternate design points** + +- Should we create multiple threads to do the work? + +Deduping can be done leisurely, so it doesn’t merit having multiple threads. + +- Can we use an existing thread to do the work on? + +The finalizer thread is something that’s idling most of the time. However there are already plenty of types of work scheduled to potentially run on the finalizer thread so adding yet another thing, especially an opt in feature, can get messy. + +#### **Which strings to dedup** + +Only strings allocated on the managed heap will be considered for deduplication. And only the ones that live in the old generations, meaning gen2 an LOH, will be considered. Deduping in young generations would be unproductive as they will likely die very soon. It would be extremely unproductive if the copy we are deduping to actually lived in young gens. + +#### **Calculating hash codes and large string consideration** + +Currently calling GetHashCode of a string calculates a 32-bit hash code. This is not stored anywhere, unlike the default hash code that’s stored either in the syncblk or a syncblk entry, depending whether the syncblk is also used by something else like locking. As the deduping thread goes through the heap it will calculate the 32-bit hash code and actually install it. + +However, a 32-bit hash code means we always need to check for collision by actually comparing the string content if the hash code is the same. And for large strings having to compare the string content could be very costly. For LOH compaction we already allocate a padding object for each large object (which currently takes up at most 0.4% of LOH space on 64-bit). We could make this padding object 1-ptr size larger and store the address of the string it’s deduped too. Likewise we can also use this to store the fact “this is the copy the hash table keeps track of so no need to dedup”. This way we can avoid having to do the detection multiple times for the same string. Below illustrates a scenario where large strings are deduplicated. + +`pad | s0 | pad | s1 | pad | s0_1` + +`obj0 (-> s0) | obj1 (-> s0_1) | obj2 (->s1) | obj3 (->s0_1) | obj4 (->s1) ` + +Each string obj, ie, s*, is a string on LOH and has a padding object in front of it which is not shown. + +s0_1 has the same content as s0. s1 has the same hash code but not the same content. + +"obj->s" means obj points to a string object s, or has a ref to s. So obj0 has a ref to s0, obj1 has a ref to s0_1, obj2 has a ref to s1 and so on. + +1. As we go through the heap, we see obj0 which points to s0. +2. s0’s hash is calculated which we use to look into the hash table. +3. We see that no entries exist for that hash so we create an entry for it and in s0’s padding indicates that it’s stored in the hash table, ie, it’s the copy we keep. +4. Then we see obj1 which points to s0_1 whose hash doesn’t exist yet. We calculate the hash for s0_1, and see that there’s an entry for this hash already in the hash table, now we compare the content and see that it’s the same, now we store s0 in the padding object before s0_1 and change obj1’s ref to point to s0. +5. Then we see obj2 and calculate s1’s hash. We notice an entry already exists for that hash so we compare the content and the content is not the same as s0’s. So we enter s1 into the hash table and indicate that it’s stored in the hash table. +6. Then we see obj3, and s0_1 indicates that it should be deduped to s0 so we change obj3’s ref to point to s0_1 right away. +7. Then we see obj4 which points to s1 and s1 indicates it’s stored in the hash table so we don’t need to dedup. + +Since we know the size of a string object trivially, we know which strings are on LOH. + +**Situations when we choose to not dedup** + +- If `InterlockCompareExchangePointer` fails because the ref was modified while we were finding a copy to dedup to (or insert into the hash table), we skip this ref. +- If too many collisions exist for a hash code, we skip deduping for strings with that hash code. This avoids the DoS attack by creating too many strings for the same hash. +- If the string is too large. At some point going through a very large string to calculate its hash code will become simply not worth the effort. We'll need to do some perf investigation to figure out a good limit. + +**Alternate design points** + +- Should we calculate the hash codes for SOH strings as gen1 GCs promote them into gen2? + +This would increase gen1 pause. + +- Should we dedup while creating LOH strings? + +This would reduce LOH string allocation speed and potentially by a lot. + +#### **How often to dedup** + +If there’s no new objects that get into gen2/LOH, there’s no need to run dedup as the duplicates would have already been eliminated (mostly) during the last dedup cycle. So we should use the new amount of objects these generations get to determine how often to dedup, ie, taking the following factors into consideration - + +- We know when new LOH strings are allocated (all LOH allocations are done via C++ helpers in gchelpers.cpp), we can take the accumulative size of new LOH strings till it reaches a certain percentage of LOH before starting the next dedup cycle. + +- We know how much is promoted into gen2 and we can also wait till a certain percentage of gen2 consists of newly promoted memory before starting the next dedup cycle. + +#### **Compatibility** + +The following scenarios become problematic or more problematic when deduping is on so we need ways to help users find them. + +- Mutating the string content + +Strings are supposed to be immutable. However in unsafe code you can change the string content after it’s created. Changing string content already asking for trouble without deduping – you could be changing the interned copy which means you are modifying someone else’s string which could cause completely unpredictable results for them. + +The most common way is to use the fixed keyword: + +```c# +fixed (char* p = str) +{ + p[0] = 'C'; +} +``` + +There are other ways such as + +`((char*)(gcHandlePointingToString.AddrOfPinnedObject())) = 'c';` + +Or + +`Unsafe.AsRef (in str.GetPinnableReference()) = 'c';` + +- Locking on a string + +Locking on a string object is already discouraged due to a string can be interned. Having string dedup on can make this problematic more often if the string you called lock on is now deduped to a different string object. + +- Reference equality + +This example illustrates an example of `ReferenceEquals` that will not work if `_field` was deduped to a different string reference by the time the assignment to a2 happens. + +```c# +string _field; + +void Test() +{ + _field = new string('a', 1); + + string a1 = _field; + Thread.Sleep(1000); + string a2 = _field; + + // This assert can fail with string deduping turned on + Debug.Assert(ReferenceEquals(a1,a2)); +} +``` + +**Runtime assistance to help with these scenarios** + +- Static analysis + +For .NET 5.0, there’s a static analysis [plan](https://github.com/dotnet/runtime/issues/30740). Verifying if string content is mutated can be part of that analysis suite. It would also be beneficial to have VS do this verification and give you a warning when you are mutating string content. + +To start with we will provide analysis for the following – + +1. Using the fixed keyword to modify string content. + +I’m seeing that there are almost 600 places in libraries that do `fixed (char*` but hopefully most of them do not actually modify the string content. We should definitely be encouraging folks to switch to using `string.Create` like what [PR#31700](https://github.com/dotnet/runtime/pull/31700) did. + +2. Using lock on a string object. + +- Reference equality checks on strings + +Since `ReferenceEquals` is performance critical API, we cannot do checks in its implementation. Checks will be done by how it's jitted - when the JIT sees that there are two object references being compared for equality, when a special diagnostics flag is set, it can jit a call to a helper method to do that and that helper method can produce diagnostics when the code is trying to compare identity of two strings. + +We do have some libraries that rely on `ReferenceEquals`. We need to figure out what to do about them. See discussion [here](https://github.com/dotnet/runtime/pull/31971#pullrequestreview-355531406). + +- Additional checks in heap verification + +Heap verification will now include checks to verify that no one changes the string content after it’s hash is computed. This can be turned on when a certain level of COMPlus_HeapVerify is specified. + +- Stress mode + +Instead of waiting till the productive moment to start the next deduping cycle, we can have a stress mode where we dedup randomly to catch problems sooner, same idea as GC stress to detect GC holes sooner. + +We could even artificially create duplicates in this stress mode to find places that depend on object identity. + +- Backup nonconcurrent dedup mode + +If you are running into these problematic scenarios and cannot make changes, and you can tolerate longer STW (Stop-The-World) pauses, we will provide a mode where deduping is completely done in either a full blocking GC or during the STW pause of a BGC. Obviously this would make BGC’s STW pauses much, much longer. This would basically just call the function that the dedup thread calls, but in these STW pauses. If you use a CPU profiler you should be able to see preciously how long the dedup part takes during the STW pause. + +We will either provide this as an API (GC.DeduplicateStrings) or as a config that only does dedup during full blocking GCs. The former is flexible and can give you detailed info such as how much space deduplicating strings saved. You could call this leisurely at a time when you know longer latency can be tolerated (eg, the server instance is taken out of rotation so you can tolerate a long pause). + +#### **Potential future work** + +**Experimenting with RTM** + +We might see some performance gains using RTM (Restricted Transactional Memory) on machines with large L1 caches but this is a P2 item. After we have the software solution implemented it would be easy to experiment with this. However, I have doubts it would give perf gain in most scenarios since looking into the hash table is quite a bit of work for RTM and likely will give high abort rate. + +**Deduping other types of objects** + +We might consider to not limit deduping to just strings. There was a discussion in [runtime issue #12628](https://github.com/dotnet/runtime/issues/12628). + +**Deduping long lived references on stack** + +There might be merit to look into deduping long lived refs on the stack. The amount of work it requires and the return makes it low priority but it may help with some corner cases. \ No newline at end of file diff --git a/docs/design/features/assembly-conflict-resolution.md b/docs/design/features/assembly-conflict-resolution.md index 530ea3b3189d31..cd0bff4b1ced40 100644 --- a/docs/design/features/assembly-conflict-resolution.md +++ b/docs/design/features/assembly-conflict-resolution.md @@ -2,9 +2,7 @@ # Assembly Conflict Resolution ## Summary -This document describes current and proposed behavior for dealing with references to assemblies that exist physically in more than one location including the "app" location and "framework" location(s). It proposes moving from "app wins" to "framework wins" during a [minor] or [major] roll-forward when the framework has a newer version of the given assembly. - -The corresponding issue is https://github.com/dotnet/core-setup/issues/3546. +This document describes current behavior for dealing with references to assemblies that exist physically in more than one location including the "app" location and "framework" location(s). ## Current behavior @@ -16,20 +14,13 @@ Since each layer (and other probing locations) can contain the same assembly by #### Probe Ordering The probing locations consists of: -1. Serving Location -1. Shared Store -1. Framework directory(s) from higher to lower +1. Servicing Location 1. App directory -1. Additional locations specified in runtimeconfig.dev.json file +1. Framework directory(s) from higher to lower +1. Shared Store +1. Additional locations specified in `runtimeconfig.dev.json` or via `--additionalprobingpath` file -For example, here's the probing order on Windows when running a non-published folder (in order to get additional locations from the app.runtimeconfig.dev.json file) -* `C:\\Program Files (x86)\\coreservicing\\x64` -* `C:\\Program Files (x86)\\coreservicing\\pkgs` -* `C:\\Program files\\dotnet\\shared\\Microsoft.NETCore.App\\2.0.0` -* (app location) -* `C:\\Users\\\\.nuget\\packages` - `C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackagesFallback` -* `C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder` +Detailed description of the exact probe locations is described in [host-probing](host-probing.md). Once a deps.json entry has been found in a probe location, no further probes are performed for that entry. @@ -41,25 +32,18 @@ The order in which each layer's deps.json is processed is: #### Algorithm 1. Determine the probing paths -1. For each entry in the app's deps.json -1. ->For each probing path -1. -->If the probing path is a framework, then check its deps.json to see if it contains the exact package (by name and version). If so, then use the framework's location and end probing for this entry -1. -->If the probing path is not a framework, then use that location and end probing for this entry -1. Read the additional deps from `--additional-deps` and repeat steps 3-5 -1. Read each framework's deps.json (higher to lower) and repeat steps 3-5 +1. For each entry in the app's `.deps.json` +1. ->If there's already a resolved entry with the same asset name, then check the assembly and file version of the new entry against the already resolved one. If the new entry is equal or lower, skip it. Otherwise remove the existing one and go to the "else" branch below +1. ->Else (new asset, or replaced with higher version) probe for the actual asset file +1. -->For each probing path except frameworks that are higher-level +1. --->If the probing path is a framework, then check its `.deps.json` to see if it contains the exact package (by name and version). If it does, then use that location and end probing for this entry. +1. --->If the probing path is not a framework, then use that location and end probing for this entry +1. Read the additional deps from `--additional-deps` and repeat steps 3-7 +1. Read each framework's deps.json (higher to lower) and repeat steps 3-7 1. Pass the set of assemblies and their paths to the CLR -Note that for an app, its probing path comes *after* the framework's, so intuitively it would appear that "framework wins" in collisions. However, because the app's deps.json is parsed *before* the framework's deps.json and because the app will likely reference an OOB package that the framework doesn't (because a framework, at least Microsoft.NETCore.App, has its own metapackage and does not reference OOB packages), the framework probing path never matches up in step 4 for the app's deps.json package\assembly entry, so it goes to the next probing path which is the app's and because the package matches the "app wins". - -## Changes for 2.1+ -Probe the app location before the framework's. This means flip (3) and (4) under **Probe Ordering** above and treat the app as the highest-level framework. The reason is that there may be frameworks that use OOB packages like apps, and we want to have "app wins" in non roll-forward cases. - -Replace step 3 under **Algorithm** above with: -* For each probing path except frameworks that are higher-level - -The reason for this change is that a given framework should never have a dependency on a higher-level framework, and is expected to find deps assets in its layer or lower. This is also required so that the given framework can find its asset, and replace the higher-level asset (see next paragraph). +Note that for an app both its `.deps.json` as well as probing path comes before the framework's `.deps.json`, so the app will usually win. Also because the app will likely reference an OOB package that the framework doesn't (because a framework, at least Microsoft.NETCore.App, has its own metapackage and does not reference OOB packages), the framework probing path never matches up in step 6 for the app's `.deps.json` package\assembly entry, so the "app wins". -Replace step 4 under **Algorithm** above with: -* If the probing path is a framework, then check its deps.json to see if it contains the exact package (by name and version). If so check if a [minor] or [major] roll-forward occurred for this framework. If true (roll-forward), then check its deps.json to see if it contains a newer version of the assembly (by Assembly Version and then File Version if necessary) compared to a previously found deps entry and use that and end probing for this entry. If false (no roll-forward), then use that location and end probing for this entry. +The reason for only probing paths from equal or lower level framework in step 5 is that a given framework should never have a dependency on a higher-level framework, and is expected to find deps assets in its layer or lower. This is also required so that the given framework can find its asset, and replace the higher-level asset (see next paragraph). In order to compare Assembly Version and File Version, additional metadata will need to be written to each deps.json file. If this metadata is not present (as in the case of applications published prior to 2.1) then the assembly will be considered older and will not replace any locations that the assembly was previously found at. diff --git a/docs/design/features/localization-options.md b/docs/design/features/localization-options.md new file mode 100644 index 00000000000000..4d3fa6b56b3b89 --- /dev/null +++ b/docs/design/features/localization-options.md @@ -0,0 +1,309 @@ +# Localization: .NET Core host and runtime + +The .NET Core host and runtime contain messages that can be displayed to both end-users and developers. Currently, all such messages are displayed in English. + +Other managed components built on top of .NET Core (e.g. SDK, WinForms, WPF) have already been localized, so a process already exists for handling translation and localizing assets, while the .NET Core runtime handles satellite assembly loading. The host and runtime are different in that they have messages that originate from native components and must continue to do so. While the runtime does contain some managed resources, this document focusses on localization of native resources. + +The goal is to support: + + - Windows, Linux, and OSX + - Windows was identified as the highest priority due to WPF and WinForms scenarios + - 14 languages (same languages supported by Visual Studio): `cs`, `de`, `en`, `es`, `fr`, `it`, `ja`, `ko`, `pl`, `pt-BR`, `ru`, `tr`, `zh-Hans`, `zh-Hant` + - All the target languages are left-to-right + +## String localization on different platforms + +### Windows + +On Windows, [resource script (.rc) files](https://docs.microsoft.com/cpp/windows/resource-files-visual-studio) are used to create resources that will be embedded into a binary. These files define [`STRINGTABLE`](https://docs.microsoft.com/windows/win32/menurc/stringtable-resource) resources containing the resource strings. Each string has a resource identifier - a symbol name mapped to an integer value - which can be used to look up the string value. + +The [`LoadString`](https://docs.microsoft.com/windows/win32/api/winuser/nf-winuser-loadstringw) and [`FormatMessage`](https://docs.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessage) APIs retrieve a string resources based on a specified identifier (the integer value of the resource identifier) from a specified module. These APIs leave it to their consumer to find and load the appropriate module containing the desired resources. While resources for all languages can be included in the main binary itself, it is common to separate language-specific resources into resource-only libraries. + +### Linux + +The [GNU `gettext` APIs and tools](https://www.gnu.org/software/gettext/manual/gettext.html) are the standard for internationalization and localization on Linux. The tools provide a way to extract strings from C/C++ sources into separate source string ([.po](https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files)) files (which could then be translated) and produce binary ([.mo](https://www.gnu.org/software/gettext/manual/gettext.html#MO-Files)) files from those source string files. The APIs allow retrieval of the translated strings through a `msgid` (string), where the convention is to use the untranslated string as the `msgid`. + +The `gettext` API looks for the binary files in a folder of the format: + + //LC_MESSAGES/.mo + +The `` and `` can be [configured](https://www.gnu.org/software/gettext/manual/gettext.html#Ambiguities) via the `dgettext` and `bindtextdomain` APIs. The `` is that of the current process. Users can configure the locale through [environment variables](https://www.gnu.org/software/gettext/manual/gettext.html#Locale-Environment-Variables). + +### OSX + +For OSX bundles, separate [strings resource (.strings) files](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) are used for string localization. The platform provides a tool to extract strings from sources into .strings files and APIs for retrieving the strings from the .strings files. The .strings files are a mapping key strings to corresponding value strings, where it is common to use the untranslated string as the key. + +The Core Foundation framework provides [`CFCopyLocalizedString*` macros](https://developer.apple.com/documentation/corefoundation/cfcopylocalizedstring) for loading string resources. They will look for the strings files in a folder of the format: + + /.lproj/.strings + +The `` and `` are based on the bundle specified in the API call. The `` is that of the system. + +Bundles are a concept applied to directories laid out in a known structure. Without an actual bundle, [`CFBundleCreate`](https://developer.apple.com/documentation/corefoundation/1537154-cfbundlecreate) can still be used to create a bundle from any specified directory and [`CFCopyLocalizedStringFromTableInBundle`](https://developer.apple.com/documentation/corefoundation/cfcopylocalizedstringfromtableinbundle) can be used to retrieve the localized strings. + +## Current state + +### Host + +All strings are currently hard-coded in the hosting components directly where they will be displayed. There are no utilities or infrastructure around resource strings. All strings that would require localization are from native components. + +#### Hosting components + +The host has multiple components that are deployed in different ways, live in separate places, and can be of different versions. This means that there will need to be separation between their resources as well. The approach to localization may also vary based on the different use cases for each component. + +### Runtime + +On Windows, the English resource strings are in separate `mscorrc.debug` and `mscorrc` libraries. On Linux and OSX, the English resource strings are compiled into `coreclr` itself (as string constants, not an embedded resource). String resources exist in both native (.rc) and managed (.resx). + +Some infrastructure is in place for loading of resources on Windows, but is not fully tested. Infrastructure for resource loading on Linux existed (recently removed), but was also untested. There was never any attempt at support for resource loading on OSX. + +## Proposed + +### Host + +Each host component will include English resource strings by default. If the resource for the appropriate locale could not be found, the host components can always fall back to English. + +`dotnet`, `hostfxr`, and `hostpolicy` will each have separate resources that will be installed by the .NET Core runtime. These components can be different versions, so their resources must be separate. + +`apphost` will have a single localized message. All languages will be included in the executable itself. The message will direct the user to a URL that will contain localized content. + +`ijwhost`, `winrthost`, and `nethost` intentionally do not show messages by default. They will not be localized. + +`comhost` also intentionally does not show messages, but it does populate an `IErrorInfo` with an error string, allowing consumers to access any error messages. This can take the same approach as `apphost`, but would be a lower priority for localization. + +#### Hosting components + +`dotnet`, `hostfxr`, and `hostpolicy` are all included as part of a .NET Core install. They can each carry their own separate resources in a known path relative next to their current install locations. + +The other entry-point hosts (`apphost`, `comhost`, `ijwhost`, `winrthost`, `nethost`) add some complication as they represent and ship as part of the developer's application or component. They are also the most impactful in terms of file size, as they are not shared across applications the way that other components can be. + +The messaging coming from the hosts themselves is a small portion of the host messaging. They are mostly around: +- Failure to find `hostfxr` (all hosts) +- Failure to load `hostfxr` (all hosts) +- Single-file bundle reading and extraction issues (`apphost` only) + +Possible options for hosts: + +*Deploy resources with each host* + + - Every host comes with its own resources, so compatibility will not be a problem + - Hosts will still be localized when there is no runtime + - Issues: + - SDK/deployment logic around including the appropriate resources and gestures for choosing those resources + + - Options: + 1. Embedded resources for hosts + - Size bloat could be impactful, since it would be for each host and one app can be comprised of multiple hosts + - Deployment would not strictly have to change if everything is always embedded, but it would likely be desirable to have at least two versions (only English and all languages embedded) and allow users to choose + - The canonical way of doing native localization is having separate resource files, so embedding everything would mean having to come up with a different, special method + - This would also be necessary for [single-file](#single-file) support + + 2. Separate resource for each host + - Number of files on disk would increase greatly (each host x each language) + - Deployment becomes very complicated, since the hosts represent the user's app/component and are acquired through building with the SDK (`nethost` adds more complication as it is up to the users to acquire and deploy it) + - Developers would need some way of choosing languages to include + +*Install resources with .NET Core* + + - If the runtime is not installed/found, hosts will not have localized resources + - If the hosts are newer than installed runtime, new messages would not be localized + - Issues: + - Compatibility concerns for resource IDs / format values + - Awkward split deployment since `*host` components are not normally part of the .NET Core runtime install + + - Options: + 1. Separate resource for each host + - Resource for each host would still need to be backwards compatible, since there is no guarantee that the host is the same version as the resource installed with the runtime + - Some messages are used for all hosts, so they would be duplicated across resource libraries + + 2. Option: Shared resource for all hosts (except `dotnet`) + - Compatibility requirement for resource shared between hosts + +`comhost`, `ijwhost`, `winrthost`, and `nethost` are designed to be consumed by a component that .NET Core does not own and intentionally do not show messages to the user. As such, they sit at a low priority for localization support. + +`apphost` is the end-user-facing host. The amount of logic and messaging in `apphost` is intentionally limited. The most important message it contains for an end-user is for the missing .NET Core runtime scenario, so it should not rely on resources installed via the .NET Core runtime. + +Embedding resources in the `apphost` would make for the most stream-lined user experience (particularly around deployment). Since the `apphost` is sensitive to size, the number of messages will be pared down to one generic localized message which directs the user to a URL. + +Options: + + 1. No localization + - Main user-facing message already has a URL, which could be updated to include user locale such that it would direct to a page based on the user locale + 2. Single localized message pointing to a URL for error details + - Show English error message. Show localized message pointing the user to some URL to get details (which would direct to a page based on the user locale). + - If this experience is acceptable, it would be applicable for all future error messages in the host + - Need to own or partner more closely with server / docs + 3. Single localized message indicating an error and pointing to a URL for error details + - Show localized message indicating error occurred running the application and pointing to a URL (which would direct to a page based on the user locale). Additional error details in English. + - Need to own or partner more closely with server / docs + +Both (2) and (3) represent similar amounts of work. (2) would ensure that the single message would not need to change and no other messages would need to be added in the future. (3) provides a slightly nicer user experience. In all cases, the user would be shown a URL that would direct to localized content. + +### Runtime + +The `mscorrc.debug` and `mscorrc` resource libraries will be combined into one. All native components use resources from `mscorrc`. + +`System.Private.CoreLib` will have `System.Private.CoreLib.resources` satellite assemblies and rely on the satellite assembly loading infrastructure in .NET Core to work. + +### Locale + +Localization for native components will be based on the user's locale. + +Standard methods for native localization use the user's locale. However, managed satellite assemblies also respect the thread's current culture. If the managed thread's current culture is not the same as the user's locale, this could result in mixed languages. Attempting to have the native components also follow the managed thread's culture would introduce issues and add significant complexity: + - Managed code may not be callable at the time a message needs to be displayed + - Some messages propagate up from the host (e.g. errors in `AssemblyDependencyResolver`) and host components do not have a simple way to access the managed thread's culture + - Not all platforms have a standard way to choose a specific language outside of process-wide configuration (e.g. `gettext` on Linux always uses the locale based on environment variables) + +### Translated assets + +All localizable resources need to be in the XLIFF file format (.xlf). New tooling will be required to convert from an untranslated base format to language-specific .xlf files and from the language-specific .xlf files to a format (.rc/.po/.strings, UTF-8/UTF-16) that will be compiled into resource libraries (or deployed directly) for each platform. + +The existing [xliff-tasks](https://github.com/dotnet/xliff-tasks) tooling supports conversion between managed resource files (.resx) and .xlf files and building satellite resource libraries. It is all MSBuild-based and has no concept of native resources or build processes. Extending it in a way that works naturally with CMake builds across platforms would be non-trivial. + +It is also an option to create tooling directly integrated in the dotnet/runtime repo itself. This would not be a generic and reusable component outside of the dotnet/runtime repo and its build system. + +### Platforms + +Each platform has its own standard way and file formats for handling localization. There are two main approaches that can be taken here: + 1. Convert a base format to platform-specific localization formats and use platform-specific localization support + - Requires a tool/script to convert file formats at build time + - Uses platform support and standard localization methods that the .NET Core team will not need to maintain + - Different method for handling localized resources on each platform + 2. Create a custom solution: storage format for string resources, tools for generation from the [translated assets (.xlf)](#translated-assets), and implementation for reading + - Requires design of completely custom support that will need to be maintained by the .NET Core team on all platforms + - Allows support for both string resources from file or memory + - All platforms could use the same method for handling localized resources + +For [single-file](#single-file) support without any separate files, (1) would not be sufficient and a custom solution (2) would be required. For single-file support where localized resources can be included as separate files, the platform-specific solutions could be used. + +#### Windows-specific + +Resource script (.rc) files will be used as the main source of string values written in the development language (English). These base .rc files will be used to update [.xlf files](#translated-assets). Those which will then be compiled into language-specific resource libraries. + +The host and runtime will follow the typical [Windows method](#windows) for localization of native string resources. Resources for each language will be compiled into a resource-only library, laid out in a language-specific subfolder. For example: + +``` +host/fxr/ + hostfxr.dll + fr + hostfxr.resources.dll +shared/Microsoft.NETCore.App/ + coreclr.dll + hostpolicy.dll + fr + hostpolicy.resources.dll + mscorrc.dll +``` + +At run time, the .NET Core host/runtime will find and load the resource DLL from the subfolder corresponding to the user's current locale. If the resource cannot be found, English will be the fallback. + +#### Linux-specific + +The development language (English) strings will be compiled into the host and runtime directly. The langage-specific .xlf files will be converted into .po files and then .mo files. Those binary .mo files will be laid out in a language-specific subfolder. For example: + +``` +host/fxr/ + libhostfxr.so + fr + LC_MESSAGES + hostfxr.mo +shared/Microsoft.NETCore.App/ + libcoreclr.so + libhostpolicy.so + fr + LC_MESSAGES + hostpolicy.mo + mscorrc.mo +``` + +The `gettext` APIs will be used to retrieve the appropriate message using the development language strings as the `msgid`. + +#### OSX-specific + +The development language (English) strings will be compiled into the host and runtime directly. The language-specific .xlf files will be converted into .strings files. Those .strings files will be laid out in a language-specific subfolder. For example: + +``` +host/fxr/ + libhostfxr.dylib + fr.lproj + hostfxr.strings +shared/Microsoft.NETCore.App/ + libcoreclr.dylib + libhostpolicy.dylib + fr.lproj + hostpolicy.strings + mscorrc.strings +``` + +The `CFCopyLocalizedStringFromTableInBundle` API will be used to retrieve the appropriate message using the development language strings as the key. + +#### Custom solution + +The development language (English) strings will be compiled into the host and runtime directly. The langage-specific `.xlf` files will be converted into a chosen storage format. Those files will be laid out in a language-specific subfolder. For example: + +``` +host/fxr/ + hostfxr.dll (.so/.dylib) + fr + hostfxr.resources +shared/Microsoft.NETCore.App/ + coreclr.dll (.so/.dylib) + hostpolicy.dll (.so/.dylib) + fr + hostpolicy.resources + mscorrc.resources +``` + +For single file, the language-specific resources will be bundled into the application's executable. + +Cross-platform utilities will be created for resource loading. The reader/parser will support both reading from a file and memory. + +### Shared utilities between host and runtime + +Both the host and runtime require support for native localization. Since (with the exception of `apphost`) they would use the same approach, rather than each having their own copy, it would make sense for them to share utilities around finding and loading resources. + +Ideally, the host and runtime could use the same static lib. However, even though they are now in the same repo, their builds are still fairly partitioned. A reasonable middle ground could be to have source files that are compiled into both the host and runtime components. This does have the complication that the host and runtime have separate PALs, so any shared code would need to work properly with both sides. + +### Packaging and deployment + +Installers and packages will need to include the language-specific resource files. This could involve updating all existing installers or could mean the creation of multiple new installers. + +Exactly how resources should be delivered is an [open question](#packaging-and-deployment-1). + +## Open questions + +### Language override + +Messages from the host and runtime can be user-facing or developer-facing. Some developers do not want to have localized messages, so there should be some way to override localizing to the user's locale. This would need to be a setting that both the host and runtime could easily check. + +On Windows, the native component fully controls which resource library to load, so it would be able to check for an override (like an environment variable). The `gettext` APIs on Linux essentially allow this kind of override through environment variables. There is not a clear way to configure the APIs on OSX to override the locale; the .strings files can be loaded/read as a dictionary directly through the [`CFPropertyListCreateWithStream`](https://developer.apple.com/documentation/corefoundation/1430023-cfpropertylistcreatewithstream) API. + +The SDK already allows overriding of the locale through the `DOTNET_CLI_UI_LANGUAGE` environment variable. + +Any automated testing would likely also require some form of language override. + +### Single-file + +The standard way of doing native localization is based on having separate resources files. On Windows, it is possible to embed resources for multiple languages into one library and use [`FormatMessage`](https://docs.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessage) or a combination of [`FindResourceEx`](https://docs.microsoft.com/windows/win32/api/winbase/nf-winbase-findresourceexa) and [`LoadResource`](https://docs.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-loadresource) to load the resource for a specific language. On Linux and OSX, no such platform support exists. + +Extracting files to disk has proven to be extremely problematic across all platforms (permissions, anti-virus, clean up). Adding native resources to that extraction would only exacerbate the existing issues. This means that localized resources would need be read from memory. A custom solution would need to be created and maintained: + - Format for storing identifiers and their corresponding strings for every language + - Tooling to generate the format based on [translated assets](#translation-and-localized-assets) + - Reader/parser for the custom format to retrieve the appropriate string + +If support for localization of native components in single-file scenarios without separate resource files is a priority, it would make sense to just use the custom solution (that could handle both reading from files and memory) for non-single-file scenarios as well. + +Since localization would not be needed by all applications, localized resources could also be considered an add-on to single-file and not part of the single-file itself. To support localization, the developer would need to include separate localized resources alongside the single-file executable. In this case, the platform-specific solution would be used. Since Windows does provide a supported way to handle multiple embedded localized resources, the experience for localization could also be improved on Windows such that it does embed all resources into one library. + +### Packaging and deployment + +WPF and WinForms always include all languanges in an install. Does the host/runtime do the same or have separate language packs? How are they delivered (e.g. single installer with runtime and options for different languages, separate installer for languages with options for different languanges, separate installer per language)? + +### SDK + +Self-contained applications would need to include resources for all languages they support. Some developer input would be required to specify the desired language support and the SDK would need to be updated to handle the different options: + - All supported languages + - One specific language + - A subset of supported languages (more than one) + +Note: Building WPF self-contained applications currently includes resources for all languages. diff --git a/docs/issue-mappings/README.md b/docs/issue-mappings/README.md new file mode 100644 index 00000000000000..e533e53d41c6b2 --- /dev/null +++ b/docs/issue-mappings/README.md @@ -0,0 +1,8 @@ +Many of the issues in this repo were originally created in the dotnet/coreclr, dotnet/corefx, and dotnet/core-setup repos, then migrated here to the dotnet/runtime repo. + +In this process their ID numbers inevitably changed. If you have the old ID number, you can find the new ID number by simply navigating to the old URL: your browser will be redirected to the new URL. + +For example, https://github.com/dotnet/coreclr/issues/25 redirects to https://github.com/dotnet/runtime/issues/3858. + +In some circumstances you may have the new URL and want the old one. For example, if you are looking at a migrated issue and wish to search your email or chat logs for a discussion that referred to the old URL. In that case, you can use these mapping files to look up the old ID and find the old URL. + diff --git a/docs/issue-mappings/core-setup.mapping.txt b/docs/issue-mappings/core-setup.mapping.txt new file mode 100644 index 00000000000000..d8c936cf1aeb07 --- /dev/null +++ b/docs/issue-mappings/core-setup.mapping.txt @@ -0,0 +1,1455 @@ +https://github.com/dotnet/core-setup/issues/XXXX ---> https://github.com/dotnet/runtime/issues/YYYY +18 ---> 2412 +20 ---> 2413 +23 ---> 2414 +25 ---> 2415 +26 ---> 2416 +27 ---> 2417 +33 ---> 2418 +34 ---> 2419 +37 ---> 2420 +40 ---> 2421 +41 ---> 2422 +42 ---> 2423 +71 ---> 2424 +72 ---> 2425 +80 ---> 2426 +84 ---> 2427 +89 ---> 2428 +94 ---> 2429 +102 ---> 2430 +108 ---> 2431 +110 ---> 2432 +118 ---> 2433 +119 ---> 2434 +121 ---> 2435 +150 ---> 2436 +154 ---> 2437 +158 ---> 2438 +161 ---> 2439 +165 ---> 2440 +167 ---> 2441 +169 ---> 2442 +172 ---> 2443 +174 ---> 2444 +176 ---> 2445 +177 ---> 2446 +181 ---> 2447 +183 ---> 2448 +185 ---> 2449 +186 ---> 2450 +189 ---> 2451 +191 ---> 2452 +193 ---> 2453 +194 ---> 2454 +196 ---> 2455 +198 ---> 2456 +200 ---> 2457 +204 ---> 2458 +211 ---> 2459 +215 ---> 2460 +216 ---> 2461 +217 ---> 2462 +223 ---> 2463 +225 ---> 2464 +228 ---> 2465 +229 ---> 2466 +230 ---> 2467 +233 ---> 2468 +234 ---> 2469 +238 ---> 2470 +253 ---> 2471 +256 ---> 2472 +259 ---> 2473 +274 ---> 2475 +275 ---> 2476 +276 ---> 2477 +279 ---> 2478 +283 ---> 2479 +298 ---> 2480 +300 ---> 2481 +306 ---> 2482 +325 ---> 2483 +327 ---> 2484 +347 ---> 2485 +361 ---> 2486 +364 ---> 2487 +378 ---> 2488 +385 ---> 2489 +390 ---> 2490 +392 ---> 2491 +400 ---> 2492 +402 ---> 2493 +409 ---> 2494 +421 ---> 2495 +422 ---> 2496 +423 ---> 2497 +432 ---> 2498 +436 ---> 2499 +438 ---> 2500 +444 ---> 2501 +455 ---> 2502 +456 ---> 2503 +458 ---> 2504 +459 ---> 2505 +461 ---> 2506 +467 ---> 2507 +472 ---> 2508 +499 ---> 2509 +510 ---> 2510 +514 ---> 2511 +515 ---> 2512 +538 ---> 2513 +544 ---> 2514 +545 ---> 2515 +565 ---> 2516 +570 ---> 2517 +572 ---> 2518 +579 ---> 2519 +595 ---> 2520 +617 ---> 2521 +618 ---> 2522 +619 ---> 2523 +620 ---> 2524 +622 ---> 2525 +623 ---> 2526 +624 ---> 2527 +625 ---> 2528 +626 ---> 2529 +627 ---> 2530 +628 ---> 2531 +634 ---> 2532 +635 ---> 2533 +636 ---> 2534 +637 ---> 2535 +638 ---> 2536 +650 ---> 2537 +651 ---> 2538 +675 ---> 2539 +676 ---> 2540 +679 ---> 2541 +680 ---> 2542 +685 ---> 2543 +695 ---> 2544 +715 ---> 2545 +721 ---> 2546 +723 ---> 2547 +725 ---> 2548 +729 ---> 2550 +734 ---> 2551 +736 ---> 2552 +753 ---> 2553 +764 ---> 2554 +789 ---> 2555 +790 ---> 2556 +801 ---> 2557 +811 ---> 2558 +813 ---> 2559 +847 ---> 2560 +849 ---> 2561 +934 ---> 2562 +949 ---> 2563 +1017 ---> 2564 +1021 ---> 2565 +1030 ---> 2566 +1121 ---> 2567 +1126 ---> 2568 +1183 ---> 2569 +1192 ---> 2570 +1217 ---> 2571 +1219 ---> 2572 +1221 ---> 2573 +1229 ---> 2574 +1230 ---> 2575 +1231 ---> 2576 +1267 ---> 2577 +1285 ---> 2578 +1288 ---> 2579 +1322 ---> 2580 +1378 ---> 2581 +1386 ---> 2582 +1400 ---> 2583 +1408 ---> 2584 +1411 ---> 2585 +1432 ---> 2586 +1454 ---> 2587 +1461 ---> 2588 +1484 ---> 2589 +1489 ---> 2590 +1490 ---> 2591 +1503 ---> 2592 +1504 ---> 2593 +1507 ---> 2594 +1519 ---> 2595 +1530 ---> 2401 +1532 ---> 2596 +1548 ---> 2597 +1550 ---> 2598 +1551 ---> 2599 +1553 ---> 2600 +1555 ---> 2601 +1557 ---> 2602 +1559 ---> 2603 +1561 ---> 2604 +1562 ---> 2605 +1564 ---> 2606 +1565 ---> 2607 +1566 ---> 2608 +1570 ---> 2609 +1573 ---> 2610 +1574 ---> 2611 +1575 ---> 2612 +1578 ---> 2613 +1581 ---> 2614 +1589 ---> 2615 +1590 ---> 2616 +1591 ---> 2617 +1593 ---> 2618 +1596 ---> 2619 +1597 ---> 2620 +1598 ---> 2621 +1599 ---> 2622 +1605 ---> 2623 +1607 ---> 2624 +1609 ---> 2625 +1614 ---> 2626 +1620 ---> 2627 +1622 ---> 2628 +1632 ---> 2629 +1636 ---> 2630 +1638 ---> 2631 +1645 ---> 2632 +1646 ---> 2633 +1651 ---> 2044 +1653 ---> 2634 +1664 ---> 2635 +1673 ---> 2636 +1674 ---> 2637 +1707 ---> 2638 +1719 ---> 2639 +1721 ---> 2640 +1722 ---> 2641 +1725 ---> 2642 +1739 ---> 2643 +1740 ---> 2644 +1741 ---> 2645 +1749 ---> 2646 +1755 ---> 2647 +1756 ---> 2648 +1757 ---> 2649 +1758 ---> 2650 +1760 ---> 2651 +1762 ---> 2652 +1801 ---> 2653 +1805 ---> 2654 +1810 ---> 2655 +1816 ---> 2656 +1824 ---> 2657 +1825 ---> 2658 +1832 ---> 2659 +1835 ---> 2660 +1840 ---> 2661 +1842 ---> 2662 +1846 ---> 2663 +1848 ---> 2664 +1856 ---> 2665 +1868 ---> 2666 +1871 ---> 2667 +1884 ---> 2668 +1886 ---> 2669 +1903 ---> 2670 +1908 ---> 2671 +1913 ---> 2672 +1926 ---> 2673 +1931 ---> 2674 +1947 ---> 2675 +1950 ---> 2676 +1960 ---> 2677 +1961 ---> 2678 +1964 ---> 2679 +1973 ---> 2680 +1974 ---> 2681 +1975 ---> 2682 +1977 ---> 2683 +1984 ---> 2684 +1987 ---> 2685 +1993 ---> 2686 +1994 ---> 2687 +2007 ---> 2688 +2014 ---> 2689 +2016 ---> 2690 +2025 ---> 2691 +2031 ---> 2692 +2033 ---> 2693 +2050 ---> 2694 +2054 ---> 2695 +2070 ---> 2696 +2076 ---> 2697 +2081 ---> 2698 +2082 ---> 2699 +2096 ---> 2700 +2113 ---> 2701 +2117 ---> 2702 +2127 ---> 2703 +2130 ---> 2704 +2136 ---> 2705 +2144 ---> 2706 +2155 ---> 2707 +2156 ---> 2708 +2157 ---> 2709 +2161 ---> 2710 +2169 ---> 2711 +2176 ---> 2712 +2188 ---> 2713 +2189 ---> 2714 +2190 ---> 2715 +2191 ---> 2716 +2192 ---> 2717 +2193 ---> 2718 +2194 ---> 2719 +2195 ---> 2720 +2196 ---> 2721 +2197 ---> 2722 +2198 ---> 2723 +2199 ---> 2724 +2200 ---> 2725 +2201 ---> 2726 +2208 ---> 2727 +2210 ---> 2728 +2214 ---> 2729 +2216 ---> 2730 +2222 ---> 2731 +2223 ---> 2732 +2224 ---> 2733 +2225 ---> 2734 +2228 ---> 2735 +2230 ---> 2736 +2231 ---> 2737 +2232 ---> 2738 +2233 ---> 2739 +2238 ---> 2740 +2245 ---> 2741 +2246 ---> 2742 +2247 ---> 2743 +2252 ---> 2744 +2257 ---> 2745 +2260 ---> 2746 +2261 ---> 2747 +2262 ---> 2748 +2263 ---> 2749 +2265 ---> 2750 +2266 ---> 2751 +2267 ---> 2752 +2268 ---> 2753 +2270 ---> 2754 +2273 ---> 2755 +2279 ---> 2756 +2280 ---> 2757 +2281 ---> 2758 +2283 ---> 2759 +2284 ---> 2760 +2294 ---> 2761 +2301 ---> 2762 +2302 ---> 2763 +2303 ---> 2764 +2306 ---> 2765 +2307 ---> 2766 +2313 ---> 2767 +2319 ---> 2768 +2322 ---> 2769 +2327 ---> 2770 +2334 ---> 2771 +2335 ---> 2772 +2336 ---> 2773 +2338 ---> 2774 +2339 ---> 2775 +2341 ---> 2776 +2344 ---> 2777 +2347 ---> 2778 +2349 ---> 2779 +2358 ---> 2780 +2360 ---> 2781 +2376 ---> 2782 +2377 ---> 2783 +2380 ---> 2784 +2398 ---> 2785 +2405 ---> 2786 +2407 ---> 2787 +2412 ---> 2788 +2413 ---> 2789 +2432 ---> 2790 +2435 ---> 2791 +2437 ---> 2792 +2438 ---> 2793 +2443 ---> 2794 +2449 ---> 2795 +2451 ---> 2796 +2473 ---> 2797 +2491 ---> 2798 +2496 ---> 2799 +2497 ---> 2800 +2502 ---> 2801 +2506 ---> 2802 +2512 ---> 2803 +2513 ---> 2804 +2516 ---> 2805 +2519 ---> 2806 +2523 ---> 2807 +2531 ---> 2808 +2533 ---> 2809 +2559 ---> 2810 +2562 ---> 2811 +2563 ---> 2812 +2570 ---> 2813 +2586 ---> 2814 +2588 ---> 2815 +2597 ---> 2816 +2601 ---> 2817 +2606 ---> 2818 +2611 ---> 2819 +2613 ---> 2820 +2617 ---> 2821 +2624 ---> 2822 +2647 ---> 2823 +2649 ---> 2824 +2655 ---> 2825 +2657 ---> 2826 +2658 ---> 2827 +2661 ---> 2828 +2663 ---> 2829 +2682 ---> 2830 +2690 ---> 2831 +2697 ---> 2832 +2707 ---> 2833 +2709 ---> 2834 +2715 ---> 2835 +2716 ---> 2836 +2719 ---> 2837 +2743 ---> 2838 +2759 ---> 2839 +2765 ---> 2840 +2768 ---> 2841 +2794 ---> 2842 +2806 ---> 2843 +2808 ---> 2844 +2811 ---> 2845 +2817 ---> 2846 +2819 ---> 2847 +2820 ---> 2848 +2828 ---> 2849 +2845 ---> 2850 +2852 ---> 2851 +2855 ---> 2852 +2862 ---> 2853 +2868 ---> 2854 +2875 ---> 2855 +2876 ---> 2856 +2892 ---> 2857 +2897 ---> 2858 +2898 ---> 2859 +2943 ---> 2860 +2947 ---> 2861 +2954 ---> 2862 +2962 ---> 2863 +2963 ---> 2864 +2969 ---> 2865 +2981 ---> 2866 +2983 ---> 2867 +2986 ---> 2868 +2990 ---> 2869 +3008 ---> 2870 +3012 ---> 2871 +3013 ---> 2872 +3014 ---> 2873 +3015 ---> 2874 +3023 ---> 2875 +3030 ---> 2876 +3044 ---> 2877 +3049 ---> 2878 +3054 ---> 2879 +3061 ---> 2880 +3067 ---> 2881 +3072 ---> 2882 +3073 ---> 2883 +3077 ---> 2884 +3078 ---> 2885 +3079 ---> 2886 +3081 ---> 2887 +3085 ---> 2888 +3092 ---> 2889 +3094 ---> 2890 +3095 ---> 2891 +3100 ---> 2892 +3107 ---> 2893 +3111 ---> 2894 +3117 ---> 2895 +3122 ---> 2896 +3123 ---> 2897 +3126 ---> 2898 +3127 ---> 2899 +3128 ---> 2900 +3131 ---> 2901 +3133 ---> 2902 +3138 ---> 2903 +3150 ---> 2904 +3153 ---> 2905 +3155 ---> 2906 +3174 ---> 2907 +3175 ---> 2908 +3176 ---> 2909 +3177 ---> 2910 +3185 ---> 2911 +3189 ---> 2912 +3190 ---> 2913 +3192 ---> 2914 +3193 ---> 2915 +3213 ---> 2916 +3220 ---> 2917 +3226 ---> 2918 +3227 ---> 2919 +3232 ---> 2920 +3233 ---> 2921 +3243 ---> 2922 +3260 ---> 2923 +3264 ---> 2924 +3265 ---> 2925 +3269 ---> 2926 +3275 ---> 2927 +3276 ---> 2928 +3278 ---> 2929 +3279 ---> 2930 +3280 ---> 2931 +3281 ---> 2932 +3297 ---> 2933 +3301 ---> 2934 +3303 ---> 2935 +3308 ---> 2936 +3311 ---> 2937 +3314 ---> 2938 +3315 ---> 2939 +3323 ---> 2940 +3325 ---> 2941 +3332 ---> 2942 +3333 ---> 2943 +3344 ---> 2944 +3354 ---> 2945 +3358 ---> 2946 +3360 ---> 2947 +3361 ---> 2948 +3362 ---> 2949 +3369 ---> 2950 +3373 ---> 2951 +3377 ---> 2952 +3381 ---> 2953 +3391 ---> 2954 +3396 ---> 2955 +3397 ---> 2956 +3399 ---> 2957 +3400 ---> 2958 +3407 ---> 2959 +3410 ---> 2960 +3418 ---> 2961 +3427 ---> 2962 +3428 ---> 2963 +3429 ---> 2964 +3430 ---> 2965 +3446 ---> 2967 +3447 ---> 2968 +3455 ---> 2969 +3457 ---> 2970 +3458 ---> 2971 +3461 ---> 2972 +3462 ---> 2973 +3468 ---> 2974 +3469 ---> 2975 +3470 ---> 2976 +3474 ---> 2977 +3476 ---> 2978 +3489 ---> 2979 +3490 ---> 2980 +3494 ---> 2981 +3499 ---> 2982 +3502 ---> 2983 +3503 ---> 2984 +3506 ---> 2985 +3507 ---> 2986 +3510 ---> 2987 +3511 ---> 2988 +3516 ---> 2989 +3521 ---> 2990 +3527 ---> 2991 +3528 ---> 2992 +3531 ---> 2993 +3546 ---> 2994 +3548 ---> 2995 +3556 ---> 2996 +3561 ---> 2997 +3566 ---> 2998 +3577 ---> 2999 +3579 ---> 3000 +3580 ---> 3001 +3584 ---> 3002 +3592 ---> 3003 +3593 ---> 3004 +3597 ---> 3005 +3598 ---> 3006 +3603 ---> 3007 +3606 ---> 3008 +3607 ---> 3010 +3609 ---> 3011 +3610 ---> 3012 +3613 ---> 3013 +3614 ---> 3014 +3615 ---> 3015 +3623 ---> 3016 +3625 ---> 3017 +3626 ---> 3018 +3627 ---> 3019 +3628 ---> 3020 +3629 ---> 3021 +3630 ---> 3022 +3631 ---> 3023 +3632 ---> 3024 +3633 ---> 3025 +3634 ---> 3026 +3636 ---> 3027 +3638 ---> 3028 +3642 ---> 3029 +3647 ---> 3030 +3649 ---> 3031 +3663 ---> 3032 +3668 ---> 3033 +3671 ---> 3034 +3673 ---> 3035 +3680 ---> 3037 +3684 ---> 3038 +3690 ---> 3039 +3693 ---> 3040 +3701 ---> 3041 +3702 ---> 3042 +3703 ---> 3043 +3706 ---> 3044 +3709 ---> 3045 +3712 ---> 3046 +3718 ---> 3047 +3720 ---> 3048 +3723 ---> 3049 +3726 ---> 3050 +3734 ---> 3051 +3742 ---> 3052 +3751 ---> 3053 +3754 ---> 3054 +3756 ---> 3055 +3757 ---> 3056 +3758 ---> 3057 +3762 ---> 3058 +3764 ---> 3059 +3765 ---> 3060 +3768 ---> 3061 +3770 ---> 3062 +3773 ---> 3063 +3777 ---> 3064 +3791 ---> 3065 +3792 ---> 3066 +3793 ---> 3067 +3799 ---> 3068 +3802 ---> 3069 +3805 ---> 3070 +3807 ---> 3071 +3814 ---> 3072 +3815 ---> 3073 +3816 ---> 3074 +3817 ---> 3075 +3818 ---> 3076 +3819 ---> 3077 +3822 ---> 3078 +3823 ---> 3079 +3830 ---> 3080 +3837 ---> 3081 +3839 ---> 3082 +3841 ---> 3083 +3843 ---> 1466 +3845 ---> 3084 +3850 ---> 3085 +3852 ---> 3086 +3856 ---> 3087 +3875 ---> 3088 +3877 ---> 3089 +3881 ---> 3090 +3884 ---> 3091 +3885 ---> 3092 +3889 ---> 3093 +3890 ---> 3094 +3896 ---> 3095 +3902 ---> 3096 +3907 ---> 3097 +3910 ---> 3098 +3911 ---> 3099 +3930 ---> 3100 +3931 ---> 3101 +3940 ---> 3102 +3944 ---> 3103 +3945 ---> 3104 +3949 ---> 3105 +3951 ---> 3106 +3953 ---> 3107 +3965 ---> 3108 +3972 ---> 3109 +3976 ---> 3110 +3977 ---> 3111 +3980 ---> 3112 +3987 ---> 3113 +3997 ---> 3114 +3998 ---> 3115 +3999 ---> 3116 +4000 ---> 3117 +4001 ---> 3118 +4003 ---> 3119 +4007 ---> 3120 +4008 ---> 3121 +4009 ---> 3122 +4011 ---> 3123 +4016 ---> 3124 +4022 ---> 3125 +4026 ---> 3126 +4027 ---> 3127 +4030 ---> 3128 +4034 ---> 3129 +4037 ---> 3130 +4038 ---> 3131 +4039 ---> 3132 +4045 ---> 3133 +4047 ---> 3134 +4049 ---> 3135 +4052 ---> 3136 +4053 ---> 3137 +4054 ---> 3138 +4055 ---> 3139 +4058 ---> 3140 +4068 ---> 3141 +4071 ---> 3142 +4078 ---> 3143 +4080 ---> 3144 +4081 ---> 3145 +4082 ---> 3146 +4083 ---> 3147 +4088 ---> 3148 +4097 ---> 3149 +4098 ---> 3150 +4099 ---> 3151 +4100 ---> 3152 +4101 ---> 3153 +4102 ---> 3154 +4109 ---> 3155 +4112 ---> 3156 +4113 ---> 3157 +4125 ---> 3158 +4126 ---> 3159 +4130 ---> 3160 +4134 ---> 3161 +4139 ---> 3162 +4141 ---> 3163 +4143 ---> 3164 +4144 ---> 3165 +4146 ---> 3166 +4148 ---> 3167 +4149 ---> 3168 +4152 ---> 3169 +4153 ---> 3170 +4154 ---> 3171 +4158 ---> 3172 +4159 ---> 3173 +4161 ---> 3174 +4169 ---> 3175 +4173 ---> 3176 +4175 ---> 3177 +4177 ---> 3178 +4178 ---> 3179 +4179 ---> 3180 +4181 ---> 3181 +4183 ---> 3182 +4185 ---> 3183 +4186 ---> 3184 +4187 ---> 3185 +4188 ---> 3186 +4192 ---> 3187 +4193 ---> 3188 +4194 ---> 3189 +4195 ---> 3190 +4197 ---> 3191 +4200 ---> 3192 +4201 ---> 3193 +4202 ---> 3194 +4207 ---> 3195 +4208 ---> 3196 +4209 ---> 3197 +4216 ---> 3198 +4217 ---> 3199 +4224 ---> 3200 +4228 ---> 3201 +4229 ---> 3202 +4230 ---> 3203 +4232 ---> 3204 +4233 ---> 3205 +4236 ---> 3206 +4245 ---> 3207 +4247 ---> 3208 +4248 ---> 3209 +4249 ---> 3210 +4256 ---> 3211 +4262 ---> 3212 +4289 ---> 3213 +4291 ---> 3214 +4293 ---> 3215 +4294 ---> 3216 +4295 ---> 3217 +4296 ---> 3218 +4298 ---> 3219 +4299 ---> 3220 +4303 ---> 3221 +4304 ---> 3222 +4308 ---> 3223 +4309 ---> 3224 +4311 ---> 3225 +4312 ---> 3226 +4313 ---> 3227 +4314 ---> 3228 +4315 ---> 3229 +4317 ---> 3230 +4318 ---> 3231 +4319 ---> 3232 +4320 ---> 3233 +4322 ---> 3234 +4324 ---> 3235 +4326 ---> 3236 +4328 ---> 3237 +4330 ---> 3238 +4334 ---> 3239 +4343 ---> 3240 +4344 ---> 3241 +4350 ---> 3242 +4352 ---> 3243 +4361 ---> 3244 +4362 ---> 3245 +4365 ---> 3246 +4366 ---> 3247 +4368 ---> 3248 +4370 ---> 3249 +4372 ---> 3250 +4375 ---> 3251 +4376 ---> 3252 +4378 ---> 3253 +4379 ---> 3254 +4384 ---> 3255 +4386 ---> 3256 +4388 ---> 3257 +4390 ---> 3258 +4391 ---> 3259 +4408 ---> 3260 +4413 ---> 3261 +4417 ---> 3262 +4419 ---> 3263 +4422 ---> 3264 +4425 ---> 3265 +4426 ---> 3266 +4427 ---> 3267 +4428 ---> 3268 +4435 ---> 3269 +4446 ---> 3270 +4453 ---> 3271 +4455 ---> 3272 +4459 ---> 3273 +4460 ---> 3274 +4472 ---> 3275 +4473 ---> 3276 +4475 ---> 3277 +4481 ---> 3278 +4484 ---> 3279 +4492 ---> 3280 +4494 ---> 3281 +4496 ---> 3282 +4497 ---> 3283 +4506 ---> 3284 +4511 ---> 3285 +4512 ---> 3286 +4517 ---> 3287 +4525 ---> 3288 +4529 ---> 3289 +4530 ---> 3290 +4533 ---> 3291 +4537 ---> 3292 +4541 ---> 3293 +4543 ---> 3294 +4556 ---> 3295 +4558 ---> 3296 +4559 ---> 3297 +4560 ---> 3298 +4561 ---> 3299 +4565 ---> 3300 +4573 ---> 3301 +4578 ---> 3302 +4579 ---> 3303 +4587 ---> 3304 +4593 ---> 3305 +4596 ---> 3306 +4622 ---> 3307 +4636 ---> 3308 +4637 ---> 3309 +4638 ---> 3310 +4639 ---> 3311 +4640 ---> 3312 +4641 ---> 3313 +4642 ---> 3314 +4646 ---> 3315 +4649 ---> 3316 +4654 ---> 3317 +4657 ---> 3318 +4664 ---> 3319 +4697 ---> 3320 +4698 ---> 3321 +4703 ---> 3322 +4707 ---> 3323 +4709 ---> 3324 +4710 ---> 3325 +4716 ---> 3326 +4722 ---> 3327 +4724 ---> 3328 +4725 ---> 3329 +4727 ---> 3330 +4729 ---> 3331 +4730 ---> 3332 +4731 ---> 3333 +4732 ---> 3334 +4742 ---> 3335 +4744 ---> 3336 +4745 ---> 3337 +4747 ---> 3338 +4752 ---> 3339 +4755 ---> 3340 +4768 ---> 3341 +4769 ---> 3342 +4770 ---> 3343 +4771 ---> 3344 +4772 ---> 3345 +4773 ---> 3346 +4774 ---> 3347 +4775 ---> 3348 +4776 ---> 3349 +4777 ---> 3350 +4778 ---> 3351 +4779 ---> 3352 +4780 ---> 3353 +4781 ---> 3354 +4782 ---> 3355 +4783 ---> 3356 +4784 ---> 3357 +4785 ---> 3358 +4786 ---> 3359 +4787 ---> 3360 +4788 ---> 3361 +4789 ---> 3362 +4795 ---> 3363 +4797 ---> 3364 +4802 ---> 3365 +4809 ---> 3366 +4810 ---> 3367 +4811 ---> 3368 +4814 ---> 3369 +4819 ---> 3370 +4823 ---> 3371 +4828 ---> 3372 +4830 ---> 3373 +4833 ---> 3374 +4836 ---> 3375 +4840 ---> 3376 +4843 ---> 3377 +4849 ---> 3378 +4854 ---> 3379 +4858 ---> 3380 +4859 ---> 3381 +4865 ---> 3382 +4866 ---> 3383 +4868 ---> 3384 +4873 ---> 3385 +4879 ---> 3386 +4880 ---> 3387 +4884 ---> 3388 +4890 ---> 3389 +4894 ---> 3390 +4900 ---> 3391 +4903 ---> 3392 +4904 ---> 3393 +4915 ---> 3394 +4921 ---> 3395 +4923 ---> 3396 +4935 ---> 3397 +4937 ---> 3398 +4943 ---> 3399 +4944 ---> 3400 +4945 ---> 3401 +4947 ---> 3402 +4949 ---> 3403 +4951 ---> 3404 +4952 ---> 3405 +4957 ---> 3406 +4958 ---> 3407 +4962 ---> 3408 +4963 ---> 3409 +4969 ---> 3410 +4973 ---> 3411 +4975 ---> 3412 +4978 ---> 3413 +4986 ---> 3414 +4987 ---> 3415 +4997 ---> 3416 +5002 ---> 3417 +5019 ---> 3418 +5020 ---> 3419 +5021 ---> 3420 +5028 ---> 3421 +5034 ---> 3422 +5040 ---> 3423 +5044 ---> 3424 +5045 ---> 3425 +5047 ---> 3426 +5048 ---> 3427 +5051 ---> 3428 +5052 ---> 3429 +5053 ---> 3430 +5056 ---> 3431 +5058 ---> 3432 +5061 ---> 3433 +5062 ---> 3434 +5064 ---> 3435 +5066 ---> 3436 +5067 ---> 3437 +5068 ---> 3438 +5073 ---> 3439 +5074 ---> 3440 +5076 ---> 3441 +5082 ---> 3442 +5083 ---> 3443 +5099 ---> 3444 +5101 ---> 3445 +5102 ---> 3446 +5105 ---> 3447 +5106 ---> 3448 +5107 ---> 3449 +5108 ---> 3450 +5112 ---> 3451 +5113 ---> 3452 +5120 ---> 3453 +5130 ---> 3454 +5132 ---> 3455 +5135 ---> 3456 +5174 ---> 3457 +5175 ---> 3458 +5176 ---> 3459 +5179 ---> 3460 +5180 ---> 3461 +5181 ---> 3462 +5182 ---> 3463 +5186 ---> 3464 +5197 ---> 3465 +5199 ---> 3466 +5201 ---> 3467 +5205 ---> 3468 +5206 ---> 3469 +5213 ---> 3470 +5219 ---> 3471 +5221 ---> 3472 +5224 ---> 3473 +5225 ---> 3474 +5226 ---> 3475 +5234 ---> 3476 +5235 ---> 3477 +5244 ---> 3478 +5253 ---> 3479 +5254 ---> 3480 +5262 ---> 3481 +5297 ---> 3482 +5303 ---> 3483 +5317 ---> 3484 +5320 ---> 3485 +5323 ---> 3486 +5329 ---> 3487 +5337 ---> 3488 +5341 ---> 3489 +5366 ---> 3490 +5368 ---> 3491 +5379 ---> 3492 +5396 ---> 3493 +5399 ---> 3494 +5427 ---> 3495 +5435 ---> 3496 +5441 ---> 3497 +5446 ---> 3498 +5447 ---> 3499 +5449 ---> 3500 +5454 ---> 3501 +5456 ---> 3502 +5458 ---> 3503 +5481 ---> 3504 +5483 ---> 3506 +5485 ---> 3507 +5487 ---> 3508 +5489 ---> 3509 +5490 ---> 3510 +5494 ---> 3511 +5511 ---> 3512 +5518 ---> 3513 +5529 ---> 3514 +5530 ---> 3515 +5551 ---> 3516 +5553 ---> 3517 +5556 ---> 3518 +5562 ---> 3519 +5572 ---> 3520 +5580 ---> 3521 +5588 ---> 3522 +5628 ---> 3523 +5643 ---> 3524 +5645 ---> 3525 +5661 ---> 3526 +5662 ---> 3527 +5663 ---> 3528 +5665 ---> 3529 +5666 ---> 3530 +5675 ---> 3531 +5694 ---> 3532 +5716 ---> 3533 +5728 ---> 3534 +5731 ---> 3535 +5732 ---> 3536 +5739 ---> 3537 +5750 ---> 3538 +5753 ---> 3539 +5759 ---> 3540 +5780 ---> 3541 +5790 ---> 3542 +5800 ---> 3543 +5812 ---> 3544 +5813 ---> 3545 +5817 ---> 3546 +5820 ---> 3547 +5832 ---> 3548 +5852 ---> 3549 +5870 ---> 3550 +5872 ---> 3551 +5874 ---> 3552 +5903 ---> 3553 +5932 ---> 3554 +5940 ---> 3555 +5941 ---> 3556 +5946 ---> 3557 +5969 ---> 3558 +5975 ---> 3559 +5996 ---> 3560 +6050 ---> 3561 +6051 ---> 3562 +6084 ---> 3563 +6100 ---> 3564 +6114 ---> 3565 +6116 ---> 3566 +6117 ---> 3567 +6175 ---> 3568 +6189 ---> 3569 +6197 ---> 3570 +6199 ---> 3571 +6210 ---> 3572 +6212 ---> 3573 +6222 ---> 3574 +6236 ---> 3575 +6262 ---> 3576 +6269 ---> 3577 +6286 ---> 3578 +6337 ---> 3579 +6338 ---> 3580 +6341 ---> 3581 +6345 ---> 3582 +6354 ---> 3583 +6355 ---> 3585 +6361 ---> 3586 +6370 ---> 3587 +6380 ---> 3588 +6381 ---> 3589 +6384 ---> 3590 +6388 ---> 3591 +6396 ---> 3592 +6409 ---> 3593 +6412 ---> 3594 +6420 ---> 3595 +6436 ---> 3596 +6507 ---> 3597 +6508 ---> 3598 +6509 ---> 3599 +6511 ---> 3600 +6516 ---> 3601 +6518 ---> 3602 +6521 ---> 3603 +6532 ---> 3604 +6550 ---> 3605 +6552 ---> 3606 +6587 ---> 3607 +6588 ---> 3608 +6589 ---> 3609 +6591 ---> 3610 +6592 ---> 3611 +6593 ---> 3612 +6594 ---> 3613 +6595 ---> 3614 +6607 ---> 3615 +6610 ---> 3616 +6635 ---> 3617 +6651 ---> 3618 +6662 ---> 3619 +6669 ---> 3620 +6678 ---> 3621 +6679 ---> 3622 +6687 ---> 3623 +6688 ---> 3624 +6694 ---> 3625 +6696 ---> 3626 +6711 ---> 3627 +6713 ---> 3628 +6727 ---> 3629 +6728 ---> 3630 +6730 ---> 3631 +6762 ---> 3632 +6764 ---> 3633 +6768 ---> 3634 +6782 ---> 3635 +6786 ---> 3636 +6793 ---> 3637 +6810 ---> 3638 +6813 ---> 3639 +6825 ---> 3640 +6826 ---> 3641 +6832 ---> 3642 +6838 ---> 3643 +6839 ---> 3644 +6858 ---> 3645 +6865 ---> 3646 +6877 ---> 3647 +6881 ---> 3648 +6883 ---> 3649 +6893 ---> 3650 +6901 ---> 3651 +6908 ---> 3652 +6912 ---> 3653 +6914 ---> 3654 +6922 ---> 3655 +6934 ---> 3656 +6938 ---> 1382 +6942 ---> 3657 +6958 ---> 3658 +6960 ---> 3659 +6961 ---> 3660 +6966 ---> 3661 +6970 ---> 3662 +6972 ---> 3663 +6991 ---> 3664 +7018 ---> 3665 +7031 ---> 3666 +7039 ---> 3667 +7046 ---> 3668 +7062 ---> 3669 +7063 ---> 3670 +7065 ---> 3671 +7070 ---> 3672 +7112 ---> 3673 +7114 ---> 3674 +7118 ---> 3675 +7123 ---> 3676 +7128 ---> 3677 +7137 ---> 3678 +7147 ---> 3679 +7148 ---> 3680 +7149 ---> 3681 +7150 ---> 3682 +7173 ---> 3683 +7212 ---> 3684 +7218 ---> 3685 +7234 ---> 3686 +7250 ---> 3687 +7253 ---> 3688 +7254 ---> 3689 +7269 ---> 3690 +7274 ---> 3691 +7290 ---> 3692 +7317 ---> 3693 +7327 ---> 3694 +7340 ---> 3695 +7343 ---> 3696 +7344 ---> 3697 +7348 ---> 3698 +7368 ---> 3699 +7377 ---> 3700 +7396 ---> 3701 +7412 ---> 3702 +7470 ---> 3703 +7491 ---> 3704 +7516 ---> 3705 +7531 ---> 3706 +7532 ---> 3707 +7534 ---> 3708 +7539 ---> 3709 +7546 ---> 3710 +7550 ---> 3711 +7557 ---> 3712 +7567 ---> 3713 +7572 ---> 3714 +7575 ---> 3715 +7585 ---> 3716 +7597 ---> 3717 +7609 ---> 3718 +7610 ---> 3719 +7629 ---> 3720 +7635 ---> 3721 +7651 ---> 3722 +7653 ---> 3723 +7659 ---> 3724 +7691 ---> 3725 +7693 ---> 3726 +7694 ---> 3727 +7698 ---> 3728 +7700 ---> 3729 +7728 ---> 3730 +7730 ---> 3731 +7732 ---> 3732 +7737 ---> 3733 +7738 ---> 3734 +7746 ---> 3735 +7763 ---> 3736 +7772 ---> 3737 +7778 ---> 3738 +7794 ---> 3739 +7800 ---> 3740 +7809 ---> 3741 +7817 ---> 3742 +7818 ---> 3743 +7819 ---> 3744 +7825 ---> 3745 +7846 ---> 3746 +7848 ---> 3747 +7849 ---> 3748 +7851 ---> 3749 +7860 ---> 831 +7870 ---> 3750 +7872 ---> 3751 +7913 ---> 3752 +7933 ---> 3753 +7940 ---> 3754 +7954 ---> 3755 +8024 ---> 3756 +8030 ---> 3757 +8100 ---> 3758 +8112 ---> 3759 +8125 ---> 30813 +8170 ---> 3760 +8222 ---> 3761 +8233 ---> 3762 +8235 ---> 1375 +8244 ---> 3763 +8252 ---> 3764 +8254 ---> 3765 +8275 ---> 3766 +8276 ---> 3767 +8277 ---> 3768 +8278 ---> 3769 +8285 ---> 3770 +8297 ---> 3771 +8298 ---> 3772 +8299 ---> 3773 +8305 ---> 3774 +8306 ---> 3775 +8307 ---> 3776 +8310 ---> 3777 +8314 ---> 3778 +8347 ---> 3779 +8354 ---> 3780 +8356 ---> 3781 +8363 ---> 3782 +8368 ---> 3783 +8379 ---> 3784 +8398 ---> 3785 +8404 ---> 3786 +8422 ---> 3787 +8424 ---> 3788 +8427 ---> 3789 +8438 ---> 3790 +8461 ---> 3791 +8466 ---> 3792 +8488 ---> 3793 +8490 ---> 3794 +8495 ---> 3795 +8496 ---> 3796 +8498 ---> 3797 +8504 ---> 3798 +8505 ---> 3799 +8507 ---> 3800 +8511 ---> 3801 +8514 ---> 3802 +8521 ---> 3803 +8522 ---> 3804 +8525 ---> 3805 +8529 ---> 3806 +8538 ---> 3807 +8539 ---> 2402 +8546 ---> 3808 +8559 ---> 3809 +8570 ---> 3810 +8573 ---> 3811 +8588 ---> 3812 +8589 ---> 3813 +8597 ---> 3814 +8601 ---> 3815 +8620 ---> 3816 +8626 ---> 3817 +8643 ---> 2320 +8669 ---> 2400 +8681 ---> 3818 +8682 ---> 3819 +8683 ---> 3820 +8686 ---> 906 +8691 ---> 3821 +8692 ---> 3822 +8694 ---> 3823 +8698 ---> 3824 +8703 ---> 3825 +8734 ---> 3826 +8735 ---> 3827 +8763 ---> 3828 +8764 ---> 3829 +8766 ---> 3830 +8774 ---> 3831 +8776 ---> 3832 +8779 ---> 3833 +8805 ---> 3834 +8829 ---> 3835 +8830 ---> 3836 +8832 ---> 3837 +8850 ---> 3838 +8852 ---> 3839 +8853 ---> 1362 +8860 ---> 3840 +8861 ---> 3841 +8862 ---> 3842 +8863 ---> 3843 +8865 ---> 3844 +8871 ---> 3845 +8882 ---> 3846 +8901 ---> 3847 +8902 ---> 3848 +8903 ---> 3849 +8913 ---> 641 +8926 ---> 640 +8927 ---> 639 +8932 ---> 3850 +8933 ---> 3851 +8938 ---> 638 +8941 ---> 3852 +8942 ---> 3853 +8944 ---> 1325 +8951 ---> 3854 +8986 ---> 2000 diff --git a/docs/issue-mappings/coreclr.mapping.txt b/docs/issue-mappings/coreclr.mapping.txt new file mode 100644 index 00000000000000..691735417c7167 --- /dev/null +++ b/docs/issue-mappings/coreclr.mapping.txt @@ -0,0 +1,10042 @@ +https://github.com/dotnet/coreclr/issues/XXXX ---> https://github.com/dotnet/runtime/issues/YYYY +25 ---> 3858 +26 ---> 3859 +28 ---> 3860 +29 ---> 3861 +30 ---> 3862 +31 ---> 3863 +33 ---> 3864 +34 ---> 3865 +37 ---> 3866 +39 ---> 3867 +40 ---> 3868 +43 ---> 3869 +44 ---> 3870 +45 ---> 3871 +47 ---> 3872 +49 ---> 3873 +51 ---> 3874 +52 ---> 3875 +54 ---> 3876 +55 ---> 3877 +57 ---> 3878 +59 ---> 3879 +60 ---> 3880 +61 ---> 3881 +65 ---> 3882 +68 ---> 3883 +70 ---> 3884 +72 ---> 3885 +73 ---> 3886 +74 ---> 3887 +76 ---> 3888 +77 ---> 3889 +78 ---> 3890 +79 ---> 3891 +83 ---> 3892 +84 ---> 3893 +85 ---> 3894 +87 ---> 3895 +88 ---> 3896 +90 ---> 3897 +91 ---> 3898 +92 ---> 3899 +94 ---> 3900 +95 ---> 3901 +98 ---> 3902 +99 ---> 3903 +101 ---> 3904 +102 ---> 3905 +103 ---> 3906 +106 ---> 3907 +110 ---> 3908 +111 ---> 3909 +113 ---> 3910 +114 ---> 3911 +116 ---> 3912 +120 ---> 3913 +121 ---> 3914 +122 ---> 3915 +123 ---> 3916 +128 ---> 3917 +131 ---> 3918 +132 ---> 3919 +133 ---> 3920 +135 ---> 3921 +139 ---> 3922 +141 ---> 3923 +143 ---> 3924 +145 ---> 3925 +147 ---> 3926 +148 ---> 3927 +154 ---> 3928 +156 ---> 3929 +157 ---> 3930 +158 ---> 3931 +159 ---> 3932 +161 ---> 3933 +164 ---> 3934 +165 ---> 3935 +168 ---> 3936 +169 ---> 3937 +170 ---> 3938 +171 ---> 3939 +174 ---> 3940 +176 ---> 3941 +177 ---> 3942 +178 ---> 3943 +181 ---> 3944 +182 ---> 3945 +192 ---> 3946 +193 ---> 3947 +194 ---> 3948 +195 ---> 3949 +196 ---> 3950 +197 ---> 3951 +198 ---> 3952 +199 ---> 3953 +200 ---> 3954 +201 ---> 2410 +202 ---> 3955 +203 ---> 3956 +204 ---> 3957 +206 ---> 3958 +208 ---> 3959 +209 ---> 3960 +210 ---> 3961 +214 ---> 3962 +216 ---> 3963 +218 ---> 3964 +222 ---> 3965 +225 ---> 3966 +227 ---> 3967 +232 ---> 3968 +240 ---> 3969 +243 ---> 3970 +247 ---> 3971 +250 ---> 3972 +253 ---> 3973 +263 ---> 3974 +270 ---> 3975 +273 ---> 3976 +275 ---> 3977 +276 ---> 3978 +280 ---> 3979 +281 ---> 3980 +285 ---> 3981 +286 ---> 3982 +288 ---> 3983 +291 ---> 3984 +293 ---> 3985 +295 ---> 3986 +296 ---> 3987 +297 ---> 3988 +298 ---> 3989 +299 ---> 3990 +301 ---> 3991 +303 ---> 3992 +305 ---> 3993 +306 ---> 3994 +307 ---> 3995 +311 ---> 3996 +315 ---> 3997 +318 ---> 3998 +324 ---> 3999 +327 ---> 4000 +328 ---> 4001 +329 ---> 4002 +333 ---> 4003 +344 ---> 4004 +345 ---> 4005 +349 ---> 4006 +350 ---> 4007 +352 ---> 4008 +353 ---> 4009 +355 ---> 4010 +359 ---> 4011 +360 ---> 4012 +366 ---> 4013 +371 ---> 4014 +374 ---> 4015 +375 ---> 4016 +377 ---> 4017 +385 ---> 4018 +387 ---> 4019 +390 ---> 4020 +393 ---> 4021 +401 ---> 4022 +405 ---> 4023 +408 ---> 4024 +410 ---> 4025 +412 ---> 4026 +420 ---> 4027 +422 ---> 4028 +430 ---> 4029 +431 ---> 4030 +442 ---> 4031 +444 ---> 4032 +445 ---> 4033 +446 ---> 4034 +447 ---> 4035 +450 ---> 4036 +452 ---> 4037 +454 ---> 4038 +455 ---> 4039 +456 ---> 4040 +457 ---> 4041 +458 ---> 4042 +461 ---> 4043 +462 ---> 4044 +463 ---> 4045 +467 ---> 4046 +471 ---> 4047 +474 ---> 4048 +475 ---> 4049 +477 ---> 4050 +478 ---> 4051 +479 ---> 4052 +480 ---> 4053 +481 ---> 4054 +487 ---> 4055 +488 ---> 4056 +489 ---> 4057 +497 ---> 4058 +501 ---> 4059 +502 ---> 4060 +503 ---> 4061 +504 ---> 4062 +505 ---> 4063 +506 ---> 4064 +510 ---> 4065 +512 ---> 4066 +513 ---> 4067 +523 ---> 4068 +536 ---> 4069 +541 ---> 4070 +542 ---> 4071 +545 ---> 4072 +547 ---> 4073 +549 ---> 4074 +552 ---> 4075 +555 ---> 4076 +559 ---> 4077 +560 ---> 4078 +565 ---> 4079 +566 ---> 4080 +568 ---> 4081 +571 ---> 4082 +583 ---> 4083 +588 ---> 4084 +592 ---> 4085 +594 ---> 4086 +598 ---> 4087 +601 ---> 4088 +602 ---> 4089 +603 ---> 4090 +609 ---> 4091 +610 ---> 4092 +611 ---> 4093 +615 ---> 4094 +623 ---> 4095 +625 ---> 4096 +626 ---> 4097 +629 ---> 4098 +630 ---> 4099 +631 ---> 4100 +632 ---> 4101 +633 ---> 4102 +635 ---> 4103 +636 ---> 4104 +638 ---> 4105 +639 ---> 4106 +641 ---> 4107 +642 ---> 4108 +644 ---> 4109 +645 ---> 4110 +648 ---> 4111 +650 ---> 4112 +652 ---> 4113 +657 ---> 4114 +658 ---> 4115 +659 ---> 4116 +661 ---> 4122 +665 ---> 4123 +667 ---> 4124 +673 ---> 4125 +677 ---> 4126 +678 ---> 4127 +679 ---> 4128 +680 ---> 4129 +681 ---> 4130 +682 ---> 4131 +689 ---> 4132 +693 ---> 4133 +698 ---> 4134 +708 ---> 4135 +709 ---> 4136 +711 ---> 4137 +717 ---> 4138 +720 ---> 4139 +728 ---> 4140 +731 ---> 4141 +732 ---> 4142 +735 ---> 4143 +739 ---> 4144 +740 ---> 4145 +741 ---> 4146 +743 ---> 4147 +744 ---> 4148 +747 ---> 4149 +748 ---> 4150 +749 ---> 4151 +751 ---> 4152 +755 ---> 4153 +756 ---> 4154 +757 ---> 4155 +758 ---> 4156 +760 ---> 4157 +761 ---> 4158 +762 ---> 4159 +763 ---> 4160 +764 ---> 4161 +767 ---> 4162 +770 ---> 4163 +772 ---> 4164 +777 ---> 4165 +778 ---> 4166 +779 ---> 4167 +792 ---> 4168 +793 ---> 4169 +797 ---> 4170 +799 ---> 4171 +801 ---> 4172 +803 ---> 4173 +808 ---> 4174 +810 ---> 4175 +814 ---> 4176 +816 ---> 4177 +818 ---> 4178 +820 ---> 4179 +821 ---> 4180 +824 ---> 4181 +828 ---> 4182 +832 ---> 4183 +834 ---> 4184 +841 ---> 4185 +842 ---> 4186 +846 ---> 4187 +851 ---> 4188 +854 ---> 4189 +862 ---> 4190 +866 ---> 4191 +869 ---> 4192 +872 ---> 4193 +873 ---> 4194 +877 ---> 4195 +882 ---> 4196 +884 ---> 4197 +886 ---> 4198 +889 ---> 4199 +890 ---> 4200 +891 ---> 4201 +892 ---> 4202 +898 ---> 4203 +901 ---> 4204 +907 ---> 4205 +909 ---> 4206 +914 ---> 4207 +915 ---> 4208 +916 ---> 4209 +917 ---> 4210 +918 ---> 4211 +919 ---> 4212 +925 ---> 4213 +926 ---> 4214 +927 ---> 4215 +930 ---> 4216 +931 ---> 4217 +933 ---> 4218 +934 ---> 4219 +935 ---> 4220 +937 ---> 4221 +938 ---> 4222 +939 ---> 4223 +940 ---> 4224 +943 ---> 4225 +947 ---> 4226 +948 ---> 4227 +950 ---> 4228 +952 ---> 4229 +953 ---> 4230 +954 ---> 4231 +959 ---> 4232 +963 ---> 4233 +969 ---> 4234 +970 ---> 4235 +971 ---> 4236 +972 ---> 4237 +973 ---> 4238 +974 ---> 4239 +976 ---> 4240 +977 ---> 4241 +978 ---> 4242 +983 ---> 4243 +984 ---> 4244 +987 ---> 4245 +989 ---> 4246 +990 ---> 4247 +991 ---> 4248 +993 ---> 4249 +995 ---> 4250 +1000 ---> 4251 +1002 ---> 4252 +1003 ---> 4253 +1005 ---> 4254 +1010 ---> 4255 +1011 ---> 4256 +1012 ---> 4257 +1015 ---> 4258 +1016 ---> 4259 +1017 ---> 4260 +1018 ---> 4261 +1019 ---> 4262 +1026 ---> 4263 +1027 ---> 4264 +1031 ---> 4265 +1032 ---> 4266 +1033 ---> 4267 +1034 ---> 4268 +1035 ---> 4269 +1036 ---> 4270 +1037 ---> 4271 +1038 ---> 4272 +1039 ---> 4273 +1040 ---> 4274 +1043 ---> 4275 +1044 ---> 4276 +1053 ---> 4277 +1058 ---> 4278 +1060 ---> 4279 +1062 ---> 4280 +1063 ---> 4281 +1070 ---> 4282 +1072 ---> 4283 +1076 ---> 4284 +1077 ---> 4285 +1078 ---> 4286 +1079 ---> 4287 +1082 ---> 4288 +1083 ---> 4289 +1086 ---> 4290 +1089 ---> 4291 +1091 ---> 4292 +1093 ---> 4293 +1094 ---> 4294 +1096 ---> 4295 +1097 ---> 4296 +1098 ---> 4297 +1099 ---> 4298 +1102 ---> 4299 +1104 ---> 4300 +1110 ---> 4301 +1113 ---> 4302 +1119 ---> 4303 +1122 ---> 4304 +1128 ---> 4305 +1131 ---> 4306 +1132 ---> 4307 +1133 ---> 4308 +1135 ---> 4309 +1138 ---> 4310 +1139 ---> 4311 +1145 ---> 4312 +1146 ---> 4313 +1147 ---> 4314 +1148 ---> 4315 +1150 ---> 4316 +1151 ---> 4317 +1152 ---> 4318 +1154 ---> 4319 +1155 ---> 4320 +1157 ---> 4321 +1160 ---> 4322 +1161 ---> 4323 +1162 ---> 4324 +1163 ---> 4325 +1164 ---> 4326 +1165 ---> 4327 +1166 ---> 4328 +1167 ---> 4329 +1170 ---> 4330 +1171 ---> 4331 +1172 ---> 4332 +1173 ---> 4333 +1176 ---> 4334 +1177 ---> 4335 +1178 ---> 4336 +1181 ---> 4337 +1182 ---> 4338 +1183 ---> 4339 +1184 ---> 4340 +1186 ---> 4341 +1187 ---> 4342 +1190 ---> 4343 +1191 ---> 4344 +1192 ---> 4345 +1193 ---> 4346 +1197 ---> 4347 +1198 ---> 4348 +1201 ---> 4349 +1203 ---> 4350 +1204 ---> 4351 +1206 ---> 4352 +1207 ---> 4353 +1208 ---> 4354 +1212 ---> 4355 +1213 ---> 4356 +1214 ---> 4357 +1218 ---> 4358 +1220 ---> 4359 +1221 ---> 4360 +1223 ---> 4361 +1224 ---> 4362 +1226 ---> 4363 +1228 ---> 4364 +1232 ---> 4365 +1233 ---> 4366 +1234 ---> 4367 +1235 ---> 4368 +1236 ---> 4369 +1237 ---> 4370 +1240 ---> 4371 +1244 ---> 4372 +1253 ---> 4373 +1256 ---> 4374 +1259 ---> 4375 +1260 ---> 4376 +1264 ---> 4377 +1265 ---> 4378 +1267 ---> 4379 +1268 ---> 4380 +1270 ---> 4381 +1271 ---> 4382 +1272 ---> 4383 +1279 ---> 4384 +1281 ---> 4385 +1282 ---> 4386 +1284 ---> 4387 +1287 ---> 4388 +1290 ---> 4389 +1294 ---> 4390 +1296 ---> 4391 +1297 ---> 4392 +1299 ---> 4393 +1300 ---> 4394 +1303 ---> 4395 +1304 ---> 4396 +1305 ---> 4397 +1306 ---> 4398 +1307 ---> 4399 +1308 ---> 4400 +1310 ---> 4401 +1311 ---> 4402 +1312 ---> 4403 +1313 ---> 4404 +1315 ---> 4405 +1316 ---> 4406 +1318 ---> 4407 +1321 ---> 4408 +1322 ---> 4409 +1323 ---> 4410 +1328 ---> 4411 +1335 ---> 4412 +1340 ---> 4413 +1341 ---> 4414 +1344 ---> 4415 +1345 ---> 4416 +1350 ---> 4417 +1351 ---> 4418 +1356 ---> 4419 +1358 ---> 4420 +1359 ---> 4421 +1360 ---> 4422 +1361 ---> 4423 +1367 ---> 4424 +1368 ---> 4425 +1373 ---> 4426 +1374 ---> 4427 +1376 ---> 4428 +1379 ---> 4429 +1386 ---> 4430 +1389 ---> 4431 +1396 ---> 4432 +1401 ---> 4433 +1402 ---> 4434 +1404 ---> 4435 +1407 ---> 4436 +1408 ---> 4437 +1411 ---> 4438 +1414 ---> 4439 +1417 ---> 4440 +1419 ---> 4441 +1420 ---> 4442 +1421 ---> 4443 +1425 ---> 4444 +1426 ---> 4445 +1427 ---> 4446 +1438 ---> 4447 +1440 ---> 4448 +1441 ---> 4449 +1443 ---> 4450 +1444 ---> 4451 +1447 ---> 4452 +1448 ---> 4453 +1453 ---> 4454 +1454 ---> 4455 +1456 ---> 4456 +1457 ---> 4457 +1459 ---> 20268 +1461 ---> 4458 +1462 ---> 4459 +1463 ---> 4460 +1466 ---> 4461 +1468 ---> 4462 +1473 ---> 4463 +1474 ---> 4464 +1475 ---> 4465 +1476 ---> 4466 +1477 ---> 4467 +1478 ---> 4468 +1480 ---> 4469 +1482 ---> 4470 +1485 ---> 4471 +1487 ---> 4472 +1494 ---> 4473 +1502 ---> 4474 +1504 ---> 4475 +1505 ---> 4476 +1506 ---> 4477 +1508 ---> 4478 +1510 ---> 4479 +1513 ---> 4480 +1519 ---> 4481 +1521 ---> 4482 +1526 ---> 4483 +1527 ---> 4484 +1528 ---> 4485 +1529 ---> 4486 +1530 ---> 4487 +1531 ---> 4488 +1532 ---> 4489 +1534 ---> 4490 +1535 ---> 4491 +1541 ---> 4492 +1545 ---> 4493 +1548 ---> 4494 +1549 ---> 4495 +1550 ---> 4496 +1551 ---> 4497 +1556 ---> 4498 +1558 ---> 4499 +1561 ---> 4500 +1563 ---> 4501 +1570 ---> 4502 +1571 ---> 4503 +1576 ---> 4504 +1579 ---> 4505 +1590 ---> 4506 +1591 ---> 4507 +1592 ---> 4508 +1594 ---> 4509 +1595 ---> 4510 +1597 ---> 4511 +1599 ---> 4512 +1602 ---> 4513 +1605 ---> 4514 +1606 ---> 4515 +1607 ---> 4516 +1611 ---> 4517 +1615 ---> 4518 +1619 ---> 4519 +1622 ---> 4520 +1633 ---> 4521 +1634 ---> 4522 +1635 ---> 4523 +1636 ---> 4524 +1637 ---> 4525 +1639 ---> 4526 +1640 ---> 4527 +1641 ---> 4528 +1642 ---> 4529 +1643 ---> 4530 +1647 ---> 4531 +1648 ---> 4532 +1649 ---> 4533 +1652 ---> 4534 +1655 ---> 4535 +1659 ---> 4536 +1660 ---> 4537 +1664 ---> 4538 +1667 ---> 4539 +1673 ---> 4540 +1674 ---> 4541 +1676 ---> 4542 +1678 ---> 4543 +1679 ---> 4544 +1680 ---> 4545 +1682 ---> 4546 +1685 ---> 4547 +1686 ---> 4548 +1691 ---> 4549 +1698 ---> 4550 +1700 ---> 4551 +1703 ---> 4552 +1707 ---> 4553 +1708 ---> 4554 +1709 ---> 4555 +1712 ---> 4556 +1713 ---> 4557 +1714 ---> 4558 +1716 ---> 4559 +1717 ---> 4560 +1728 ---> 4561 +1729 ---> 4562 +1731 ---> 4563 +1732 ---> 4564 +1734 ---> 4565 +1736 ---> 4566 +1740 ---> 4567 +1741 ---> 4568 +1742 ---> 4569 +1743 ---> 4570 +1748 ---> 4571 +1750 ---> 4572 +1752 ---> 4573 +1754 ---> 4574 +1757 ---> 4575 +1760 ---> 4576 +1764 ---> 4577 +1765 ---> 4578 +1767 ---> 4579 +1771 ---> 4580 +1774 ---> 4581 +1776 ---> 4582 +1782 ---> 4583 +1784 ---> 4584 +1787 ---> 4585 +1791 ---> 4586 +1792 ---> 4587 +1794 ---> 4588 +1795 ---> 4589 +1796 ---> 4590 +1798 ---> 4591 +1799 ---> 4592 +1801 ---> 4593 +1807 ---> 4594 +1810 ---> 4595 +1814 ---> 4596 +1823 ---> 4597 +1825 ---> 4598 +1826 ---> 4599 +1831 ---> 4600 +1835 ---> 4601 +1836 ---> 4602 +1837 ---> 4603 +1838 ---> 4604 +1842 ---> 4605 +1843 ---> 4606 +1844 ---> 4607 +1845 ---> 4608 +1846 ---> 4609 +1847 ---> 4610 +1853 ---> 4611 +1855 ---> 4612 +1856 ---> 4613 +1859 ---> 4614 +1860 ---> 4615 +1863 ---> 4616 +1865 ---> 4617 +1870 ---> 4618 +1871 ---> 4619 +1872 ---> 4620 +1874 ---> 4621 +1877 ---> 4622 +1881 ---> 4623 +1884 ---> 4624 +1885 ---> 4625 +1889 ---> 4626 +1890 ---> 4627 +1895 ---> 4628 +1902 ---> 4629 +1913 ---> 4630 +1919 ---> 4631 +1923 ---> 4632 +1934 ---> 4633 +1935 ---> 4634 +1937 ---> 4635 +1941 ---> 4636 +1943 ---> 4637 +1950 ---> 4638 +1951 ---> 4639 +1952 ---> 4640 +1953 ---> 4641 +1954 ---> 4642 +1955 ---> 4643 +1957 ---> 4644 +1962 ---> 4645 +1964 ---> 4646 +1966 ---> 4647 +1969 ---> 4648 +1973 ---> 4649 +1974 ---> 4650 +1977 ---> 4651 +1986 ---> 4652 +1991 ---> 4653 +1992 ---> 4654 +1993 ---> 4655 +1995 ---> 4656 +1996 ---> 4657 +1997 ---> 4658 +2003 ---> 4659 +2004 ---> 4660 +2005 ---> 4661 +2007 ---> 4662 +2014 ---> 4663 +2021 ---> 4664 +2022 ---> 4665 +2029 ---> 4666 +2035 ---> 4667 +2036 ---> 4668 +2037 ---> 4669 +2038 ---> 4670 +2040 ---> 4671 +2044 ---> 4672 +2051 ---> 4673 +2053 ---> 4674 +2054 ---> 4675 +2058 ---> 4676 +2059 ---> 4677 +2072 ---> 4678 +2075 ---> 4679 +2076 ---> 4680 +2080 ---> 4681 +2083 ---> 4682 +2085 ---> 4683 +2086 ---> 4684 +2089 ---> 4685 +2090 ---> 4686 +2093 ---> 4687 +2095 ---> 4688 +2099 ---> 4689 +2101 ---> 4690 +2103 ---> 4691 +2105 ---> 4692 +2106 ---> 4693 +2113 ---> 4694 +2115 ---> 4695 +2118 ---> 4696 +2119 ---> 4697 +2124 ---> 4698 +2126 ---> 4699 +2128 ---> 4700 +2131 ---> 4701 +2135 ---> 4702 +2137 ---> 4703 +2139 ---> 4704 +2140 ---> 4705 +2143 ---> 4706 +2144 ---> 4707 +2145 ---> 4708 +2146 ---> 4710 +2150 ---> 4711 +2153 ---> 4712 +2155 ---> 4713 +2157 ---> 4714 +2158 ---> 4715 +2159 ---> 4716 +2163 ---> 4717 +2165 ---> 4718 +2172 ---> 4719 +2173 ---> 4720 +2174 ---> 4721 +2175 ---> 4722 +2176 ---> 4723 +2179 ---> 4724 +2181 ---> 4725 +2183 ---> 4726 +2184 ---> 4727 +2185 ---> 4728 +2188 ---> 4729 +2189 ---> 4730 +2191 ---> 4731 +2193 ---> 13625 +2197 ---> 4732 +2200 ---> 4733 +2215 ---> 4734 +2217 ---> 4735 +2218 ---> 4736 +2221 ---> 4737 +2222 ---> 4738 +2223 ---> 4739 +2224 ---> 4740 +2233 ---> 4741 +2234 ---> 4742 +2235 ---> 4743 +2236 ---> 4744 +2237 ---> 4745 +2238 ---> 4746 +2240 ---> 4747 +2242 ---> 4748 +2245 ---> 4749 +2250 ---> 4750 +2251 ---> 4751 +2252 ---> 4752 +2255 ---> 4753 +2256 ---> 4754 +2257 ---> 4755 +2263 ---> 4756 +2265 ---> 4757 +2266 ---> 4758 +2273 ---> 4759 +2274 ---> 4760 +2279 ---> 4761 +2285 ---> 4762 +2286 ---> 4763 +2289 ---> 4764 +2290 ---> 4765 +2291 ---> 4766 +2294 ---> 4767 +2295 ---> 4768 +2296 ---> 4769 +2297 ---> 4770 +2298 ---> 4771 +2299 ---> 4772 +2300 ---> 4773 +2301 ---> 4774 +2304 ---> 4775 +2305 ---> 4776 +2306 ---> 4777 +2307 ---> 4778 +2309 ---> 4779 +2311 ---> 4780 +2314 ---> 4781 +2315 ---> 4782 +2317 ---> 4783 +2322 ---> 4784 +2325 ---> 4785 +2326 ---> 4786 +2328 ---> 4787 +2329 ---> 4788 +2330 ---> 4789 +2331 ---> 4790 +2332 ---> 4791 +2333 ---> 4792 +2334 ---> 4793 +2336 ---> 4794 +2338 ---> 4795 +2345 ---> 4796 +2348 ---> 4797 +2349 ---> 4798 +2350 ---> 4799 +2352 ---> 4800 +2353 ---> 4801 +2355 ---> 4802 +2357 ---> 4803 +2359 ---> 4804 +2362 ---> 4805 +2366 ---> 4806 +2373 ---> 4807 +2374 ---> 4808 +2379 ---> 4809 +2380 ---> 4810 +2383 ---> 4811 +2384 ---> 4812 +2385 ---> 4813 +2387 ---> 4814 +2388 ---> 4815 +2389 ---> 4816 +2396 ---> 4817 +2397 ---> 4818 +2398 ---> 4819 +2399 ---> 4820 +2401 ---> 4821 +2402 ---> 4822 +2403 ---> 4823 +2404 ---> 4824 +2405 ---> 4825 +2406 ---> 4826 +2407 ---> 4827 +2408 ---> 4828 +2409 ---> 4829 +2410 ---> 4830 +2411 ---> 4831 +2412 ---> 4832 +2413 ---> 4833 +2414 ---> 4834 +2415 ---> 4835 +2416 ---> 4836 +2417 ---> 4837 +2418 ---> 4838 +2419 ---> 4839 +2420 ---> 4840 +2421 ---> 4841 +2422 ---> 4842 +2423 ---> 4843 +2426 ---> 4844 +2427 ---> 4845 +2429 ---> 4846 +2430 ---> 4847 +2432 ---> 4848 +2433 ---> 4849 +2434 ---> 4850 +2435 ---> 4851 +2441 ---> 4852 +2442 ---> 4853 +2443 ---> 4854 +2444 ---> 4855 +2445 ---> 4856 +2448 ---> 4857 +2449 ---> 4858 +2450 ---> 4859 +2451 ---> 4860 +2452 ---> 4861 +2454 ---> 4862 +2457 ---> 4863 +2458 ---> 4864 +2460 ---> 4865 +2466 ---> 4866 +2467 ---> 4867 +2470 ---> 4868 +2472 ---> 4869 +2473 ---> 4870 +2478 ---> 4871 +2480 ---> 4872 +2481 ---> 4873 +2482 ---> 4874 +2483 ---> 4875 +2484 ---> 4876 +2486 ---> 4877 +2489 ---> 4878 +2499 ---> 4879 +2500 ---> 4880 +2501 ---> 4881 +2502 ---> 4882 +2508 ---> 4883 +2509 ---> 4884 +2510 ---> 4885 +2511 ---> 4886 +2514 ---> 4887 +2515 ---> 4888 +2519 ---> 4889 +2524 ---> 4890 +2525 ---> 4891 +2526 ---> 4892 +2527 ---> 4893 +2531 ---> 4894 +2532 ---> 4895 +2534 ---> 4896 +2535 ---> 4897 +2536 ---> 4898 +2537 ---> 4899 +2538 ---> 4900 +2539 ---> 4901 +2547 ---> 4902 +2551 ---> 4903 +2553 ---> 4904 +2554 ---> 4905 +2555 ---> 4906 +2556 ---> 4907 +2565 ---> 4908 +2575 ---> 4909 +2576 ---> 4910 +2577 ---> 4911 +2578 ---> 4912 +2579 ---> 4913 +2580 ---> 4914 +2583 ---> 4915 +2584 ---> 4916 +2585 ---> 4917 +2589 ---> 4918 +2590 ---> 4919 +2591 ---> 4920 +2594 ---> 4921 +2596 ---> 4922 +2597 ---> 4923 +2600 ---> 4924 +2605 ---> 4925 +2606 ---> 4926 +2610 ---> 4927 +2615 ---> 4928 +2634 ---> 4929 +2638 ---> 4930 +2643 ---> 4931 +2644 ---> 4932 +2650 ---> 4933 +2651 ---> 4934 +2652 ---> 4935 +2653 ---> 4936 +2655 ---> 4937 +2656 ---> 4938 +2658 ---> 4939 +2663 ---> 4940 +2666 ---> 4941 +2671 ---> 4942 +2672 ---> 4943 +2673 ---> 4944 +2674 ---> 4945 +2679 ---> 4946 +2680 ---> 4947 +2681 ---> 4948 +2683 ---> 4949 +2688 ---> 4950 +2690 ---> 4951 +2698 ---> 4952 +2699 ---> 4953 +2700 ---> 4954 +2701 ---> 4955 +2704 ---> 4956 +2708 ---> 4957 +2710 ---> 4958 +2711 ---> 4959 +2712 ---> 4960 +2713 ---> 4961 +2714 ---> 4962 +2715 ---> 4963 +2717 ---> 4964 +2721 ---> 4965 +2725 ---> 4966 +2727 ---> 4967 +2728 ---> 4968 +2730 ---> 4969 +2731 ---> 4970 +2734 ---> 4971 +2736 ---> 4972 +2744 ---> 4973 +2749 ---> 4974 +2754 ---> 4975 +2757 ---> 4976 +2759 ---> 4977 +2761 ---> 4978 +2763 ---> 4979 +2764 ---> 4980 +2765 ---> 4981 +2767 ---> 4982 +2768 ---> 4983 +2769 ---> 4984 +2770 ---> 4985 +2771 ---> 4986 +2773 ---> 4987 +2785 ---> 4988 +2790 ---> 4989 +2796 ---> 4990 +2798 ---> 4991 +2801 ---> 4992 +2805 ---> 4993 +2810 ---> 4994 +2812 ---> 4995 +2813 ---> 4996 +2816 ---> 4997 +2823 ---> 4998 +2831 ---> 4999 +2834 ---> 5000 +2835 ---> 5001 +2840 ---> 5002 +2842 ---> 5003 +2844 ---> 5004 +2847 ---> 5005 +2848 ---> 5006 +2849 ---> 5007 +2850 ---> 5008 +2854 ---> 5009 +2856 ---> 5010 +2858 ---> 5011 +2870 ---> 5012 +2872 ---> 5013 +2874 ---> 5014 +2876 ---> 5015 +2877 ---> 5016 +2881 ---> 5017 +2886 ---> 5018 +2892 ---> 5019 +2895 ---> 5020 +2896 ---> 5021 +2897 ---> 5022 +2907 ---> 5023 +2908 ---> 5024 +2909 ---> 5025 +2910 ---> 5026 +2915 ---> 5027 +2920 ---> 5028 +2921 ---> 5029 +2925 ---> 5030 +2926 ---> 5031 +2927 ---> 5032 +2932 ---> 5033 +2937 ---> 5034 +2942 ---> 5035 +2944 ---> 5036 +2947 ---> 5037 +2952 ---> 5038 +2957 ---> 5039 +2959 ---> 5040 +2963 ---> 5041 +2964 ---> 5042 +2965 ---> 5043 +2966 ---> 5044 +2967 ---> 5045 +2968 ---> 5046 +2969 ---> 5047 +2970 ---> 5048 +2975 ---> 5049 +2980 ---> 5050 +2982 ---> 5051 +2985 ---> 5052 +2987 ---> 5053 +2988 ---> 5054 +2989 ---> 5055 +2990 ---> 5056 +2991 ---> 5057 +2993 ---> 5058 +2999 ---> 5059 +3002 ---> 5060 +3007 ---> 5061 +3013 ---> 5062 +3014 ---> 5063 +3015 ---> 5064 +3019 ---> 5065 +3020 ---> 5066 +3022 ---> 5067 +3025 ---> 5068 +3028 ---> 5069 +3029 ---> 5070 +3032 ---> 5071 +3034 ---> 5073 +3037 ---> 5074 +3040 ---> 5075 +3047 ---> 5076 +3049 ---> 5077 +3054 ---> 5078 +3057 ---> 5079 +3058 ---> 5080 +3064 ---> 5081 +3065 ---> 5082 +3068 ---> 5083 +3069 ---> 5084 +3077 ---> 5085 +3078 ---> 5086 +3079 ---> 5087 +3080 ---> 5088 +3085 ---> 5089 +3089 ---> 5090 +3090 ---> 5091 +3092 ---> 5092 +3098 ---> 5093 +3101 ---> 5094 +3103 ---> 5095 +3104 ---> 5096 +3105 ---> 5097 +3109 ---> 5098 +3111 ---> 5099 +3116 ---> 5100 +3123 ---> 5101 +3125 ---> 5102 +3128 ---> 5103 +3129 ---> 5104 +3130 ---> 5105 +3131 ---> 5106 +3133 ---> 5107 +3134 ---> 5108 +3141 ---> 5109 +3142 ---> 5110 +3143 ---> 5111 +3144 ---> 5112 +3147 ---> 5113 +3151 ---> 5114 +3152 ---> 5115 +3154 ---> 5116 +3155 ---> 5117 +3164 ---> 5118 +3165 ---> 5119 +3168 ---> 5120 +3169 ---> 5121 +3174 ---> 5122 +3178 ---> 5123 +3180 ---> 5124 +3182 ---> 5125 +3184 ---> 5126 +3186 ---> 5127 +3190 ---> 5128 +3194 ---> 5129 +3199 ---> 5130 +3202 ---> 5131 +3204 ---> 5132 +3206 ---> 5133 +3207 ---> 5134 +3208 ---> 5135 +3209 ---> 5136 +3210 ---> 5137 +3216 ---> 5138 +3217 ---> 5139 +3223 ---> 5140 +3225 ---> 5141 +3226 ---> 5142 +3227 ---> 5143 +3234 ---> 5144 +3235 ---> 5145 +3239 ---> 5146 +3245 ---> 5147 +3246 ---> 5148 +3249 ---> 5149 +3251 ---> 5150 +3258 ---> 5151 +3263 ---> 5152 +3271 ---> 5153 +3272 ---> 5154 +3276 ---> 5155 +3281 ---> 5156 +3283 ---> 5157 +3287 ---> 5158 +3291 ---> 5159 +3292 ---> 5160 +3297 ---> 5161 +3299 ---> 5162 +3305 ---> 5163 +3306 ---> 5164 +3309 ---> 5165 +3311 ---> 5166 +3312 ---> 5167 +3313 ---> 5168 +3317 ---> 5169 +3318 ---> 5170 +3320 ---> 5171 +3321 ---> 5172 +3322 ---> 5173 +3323 ---> 5174 +3324 ---> 5175 +3325 ---> 5176 +3326 ---> 5177 +3330 ---> 5178 +3332 ---> 5179 +3338 ---> 5180 +3342 ---> 31478 +3347 ---> 5181 +3349 ---> 5182 +3352 ---> 5183 +3355 ---> 5184 +3360 ---> 5185 +3366 ---> 5186 +3367 ---> 5187 +3368 ---> 5188 +3369 ---> 5189 +3371 ---> 5190 +3372 ---> 5191 +3373 ---> 5192 +3377 ---> 5193 +3379 ---> 5194 +3380 ---> 5195 +3382 ---> 5196 +3384 ---> 5197 +3386 ---> 5198 +3391 ---> 5199 +3392 ---> 5200 +3396 ---> 5201 +3408 ---> 5202 +3412 ---> 5203 +3413 ---> 5204 +3414 ---> 5205 +3416 ---> 5206 +3417 ---> 5207 +3419 ---> 5208 +3420 ---> 5209 +3421 ---> 5210 +3422 ---> 5211 +3426 ---> 5212 +3439 ---> 5213 +3442 ---> 5214 +3443 ---> 5215 +3449 ---> 5216 +3450 ---> 5217 +3451 ---> 5218 +3453 ---> 5219 +3454 ---> 5220 +3455 ---> 5221 +3461 ---> 5222 +3462 ---> 5223 +3463 ---> 5224 +3465 ---> 5225 +3474 ---> 5226 +3475 ---> 5227 +3480 ---> 5228 +3481 ---> 5229 +3482 ---> 5230 +3485 ---> 5231 +3486 ---> 5232 +3487 ---> 5233 +3490 ---> 5234 +3493 ---> 5235 +3501 ---> 5236 +3504 ---> 5237 +3506 ---> 5238 +3510 ---> 5239 +3514 ---> 5240 +3515 ---> 5241 +3516 ---> 5242 +3517 ---> 5243 +3520 ---> 5244 +3524 ---> 5245 +3526 ---> 5246 +3527 ---> 5247 +3529 ---> 5248 +3531 ---> 5249 +3532 ---> 5250 +3534 ---> 5251 +3539 ---> 5252 +3540 ---> 5253 +3541 ---> 5254 +3542 ---> 5255 +3544 ---> 5256 +3545 ---> 5257 +3546 ---> 5258 +3547 ---> 5259 +3549 ---> 5260 +3550 ---> 5261 +3551 ---> 5262 +3552 ---> 5263 +3554 ---> 5264 +3557 ---> 5265 +3559 ---> 5266 +3560 ---> 5267 +3561 ---> 5268 +3565 ---> 5269 +3566 ---> 5270 +3569 ---> 5271 +3570 ---> 5272 +3571 ---> 5273 +3572 ---> 5274 +3578 ---> 5275 +3579 ---> 5276 +3580 ---> 5277 +3581 ---> 5278 +3582 ---> 5279 +3583 ---> 5280 +3584 ---> 5281 +3585 ---> 5282 +3586 ---> 5283 +3591 ---> 5284 +3593 ---> 5285 +3596 ---> 5286 +3597 ---> 5287 +3600 ---> 5288 +3601 ---> 5289 +3604 ---> 5290 +3605 ---> 5291 +3606 ---> 5292 +3607 ---> 5293 +3608 ---> 5294 +3609 ---> 5295 +3610 ---> 5296 +3611 ---> 5297 +3612 ---> 5298 +3613 ---> 5299 +3614 ---> 5300 +3615 ---> 5301 +3616 ---> 5302 +3617 ---> 5303 +3618 ---> 5304 +3619 ---> 5305 +3620 ---> 5306 +3622 ---> 5307 +3623 ---> 5308 +3627 ---> 5309 +3633 ---> 5310 +3635 ---> 5311 +3636 ---> 5312 +3643 ---> 5313 +3646 ---> 5314 +3648 ---> 5315 +3649 ---> 5316 +3651 ---> 5317 +3657 ---> 5318 +3660 ---> 5319 +3661 ---> 5320 +3663 ---> 5321 +3664 ---> 5322 +3665 ---> 5323 +3666 ---> 5324 +3667 ---> 5325 +3668 ---> 5326 +3669 ---> 5327 +3676 ---> 5328 +3681 ---> 5329 +3684 ---> 5330 +3686 ---> 5331 +3688 ---> 5332 +3689 ---> 5333 +3690 ---> 5334 +3691 ---> 5335 +3693 ---> 5336 +3701 ---> 5337 +3703 ---> 5338 +3704 ---> 5339 +3707 ---> 5340 +3708 ---> 5341 +3709 ---> 5342 +3710 ---> 5343 +3712 ---> 5344 +3713 ---> 5345 +3714 ---> 5346 +3715 ---> 5347 +3716 ---> 5348 +3717 ---> 5349 +3718 ---> 5350 +3721 ---> 5351 +3722 ---> 5352 +3723 ---> 5353 +3724 ---> 5354 +3726 ---> 5355 +3727 ---> 5356 +3728 ---> 5357 +3730 ---> 5358 +3731 ---> 5359 +3732 ---> 5360 +3733 ---> 5361 +3734 ---> 5362 +3738 ---> 5363 +3746 ---> 5364 +3747 ---> 5365 +3748 ---> 5366 +3750 ---> 5367 +3753 ---> 5368 +3754 ---> 5369 +3756 ---> 5370 +3759 ---> 5371 +3760 ---> 5372 +3763 ---> 5373 +3764 ---> 5374 +3765 ---> 5375 +3766 ---> 5376 +3767 ---> 5377 +3768 ---> 5378 +3769 ---> 5379 +3772 ---> 5380 +3775 ---> 5381 +3776 ---> 5382 +3778 ---> 5383 +3784 ---> 5384 +3785 ---> 5385 +3787 ---> 5386 +3788 ---> 5387 +3789 ---> 5388 +3792 ---> 5389 +3795 ---> 5390 +3800 ---> 5391 +3802 ---> 5392 +3804 ---> 5393 +3805 ---> 5394 +3806 ---> 5395 +3811 ---> 5396 +3816 ---> 5397 +3817 ---> 5398 +3818 ---> 5399 +3819 ---> 5400 +3820 ---> 5401 +3821 ---> 5402 +3822 ---> 5403 +3823 ---> 5404 +3824 ---> 5405 +3825 ---> 5406 +3826 ---> 5407 +3827 ---> 5408 +3828 ---> 5409 +3829 ---> 5410 +3832 ---> 5411 +3834 ---> 5412 +3835 ---> 5413 +3836 ---> 5414 +3837 ---> 5415 +3839 ---> 5416 +3842 ---> 5417 +3844 ---> 5418 +3848 ---> 5419 +3850 ---> 5420 +3856 ---> 5421 +3857 ---> 5422 +3859 ---> 5423 +3860 ---> 5424 +3861 ---> 5425 +3878 ---> 5426 +3884 ---> 5427 +3886 ---> 5428 +3894 ---> 5429 +3898 ---> 5430 +3903 ---> 5431 +3906 ---> 5432 +3910 ---> 5433 +3912 ---> 5434 +3916 ---> 5435 +3918 ---> 5436 +3922 ---> 5437 +3925 ---> 5438 +3926 ---> 5439 +3927 ---> 5440 +3937 ---> 5441 +3938 ---> 5442 +3939 ---> 5443 +3940 ---> 5444 +3945 ---> 5445 +3947 ---> 5446 +3948 ---> 5447 +3951 ---> 5448 +3952 ---> 5449 +3956 ---> 5450 +3957 ---> 5451 +3964 ---> 5452 +3968 ---> 5453 +3969 ---> 5454 +3970 ---> 5455 +3971 ---> 5456 +3972 ---> 5457 +3973 ---> 5458 +3975 ---> 5459 +3977 ---> 5460 +3978 ---> 5461 +3979 ---> 5462 +3986 ---> 5463 +3987 ---> 5464 +3988 ---> 5465 +3991 ---> 5466 +4011 ---> 5467 +4013 ---> 5468 +4022 ---> 5469 +4025 ---> 5470 +4026 ---> 5471 +4027 ---> 5472 +4028 ---> 5473 +4032 ---> 5474 +4040 ---> 5475 +4044 ---> 5476 +4046 ---> 5477 +4048 ---> 5478 +4049 ---> 5479 +4055 ---> 5480 +4059 ---> 5481 +4062 ---> 5482 +4064 ---> 5483 +4066 ---> 5484 +4067 ---> 5485 +4070 ---> 5486 +4073 ---> 5487 +4075 ---> 5488 +4076 ---> 5489 +4082 ---> 5490 +4083 ---> 5491 +4087 ---> 5492 +4088 ---> 5493 +4090 ---> 5494 +4091 ---> 5495 +4093 ---> 5496 +4094 ---> 5497 +4098 ---> 5498 +4104 ---> 5499 +4105 ---> 5500 +4107 ---> 5501 +4108 ---> 5502 +4109 ---> 5503 +4114 ---> 5504 +4115 ---> 5505 +4118 ---> 5506 +4121 ---> 5507 +4122 ---> 5508 +4124 ---> 5509 +4126 ---> 5510 +4127 ---> 5511 +4128 ---> 5512 +4129 ---> 5513 +4130 ---> 5514 +4132 ---> 5515 +4133 ---> 5516 +4138 ---> 5517 +4142 ---> 5518 +4143 ---> 5519 +4145 ---> 5520 +4147 ---> 5521 +4150 ---> 5522 +4156 ---> 5524 +4166 ---> 5525 +4167 ---> 5526 +4168 ---> 5527 +4169 ---> 5528 +4170 ---> 5529 +4171 ---> 5530 +4172 ---> 5531 +4173 ---> 5533 +4174 ---> 5534 +4175 ---> 5535 +4176 ---> 5536 +4177 ---> 5537 +4178 ---> 5538 +4179 ---> 5539 +4180 ---> 5540 +4181 ---> 5541 +4182 ---> 5542 +4183 ---> 5543 +4184 ---> 5544 +4185 ---> 5545 +4186 ---> 5546 +4188 ---> 5547 +4189 ---> 5548 +4190 ---> 5549 +4191 ---> 5550 +4192 ---> 5551 +4193 ---> 5552 +4194 ---> 5553 +4195 ---> 5554 +4196 ---> 5555 +4197 ---> 5556 +4200 ---> 5557 +4201 ---> 5558 +4204 ---> 5559 +4208 ---> 5560 +4209 ---> 5561 +4210 ---> 5562 +4211 ---> 5563 +4212 ---> 5564 +4213 ---> 5565 +4214 ---> 5566 +4215 ---> 5567 +4216 ---> 5568 +4217 ---> 5569 +4219 ---> 5570 +4220 ---> 5571 +4222 ---> 5572 +4223 ---> 5573 +4224 ---> 5574 +4225 ---> 5575 +4226 ---> 5576 +4227 ---> 5577 +4228 ---> 5578 +4229 ---> 5579 +4230 ---> 5580 +4231 ---> 5581 +4232 ---> 5582 +4233 ---> 5583 +4234 ---> 5584 +4235 ---> 5585 +4236 ---> 5586 +4237 ---> 5587 +4238 ---> 5588 +4241 ---> 5589 +4244 ---> 5590 +4251 ---> 5591 +4252 ---> 5593 +4254 ---> 5594 +4259 ---> 5595 +4262 ---> 5596 +4263 ---> 5597 +4264 ---> 5598 +4265 ---> 5599 +4267 ---> 5600 +4270 ---> 5601 +4271 ---> 5602 +4276 ---> 5603 +4284 ---> 5604 +4285 ---> 5605 +4286 ---> 5606 +4288 ---> 5607 +4298 ---> 5608 +4299 ---> 5609 +4301 ---> 5610 +4306 ---> 5611 +4307 ---> 5612 +4311 ---> 5613 +4315 ---> 5614 +4316 ---> 5615 +4318 ---> 5616 +4321 ---> 5617 +4328 ---> 5618 +4329 ---> 5619 +4331 ---> 5620 +4332 ---> 5621 +4333 ---> 5622 +4334 ---> 5623 +4336 ---> 5624 +4344 ---> 5625 +4345 ---> 5626 +4350 ---> 5627 +4351 ---> 5628 +4354 ---> 5629 +4356 ---> 5630 +4358 ---> 5631 +4362 ---> 5632 +4365 ---> 5633 +4366 ---> 5634 +4367 ---> 5635 +4379 ---> 5636 +4380 ---> 5637 +4382 ---> 5638 +4395 ---> 5639 +4400 ---> 5640 +4402 ---> 5641 +4403 ---> 5642 +4404 ---> 5643 +4407 ---> 5644 +4408 ---> 5645 +4409 ---> 5646 +4410 ---> 5647 +4411 ---> 5648 +4412 ---> 5649 +4413 ---> 5650 +4417 ---> 5651 +4420 ---> 5652 +4421 ---> 5653 +4422 ---> 5654 +4424 ---> 5655 +4428 ---> 5656 +4430 ---> 5657 +4431 ---> 5658 +4432 ---> 5659 +4435 ---> 5660 +4436 ---> 5661 +4437 ---> 5662 +4438 ---> 5663 +4440 ---> 5664 +4441 ---> 5665 +4445 ---> 5666 +4446 ---> 5667 +4452 ---> 5668 +4465 ---> 5669 +4474 ---> 5670 +4475 ---> 5671 +4476 ---> 5672 +4477 ---> 5673 +4479 ---> 5674 +4494 ---> 5675 +4496 ---> 5676 +4497 ---> 5677 +4499 ---> 5678 +4500 ---> 5679 +4505 ---> 5680 +4506 ---> 5681 +4507 ---> 5682 +4508 ---> 5683 +4509 ---> 5684 +4510 ---> 5685 +4511 ---> 5686 +4513 ---> 5687 +4514 ---> 5688 +4521 ---> 5689 +4529 ---> 5690 +4531 ---> 5691 +4534 ---> 5692 +4536 ---> 5693 +4538 ---> 5694 +4545 ---> 5695 +4546 ---> 5696 +4547 ---> 5697 +4548 ---> 5698 +4549 ---> 5699 +4550 ---> 5700 +4552 ---> 5701 +4555 ---> 5702 +4558 ---> 5703 +4568 ---> 5704 +4569 ---> 5705 +4570 ---> 5706 +4571 ---> 5707 +4575 ---> 5708 +4579 ---> 5709 +4582 ---> 5710 +4583 ---> 5711 +4584 ---> 5712 +4589 ---> 5713 +4590 ---> 5714 +4593 ---> 5715 +4596 ---> 5716 +4600 ---> 5717 +4603 ---> 5718 +4605 ---> 5719 +4607 ---> 5720 +4615 ---> 5721 +4617 ---> 5722 +4619 ---> 5723 +4623 ---> 5724 +4628 ---> 5725 +4629 ---> 5726 +4630 ---> 5727 +4631 ---> 5728 +4634 ---> 5729 +4635 ---> 5730 +4638 ---> 5731 +4639 ---> 5732 +4642 ---> 5733 +4647 ---> 5734 +4648 ---> 5735 +4649 ---> 5736 +4650 ---> 5737 +4651 ---> 5738 +4657 ---> 5739 +4659 ---> 5740 +4660 ---> 5741 +4661 ---> 5742 +4663 ---> 5743 +4664 ---> 5744 +4665 ---> 5745 +4666 ---> 5746 +4667 ---> 5747 +4668 ---> 5748 +4669 ---> 5749 +4671 ---> 5750 +4672 ---> 5751 +4674 ---> 5752 +4678 ---> 5753 +4681 ---> 5754 +4682 ---> 5755 +4683 ---> 5756 +4700 ---> 5757 +4703 ---> 5758 +4706 ---> 5759 +4708 ---> 5760 +4711 ---> 5761 +4712 ---> 5762 +4714 ---> 5763 +4716 ---> 5764 +4717 ---> 5765 +4720 ---> 5766 +4722 ---> 5767 +4724 ---> 5768 +4725 ---> 5769 +4730 ---> 5770 +4733 ---> 5771 +4734 ---> 5772 +4737 ---> 5773 +4739 ---> 5774 +4741 ---> 5775 +4743 ---> 5776 +4745 ---> 5777 +4746 ---> 5778 +4748 ---> 5779 +4749 ---> 5780 +4750 ---> 5781 +4751 ---> 5782 +4752 ---> 5783 +4756 ---> 5784 +4766 ---> 5785 +4769 ---> 5786 +4775 ---> 5787 +4777 ---> 5788 +4779 ---> 5789 +4781 ---> 5790 +4784 ---> 5791 +4785 ---> 5792 +4788 ---> 5793 +4794 ---> 5794 +4796 ---> 5795 +4798 ---> 5796 +4799 ---> 5797 +4801 ---> 5798 +4802 ---> 5799 +4805 ---> 5800 +4817 ---> 5801 +4823 ---> 5802 +4824 ---> 5803 +4825 ---> 5804 +4827 ---> 5805 +4832 ---> 5806 +4835 ---> 5807 +4840 ---> 5808 +4844 ---> 5809 +4849 ---> 5810 +4850 ---> 5811 +4851 ---> 5812 +4853 ---> 5813 +4854 ---> 5814 +4855 ---> 5815 +4856 ---> 5816 +4859 ---> 5817 +4860 ---> 5818 +4861 ---> 5819 +4869 ---> 5820 +4871 ---> 5821 +4873 ---> 5822 +4875 ---> 5823 +4876 ---> 5824 +4877 ---> 5825 +4879 ---> 5826 +4880 ---> 5827 +4885 ---> 5828 +4892 ---> 5829 +4893 ---> 5830 +4897 ---> 5831 +4906 ---> 5832 +4908 ---> 5833 +4910 ---> 5834 +4912 ---> 5835 +4913 ---> 5836 +4914 ---> 5837 +4924 ---> 5838 +4925 ---> 5839 +4929 ---> 5840 +4934 ---> 5841 +4935 ---> 5842 +4936 ---> 5843 +4937 ---> 5844 +4938 ---> 5845 +4939 ---> 5846 +4940 ---> 5847 +4943 ---> 5848 +4944 ---> 5849 +4946 ---> 5850 +4947 ---> 5851 +4948 ---> 5852 +4949 ---> 5853 +4950 ---> 5854 +4951 ---> 5855 +4960 ---> 5856 +4971 ---> 5857 +4980 ---> 5858 +4981 ---> 5859 +4987 ---> 5860 +4989 ---> 5861 +4992 ---> 5862 +5000 ---> 5863 +5006 ---> 5864 +5009 ---> 5865 +5012 ---> 5866 +5017 ---> 5867 +5018 ---> 5868 +5025 ---> 5869 +5029 ---> 5870 +5033 ---> 5871 +5035 ---> 5872 +5037 ---> 5873 +5038 ---> 5874 +5040 ---> 5875 +5043 ---> 5876 +5046 ---> 5877 +5047 ---> 5878 +5053 ---> 5879 +5056 ---> 5880 +5058 ---> 5881 +5060 ---> 5882 +5061 ---> 5883 +5063 ---> 5884 +5064 ---> 5885 +5065 ---> 5886 +5071 ---> 5887 +5081 ---> 5888 +5082 ---> 5889 +5083 ---> 5890 +5088 ---> 5891 +5089 ---> 5892 +5090 ---> 5893 +5094 ---> 5894 +5095 ---> 5895 +5097 ---> 5896 +5113 ---> 5897 +5116 ---> 5898 +5117 ---> 5899 +5119 ---> 5900 +5120 ---> 5901 +5128 ---> 5902 +5130 ---> 5903 +5134 ---> 5904 +5135 ---> 5905 +5137 ---> 5906 +5138 ---> 5907 +5141 ---> 5908 +5147 ---> 5909 +5149 ---> 5910 +5152 ---> 5911 +5155 ---> 5912 +5157 ---> 5913 +5160 ---> 5914 +5162 ---> 5915 +5163 ---> 5916 +5164 ---> 5917 +5165 ---> 5918 +5166 ---> 5919 +5168 ---> 5920 +5169 ---> 5921 +5172 ---> 5922 +5174 ---> 5923 +5176 ---> 5924 +5177 ---> 5925 +5181 ---> 5926 +5185 ---> 5927 +5188 ---> 5928 +5193 ---> 5929 +5194 ---> 5930 +5195 ---> 5931 +5198 ---> 5932 +5200 ---> 5933 +5201 ---> 5934 +5202 ---> 5935 +5213 ---> 5936 +5222 ---> 5937 +5223 ---> 5938 +5226 ---> 5939 +5229 ---> 5940 +5232 ---> 5941 +5241 ---> 5942 +5242 ---> 5943 +5243 ---> 5944 +5245 ---> 5945 +5246 ---> 5946 +5250 ---> 5947 +5258 ---> 5948 +5259 ---> 5949 +5264 ---> 5950 +5268 ---> 5951 +5273 ---> 5952 +5274 ---> 5953 +5275 ---> 5954 +5278 ---> 5955 +5282 ---> 5956 +5284 ---> 5957 +5285 ---> 5958 +5286 ---> 5959 +5291 ---> 5960 +5292 ---> 5961 +5303 ---> 5962 +5310 ---> 5963 +5311 ---> 5964 +5314 ---> 5965 +5316 ---> 5966 +5318 ---> 5967 +5319 ---> 5968 +5321 ---> 5969 +5324 ---> 5970 +5325 ---> 5971 +5326 ---> 5972 +5329 ---> 5973 +5330 ---> 5974 +5333 ---> 5975 +5336 ---> 5976 +5337 ---> 5977 +5338 ---> 5978 +5341 ---> 5979 +5343 ---> 5980 +5346 ---> 5981 +5354 ---> 5982 +5357 ---> 5983 +5358 ---> 5984 +5364 ---> 5985 +5366 ---> 5986 +5367 ---> 5987 +5368 ---> 5988 +5369 ---> 5989 +5371 ---> 5990 +5377 ---> 5991 +5385 ---> 5992 +5391 ---> 5993 +5393 ---> 5994 +5397 ---> 5995 +5403 ---> 5996 +5405 ---> 5997 +5407 ---> 5998 +5408 ---> 5999 +5413 ---> 6000 +5416 ---> 6001 +5419 ---> 6002 +5420 ---> 6003 +5424 ---> 6004 +5427 ---> 6005 +5428 ---> 6006 +5430 ---> 6007 +5437 ---> 6008 +5438 ---> 6009 +5441 ---> 6010 +5449 ---> 6011 +5450 ---> 6012 +5451 ---> 6013 +5456 ---> 6014 +5457 ---> 6015 +5463 ---> 6016 +5464 ---> 6017 +5466 ---> 6018 +5467 ---> 6019 +5479 ---> 6020 +5484 ---> 6021 +5488 ---> 6022 +5490 ---> 6023 +5496 ---> 6024 +5497 ---> 6025 +5500 ---> 6026 +5501 ---> 6027 +5502 ---> 6028 +5505 ---> 6029 +5506 ---> 6030 +5508 ---> 6031 +5509 ---> 6032 +5510 ---> 6033 +5514 ---> 6034 +5515 ---> 6036 +5516 ---> 6037 +5517 ---> 6038 +5518 ---> 6039 +5519 ---> 6040 +5526 ---> 6041 +5527 ---> 6042 +5530 ---> 6043 +5535 ---> 6044 +5536 ---> 6045 +5537 ---> 6046 +5541 ---> 6047 +5542 ---> 6048 +5546 ---> 6049 +5549 ---> 6050 +5551 ---> 6051 +5552 ---> 6052 +5555 ---> 6053 +5556 ---> 6054 +5557 ---> 6055 +5558 ---> 6056 +5559 ---> 6057 +5560 ---> 6058 +5561 ---> 6059 +5562 ---> 6060 +5563 ---> 6061 +5567 ---> 6062 +5569 ---> 6063 +5572 ---> 6064 +5583 ---> 6065 +5592 ---> 6066 +5594 ---> 6067 +5595 ---> 6068 +5600 ---> 6069 +5602 ---> 6070 +5603 ---> 6071 +5608 ---> 6072 +5610 ---> 6073 +5612 ---> 6074 +5613 ---> 6075 +5615 ---> 6076 +5616 ---> 6077 +5617 ---> 6078 +5620 ---> 6079 +5626 ---> 6080 +5628 ---> 6081 +5629 ---> 6082 +5631 ---> 6083 +5632 ---> 6084 +5634 ---> 6085 +5635 ---> 6086 +5638 ---> 6087 +5639 ---> 6088 +5640 ---> 6089 +5641 ---> 6090 +5642 ---> 6091 +5643 ---> 6092 +5644 ---> 6093 +5645 ---> 6094 +5646 ---> 6095 +5647 ---> 6096 +5659 ---> 6097 +5660 ---> 6098 +5664 ---> 6099 +5665 ---> 6100 +5668 ---> 6101 +5669 ---> 6103 +5672 ---> 6104 +5674 ---> 6105 +5675 ---> 6106 +5677 ---> 6107 +5686 ---> 6108 +5687 ---> 6109 +5689 ---> 6110 +5696 ---> 6111 +5698 ---> 6112 +5699 ---> 6113 +5705 ---> 6114 +5706 ---> 6115 +5709 ---> 6116 +5710 ---> 6117 +5712 ---> 6118 +5714 ---> 6119 +5716 ---> 6120 +5717 ---> 6121 +5719 ---> 6122 +5720 ---> 6123 +5721 ---> 6124 +5734 ---> 6125 +5735 ---> 6126 +5736 ---> 6127 +5739 ---> 6128 +5741 ---> 6129 +5748 ---> 6130 +5751 ---> 6131 +5752 ---> 6132 +5759 ---> 6133 +5760 ---> 6134 +5761 ---> 6135 +5763 ---> 6136 +5769 ---> 6137 +5772 ---> 6138 +5778 ---> 6139 +5779 ---> 6140 +5780 ---> 6141 +5782 ---> 6142 +5783 ---> 6143 +5784 ---> 6144 +5790 ---> 6145 +5795 ---> 6146 +5796 ---> 6147 +5801 ---> 6148 +5806 ---> 6149 +5809 ---> 6150 +5811 ---> 6151 +5812 ---> 6152 +5817 ---> 6153 +5818 ---> 6154 +5823 ---> 6155 +5825 ---> 6156 +5826 ---> 6157 +5828 ---> 6158 +5829 ---> 6159 +5832 ---> 6160 +5833 ---> 6161 +5834 ---> 6162 +5837 ---> 6163 +5838 ---> 6164 +5844 ---> 6165 +5845 ---> 6166 +5848 ---> 6167 +5851 ---> 6168 +5853 ---> 6169 +5855 ---> 6170 +5857 ---> 6171 +5860 ---> 6172 +5866 ---> 6173 +5867 ---> 6174 +5869 ---> 6175 +5870 ---> 6176 +5872 ---> 6177 +5877 ---> 6178 +5878 ---> 6179 +5880 ---> 6180 +5881 ---> 6181 +5883 ---> 6182 +5906 ---> 6183 +5910 ---> 6184 +5917 ---> 6185 +5918 ---> 6186 +5920 ---> 6187 +5922 ---> 6188 +5927 ---> 6189 +5928 ---> 6190 +5930 ---> 6191 +5947 ---> 6192 +5949 ---> 6193 +5951 ---> 6194 +5953 ---> 6195 +5954 ---> 6196 +5955 ---> 6197 +5956 ---> 6198 +5957 ---> 6199 +5965 ---> 6200 +5967 ---> 6201 +5969 ---> 6202 +5974 ---> 6203 +5975 ---> 6204 +5976 ---> 6205 +5982 ---> 6206 +5989 ---> 6207 +5994 ---> 6208 +5995 ---> 6209 +5996 ---> 6210 +5999 ---> 6211 +6001 ---> 6212 +6004 ---> 6213 +6008 ---> 6214 +6011 ---> 6216 +6012 ---> 6217 +6013 ---> 6218 +6014 ---> 6219 +6016 ---> 6220 +6018 ---> 6221 +6020 ---> 6222 +6022 ---> 6223 +6023 ---> 6224 +6024 ---> 6225 +6026 ---> 6226 +6028 ---> 6227 +6029 ---> 6228 +6034 ---> 6229 +6051 ---> 6230 +6052 ---> 6231 +6055 ---> 6232 +6056 ---> 6233 +6057 ---> 6234 +6058 ---> 6235 +6059 ---> 6236 +6060 ---> 6237 +6061 ---> 6238 +6062 ---> 6239 +6063 ---> 6240 +6064 ---> 6241 +6065 ---> 6242 +6066 ---> 6243 +6067 ---> 6244 +6068 ---> 6245 +6074 ---> 6246 +6085 ---> 6247 +6087 ---> 6248 +6095 ---> 6249 +6097 ---> 6250 +6107 ---> 6251 +6110 ---> 6252 +6111 ---> 6253 +6115 ---> 6254 +6116 ---> 6255 +6118 ---> 6256 +6121 ---> 6257 +6122 ---> 6258 +6123 ---> 6259 +6126 ---> 6260 +6127 ---> 6261 +6128 ---> 6262 +6129 ---> 6263 +6131 ---> 6264 +6132 ---> 6265 +6136 ---> 6266 +6138 ---> 6267 +6140 ---> 6268 +6143 ---> 6269 +6144 ---> 6270 +6155 ---> 6271 +6160 ---> 6272 +6162 ---> 6273 +6165 ---> 6274 +6166 ---> 6275 +6167 ---> 6276 +6168 ---> 6277 +6169 ---> 6278 +6171 ---> 6279 +6172 ---> 6280 +6174 ---> 6281 +6178 ---> 6282 +6179 ---> 6283 +6180 ---> 6284 +6181 ---> 6285 +6184 ---> 6286 +6185 ---> 6287 +6186 ---> 6288 +6187 ---> 6289 +6191 ---> 6290 +6196 ---> 6291 +6203 ---> 6292 +6206 ---> 6293 +6209 ---> 6294 +6211 ---> 6295 +6214 ---> 6296 +6217 ---> 6297 +6218 ---> 6298 +6222 ---> 6299 +6223 ---> 6300 +6228 ---> 6301 +6231 ---> 6302 +6232 ---> 6303 +6233 ---> 6304 +6234 ---> 6305 +6236 ---> 6306 +6237 ---> 6307 +6238 ---> 6308 +6239 ---> 6309 +6248 ---> 6310 +6250 ---> 6311 +6252 ---> 6312 +6259 ---> 6313 +6260 ---> 6314 +6261 ---> 6315 +6264 ---> 6316 +6265 ---> 6317 +6266 ---> 6318 +6268 ---> 6319 +6269 ---> 6320 +6271 ---> 6321 +6272 ---> 6322 +6273 ---> 6323 +6275 ---> 6324 +6279 ---> 6325 +6280 ---> 6326 +6282 ---> 6327 +6283 ---> 6328 +6284 ---> 6329 +6286 ---> 6330 +6288 ---> 6331 +6289 ---> 6332 +6292 ---> 6333 +6298 ---> 6334 +6301 ---> 6335 +6303 ---> 6336 +6308 ---> 6337 +6309 ---> 6338 +6312 ---> 6339 +6317 ---> 6340 +6318 ---> 6341 +6319 ---> 6342 +6320 ---> 6343 +6321 ---> 6344 +6329 ---> 6345 +6333 ---> 6346 +6334 ---> 6347 +6341 ---> 6348 +6343 ---> 6349 +6345 ---> 6350 +6347 ---> 6351 +6349 ---> 6352 +6350 ---> 6353 +6351 ---> 6354 +6352 ---> 6355 +6355 ---> 6356 +6356 ---> 6357 +6361 ---> 6358 +6363 ---> 6359 +6364 ---> 6360 +6368 ---> 6361 +6370 ---> 6362 +6378 ---> 6363 +6380 ---> 6364 +6381 ---> 6365 +6382 ---> 6366 +6387 ---> 6367 +6388 ---> 6368 +6390 ---> 6369 +6391 ---> 6370 +6392 ---> 6371 +6397 ---> 6372 +6408 ---> 6373 +6409 ---> 6374 +6411 ---> 6375 +6413 ---> 6376 +6421 ---> 6377 +6427 ---> 6378 +6439 ---> 6379 +6446 ---> 6380 +6451 ---> 6381 +6452 ---> 6382 +6454 ---> 6383 +6458 ---> 6384 +6459 ---> 6385 +6460 ---> 6386 +6465 ---> 6387 +6469 ---> 6388 +6470 ---> 6389 +6474 ---> 6390 +6475 ---> 6391 +6476 ---> 6392 +6482 ---> 6393 +6483 ---> 6394 +6492 ---> 6395 +6494 ---> 6396 +6501 ---> 6397 +6503 ---> 6398 +6504 ---> 6399 +6505 ---> 6400 +6507 ---> 6401 +6510 ---> 6402 +6513 ---> 6403 +6514 ---> 6404 +6517 ---> 6405 +6518 ---> 6406 +6520 ---> 6407 +6524 ---> 6408 +6525 ---> 6409 +6527 ---> 6410 +6528 ---> 6411 +6530 ---> 6412 +6531 ---> 6413 +6532 ---> 6414 +6536 ---> 6415 +6537 ---> 6416 +6539 ---> 6417 +6540 ---> 6418 +6541 ---> 6419 +6543 ---> 6420 +6544 ---> 6421 +6545 ---> 6422 +6549 ---> 6423 +6550 ---> 6424 +6553 ---> 6425 +6554 ---> 6426 +6555 ---> 6427 +6559 ---> 6428 +6563 ---> 6429 +6567 ---> 6430 +6568 ---> 6431 +6569 ---> 6432 +6570 ---> 6433 +6573 ---> 6434 +6574 ---> 6435 +6575 ---> 6436 +6580 ---> 6437 +6581 ---> 6438 +6583 ---> 6439 +6585 ---> 6440 +6588 ---> 6441 +6590 ---> 6442 +6591 ---> 6443 +6599 ---> 6444 +6600 ---> 6445 +6602 ---> 6446 +6604 ---> 6447 +6605 ---> 6448 +6607 ---> 6449 +6610 ---> 6450 +6615 ---> 6451 +6622 ---> 6452 +6623 ---> 6453 +6624 ---> 6454 +6625 ---> 6455 +6626 ---> 6456 +6632 ---> 6457 +6635 ---> 6458 +6640 ---> 6459 +6642 ---> 6460 +6644 ---> 6461 +6649 ---> 6462 +6650 ---> 6463 +6661 ---> 6464 +6667 ---> 6465 +6669 ---> 6466 +6670 ---> 6467 +6672 ---> 6468 +6675 ---> 6469 +6676 ---> 6470 +6677 ---> 6471 +6680 ---> 6472 +6681 ---> 6473 +6684 ---> 6474 +6688 ---> 6475 +6692 ---> 6476 +6695 ---> 6477 +6697 ---> 6478 +6698 ---> 6479 +6707 ---> 6480 +6710 ---> 6481 +6713 ---> 6482 +6714 ---> 6483 +6715 ---> 6484 +6716 ---> 6485 +6717 ---> 6486 +6718 ---> 6487 +6719 ---> 6488 +6720 ---> 6489 +6725 ---> 6490 +6727 ---> 6491 +6730 ---> 6492 +6732 ---> 6493 +6733 ---> 6494 +6734 ---> 6495 +6735 ---> 6496 +6736 ---> 6497 +6737 ---> 6498 +6738 ---> 6499 +6739 ---> 6500 +6744 ---> 6501 +6746 ---> 6502 +6750 ---> 6503 +6752 ---> 6504 +6755 ---> 6505 +6757 ---> 6506 +6758 ---> 6507 +6759 ---> 6508 +6760 ---> 6509 +6768 ---> 6510 +6771 ---> 6511 +6777 ---> 6512 +6778 ---> 6513 +6779 ---> 6514 +6784 ---> 6515 +6785 ---> 6516 +6787 ---> 6517 +6790 ---> 6518 +6792 ---> 6519 +6794 ---> 6520 +6795 ---> 6521 +6798 ---> 6522 +6802 ---> 6523 +6803 ---> 6524 +6804 ---> 6525 +6809 ---> 6526 +6814 ---> 6527 +6825 ---> 6528 +6826 ---> 6529 +6830 ---> 6530 +6834 ---> 6531 +6835 ---> 6532 +6838 ---> 6533 +6839 ---> 6534 +6841 ---> 6535 +6843 ---> 6536 +6844 ---> 6537 +6853 ---> 6538 +6854 ---> 6539 +6856 ---> 6540 +6857 ---> 6541 +6860 ---> 6542 +6862 ---> 6543 +6874 ---> 6544 +6875 ---> 6545 +6876 ---> 6546 +6877 ---> 6547 +6881 ---> 6548 +6884 ---> 6549 +6886 ---> 6550 +6893 ---> 6551 +6900 ---> 6552 +6901 ---> 6553 +6902 ---> 6554 +6904 ---> 6555 +6906 ---> 6556 +6912 ---> 6557 +6915 ---> 6558 +6916 ---> 6559 +6918 ---> 6560 +6920 ---> 6561 +6924 ---> 6562 +6925 ---> 6563 +6927 ---> 6564 +6930 ---> 6565 +6931 ---> 6566 +6934 ---> 6567 +6935 ---> 6568 +6936 ---> 6569 +6939 ---> 6570 +6940 ---> 6571 +6942 ---> 6572 +6950 ---> 6573 +6955 ---> 6574 +6957 ---> 6575 +6965 ---> 6576 +6977 ---> 6577 +6981 ---> 6578 +6982 ---> 6579 +6998 ---> 6580 +6999 ---> 6581 +7002 ---> 6582 +7003 ---> 6583 +7005 ---> 6584 +7008 ---> 6585 +7017 ---> 6586 +7030 ---> 6587 +7033 ---> 6588 +7034 ---> 6589 +7035 ---> 6590 +7036 ---> 6591 +7038 ---> 6592 +7039 ---> 6593 +7040 ---> 6594 +7042 ---> 6595 +7043 ---> 6596 +7044 ---> 6597 +7046 ---> 6598 +7047 ---> 6599 +7051 ---> 6600 +7053 ---> 6601 +7054 ---> 6602 +7055 ---> 6603 +7056 ---> 6604 +7057 ---> 6605 +7060 ---> 6606 +7061 ---> 6607 +7069 ---> 6608 +7072 ---> 6609 +7074 ---> 6610 +7078 ---> 6611 +7083 ---> 6612 +7086 ---> 6613 +7087 ---> 6614 +7088 ---> 6615 +7089 ---> 6616 +7090 ---> 6617 +7091 ---> 6618 +7092 ---> 6619 +7093 ---> 6620 +7094 ---> 6621 +7095 ---> 6622 +7097 ---> 6623 +7100 ---> 6624 +7103 ---> 6625 +7110 ---> 6626 +7113 ---> 6627 +7115 ---> 6628 +7124 ---> 6629 +7127 ---> 6630 +7128 ---> 6631 +7134 ---> 6632 +7135 ---> 6633 +7138 ---> 6634 +7141 ---> 6635 +7143 ---> 6636 +7144 ---> 6637 +7146 ---> 6638 +7147 ---> 6639 +7150 ---> 6640 +7151 ---> 6641 +7154 ---> 6642 +7160 ---> 6643 +7161 ---> 6644 +7163 ---> 6645 +7167 ---> 6646 +7168 ---> 6647 +7171 ---> 6648 +7173 ---> 6649 +7184 ---> 6650 +7186 ---> 6651 +7190 ---> 6652 +7192 ---> 6653 +7195 ---> 6654 +7196 ---> 6655 +7197 ---> 6656 +7200 ---> 6657 +7203 ---> 6658 +7205 ---> 6659 +7210 ---> 6660 +7211 ---> 6661 +7215 ---> 6662 +7216 ---> 6663 +7217 ---> 6664 +7218 ---> 6665 +7219 ---> 6666 +7223 ---> 6667 +7224 ---> 6668 +7225 ---> 6669 +7226 ---> 6670 +7227 ---> 6671 +7228 ---> 6672 +7229 ---> 6673 +7230 ---> 6674 +7231 ---> 6675 +7234 ---> 6676 +7235 ---> 6677 +7236 ---> 6678 +7239 ---> 6679 +7240 ---> 6680 +7243 ---> 6681 +7245 ---> 6682 +7247 ---> 6683 +7248 ---> 6684 +7251 ---> 6685 +7253 ---> 6686 +7254 ---> 6687 +7255 ---> 6688 +7256 ---> 6689 +7257 ---> 6690 +7259 ---> 6691 +7260 ---> 6692 +7263 ---> 6693 +7264 ---> 6694 +7266 ---> 6695 +7270 ---> 6696 +7272 ---> 6697 +7274 ---> 6698 +7275 ---> 6699 +7277 ---> 6700 +7282 ---> 6701 +7283 ---> 6702 +7290 ---> 6703 +7300 ---> 6704 +7301 ---> 6705 +7305 ---> 6706 +7313 ---> 6707 +7316 ---> 6708 +7321 ---> 6709 +7331 ---> 6710 +7333 ---> 6711 +7334 ---> 6712 +7343 ---> 6713 +7345 ---> 6714 +7346 ---> 6715 +7350 ---> 6716 +7351 ---> 6717 +7355 ---> 6718 +7358 ---> 6719 +7363 ---> 6720 +7369 ---> 6721 +7370 ---> 6722 +7371 ---> 6723 +7375 ---> 6724 +7376 ---> 6725 +7380 ---> 6726 +7381 ---> 6727 +7382 ---> 6728 +7386 ---> 6729 +7387 ---> 6730 +7389 ---> 6731 +7391 ---> 6732 +7394 ---> 6733 +7396 ---> 6734 +7398 ---> 6735 +7401 ---> 6736 +7408 ---> 6737 +7412 ---> 6738 +7413 ---> 6739 +7415 ---> 6740 +7421 ---> 6741 +7422 ---> 6742 +7424 ---> 6743 +7426 ---> 6744 +7434 ---> 6745 +7435 ---> 6746 +7442 ---> 6747 +7443 ---> 6748 +7447 ---> 6749 +7452 ---> 6750 +7453 ---> 6751 +7454 ---> 6752 +7455 ---> 6753 +7456 ---> 6754 +7457 ---> 6755 +7458 ---> 6756 +7459 ---> 6757 +7460 ---> 6758 +7461 ---> 6759 +7463 ---> 6760 +7465 ---> 6761 +7470 ---> 6762 +7478 ---> 6763 +7479 ---> 6764 +7480 ---> 6765 +7483 ---> 6766 +7487 ---> 6767 +7488 ---> 6768 +7489 ---> 6769 +7491 ---> 6770 +7493 ---> 6771 +7496 ---> 6772 +7497 ---> 6773 +7499 ---> 6774 +7508 ---> 6775 +7519 ---> 6776 +7525 ---> 6777 +7526 ---> 6778 +7527 ---> 6779 +7529 ---> 6780 +7535 ---> 6781 +7541 ---> 6782 +7542 ---> 6783 +7545 ---> 6784 +7546 ---> 6785 +7547 ---> 6786 +7548 ---> 6787 +7549 ---> 6788 +7550 ---> 6789 +7551 ---> 6790 +7556 ---> 6791 +7559 ---> 6792 +7564 ---> 6793 +7566 ---> 6794 +7567 ---> 6795 +7569 ---> 6796 +7572 ---> 6797 +7573 ---> 6798 +7577 ---> 6799 +7581 ---> 6800 +7592 ---> 6801 +7597 ---> 6802 +7598 ---> 6803 +7599 ---> 6804 +7607 ---> 6805 +7609 ---> 6806 +7613 ---> 6807 +7614 ---> 6808 +7618 ---> 6809 +7624 ---> 6810 +7625 ---> 6811 +7626 ---> 6812 +7635 ---> 6813 +7636 ---> 6814 +7641 ---> 6815 +7643 ---> 6816 +7645 ---> 6817 +7646 ---> 6818 +7649 ---> 6819 +7651 ---> 6820 +7653 ---> 6821 +7655 ---> 6822 +7660 ---> 6823 +7664 ---> 6824 +7665 ---> 6825 +7666 ---> 6826 +7669 ---> 6827 +7670 ---> 6828 +7671 ---> 6829 +7674 ---> 6830 +7678 ---> 6831 +7679 ---> 6832 +7680 ---> 6833 +7685 ---> 6834 +7687 ---> 6835 +7689 ---> 6836 +7690 ---> 6837 +7691 ---> 6838 +7692 ---> 6839 +7693 ---> 6840 +7694 ---> 6841 +7695 ---> 6842 +7696 ---> 6843 +7697 ---> 6844 +7702 ---> 6845 +7703 ---> 6846 +7704 ---> 6847 +7705 ---> 6848 +7707 ---> 6849 +7710 ---> 6850 +7711 ---> 6851 +7722 ---> 6852 +7723 ---> 6853 +7728 ---> 6854 +7729 ---> 6855 +7731 ---> 6856 +7738 ---> 6857 +7740 ---> 6858 +7744 ---> 6859 +7747 ---> 6860 +7750 ---> 6861 +7752 ---> 6862 +7753 ---> 6863 +7757 ---> 6865 +7761 ---> 6866 +7762 ---> 6867 +7763 ---> 6868 +7765 ---> 6869 +7767 ---> 6870 +7771 ---> 6871 +7774 ---> 6872 +7780 ---> 6873 +7785 ---> 6874 +7792 ---> 6875 +7793 ---> 6876 +7797 ---> 6877 +7801 ---> 6878 +7807 ---> 6879 +7812 ---> 6880 +7815 ---> 6881 +7822 ---> 6882 +7824 ---> 6883 +7825 ---> 6884 +7829 ---> 6885 +7830 ---> 6886 +7831 ---> 6887 +7833 ---> 6888 +7834 ---> 6889 +7841 ---> 6890 +7843 ---> 6891 +7844 ---> 6892 +7845 ---> 6893 +7846 ---> 6894 +7859 ---> 6895 +7860 ---> 6896 +7861 ---> 6897 +7862 ---> 6898 +7863 ---> 6899 +7868 ---> 6900 +7871 ---> 6901 +7877 ---> 6902 +7878 ---> 6903 +7879 ---> 6904 +7880 ---> 6905 +7881 ---> 6906 +7892 ---> 6907 +7893 ---> 6908 +7894 ---> 6909 +7896 ---> 6910 +7899 ---> 6911 +7902 ---> 6912 +7903 ---> 6913 +7906 ---> 6914 +7907 ---> 6915 +7914 ---> 6916 +7916 ---> 6917 +7919 ---> 6918 +7932 ---> 6919 +7941 ---> 6920 +7952 ---> 6921 +7954 ---> 6922 +7955 ---> 6923 +7957 ---> 6924 +7960 ---> 6925 +7961 ---> 6926 +7962 ---> 6927 +7963 ---> 6929 +7969 ---> 6930 +7977 ---> 6931 +7984 ---> 6932 +7986 ---> 6933 +7987 ---> 6934 +7992 ---> 6935 +7994 ---> 6936 +8000 ---> 6937 +8002 ---> 6938 +8005 ---> 6939 +8013 ---> 6940 +8016 ---> 6941 +8027 ---> 6942 +8030 ---> 6943 +8034 ---> 6944 +8045 ---> 6945 +8050 ---> 6946 +8053 ---> 6947 +8054 ---> 6948 +8059 ---> 6949 +8061 ---> 6950 +8065 ---> 6951 +8066 ---> 6952 +8067 ---> 6953 +8071 ---> 6954 +8077 ---> 6955 +8079 ---> 6956 +8082 ---> 6957 +8084 ---> 6958 +8089 ---> 6959 +8091 ---> 6960 +8092 ---> 6961 +8093 ---> 6962 +8094 ---> 6963 +8095 ---> 6964 +8102 ---> 6965 +8103 ---> 6966 +8104 ---> 6967 +8105 ---> 6968 +8112 ---> 6969 +8116 ---> 6970 +8117 ---> 6971 +8118 ---> 6972 +8119 ---> 6973 +8126 ---> 6974 +8130 ---> 6975 +8133 ---> 6976 +8139 ---> 6977 +8141 ---> 6978 +8143 ---> 6979 +8148 ---> 6980 +8150 ---> 6981 +8152 ---> 6982 +8153 ---> 6983 +8154 ---> 6984 +8155 ---> 6985 +8156 ---> 6986 +8157 ---> 6987 +8158 ---> 6988 +8159 ---> 6989 +8160 ---> 6990 +8161 ---> 6991 +8163 ---> 6992 +8165 ---> 6993 +8167 ---> 6994 +8168 ---> 6995 +8169 ---> 6996 +8170 ---> 6997 +8171 ---> 6998 +8172 ---> 6999 +8173 ---> 7000 +8175 ---> 7001 +8177 ---> 7002 +8179 ---> 7003 +8181 ---> 7004 +8186 ---> 7005 +8188 ---> 7006 +8189 ---> 7007 +8190 ---> 7008 +8192 ---> 7009 +8193 ---> 7010 +8200 ---> 7011 +8201 ---> 7012 +8203 ---> 7013 +8204 ---> 7014 +8214 ---> 7015 +8217 ---> 7016 +8220 ---> 7017 +8221 ---> 7018 +8222 ---> 7019 +8223 ---> 7020 +8224 ---> 7021 +8225 ---> 7022 +8226 ---> 7023 +8228 ---> 7024 +8231 ---> 7025 +8232 ---> 7026 +8234 ---> 7027 +8236 ---> 7028 +8237 ---> 7029 +8238 ---> 7030 +8239 ---> 7031 +8243 ---> 7032 +8248 ---> 7033 +8255 ---> 7034 +8258 ---> 7035 +8261 ---> 7036 +8266 ---> 7037 +8267 ---> 7038 +8268 ---> 7039 +8277 ---> 7040 +8278 ---> 7041 +8279 ---> 7042 +8280 ---> 7043 +8285 ---> 7044 +8286 ---> 7045 +8287 ---> 7046 +8288 ---> 7047 +8289 ---> 7048 +8290 ---> 7049 +8300 ---> 7050 +8302 ---> 7051 +8304 ---> 7052 +8313 ---> 7053 +8316 ---> 7054 +8317 ---> 7055 +8321 ---> 7056 +8322 ---> 7057 +8323 ---> 7058 +8326 ---> 7059 +8328 ---> 7060 +8331 ---> 7061 +8341 ---> 7062 +8342 ---> 7063 +8348 ---> 7064 +8352 ---> 7065 +8353 ---> 7066 +8356 ---> 7067 +8358 ---> 7068 +8359 ---> 7069 +8360 ---> 7070 +8362 ---> 7071 +8363 ---> 7072 +8369 ---> 7073 +8383 ---> 7074 +8398 ---> 7075 +8403 ---> 7076 +8416 ---> 7077 +8418 ---> 7078 +8423 ---> 7079 +8436 ---> 7080 +8439 ---> 7081 +8440 ---> 7082 +8441 ---> 7083 +8457 ---> 7084 +8458 ---> 7085 +8459 ---> 7086 +8460 ---> 7087 +8462 ---> 7088 +8465 ---> 7089 +8469 ---> 7090 +8474 ---> 7091 +8477 ---> 7092 +8478 ---> 7093 +8480 ---> 7094 +8481 ---> 7095 +8487 ---> 7096 +8493 ---> 7097 +8495 ---> 7098 +8496 ---> 7099 +8501 ---> 7100 +8506 ---> 7101 +8516 ---> 7102 +8517 ---> 7103 +8518 ---> 7104 +8519 ---> 7105 +8521 ---> 7106 +8525 ---> 7107 +8533 ---> 7108 +8534 ---> 7109 +8535 ---> 7110 +8536 ---> 7111 +8538 ---> 7112 +8542 ---> 7113 +8548 ---> 7114 +8549 ---> 7115 +8550 ---> 7116 +8553 ---> 7117 +8554 ---> 7118 +8558 ---> 7119 +8565 ---> 7120 +8577 ---> 7121 +8586 ---> 7122 +8590 ---> 7123 +8595 ---> 7124 +8597 ---> 7125 +8599 ---> 7126 +8602 ---> 7127 +8606 ---> 7128 +8612 ---> 7129 +8616 ---> 7130 +8618 ---> 7131 +8622 ---> 7132 +8625 ---> 7133 +8626 ---> 7134 +8631 ---> 7135 +8634 ---> 7136 +8635 ---> 7137 +8639 ---> 7138 +8643 ---> 7139 +8647 ---> 7140 +8648 ---> 7141 +8654 ---> 7142 +8658 ---> 7143 +8660 ---> 7144 +8661 ---> 7145 +8663 ---> 7146 +8665 ---> 7147 +8669 ---> 7148 +8671 ---> 7149 +8679 ---> 7150 +8683 ---> 7151 +8684 ---> 7152 +8685 ---> 7153 +8689 ---> 7154 +8691 ---> 7155 +8694 ---> 7156 +8700 ---> 7157 +8702 ---> 7158 +8705 ---> 7159 +8708 ---> 7160 +8717 ---> 7161 +8718 ---> 7162 +8721 ---> 7163 +8726 ---> 7164 +8730 ---> 7165 +8732 ---> 7166 +8733 ---> 7167 +8735 ---> 7168 +8736 ---> 7169 +8742 ---> 7170 +8746 ---> 7171 +8748 ---> 7172 +8749 ---> 7173 +8752 ---> 7174 +8756 ---> 7175 +8758 ---> 7176 +8760 ---> 7177 +8761 ---> 7178 +8762 ---> 7179 +8763 ---> 7180 +8764 ---> 7181 +8770 ---> 7182 +8772 ---> 7183 +8775 ---> 7184 +8776 ---> 7185 +8779 ---> 7186 +8782 ---> 7187 +8790 ---> 7188 +8792 ---> 7189 +8794 ---> 7190 +8795 ---> 7191 +8797 ---> 7192 +8801 ---> 7193 +8812 ---> 7194 +8815 ---> 7195 +8816 ---> 7196 +8817 ---> 7197 +8819 ---> 7198 +8824 ---> 7199 +8828 ---> 7200 +8837 ---> 7201 +8838 ---> 7202 +8839 ---> 7203 +8844 ---> 7204 +8845 ---> 7205 +8847 ---> 7206 +8857 ---> 7207 +8860 ---> 7208 +8872 ---> 7209 +8873 ---> 7210 +8877 ---> 7211 +8878 ---> 7212 +8883 ---> 7213 +8884 ---> 7214 +8885 ---> 7215 +8887 ---> 7216 +8891 ---> 7217 +8893 ---> 7218 +8894 ---> 7219 +8895 ---> 7220 +8896 ---> 7221 +8898 ---> 7222 +8902 ---> 7223 +8903 ---> 7224 +8906 ---> 7225 +8919 ---> 7226 +8920 ---> 7227 +8921 ---> 7228 +8922 ---> 7229 +8924 ---> 7230 +8927 ---> 7231 +8932 ---> 7232 +8937 ---> 7233 +8943 ---> 7234 +8945 ---> 7235 +8948 ---> 7236 +8958 ---> 7237 +8959 ---> 7238 +8960 ---> 7239 +8965 ---> 7240 +8966 ---> 7241 +8967 ---> 7242 +8974 ---> 7243 +8980 ---> 7244 +8983 ---> 7245 +8988 ---> 7246 +8989 ---> 7247 +8990 ---> 7248 +8995 ---> 7249 +8999 ---> 7250 +9003 ---> 7251 +9007 ---> 7252 +9011 ---> 7253 +9014 ---> 7254 +9015 ---> 7255 +9016 ---> 7256 +9017 ---> 7257 +9018 ---> 7258 +9019 ---> 7259 +9026 ---> 7260 +9030 ---> 7261 +9031 ---> 7262 +9032 ---> 7263 +9033 ---> 7264 +9036 ---> 7265 +9037 ---> 7266 +9038 ---> 7267 +9039 ---> 7268 +9040 ---> 7269 +9041 ---> 7270 +9042 ---> 7271 +9045 ---> 7272 +9047 ---> 7273 +9051 ---> 7274 +9053 ---> 7275 +9055 ---> 7276 +9057 ---> 7277 +9064 ---> 7278 +9066 ---> 7279 +9067 ---> 7280 +9068 ---> 7281 +9069 ---> 7282 +9080 ---> 7283 +9087 ---> 7284 +9088 ---> 7285 +9089 ---> 7286 +9093 ---> 7287 +9094 ---> 7288 +9097 ---> 7289 +9098 ---> 7290 +9105 ---> 7291 +9107 ---> 7292 +9108 ---> 7293 +9109 ---> 7294 +9110 ---> 7295 +9118 ---> 7296 +9128 ---> 7297 +9144 ---> 7298 +9145 ---> 7299 +9146 ---> 7300 +9147 ---> 7301 +9148 ---> 7302 +9158 ---> 7303 +9159 ---> 7304 +9161 ---> 7305 +9166 ---> 7306 +9167 ---> 7307 +9168 ---> 7308 +9176 ---> 7309 +9177 ---> 7310 +9178 ---> 7311 +9179 ---> 7312 +9180 ---> 7313 +9185 ---> 7314 +9193 ---> 7315 +9201 ---> 7316 +9204 ---> 7317 +9208 ---> 7318 +9210 ---> 7319 +9214 ---> 7320 +9215 ---> 7321 +9218 ---> 7322 +9219 ---> 7323 +9220 ---> 7324 +9221 ---> 7325 +9223 ---> 7326 +9225 ---> 7327 +9226 ---> 7328 +9227 ---> 7329 +9237 ---> 7330 +9250 ---> 7331 +9253 ---> 7332 +9257 ---> 7333 +9260 ---> 7334 +9265 ---> 7335 +9272 ---> 7336 +9273 ---> 7337 +9277 ---> 7338 +9282 ---> 7339 +9285 ---> 7340 +9287 ---> 7341 +9288 ---> 7342 +9289 ---> 7343 +9292 ---> 7344 +9301 ---> 7345 +9306 ---> 7346 +9308 ---> 7347 +9309 ---> 7348 +9311 ---> 7349 +9312 ---> 7350 +9314 ---> 7351 +9317 ---> 7352 +9321 ---> 7353 +9332 ---> 7354 +9333 ---> 7355 +9334 ---> 7356 +9344 ---> 7357 +9345 ---> 7358 +9349 ---> 7359 +9353 ---> 7360 +9357 ---> 7361 +9362 ---> 7362 +9370 ---> 7363 +9373 ---> 7364 +9374 ---> 7365 +9378 ---> 7366 +9388 ---> 7367 +9393 ---> 7368 +9397 ---> 7369 +9401 ---> 7370 +9414 ---> 7371 +9419 ---> 7372 +9422 ---> 7373 +9435 ---> 7374 +9439 ---> 7375 +9440 ---> 7376 +9442 ---> 7377 +9447 ---> 7378 +9449 ---> 7379 +9452 ---> 7380 +9453 ---> 7381 +9457 ---> 7382 +9458 ---> 7383 +9459 ---> 7384 +9460 ---> 7385 +9461 ---> 7386 +9462 ---> 7387 +9464 ---> 7388 +9465 ---> 7389 +9466 ---> 7390 +9467 ---> 7391 +9468 ---> 7392 +9469 ---> 7393 +9474 ---> 7394 +9477 ---> 7395 +9480 ---> 7396 +9481 ---> 7397 +9484 ---> 7398 +9486 ---> 7399 +9488 ---> 7400 +9492 ---> 7401 +9494 ---> 7402 +9503 ---> 7403 +9517 ---> 7404 +9518 ---> 7405 +9520 ---> 7406 +9521 ---> 7407 +9526 ---> 7408 +9527 ---> 7409 +9528 ---> 7410 +9529 ---> 7411 +9530 ---> 7412 +9531 ---> 7413 +9532 ---> 7414 +9533 ---> 7415 +9534 ---> 7416 +9535 ---> 7417 +9536 ---> 7418 +9538 ---> 7419 +9545 ---> 7420 +9547 ---> 7421 +9550 ---> 7422 +9552 ---> 7423 +9553 ---> 7424 +9554 ---> 7425 +9555 ---> 7426 +9556 ---> 7427 +9558 ---> 7428 +9559 ---> 7429 +9565 ---> 7430 +9568 ---> 7431 +9569 ---> 7432 +9570 ---> 7433 +9576 ---> 7434 +9577 ---> 7435 +9578 ---> 7436 +9581 ---> 7437 +9585 ---> 7438 +9591 ---> 7439 +9592 ---> 7440 +9594 ---> 7441 +9595 ---> 7442 +9596 ---> 7443 +9597 ---> 7444 +9604 ---> 7445 +9606 ---> 7446 +9612 ---> 7447 +9614 ---> 7448 +9616 ---> 7449 +9617 ---> 7450 +9623 ---> 7451 +9624 ---> 7452 +9626 ---> 7453 +9630 ---> 7454 +9631 ---> 7455 +9632 ---> 7456 +9633 ---> 7457 +9635 ---> 7458 +9638 ---> 7459 +9641 ---> 7460 +9647 ---> 7461 +9648 ---> 7462 +9651 ---> 7463 +9659 ---> 7464 +9662 ---> 7465 +9668 ---> 7466 +9673 ---> 7467 +9674 ---> 7468 +9675 ---> 7469 +9680 ---> 7470 +9687 ---> 7471 +9689 ---> 7472 +9691 ---> 7473 +9692 ---> 7474 +9694 ---> 7475 +9696 ---> 7476 +9698 ---> 7477 +9699 ---> 7478 +9700 ---> 7479 +9701 ---> 7480 +9705 ---> 7481 +9706 ---> 7482 +9707 ---> 7483 +9709 ---> 7484 +9711 ---> 7485 +9715 ---> 7486 +9719 ---> 7487 +9722 ---> 7488 +9730 ---> 7489 +9733 ---> 7490 +9734 ---> 7491 +9735 ---> 7492 +9739 ---> 7493 +9740 ---> 7494 +9745 ---> 7495 +9746 ---> 7496 +9747 ---> 7497 +9750 ---> 7498 +9751 ---> 7499 +9757 ---> 7500 +9760 ---> 7501 +9761 ---> 7502 +9762 ---> 7503 +9764 ---> 7504 +9765 ---> 7505 +9776 ---> 7506 +9780 ---> 7507 +9793 ---> 7508 +9805 ---> 7509 +9806 ---> 7510 +9807 ---> 7511 +9818 ---> 7512 +9822 ---> 7513 +9826 ---> 7514 +9827 ---> 7515 +9832 ---> 7516 +9839 ---> 7517 +9847 ---> 7518 +9848 ---> 7519 +9850 ---> 7520 +9851 ---> 7521 +9854 ---> 7522 +9856 ---> 7523 +9858 ---> 7524 +9860 ---> 7525 +9872 ---> 7526 +9875 ---> 7527 +9879 ---> 7528 +9880 ---> 7529 +9881 ---> 7530 +9884 ---> 7531 +9885 ---> 7532 +9888 ---> 7533 +9891 ---> 7534 +9898 ---> 7535 +9901 ---> 7536 +9902 ---> 7537 +9903 ---> 7538 +9904 ---> 7539 +9905 ---> 7540 +9908 ---> 7541 +9910 ---> 7542 +9912 ---> 7543 +9913 ---> 7544 +9914 ---> 7545 +9918 ---> 7546 +9919 ---> 7547 +9932 ---> 7548 +9935 ---> 7549 +9936 ---> 7550 +9937 ---> 7551 +9938 ---> 7552 +9939 ---> 7553 +9944 ---> 7554 +9945 ---> 7555 +9946 ---> 7556 +9948 ---> 7557 +9953 ---> 7558 +9958 ---> 7559 +9960 ---> 7560 +9963 ---> 7561 +9967 ---> 7562 +9968 ---> 7563 +9969 ---> 7564 +9970 ---> 7565 +9976 ---> 7566 +9981 ---> 7567 +9983 ---> 7568 +9984 ---> 7569 +10001 ---> 7570 +10003 ---> 7571 +10004 ---> 7572 +10007 ---> 7573 +10012 ---> 7574 +10015 ---> 7575 +10019 ---> 7576 +10022 ---> 7577 +10025 ---> 7578 +10027 ---> 7579 +10031 ---> 7580 +10033 ---> 7581 +10035 ---> 7582 +10037 ---> 7583 +10042 ---> 7584 +10046 ---> 7585 +10047 ---> 7586 +10048 ---> 7587 +10049 ---> 7588 +10050 ---> 7589 +10051 ---> 7590 +10052 ---> 7591 +10056 ---> 7592 +10059 ---> 7593 +10062 ---> 7594 +10069 ---> 7595 +10070 ---> 7596 +10076 ---> 7597 +10077 ---> 7598 +10080 ---> 7599 +10082 ---> 7600 +10088 ---> 7601 +10089 ---> 7602 +10091 ---> 7603 +10093 ---> 7604 +10094 ---> 7605 +10097 ---> 7606 +10098 ---> 7607 +10099 ---> 7608 +10100 ---> 7609 +10102 ---> 7610 +10106 ---> 7611 +10107 ---> 7612 +10108 ---> 7613 +10109 ---> 7614 +10111 ---> 7615 +10115 ---> 7616 +10122 ---> 7617 +10123 ---> 7618 +10127 ---> 7619 +10131 ---> 7620 +10133 ---> 7621 +10135 ---> 7622 +10137 ---> 7623 +10139 ---> 7624 +10141 ---> 7625 +10148 ---> 7626 +10161 ---> 7627 +10165 ---> 7628 +10170 ---> 7629 +10181 ---> 7630 +10183 ---> 7631 +10185 ---> 7632 +10187 ---> 7633 +10191 ---> 7634 +10197 ---> 7635 +10199 ---> 7636 +10204 ---> 7637 +10207 ---> 7638 +10209 ---> 7639 +10222 ---> 7640 +10225 ---> 7641 +10233 ---> 7642 +10234 ---> 7643 +10247 ---> 7644 +10252 ---> 7645 +10258 ---> 7646 +10261 ---> 7647 +10265 ---> 7648 +10276 ---> 7649 +10279 ---> 7650 +10282 ---> 7651 +10285 ---> 7652 +10287 ---> 7653 +10288 ---> 7654 +10289 ---> 7655 +10290 ---> 7656 +10292 ---> 7657 +10293 ---> 7658 +10294 ---> 7659 +10297 ---> 7660 +10298 ---> 7661 +10299 ---> 7662 +10300 ---> 7663 +10305 ---> 7664 +10308 ---> 7665 +10311 ---> 7666 +10312 ---> 7667 +10314 ---> 7668 +10316 ---> 7669 +10318 ---> 7670 +10320 ---> 7671 +10324 ---> 7672 +10329 ---> 7673 +10333 ---> 7674 +10334 ---> 7675 +10337 ---> 7676 +10338 ---> 7677 +10344 ---> 7678 +10347 ---> 7679 +10349 ---> 7680 +10351 ---> 7681 +10353 ---> 7682 +10356 ---> 7683 +10358 ---> 7684 +10359 ---> 7685 +10360 ---> 7686 +10361 ---> 7687 +10362 ---> 7688 +10368 ---> 7689 +10369 ---> 7690 +10373 ---> 7691 +10377 ---> 7692 +10379 ---> 7693 +10380 ---> 7694 +10382 ---> 7695 +10385 ---> 7696 +10386 ---> 7697 +10388 ---> 7698 +10389 ---> 7699 +10390 ---> 7700 +10392 ---> 7701 +10393 ---> 7702 +10396 ---> 7703 +10403 ---> 7704 +10405 ---> 7705 +10418 ---> 7706 +10419 ---> 7707 +10420 ---> 7708 +10421 ---> 7709 +10422 ---> 7710 +10423 ---> 7711 +10424 ---> 7712 +10425 ---> 7713 +10427 ---> 7714 +10441 ---> 7715 +10442 ---> 7716 +10443 ---> 7717 +10447 ---> 7718 +10448 ---> 7719 +10449 ---> 7720 +10452 ---> 7721 +10454 ---> 7722 +10456 ---> 7723 +10458 ---> 7724 +10461 ---> 7725 +10464 ---> 7726 +10474 ---> 7727 +10481 ---> 7728 +10487 ---> 7729 +10492 ---> 7730 +10494 ---> 7731 +10495 ---> 7732 +10500 ---> 7733 +10504 ---> 7734 +10508 ---> 7735 +10514 ---> 7736 +10520 ---> 7737 +10521 ---> 7738 +10523 ---> 7739 +10524 ---> 7740 +10526 ---> 7741 +10528 ---> 7742 +10529 ---> 7743 +10531 ---> 7744 +10543 ---> 7745 +10545 ---> 7746 +10549 ---> 7747 +10555 ---> 7748 +10556 ---> 7749 +10557 ---> 7750 +10560 ---> 7751 +10561 ---> 7752 +10563 ---> 7753 +10568 ---> 7754 +10570 ---> 7755 +10585 ---> 7756 +10586 ---> 7757 +10590 ---> 7758 +10595 ---> 7759 +10597 ---> 7760 +10599 ---> 7761 +10600 ---> 7762 +10603 ---> 7763 +10605 ---> 7764 +10607 ---> 7765 +10608 ---> 7766 +10612 ---> 7767 +10616 ---> 7768 +10618 ---> 7769 +10620 ---> 7770 +10621 ---> 7771 +10622 ---> 7772 +10623 ---> 7773 +10624 ---> 7774 +10630 ---> 7775 +10635 ---> 7776 +10636 ---> 7777 +10642 ---> 7778 +10643 ---> 7779 +10644 ---> 7780 +10646 ---> 7781 +10647 ---> 7782 +10651 ---> 7783 +10654 ---> 7784 +10657 ---> 7785 +10658 ---> 7786 +10659 ---> 7787 +10660 ---> 7788 +10661 ---> 7789 +10665 ---> 7790 +10666 ---> 7791 +10673 ---> 7792 +10675 ---> 7793 +10677 ---> 7794 +10680 ---> 7795 +10684 ---> 7796 +10687 ---> 7797 +10690 ---> 7798 +10693 ---> 7799 +10694 ---> 7800 +10701 ---> 7801 +10703 ---> 7802 +10705 ---> 7803 +10707 ---> 7804 +10708 ---> 7805 +10709 ---> 7806 +10710 ---> 7807 +10712 ---> 7808 +10713 ---> 7809 +10714 ---> 7810 +10716 ---> 7811 +10717 ---> 7812 +10722 ---> 7813 +10729 ---> 7814 +10731 ---> 7815 +10732 ---> 7816 +10733 ---> 7817 +10734 ---> 7818 +10735 ---> 7819 +10737 ---> 7820 +10751 ---> 7821 +10753 ---> 7822 +10762 ---> 7823 +10763 ---> 7824 +10765 ---> 7825 +10766 ---> 7826 +10767 ---> 7827 +10769 ---> 7828 +10770 ---> 7829 +10774 ---> 7830 +10780 ---> 7831 +10785 ---> 7832 +10790 ---> 7833 +10792 ---> 7834 +10793 ---> 7835 +10796 ---> 7836 +10800 ---> 7837 +10802 ---> 7838 +10803 ---> 7839 +10809 ---> 7840 +10822 ---> 7841 +10826 ---> 7842 +10832 ---> 7843 +10836 ---> 7844 +10843 ---> 7845 +10845 ---> 7846 +10847 ---> 7847 +10848 ---> 7848 +10849 ---> 7849 +10854 ---> 7850 +10857 ---> 7851 +10858 ---> 7852 +10868 ---> 7853 +10870 ---> 7854 +10872 ---> 7855 +10873 ---> 7856 +10874 ---> 7857 +10883 ---> 7858 +10890 ---> 7859 +10895 ---> 7860 +10897 ---> 7861 +10898 ---> 7862 +10900 ---> 7863 +10915 ---> 7864 +10918 ---> 7865 +10920 ---> 7866 +10928 ---> 7867 +10931 ---> 7868 +10934 ---> 7869 +10940 ---> 7870 +10942 ---> 7871 +10944 ---> 7872 +10954 ---> 7873 +10960 ---> 7874 +10968 ---> 7875 +10970 ---> 7876 +10971 ---> 7877 +10974 ---> 7878 +10978 ---> 7879 +10980 ---> 7880 +10982 ---> 7881 +10984 ---> 7882 +10986 ---> 7883 +10991 ---> 7884 +10994 ---> 7885 +10997 ---> 7886 +10998 ---> 7887 +10999 ---> 7888 +11000 ---> 7889 +11002 ---> 7890 +11005 ---> 7891 +11006 ---> 7892 +11009 ---> 7893 +11012 ---> 7894 +11017 ---> 7895 +11018 ---> 7896 +11030 ---> 7897 +11041 ---> 7898 +11043 ---> 7899 +11048 ---> 7900 +11057 ---> 7901 +11058 ---> 7902 +11060 ---> 7903 +11061 ---> 7904 +11069 ---> 7905 +11076 ---> 7906 +11078 ---> 7907 +11079 ---> 7908 +11082 ---> 7909 +11084 ---> 7910 +11088 ---> 7911 +11089 ---> 7912 +11090 ---> 7913 +11094 ---> 7914 +11101 ---> 7915 +11102 ---> 7916 +11105 ---> 7917 +11106 ---> 7918 +11111 ---> 7919 +11112 ---> 7920 +11113 ---> 7921 +11114 ---> 7922 +11119 ---> 7923 +11121 ---> 7924 +11122 ---> 7925 +11123 ---> 7926 +11126 ---> 7927 +11128 ---> 7928 +11137 ---> 7929 +11139 ---> 7930 +11141 ---> 7931 +11142 ---> 7932 +11150 ---> 7933 +11154 ---> 7934 +11156 ---> 7935 +11159 ---> 7936 +11162 ---> 7937 +11168 ---> 7938 +11170 ---> 7939 +11171 ---> 7940 +11173 ---> 7941 +11174 ---> 7942 +11175 ---> 7943 +11177 ---> 7944 +11179 ---> 7945 +11181 ---> 7946 +11184 ---> 7947 +11189 ---> 7948 +11199 ---> 7949 +11200 ---> 7950 +11201 ---> 7951 +11211 ---> 7952 +11223 ---> 7953 +11225 ---> 7954 +11228 ---> 7955 +11232 ---> 7956 +11236 ---> 7957 +11241 ---> 7958 +11246 ---> 7959 +11248 ---> 7960 +11256 ---> 7961 +11263 ---> 7962 +11265 ---> 7963 +11270 ---> 7964 +11273 ---> 7965 +11274 ---> 7966 +11276 ---> 7967 +11279 ---> 7968 +11282 ---> 7969 +11284 ---> 7970 +11286 ---> 7971 +11288 ---> 7972 +11292 ---> 7973 +11293 ---> 7974 +11298 ---> 7975 +11299 ---> 7976 +11301 ---> 7977 +11302 ---> 7978 +11305 ---> 7979 +11306 ---> 7980 +11308 ---> 7981 +11311 ---> 7982 +11313 ---> 7983 +11318 ---> 7984 +11319 ---> 7985 +11321 ---> 7986 +11324 ---> 7987 +11330 ---> 7988 +11332 ---> 7989 +11334 ---> 7990 +11338 ---> 7991 +11339 ---> 7992 +11343 ---> 7993 +11344 ---> 7994 +11348 ---> 7995 +11349 ---> 7996 +11352 ---> 7997 +11353 ---> 7998 +11356 ---> 7999 +11357 ---> 8000 +11363 ---> 8001 +11365 ---> 8002 +11371 ---> 8003 +11373 ---> 8004 +11374 ---> 8005 +11378 ---> 8006 +11381 ---> 8007 +11383 ---> 8008 +11386 ---> 8009 +11389 ---> 8010 +11390 ---> 8011 +11391 ---> 8012 +11396 ---> 8013 +11402 ---> 8014 +11404 ---> 8015 +11407 ---> 8016 +11408 ---> 8017 +11417 ---> 8018 +11424 ---> 8019 +11432 ---> 8020 +11434 ---> 8021 +11438 ---> 8022 +11440 ---> 8023 +11442 ---> 8024 +11446 ---> 8025 +11447 ---> 8026 +11450 ---> 8027 +11452 ---> 8028 +11453 ---> 8029 +11458 ---> 8030 +11460 ---> 8031 +11461 ---> 8032 +11463 ---> 8033 +11469 ---> 8034 +11471 ---> 8035 +11472 ---> 8036 +11473 ---> 8037 +11474 ---> 8038 +11475 ---> 8039 +11476 ---> 8040 +11487 ---> 8041 +11490 ---> 8042 +11491 ---> 8043 +11494 ---> 8044 +11498 ---> 8045 +11499 ---> 8046 +11501 ---> 8047 +11502 ---> 8048 +11503 ---> 8049 +11504 ---> 8050 +11508 ---> 8051 +11509 ---> 8052 +11510 ---> 8053 +11511 ---> 8054 +11512 ---> 8055 +11513 ---> 8056 +11514 ---> 8057 +11515 ---> 8058 +11516 ---> 8059 +11517 ---> 8060 +11518 ---> 8061 +11519 ---> 8062 +11520 ---> 8063 +11524 ---> 8064 +11525 ---> 8065 +11533 ---> 8066 +11534 ---> 8067 +11537 ---> 8068 +11539 ---> 8069 +11540 ---> 8070 +11543 ---> 8071 +11545 ---> 8072 +11548 ---> 8073 +11550 ---> 8074 +11551 ---> 8075 +11552 ---> 8076 +11553 ---> 8077 +11554 ---> 8078 +11555 ---> 8079 +11556 ---> 8080 +11557 ---> 8081 +11559 ---> 8082 +11560 ---> 8083 +11561 ---> 8084 +11562 ---> 8085 +11563 ---> 8086 +11564 ---> 8087 +11565 ---> 8088 +11566 ---> 8089 +11567 ---> 8090 +11572 ---> 8091 +11574 ---> 8092 +11576 ---> 8093 +11578 ---> 8094 +11580 ---> 8095 +11581 ---> 8096 +11585 ---> 8097 +11586 ---> 8098 +11588 ---> 8099 +11590 ---> 8100 +11592 ---> 8101 +11599 ---> 8102 +11601 ---> 8103 +11603 ---> 8104 +11604 ---> 8105 +11605 ---> 8106 +11606 ---> 8107 +11607 ---> 8108 +11608 ---> 8109 +11609 ---> 8110 +11611 ---> 8111 +11614 ---> 8112 +11615 ---> 8113 +11619 ---> 8114 +11621 ---> 8115 +11632 ---> 8116 +11633 ---> 8117 +11634 ---> 8118 +11640 ---> 8119 +11642 ---> 8120 +11646 ---> 8121 +11647 ---> 8122 +11648 ---> 8123 +11652 ---> 8124 +11653 ---> 8125 +11654 ---> 8126 +11655 ---> 8127 +11656 ---> 8128 +11657 ---> 8129 +11659 ---> 8130 +11661 ---> 8131 +11663 ---> 8132 +11664 ---> 8133 +11665 ---> 8134 +11678 ---> 8135 +11679 ---> 8136 +11681 ---> 8137 +11682 ---> 8138 +11683 ---> 8139 +11686 ---> 8140 +11687 ---> 8141 +11689 ---> 8142 +11691 ---> 8143 +11692 ---> 8144 +11695 ---> 8145 +11702 ---> 8146 +11704 ---> 8147 +11707 ---> 8148 +11712 ---> 8149 +11715 ---> 8150 +11716 ---> 8151 +11717 ---> 8152 +11723 ---> 8153 +11725 ---> 8154 +11729 ---> 8155 +11733 ---> 8156 +11734 ---> 8157 +11737 ---> 8158 +11754 ---> 8159 +11755 ---> 8160 +11756 ---> 8161 +11758 ---> 8162 +11760 ---> 8163 +11761 ---> 8164 +11763 ---> 8165 +11764 ---> 8166 +11766 ---> 8167 +11768 ---> 8168 +11769 ---> 8169 +11771 ---> 8170 +11773 ---> 8171 +11779 ---> 8172 +11781 ---> 8173 +11782 ---> 8174 +11783 ---> 8175 +11784 ---> 8176 +11785 ---> 8177 +11789 ---> 8178 +11796 ---> 8179 +11799 ---> 8180 +11800 ---> 8181 +11804 ---> 8182 +11805 ---> 8183 +11808 ---> 8184 +11814 ---> 8185 +11816 ---> 8186 +11817 ---> 8187 +11820 ---> 8188 +11822 ---> 8189 +11824 ---> 8190 +11826 ---> 8191 +11827 ---> 8192 +11828 ---> 8193 +11830 ---> 8194 +11831 ---> 8195 +11833 ---> 8196 +11835 ---> 8197 +11836 ---> 8198 +11837 ---> 8199 +11838 ---> 8200 +11839 ---> 8201 +11840 ---> 8202 +11841 ---> 8203 +11842 ---> 8204 +11843 ---> 8205 +11844 ---> 8206 +11846 ---> 8207 +11847 ---> 8208 +11848 ---> 8209 +11849 ---> 8210 +11850 ---> 8211 +11851 ---> 8212 +11852 ---> 8213 +11856 ---> 8214 +11857 ---> 8215 +11861 ---> 8216 +11862 ---> 8217 +11866 ---> 8218 +11868 ---> 8219 +11869 ---> 8220 +11870 ---> 8221 +11874 ---> 8222 +11877 ---> 8223 +11879 ---> 8224 +11881 ---> 8225 +11885 ---> 8226 +11888 ---> 8227 +11890 ---> 8228 +11896 ---> 8229 +11906 ---> 8230 +11908 ---> 8231 +11914 ---> 8232 +11918 ---> 8233 +11921 ---> 8234 +11927 ---> 8235 +11928 ---> 8236 +11929 ---> 8237 +11931 ---> 8238 +11933 ---> 8239 +11934 ---> 8240 +11936 ---> 8241 +11939 ---> 8242 +11948 ---> 8243 +11952 ---> 8244 +11954 ---> 8245 +11958 ---> 8246 +11960 ---> 8247 +11961 ---> 8248 +11964 ---> 8249 +11965 ---> 8250 +11969 ---> 8251 +11970 ---> 8252 +11971 ---> 8253 +11976 ---> 8254 +11979 ---> 8255 +11981 ---> 8256 +11982 ---> 8257 +11983 ---> 8258 +11989 ---> 8259 +11991 ---> 8260 +11992 ---> 8261 +11993 ---> 8262 +11997 ---> 8263 +12007 ---> 8264 +12008 ---> 8265 +12009 ---> 8266 +12014 ---> 8267 +12015 ---> 8268 +12018 ---> 8269 +12028 ---> 8270 +12029 ---> 8271 +12031 ---> 8272 +12035 ---> 8273 +12037 ---> 8274 +12043 ---> 8275 +12048 ---> 8276 +12061 ---> 8277 +12062 ---> 8278 +12070 ---> 8279 +12073 ---> 8280 +12074 ---> 8281 +12075 ---> 8282 +12076 ---> 8283 +12077 ---> 8284 +12078 ---> 8285 +12080 ---> 8286 +12081 ---> 8287 +12086 ---> 8288 +12090 ---> 8289 +12093 ---> 8290 +12094 ---> 8291 +12098 ---> 8292 +12099 ---> 8293 +12101 ---> 8294 +12103 ---> 8295 +12110 ---> 8296 +12111 ---> 8297 +12112 ---> 8298 +12118 ---> 8299 +12120 ---> 8300 +12121 ---> 8301 +12126 ---> 8302 +12127 ---> 8303 +12128 ---> 8304 +12129 ---> 8305 +12131 ---> 8306 +12134 ---> 8307 +12135 ---> 8308 +12137 ---> 8309 +12141 ---> 8310 +12143 ---> 8311 +12146 ---> 8312 +12147 ---> 8313 +12149 ---> 8314 +12151 ---> 8315 +12152 ---> 8316 +12153 ---> 8317 +12154 ---> 8318 +12159 ---> 8319 +12166 ---> 8320 +12169 ---> 8321 +12170 ---> 8322 +12171 ---> 8323 +12174 ---> 8324 +12176 ---> 8325 +12178 ---> 8326 +12182 ---> 8327 +12183 ---> 8328 +12190 ---> 8329 +12192 ---> 8330 +12197 ---> 8331 +12199 ---> 8332 +12202 ---> 8333 +12204 ---> 8334 +12205 ---> 8335 +12207 ---> 8336 +12211 ---> 8337 +12217 ---> 8338 +12218 ---> 8339 +12219 ---> 8340 +12224 ---> 8341 +12230 ---> 8342 +12233 ---> 8343 +12246 ---> 8344 +12247 ---> 8345 +12252 ---> 8346 +12261 ---> 8347 +12262 ---> 8348 +12264 ---> 8349 +12266 ---> 8350 +12268 ---> 8351 +12271 ---> 8352 +12275 ---> 8353 +12276 ---> 8354 +12283 ---> 8355 +12286 ---> 8356 +12289 ---> 8357 +12290 ---> 8358 +12293 ---> 8359 +12301 ---> 8360 +12302 ---> 8361 +12303 ---> 8362 +12306 ---> 8363 +12308 ---> 8364 +12312 ---> 8365 +12315 ---> 8366 +12317 ---> 8367 +12327 ---> 8368 +12332 ---> 8369 +12336 ---> 8370 +12337 ---> 8371 +12340 ---> 8372 +12341 ---> 8373 +12347 ---> 8374 +12354 ---> 8375 +12355 ---> 8376 +12357 ---> 8377 +12361 ---> 8378 +12370 ---> 8379 +12383 ---> 8380 +12386 ---> 8381 +12388 ---> 8382 +12391 ---> 8383 +12392 ---> 8384 +12393 ---> 8385 +12394 ---> 8386 +12398 ---> 8387 +12407 ---> 8388 +12410 ---> 8389 +12415 ---> 8390 +12421 ---> 8391 +12426 ---> 8392 +12438 ---> 8393 +12442 ---> 8394 +12443 ---> 8395 +12444 ---> 8396 +12445 ---> 8397 +12446 ---> 8398 +12447 ---> 8399 +12448 ---> 8400 +12449 ---> 8401 +12451 ---> 8402 +12454 ---> 8403 +12455 ---> 8404 +12459 ---> 8405 +12461 ---> 8406 +12462 ---> 8407 +12463 ---> 8408 +12464 ---> 8409 +12465 ---> 8410 +12466 ---> 8411 +12467 ---> 8412 +12468 ---> 8413 +12469 ---> 8414 +12470 ---> 8415 +12471 ---> 8416 +12472 ---> 8417 +12477 ---> 8418 +12479 ---> 8419 +12480 ---> 8420 +12488 ---> 8421 +12490 ---> 8422 +12491 ---> 8423 +12492 ---> 8424 +12493 ---> 8425 +12494 ---> 8426 +12495 ---> 8427 +12499 ---> 8428 +12503 ---> 8429 +12506 ---> 8430 +12507 ---> 8431 +12508 ---> 8432 +12509 ---> 8433 +12510 ---> 8434 +12511 ---> 8435 +12512 ---> 8436 +12513 ---> 8437 +12514 ---> 8438 +12515 ---> 8439 +12516 ---> 8440 +12517 ---> 8441 +12518 ---> 8442 +12519 ---> 8443 +12520 ---> 8444 +12521 ---> 8445 +12522 ---> 8446 +12523 ---> 8447 +12524 ---> 8448 +12529 ---> 8449 +12545 ---> 8450 +12546 ---> 8451 +12547 ---> 8452 +12548 ---> 8453 +12549 ---> 8454 +12560 ---> 8455 +12565 ---> 8456 +12567 ---> 8457 +12571 ---> 8458 +12574 ---> 8459 +12582 ---> 8460 +12586 ---> 8461 +12591 ---> 8462 +12592 ---> 8463 +12594 ---> 8464 +12595 ---> 8465 +12596 ---> 8466 +12598 ---> 8467 +12599 ---> 8468 +12600 ---> 8469 +12601 ---> 8470 +12602 ---> 8471 +12605 ---> 8472 +12609 ---> 8473 +12610 ---> 8474 +12611 ---> 8475 +12612 ---> 8476 +12613 ---> 8477 +12614 ---> 8478 +12615 ---> 8479 +12616 ---> 8480 +12617 ---> 8481 +12622 ---> 8482 +12626 ---> 8483 +12627 ---> 8484 +12630 ---> 8485 +12631 ---> 8486 +12638 ---> 8487 +12639 ---> 8488 +12640 ---> 8489 +12641 ---> 8490 +12643 ---> 8491 +12644 ---> 8492 +12645 ---> 8493 +12648 ---> 8494 +12656 ---> 8495 +12657 ---> 8496 +12659 ---> 8497 +12660 ---> 8498 +12661 ---> 8499 +12663 ---> 8501 +12664 ---> 8502 +12668 ---> 8503 +12671 ---> 8504 +12672 ---> 8505 +12684 ---> 8506 +12685 ---> 8507 +12686 ---> 8508 +12691 ---> 8509 +12700 ---> 8510 +12702 ---> 8511 +12703 ---> 8512 +12704 ---> 8513 +12705 ---> 8514 +12706 ---> 8515 +12707 ---> 8516 +12709 ---> 8517 +12711 ---> 8518 +12713 ---> 8519 +12719 ---> 8520 +12720 ---> 8521 +12724 ---> 8522 +12725 ---> 8523 +12726 ---> 8524 +12733 ---> 8525 +12734 ---> 8526 +12736 ---> 8527 +12737 ---> 8528 +12738 ---> 8529 +12739 ---> 8530 +12740 ---> 8531 +12744 ---> 8532 +12745 ---> 8533 +12757 ---> 8534 +12759 ---> 8535 +12761 ---> 8536 +12764 ---> 8537 +12765 ---> 8538 +12780 ---> 8539 +12782 ---> 8540 +12790 ---> 8541 +12799 ---> 8542 +12805 ---> 8543 +12808 ---> 8544 +12809 ---> 8545 +12810 ---> 8546 +12812 ---> 8547 +12818 ---> 8548 +12820 ---> 8549 +12821 ---> 8550 +12823 ---> 8551 +12824 ---> 8552 +12826 ---> 8553 +12827 ---> 8554 +12829 ---> 8555 +12834 ---> 8556 +12835 ---> 8557 +12836 ---> 8558 +12837 ---> 8559 +12846 ---> 8560 +12847 ---> 8561 +12848 ---> 8562 +12849 ---> 8563 +12850 ---> 8564 +12851 ---> 8565 +12853 ---> 8566 +12855 ---> 8567 +12859 ---> 8568 +12860 ---> 8569 +12863 ---> 8570 +12865 ---> 8571 +12867 ---> 8572 +12868 ---> 8573 +12869 ---> 8574 +12873 ---> 8575 +12877 ---> 8576 +12880 ---> 8577 +12886 ---> 8578 +12893 ---> 8579 +12895 ---> 8580 +12898 ---> 8581 +12902 ---> 8582 +12903 ---> 8583 +12904 ---> 8584 +12906 ---> 8585 +12907 ---> 8586 +12908 ---> 8587 +12909 ---> 8588 +12910 ---> 8589 +12911 ---> 8590 +12912 ---> 8591 +12913 ---> 8592 +12914 ---> 8593 +12915 ---> 8594 +12917 ---> 8595 +12918 ---> 8596 +12919 ---> 8597 +12920 ---> 8598 +12921 ---> 8599 +12922 ---> 8600 +12923 ---> 8601 +12927 ---> 8602 +12935 ---> 8603 +12937 ---> 8604 +12940 ---> 8605 +12949 ---> 8606 +12950 ---> 8607 +12953 ---> 8608 +12957 ---> 8609 +12958 ---> 8610 +12969 ---> 8611 +12970 ---> 8612 +12971 ---> 8613 +12972 ---> 8614 +12978 ---> 8615 +12982 ---> 8616 +12983 ---> 8617 +12987 ---> 8618 +12988 ---> 8619 +12989 ---> 8620 +12990 ---> 8621 +12992 ---> 8622 +12993 ---> 8623 +12994 ---> 8624 +12997 ---> 8625 +13000 ---> 8626 +13006 ---> 8627 +13008 ---> 8628 +13009 ---> 8629 +13015 ---> 8630 +13019 ---> 8631 +13020 ---> 8632 +13021 ---> 8633 +13024 ---> 8634 +13025 ---> 8635 +13037 ---> 8636 +13046 ---> 8637 +13048 ---> 8638 +13049 ---> 8639 +13051 ---> 8640 +13053 ---> 8641 +13056 ---> 8642 +13057 ---> 8643 +13059 ---> 8644 +13081 ---> 8645 +13083 ---> 8646 +13084 ---> 8647 +13085 ---> 8648 +13086 ---> 8649 +13090 ---> 8650 +13092 ---> 8651 +13093 ---> 8652 +13097 ---> 8653 +13099 ---> 8654 +13106 ---> 8655 +13112 ---> 8656 +13115 ---> 8657 +13117 ---> 8658 +13118 ---> 8659 +13120 ---> 8660 +13121 ---> 8661 +13124 ---> 8662 +13129 ---> 8663 +13135 ---> 8664 +13136 ---> 8665 +13139 ---> 8666 +13146 ---> 8667 +13150 ---> 8668 +13153 ---> 8669 +13156 ---> 8670 +13160 ---> 8671 +13161 ---> 8672 +13162 ---> 8673 +13165 ---> 8674 +13168 ---> 8675 +13170 ---> 8676 +13173 ---> 8677 +13183 ---> 8678 +13184 ---> 8679 +13187 ---> 8680 +13192 ---> 8681 +13193 ---> 8682 +13194 ---> 8683 +13195 ---> 8684 +13199 ---> 8685 +13200 ---> 8686 +13201 ---> 8687 +13202 ---> 8688 +13203 ---> 8689 +13204 ---> 8690 +13205 ---> 8691 +13206 ---> 8692 +13207 ---> 8693 +13209 ---> 8694 +13210 ---> 8695 +13212 ---> 8696 +13213 ---> 8697 +13220 ---> 8698 +13223 ---> 8699 +13224 ---> 8700 +13225 ---> 8701 +13226 ---> 8702 +13230 ---> 8703 +13231 ---> 8704 +13235 ---> 8705 +13237 ---> 8706 +13238 ---> 8707 +13247 ---> 8708 +13253 ---> 8709 +13254 ---> 8710 +13256 ---> 8711 +13267 ---> 8712 +13272 ---> 8713 +13277 ---> 8714 +13280 ---> 8715 +13281 ---> 8716 +13282 ---> 8717 +13292 ---> 8718 +13293 ---> 8719 +13295 ---> 8720 +13311 ---> 8721 +13312 ---> 8722 +13313 ---> 8723 +13317 ---> 8724 +13326 ---> 8725 +13329 ---> 8726 +13331 ---> 8727 +13339 ---> 8728 +13340 ---> 8729 +13341 ---> 8730 +13344 ---> 8731 +13345 ---> 8732 +13348 ---> 8733 +13357 ---> 8734 +13358 ---> 8735 +13363 ---> 8736 +13367 ---> 8737 +13369 ---> 8738 +13380 ---> 8739 +13381 ---> 8740 +13383 ---> 8741 +13385 ---> 8742 +13387 ---> 8743 +13388 ---> 8744 +13393 ---> 8745 +13395 ---> 8746 +13398 ---> 8747 +13399 ---> 8748 +13404 ---> 8749 +13405 ---> 8750 +13407 ---> 8751 +13418 ---> 8752 +13420 ---> 8753 +13421 ---> 8754 +13422 ---> 8755 +13423 ---> 8756 +13425 ---> 8757 +13427 ---> 8758 +13428 ---> 8759 +13435 ---> 8760 +13443 ---> 8761 +13449 ---> 8762 +13451 ---> 8763 +13452 ---> 8764 +13453 ---> 8765 +13454 ---> 8766 +13457 ---> 8767 +13458 ---> 8768 +13460 ---> 8769 +13466 ---> 8770 +13471 ---> 8771 +13474 ---> 8772 +13476 ---> 8773 +13478 ---> 8774 +13479 ---> 8775 +13486 ---> 8776 +13489 ---> 8777 +13490 ---> 8778 +13494 ---> 8779 +13498 ---> 8780 +13499 ---> 8781 +13500 ---> 8782 +13501 ---> 8783 +13503 ---> 8784 +13507 ---> 8785 +13508 ---> 8786 +13514 ---> 8787 +13516 ---> 8788 +13518 ---> 8789 +13520 ---> 8790 +13537 ---> 8791 +13542 ---> 8792 +13544 ---> 8793 +13545 ---> 8794 +13549 ---> 8795 +13551 ---> 8796 +13555 ---> 8797 +13560 ---> 8798 +13562 ---> 8799 +13563 ---> 8800 +13564 ---> 8801 +13565 ---> 8802 +13568 ---> 8803 +13569 ---> 8804 +13571 ---> 8805 +13589 ---> 8806 +13590 ---> 8807 +13591 ---> 8808 +13592 ---> 8809 +13593 ---> 8810 +13594 ---> 8811 +13601 ---> 8812 +13603 ---> 8813 +13604 ---> 8814 +13612 ---> 8815 +13615 ---> 8816 +13618 ---> 8817 +13622 ---> 8818 +13623 ---> 8819 +13629 ---> 8820 +13630 ---> 8821 +13632 ---> 8822 +13642 ---> 8823 +13644 ---> 8824 +13651 ---> 8825 +13653 ---> 8826 +13655 ---> 8827 +13662 ---> 8828 +13667 ---> 8829 +13671 ---> 8830 +13675 ---> 8831 +13676 ---> 8832 +13686 ---> 8833 +13688 ---> 8834 +13689 ---> 8835 +13697 ---> 8836 +13699 ---> 8837 +13702 ---> 8838 +13706 ---> 8839 +13714 ---> 8840 +13716 ---> 8841 +13721 ---> 8842 +13726 ---> 8843 +13730 ---> 8844 +13731 ---> 8845 +13735 ---> 8846 +13736 ---> 8847 +13737 ---> 8848 +13738 ---> 8849 +13739 ---> 8850 +13740 ---> 8851 +13746 ---> 8852 +13750 ---> 8853 +13751 ---> 8854 +13752 ---> 8855 +13758 ---> 8856 +13760 ---> 8857 +13761 ---> 8858 +13762 ---> 8859 +13764 ---> 8860 +13765 ---> 8861 +13768 ---> 8862 +13770 ---> 8863 +13771 ---> 8864 +13772 ---> 8865 +13775 ---> 8866 +13776 ---> 8867 +13778 ---> 8868 +13779 ---> 8869 +13784 ---> 8870 +13787 ---> 8871 +13788 ---> 8872 +13789 ---> 8873 +13790 ---> 8874 +13796 ---> 8875 +13798 ---> 8876 +13801 ---> 8877 +13804 ---> 8878 +13807 ---> 8879 +13809 ---> 8880 +13810 ---> 8881 +13813 ---> 8882 +13814 ---> 8883 +13818 ---> 8884 +13820 ---> 8885 +13822 ---> 8886 +13823 ---> 8887 +13825 ---> 8888 +13826 ---> 8889 +13827 ---> 8890 +13828 ---> 8891 +13830 ---> 8892 +13834 ---> 8893 +13836 ---> 8894 +13840 ---> 8895 +13843 ---> 8896 +13844 ---> 8897 +13848 ---> 8898 +13860 ---> 8899 +13861 ---> 8900 +13862 ---> 8901 +13864 ---> 8902 +13866 ---> 8903 +13867 ---> 8904 +13873 ---> 8905 +13881 ---> 8906 +13882 ---> 8907 +13889 ---> 8908 +13900 ---> 8909 +13905 ---> 8910 +13908 ---> 8911 +13910 ---> 8912 +13914 ---> 8913 +13915 ---> 8914 +13917 ---> 8915 +13919 ---> 8916 +13930 ---> 8917 +13935 ---> 8918 +13936 ---> 8919 +13937 ---> 8920 +13942 ---> 8921 +13946 ---> 8922 +13947 ---> 8923 +13949 ---> 8924 +13951 ---> 8925 +13952 ---> 8926 +13968 ---> 8927 +13969 ---> 8928 +13970 ---> 8929 +13975 ---> 8930 +13978 ---> 8931 +13979 ---> 8932 +13980 ---> 8933 +13981 ---> 8934 +13982 ---> 8935 +13983 ---> 8936 +13984 ---> 8937 +13985 ---> 8938 +13986 ---> 8939 +13989 ---> 8940 +13992 ---> 8941 +13993 ---> 8942 +13996 ---> 8943 +13997 ---> 8944 +14007 ---> 8945 +14008 ---> 8946 +14010 ---> 8947 +14011 ---> 8948 +14012 ---> 8949 +14014 ---> 8950 +14017 ---> 8951 +14019 ---> 8952 +14022 ---> 8953 +14028 ---> 8954 +14031 ---> 8955 +14033 ---> 8956 +14034 ---> 8957 +14035 ---> 8958 +14037 ---> 8959 +14038 ---> 8960 +14040 ---> 8961 +14042 ---> 8962 +14045 ---> 8963 +14060 ---> 8964 +14064 ---> 8965 +14065 ---> 8966 +14066 ---> 8967 +14067 ---> 8968 +14074 ---> 8969 +14076 ---> 8970 +14077 ---> 8971 +14082 ---> 8972 +14084 ---> 8973 +14091 ---> 8974 +14092 ---> 8975 +14093 ---> 8976 +14097 ---> 8977 +14098 ---> 8978 +14100 ---> 8979 +14103 ---> 8980 +14104 ---> 8981 +14106 ---> 8982 +14110 ---> 8983 +14111 ---> 8984 +14112 ---> 8985 +14113 ---> 8986 +14114 ---> 8987 +14115 ---> 8988 +14116 ---> 8989 +14122 ---> 8990 +14124 ---> 8991 +14128 ---> 8992 +14134 ---> 8993 +14144 ---> 8994 +14148 ---> 8995 +14149 ---> 8996 +14150 ---> 8997 +14151 ---> 8998 +14152 ---> 8999 +14154 ---> 9000 +14155 ---> 9001 +14157 ---> 9002 +14161 ---> 9003 +14162 ---> 9004 +14163 ---> 9005 +14165 ---> 9006 +14166 ---> 9007 +14167 ---> 9008 +14168 ---> 9009 +14174 ---> 9010 +14175 ---> 9011 +14177 ---> 9012 +14186 ---> 9013 +14187 ---> 9014 +14191 ---> 9015 +14196 ---> 9016 +14198 ---> 9017 +14199 ---> 9018 +14200 ---> 9019 +14205 ---> 9020 +14206 ---> 9021 +14208 ---> 9022 +14210 ---> 9023 +14211 ---> 9024 +14212 ---> 9025 +14213 ---> 9026 +14222 ---> 9027 +14223 ---> 9028 +14236 ---> 9029 +14237 ---> 9030 +14238 ---> 9031 +14239 ---> 9032 +14245 ---> 9033 +14249 ---> 9034 +14250 ---> 9035 +14251 ---> 9036 +14256 ---> 9037 +14257 ---> 9038 +14263 ---> 9039 +14264 ---> 9040 +14271 ---> 9041 +14275 ---> 9042 +14276 ---> 9043 +14278 ---> 9044 +14279 ---> 9045 +14280 ---> 9046 +14285 ---> 9047 +14289 ---> 9048 +14291 ---> 9049 +14297 ---> 9050 +14299 ---> 9051 +14300 ---> 9052 +14301 ---> 9053 +14303 ---> 9054 +14304 ---> 9055 +14305 ---> 9056 +14308 ---> 9057 +14320 ---> 9058 +14321 ---> 9059 +14327 ---> 9060 +14332 ---> 9061 +14335 ---> 9062 +14336 ---> 9063 +14339 ---> 9064 +14344 ---> 9065 +14345 ---> 9066 +14346 ---> 9067 +14348 ---> 9068 +14354 ---> 9069 +14355 ---> 9070 +14357 ---> 9071 +14360 ---> 9072 +14361 ---> 9073 +14362 ---> 9074 +14363 ---> 9075 +14366 ---> 9076 +14367 ---> 9077 +14368 ---> 9078 +14371 ---> 9079 +14372 ---> 9080 +14373 ---> 9081 +14374 ---> 9082 +14375 ---> 9083 +14376 ---> 9084 +14377 ---> 9085 +14379 ---> 9086 +14383 ---> 9087 +14387 ---> 9088 +14388 ---> 9089 +14391 ---> 9090 +14400 ---> 9091 +14402 ---> 9092 +14406 ---> 9093 +14410 ---> 9094 +14414 ---> 9095 +14416 ---> 9096 +14417 ---> 9097 +14418 ---> 9098 +14421 ---> 9099 +14423 ---> 9100 +14426 ---> 9101 +14427 ---> 9102 +14428 ---> 9103 +14431 ---> 9104 +14434 ---> 9105 +14441 ---> 9106 +14444 ---> 9107 +14446 ---> 9108 +14453 ---> 9109 +14454 ---> 9110 +14455 ---> 9111 +14458 ---> 9112 +14460 ---> 9113 +14462 ---> 9114 +14463 ---> 9115 +14464 ---> 9116 +14471 ---> 9117 +14472 ---> 9118 +14473 ---> 9119 +14474 ---> 9120 +14477 ---> 9121 +14478 ---> 9122 +14482 ---> 9123 +14483 ---> 9124 +14485 ---> 9125 +14486 ---> 9126 +14487 ---> 9127 +14490 ---> 9128 +14491 ---> 9129 +14492 ---> 9130 +14508 ---> 9131 +14512 ---> 9132 +14514 ---> 9133 +14517 ---> 9134 +14523 ---> 9135 +14524 ---> 9136 +14525 ---> 9137 +14526 ---> 9138 +14532 ---> 9139 +14539 ---> 9140 +14540 ---> 9141 +14542 ---> 9142 +14543 ---> 9143 +14544 ---> 9144 +14546 ---> 9145 +14548 ---> 9146 +14549 ---> 9147 +14550 ---> 9148 +14551 ---> 9149 +14552 ---> 9150 +14556 ---> 9151 +14557 ---> 9152 +14561 ---> 9153 +14562 ---> 9154 +14563 ---> 9155 +14567 ---> 9156 +14568 ---> 9157 +14571 ---> 9158 +14574 ---> 9159 +14579 ---> 9160 +14581 ---> 9161 +14583 ---> 9162 +14585 ---> 9163 +14591 ---> 9164 +14592 ---> 9165 +14593 ---> 9166 +14594 ---> 9167 +14596 ---> 9168 +14599 ---> 9169 +14605 ---> 9170 +14607 ---> 9171 +14611 ---> 9172 +14613 ---> 9173 +14615 ---> 9174 +14617 ---> 9175 +14618 ---> 9176 +14624 ---> 9177 +14626 ---> 9178 +14659 ---> 9179 +14665 ---> 9180 +14666 ---> 9181 +14672 ---> 9182 +14675 ---> 9183 +14680 ---> 9184 +14681 ---> 9185 +14682 ---> 9186 +14686 ---> 9187 +14687 ---> 9188 +14688 ---> 9189 +14689 ---> 9190 +14690 ---> 9191 +14701 ---> 9192 +14707 ---> 9193 +14711 ---> 9194 +14720 ---> 9195 +14724 ---> 9196 +14728 ---> 9197 +14732 ---> 9198 +14738 ---> 9199 +14740 ---> 9200 +14742 ---> 9201 +14746 ---> 9202 +14757 ---> 9203 +14763 ---> 9204 +14770 ---> 9205 +14771 ---> 9206 +14773 ---> 9207 +14780 ---> 9208 +14783 ---> 9209 +14784 ---> 9210 +14786 ---> 9211 +14793 ---> 9212 +14794 ---> 9213 +14798 ---> 9214 +14800 ---> 9215 +14806 ---> 9216 +14810 ---> 9217 +14818 ---> 9218 +14819 ---> 9219 +14830 ---> 9220 +14831 ---> 9221 +14842 ---> 9222 +14843 ---> 9223 +14846 ---> 9224 +14856 ---> 9225 +14860 ---> 9226 +14862 ---> 9227 +14866 ---> 9228 +14867 ---> 9229 +14869 ---> 9230 +14870 ---> 9231 +14876 ---> 9232 +14878 ---> 9233 +14884 ---> 9234 +14886 ---> 9235 +14889 ---> 9236 +14890 ---> 9237 +14895 ---> 9238 +14909 ---> 9239 +14910 ---> 9240 +14915 ---> 9241 +14916 ---> 9242 +14917 ---> 9243 +14923 ---> 9244 +14926 ---> 9245 +14927 ---> 9246 +14930 ---> 9247 +14932 ---> 9248 +14947 ---> 9249 +14950 ---> 9250 +14955 ---> 9251 +14956 ---> 9252 +14957 ---> 9253 +14960 ---> 9254 +14968 ---> 9255 +14972 ---> 9256 +14977 ---> 9257 +14980 ---> 9258 +14985 ---> 9259 +14989 ---> 9260 +14991 ---> 9261 +14993 ---> 9262 +14994 ---> 9263 +14995 ---> 9264 +14996 ---> 9265 +14997 ---> 9266 +15001 ---> 9267 +15004 ---> 9268 +15005 ---> 9269 +15016 ---> 9270 +15019 ---> 9271 +15021 ---> 9272 +15027 ---> 9273 +15033 ---> 9274 +15035 ---> 9275 +15036 ---> 9276 +15037 ---> 9277 +15056 ---> 9278 +15057 ---> 9279 +15059 ---> 9280 +15061 ---> 9281 +15062 ---> 9282 +15072 ---> 9283 +15073 ---> 9284 +15074 ---> 9285 +15076 ---> 9286 +15077 ---> 9287 +15078 ---> 9288 +15089 ---> 9289 +15095 ---> 9290 +15096 ---> 9291 +15098 ---> 9292 +15108 ---> 9293 +15111 ---> 9294 +15118 ---> 9295 +15119 ---> 9296 +15122 ---> 9297 +15123 ---> 9298 +15124 ---> 9299 +15125 ---> 9300 +15126 ---> 9301 +15127 ---> 9302 +15128 ---> 9303 +15130 ---> 9304 +15136 ---> 9305 +15139 ---> 9306 +15143 ---> 9307 +15148 ---> 9308 +15150 ---> 9309 +15152 ---> 9310 +15153 ---> 9311 +15154 ---> 9312 +15155 ---> 9313 +15156 ---> 9314 +15159 ---> 9315 +15163 ---> 9316 +15165 ---> 9317 +15169 ---> 9318 +15171 ---> 9319 +15175 ---> 9320 +15183 ---> 9321 +15186 ---> 9322 +15189 ---> 9323 +15194 ---> 9324 +15197 ---> 9325 +15203 ---> 9326 +15205 ---> 9327 +15207 ---> 9328 +15216 ---> 9329 +15224 ---> 9330 +15227 ---> 9331 +15228 ---> 9332 +15232 ---> 9333 +15237 ---> 9334 +15241 ---> 9335 +15243 ---> 9336 +15245 ---> 9337 +15249 ---> 9338 +15251 ---> 9339 +15254 ---> 9340 +15256 ---> 9341 +15259 ---> 9342 +15264 ---> 9343 +15265 ---> 9344 +15271 ---> 9345 +15273 ---> 9346 +15280 ---> 9347 +15283 ---> 9348 +15284 ---> 9349 +15286 ---> 9350 +15287 ---> 9351 +15289 ---> 9352 +15291 ---> 9353 +15293 ---> 9354 +15299 ---> 9355 +15302 ---> 9356 +15303 ---> 9357 +15304 ---> 9358 +15306 ---> 9359 +15307 ---> 9360 +15308 ---> 9361 +15309 ---> 9362 +15310 ---> 9363 +15316 ---> 9364 +15318 ---> 9365 +15319 ---> 9366 +15320 ---> 9367 +15325 ---> 9368 +15328 ---> 9369 +15330 ---> 9370 +15331 ---> 9371 +15333 ---> 9372 +15334 ---> 9374 +15335 ---> 9375 +15347 ---> 9376 +15352 ---> 9377 +15353 ---> 9378 +15355 ---> 9379 +15357 ---> 9380 +15359 ---> 9381 +15364 ---> 9382 +15367 ---> 9383 +15368 ---> 9384 +15374 ---> 9385 +15375 ---> 9386 +15376 ---> 9387 +15377 ---> 9388 +15378 ---> 9389 +15379 ---> 9390 +15381 ---> 9391 +15384 ---> 9392 +15389 ---> 9393 +15392 ---> 9394 +15394 ---> 9395 +15397 ---> 9396 +15403 ---> 9397 +15405 ---> 9398 +15408 ---> 9399 +15409 ---> 9400 +15412 ---> 9401 +15414 ---> 9402 +15415 ---> 9403 +15421 ---> 9404 +15422 ---> 9405 +15423 ---> 9406 +15426 ---> 9407 +15427 ---> 9408 +15430 ---> 9409 +15432 ---> 9410 +15436 ---> 9411 +15440 ---> 9412 +15442 ---> 9413 +15451 ---> 9414 +15457 ---> 9415 +15458 ---> 9416 +15463 ---> 9417 +15465 ---> 9418 +15466 ---> 9419 +15467 ---> 9420 +15472 ---> 9421 +15476 ---> 9422 +15488 ---> 9423 +15490 ---> 9424 +15491 ---> 9425 +15492 ---> 9426 +15493 ---> 9427 +15494 ---> 9428 +15495 ---> 9429 +15503 ---> 9430 +15506 ---> 9431 +15507 ---> 9432 +15508 ---> 9433 +15509 ---> 9434 +15515 ---> 9435 +15519 ---> 9436 +15522 ---> 9437 +15526 ---> 9438 +15537 ---> 9439 +15539 ---> 9440 +15540 ---> 9441 +15542 ---> 9442 +15543 ---> 9443 +15544 ---> 9444 +15545 ---> 9445 +15551 ---> 9446 +15552 ---> 9447 +15559 ---> 9448 +15561 ---> 9449 +15564 ---> 9450 +15566 ---> 9451 +15569 ---> 9452 +15572 ---> 9453 +15576 ---> 9454 +15577 ---> 9455 +15578 ---> 9456 +15587 ---> 9457 +15589 ---> 9458 +15591 ---> 9459 +15592 ---> 9460 +15606 ---> 9461 +15607 ---> 9462 +15613 ---> 9463 +15618 ---> 9464 +15619 ---> 9465 +15623 ---> 9466 +15625 ---> 9467 +15626 ---> 9468 +15631 ---> 9469 +15632 ---> 9470 +15633 ---> 9471 +15638 ---> 9472 +15641 ---> 9473 +15644 ---> 9474 +15645 ---> 9475 +15646 ---> 9476 +15647 ---> 9477 +15648 ---> 9478 +15649 ---> 9479 +15650 ---> 9480 +15656 ---> 9481 +15662 ---> 9482 +15664 ---> 9483 +15669 ---> 9484 +15670 ---> 9485 +15671 ---> 9486 +15674 ---> 9487 +15675 ---> 9488 +15679 ---> 9489 +15681 ---> 9490 +15682 ---> 9491 +15683 ---> 9492 +15687 ---> 9493 +15693 ---> 9494 +15694 ---> 9495 +15695 ---> 9496 +15697 ---> 9497 +15700 ---> 9498 +15701 ---> 9499 +15709 ---> 9500 +15710 ---> 9501 +15718 ---> 9502 +15719 ---> 9503 +15720 ---> 9504 +15723 ---> 9505 +15730 ---> 9506 +15731 ---> 9507 +15733 ---> 9508 +15750 ---> 9509 +15751 ---> 9510 +15753 ---> 9511 +15755 ---> 9512 +15769 ---> 9513 +15770 ---> 9514 +15776 ---> 9515 +15778 ---> 9516 +15779 ---> 9517 +15780 ---> 9518 +15782 ---> 9519 +15783 ---> 9520 +15790 ---> 9521 +15795 ---> 9522 +15796 ---> 9523 +15797 ---> 9524 +15803 ---> 9525 +15806 ---> 9526 +15808 ---> 9527 +15810 ---> 9528 +15812 ---> 9529 +15818 ---> 9530 +15825 ---> 9531 +15826 ---> 9532 +15827 ---> 9533 +15828 ---> 9534 +15829 ---> 9535 +15830 ---> 9536 +15834 ---> 9537 +15838 ---> 9538 +15839 ---> 9539 +15840 ---> 9540 +15842 ---> 9541 +15843 ---> 9542 +15844 ---> 9543 +15845 ---> 9544 +15847 ---> 9545 +15848 ---> 9546 +15849 ---> 9547 +15851 ---> 9548 +15852 ---> 9549 +15854 ---> 9550 +15857 ---> 9551 +15861 ---> 9552 +15863 ---> 9553 +15864 ---> 9554 +15865 ---> 9555 +15866 ---> 9556 +15867 ---> 9557 +15874 ---> 9558 +15879 ---> 9559 +15883 ---> 9560 +15886 ---> 9561 +15888 ---> 9562 +15890 ---> 9563 +15892 ---> 9564 +15896 ---> 9565 +15899 ---> 9566 +15906 ---> 9567 +15908 ---> 9568 +15914 ---> 9569 +15918 ---> 9570 +15919 ---> 9571 +15922 ---> 9572 +15924 ---> 9573 +15931 ---> 9574 +15932 ---> 9575 +15934 ---> 9576 +15937 ---> 9577 +15943 ---> 9578 +15954 ---> 9579 +15960 ---> 9580 +15962 ---> 9581 +15963 ---> 9582 +15964 ---> 9583 +15965 ---> 9584 +15969 ---> 9585 +15971 ---> 9586 +15974 ---> 9587 +15977 ---> 9588 +15981 ---> 9589 +15982 ---> 9590 +15989 ---> 9591 +15997 ---> 9592 +16001 ---> 9593 +16004 ---> 9594 +16012 ---> 9595 +16013 ---> 9596 +16014 ---> 9597 +16016 ---> 9598 +16021 ---> 9599 +16022 ---> 9600 +16023 ---> 9601 +16024 ---> 9602 +16030 ---> 9603 +16033 ---> 9604 +16037 ---> 9605 +16038 ---> 9606 +16041 ---> 9607 +16042 ---> 9608 +16043 ---> 9609 +16044 ---> 9610 +16050 ---> 9611 +16051 ---> 9612 +16052 ---> 9613 +16053 ---> 9614 +16061 ---> 9615 +16062 ---> 9616 +16063 ---> 9617 +16064 ---> 9618 +16065 ---> 9619 +16068 ---> 9620 +16071 ---> 9621 +16072 ---> 9622 +16079 ---> 9623 +16080 ---> 9624 +16082 ---> 9625 +16088 ---> 9626 +16094 ---> 9627 +16104 ---> 9628 +16105 ---> 9629 +16106 ---> 9630 +16113 ---> 9631 +16119 ---> 9632 +16122 ---> 9633 +16123 ---> 9634 +16126 ---> 9635 +16132 ---> 9636 +16134 ---> 9637 +16135 ---> 9638 +16137 ---> 9639 +16139 ---> 9640 +16144 ---> 9641 +16145 ---> 9642 +16148 ---> 9643 +16153 ---> 9644 +16154 ---> 9645 +16158 ---> 9646 +16159 ---> 9647 +16162 ---> 9648 +16175 ---> 9649 +16176 ---> 9650 +16177 ---> 9651 +16188 ---> 9652 +16193 ---> 9653 +16194 ---> 9654 +16195 ---> 9655 +16196 ---> 9656 +16197 ---> 9657 +16198 ---> 9658 +16201 ---> 9659 +16202 ---> 9660 +16203 ---> 9661 +16204 ---> 9662 +16207 ---> 9663 +16208 ---> 9664 +16209 ---> 9665 +16210 ---> 9666 +16211 ---> 9667 +16212 ---> 9668 +16215 ---> 9669 +16216 ---> 9670 +16222 ---> 9671 +16224 ---> 9672 +16229 ---> 9673 +16234 ---> 9674 +16236 ---> 9675 +16238 ---> 9676 +16242 ---> 9677 +16244 ---> 9678 +16246 ---> 9679 +16254 ---> 9680 +16258 ---> 9681 +16266 ---> 9682 +16270 ---> 9683 +16272 ---> 9684 +16274 ---> 9685 +16275 ---> 9686 +16277 ---> 9687 +16280 ---> 9688 +16282 ---> 9689 +16285 ---> 9690 +16286 ---> 9691 +16289 ---> 9692 +16290 ---> 9693 +16293 ---> 9694 +16294 ---> 9695 +16295 ---> 9696 +16296 ---> 9697 +16298 ---> 9698 +16299 ---> 9699 +16307 ---> 9700 +16312 ---> 9701 +16315 ---> 9702 +16322 ---> 9703 +16326 ---> 9704 +16329 ---> 9705 +16330 ---> 9706 +16331 ---> 9707 +16333 ---> 9708 +16336 ---> 9709 +16338 ---> 9710 +16342 ---> 9711 +16343 ---> 9712 +16348 ---> 9713 +16349 ---> 9714 +16350 ---> 9715 +16354 ---> 9716 +16355 ---> 9717 +16356 ---> 9718 +16357 ---> 9719 +16358 ---> 9720 +16359 ---> 9721 +16360 ---> 9722 +16362 ---> 9723 +16363 ---> 9724 +16366 ---> 9725 +16368 ---> 9726 +16369 ---> 9727 +16370 ---> 9728 +16371 ---> 9729 +16374 ---> 9730 +16375 ---> 9731 +16376 ---> 9732 +16377 ---> 9733 +16385 ---> 9734 +16387 ---> 9735 +16388 ---> 9736 +16389 ---> 9737 +16397 ---> 9738 +16399 ---> 9739 +16400 ---> 9740 +16401 ---> 9741 +16402 ---> 9742 +16411 ---> 9743 +16421 ---> 9744 +16424 ---> 9745 +16427 ---> 9746 +16438 ---> 9747 +16441 ---> 9748 +16442 ---> 9749 +16443 ---> 9750 +16446 ---> 9751 +16449 ---> 9752 +16450 ---> 9753 +16453 ---> 9754 +16454 ---> 9755 +16456 ---> 9756 +16458 ---> 9757 +16460 ---> 9758 +16462 ---> 9759 +16463 ---> 9760 +16465 ---> 9761 +16469 ---> 9762 +16470 ---> 9763 +16471 ---> 9764 +16472 ---> 9765 +16474 ---> 9766 +16476 ---> 9767 +16477 ---> 9768 +16480 ---> 9769 +16482 ---> 9770 +16486 ---> 9771 +16487 ---> 9772 +16488 ---> 9773 +16489 ---> 9774 +16490 ---> 9775 +16491 ---> 9776 +16493 ---> 9777 +16497 ---> 9778 +16502 ---> 9779 +16503 ---> 9780 +16504 ---> 9781 +16506 ---> 9782 +16508 ---> 9783 +16509 ---> 9784 +16510 ---> 9785 +16513 ---> 9786 +16515 ---> 9787 +16519 ---> 9788 +16523 ---> 9789 +16526 ---> 9790 +16527 ---> 9791 +16528 ---> 9792 +16530 ---> 9793 +16536 ---> 9794 +16537 ---> 9795 +16539 ---> 9796 +16540 ---> 9797 +16541 ---> 9798 +16542 ---> 9799 +16543 ---> 9800 +16544 ---> 9801 +16545 ---> 9802 +16547 ---> 9803 +16559 ---> 9804 +16564 ---> 9805 +16565 ---> 9806 +16566 ---> 9807 +16568 ---> 9808 +16569 ---> 9809 +16573 ---> 9810 +16575 ---> 9811 +16578 ---> 9812 +16579 ---> 9813 +16580 ---> 9814 +16581 ---> 9815 +16582 ---> 9816 +16583 ---> 9817 +16584 ---> 9818 +16585 ---> 9819 +16586 ---> 9820 +16587 ---> 9821 +16589 ---> 9822 +16594 ---> 9823 +16600 ---> 9824 +16601 ---> 9825 +16602 ---> 9826 +16603 ---> 9827 +16604 ---> 9828 +16605 ---> 9829 +16606 ---> 9830 +16608 ---> 9831 +16609 ---> 9832 +16610 ---> 9833 +16611 ---> 9834 +16612 ---> 9835 +16613 ---> 9836 +16614 ---> 9837 +16615 ---> 9838 +16619 ---> 9839 +16620 ---> 9840 +16621 ---> 9841 +16623 ---> 9842 +16624 ---> 9843 +16625 ---> 9844 +16626 ---> 9845 +16627 ---> 9846 +16628 ---> 9847 +16632 ---> 9848 +16633 ---> 9849 +16642 ---> 9850 +16644 ---> 9851 +16652 ---> 9852 +16653 ---> 9853 +16656 ---> 9854 +16664 ---> 9855 +16665 ---> 9856 +16673 ---> 9857 +16675 ---> 9858 +16679 ---> 9859 +16682 ---> 9860 +16686 ---> 9861 +16695 ---> 9862 +16696 ---> 9863 +16708 ---> 9864 +16710 ---> 9865 +16712 ---> 9866 +16713 ---> 9867 +16714 ---> 9868 +16722 ---> 9869 +16723 ---> 9870 +16734 ---> 9871 +16735 ---> 9872 +16738 ---> 9873 +16744 ---> 9874 +16745 ---> 9875 +16751 ---> 9876 +16757 ---> 9877 +16763 ---> 9878 +16769 ---> 9879 +16774 ---> 9880 +16775 ---> 9881 +16776 ---> 9882 +16783 ---> 9883 +16786 ---> 9884 +16787 ---> 9885 +16796 ---> 9886 +16800 ---> 9887 +16801 ---> 9888 +16802 ---> 9889 +16803 ---> 9890 +16804 ---> 9891 +16806 ---> 9892 +16807 ---> 9893 +16811 ---> 9894 +16814 ---> 9895 +16819 ---> 9896 +16825 ---> 9897 +16826 ---> 9898 +16827 ---> 9899 +16833 ---> 9900 +16838 ---> 9901 +16840 ---> 9902 +16843 ---> 9903 +16844 ---> 9904 +16848 ---> 9905 +16850 ---> 9906 +16852 ---> 9907 +16854 ---> 9908 +16857 ---> 9909 +16862 ---> 9910 +16864 ---> 9911 +16873 ---> 9912 +16880 ---> 9913 +16881 ---> 9914 +16886 ---> 9915 +16887 ---> 9916 +16889 ---> 9917 +16890 ---> 9918 +16891 ---> 9919 +16892 ---> 9920 +16893 ---> 9921 +16898 ---> 9922 +16900 ---> 9923 +16906 ---> 852 +16908 ---> 9924 +16911 ---> 9925 +16912 ---> 9926 +16920 ---> 9927 +16922 ---> 9928 +16925 ---> 9929 +16931 ---> 9930 +16932 ---> 9931 +16933 ---> 9932 +16938 ---> 9933 +16940 ---> 9934 +16944 ---> 9935 +16950 ---> 9936 +16951 ---> 9937 +16958 ---> 9938 +16960 ---> 9939 +16961 ---> 9940 +16963 ---> 9941 +16964 ---> 9942 +16965 ---> 9943 +16971 ---> 9944 +16977 ---> 9945 +16979 ---> 9946 +16982 ---> 9947 +16985 ---> 9948 +16987 ---> 9949 +16989 ---> 9950 +16990 ---> 9951 +16995 ---> 9952 +16996 ---> 9953 +17007 ---> 9954 +17008 ---> 9955 +17013 ---> 9956 +17014 ---> 9957 +17015 ---> 9958 +17016 ---> 9959 +17020 ---> 9960 +17023 ---> 9961 +17024 ---> 9962 +17026 ---> 9963 +17027 ---> 9964 +17028 ---> 9965 +17031 ---> 9966 +17032 ---> 9967 +17037 ---> 9968 +17043 ---> 9969 +17044 ---> 9970 +17045 ---> 9971 +17047 ---> 9972 +17051 ---> 9973 +17058 ---> 9974 +17060 ---> 9975 +17063 ---> 9976 +17065 ---> 9977 +17069 ---> 9978 +17070 ---> 9979 +17071 ---> 9980 +17073 ---> 9981 +17075 ---> 9982 +17084 ---> 9983 +17089 ---> 9984 +17093 ---> 9985 +17095 ---> 9986 +17098 ---> 9987 +17099 ---> 9988 +17108 ---> 9989 +17109 ---> 9990 +17111 ---> 9991 +17116 ---> 9992 +17117 ---> 9993 +17118 ---> 9994 +17120 ---> 9995 +17121 ---> 9996 +17124 ---> 9997 +17125 ---> 9998 +17127 ---> 9999 +17128 ---> 10000 +17129 ---> 10001 +17130 ---> 10002 +17138 ---> 10003 +17140 ---> 10004 +17145 ---> 10005 +17149 ---> 10006 +17150 ---> 10007 +17153 ---> 10008 +17156 ---> 10009 +17163 ---> 10010 +17166 ---> 10011 +17167 ---> 10012 +17168 ---> 10013 +17169 ---> 10014 +17170 ---> 10015 +17171 ---> 10016 +17173 ---> 10017 +17174 ---> 10018 +17175 ---> 10019 +17176 ---> 10020 +17178 ---> 10021 +17179 ---> 10022 +17188 ---> 10023 +17191 ---> 10024 +17192 ---> 10025 +17197 ---> 10026 +17199 ---> 10027 +17205 ---> 10028 +17207 ---> 10029 +17210 ---> 10030 +17223 ---> 10031 +17224 ---> 10032 +17225 ---> 10033 +17227 ---> 10034 +17228 ---> 10035 +17230 ---> 10036 +17238 ---> 10037 +17241 ---> 10038 +17242 ---> 10039 +17243 ---> 10040 +17249 ---> 10041 +17253 ---> 10042 +17254 ---> 10043 +17256 ---> 10044 +17257 ---> 10045 +17259 ---> 10046 +17261 ---> 10047 +17270 ---> 10048 +17272 ---> 10049 +17273 ---> 10050 +17278 ---> 10051 +17282 ---> 10052 +17289 ---> 10053 +17290 ---> 10054 +17294 ---> 10055 +17295 ---> 10056 +17296 ---> 10057 +17305 ---> 10058 +17310 ---> 10059 +17312 ---> 10060 +17320 ---> 10061 +17321 ---> 10062 +17324 ---> 10063 +17325 ---> 10064 +17337 ---> 10065 +17343 ---> 10066 +17345 ---> 10067 +17348 ---> 10068 +17349 ---> 10069 +17355 ---> 10070 +17356 ---> 10071 +17361 ---> 10072 +17362 ---> 10073 +17366 ---> 10074 +17373 ---> 10075 +17378 ---> 10076 +17379 ---> 10077 +17387 ---> 10078 +17389 ---> 10079 +17393 ---> 10080 +17394 ---> 10081 +17395 ---> 10082 +17396 ---> 10083 +17397 ---> 10084 +17398 ---> 10085 +17403 ---> 10086 +17404 ---> 10087 +17406 ---> 10088 +17410 ---> 10089 +17411 ---> 10090 +17413 ---> 10091 +17414 ---> 10092 +17415 ---> 10093 +17419 ---> 10094 +17423 ---> 10095 +17425 ---> 10096 +17427 ---> 10097 +17428 ---> 10098 +17434 ---> 10099 +17435 ---> 10100 +17438 ---> 10101 +17446 ---> 10102 +17448 ---> 10103 +17449 ---> 10104 +17459 ---> 10105 +17460 ---> 10106 +17461 ---> 10107 +17462 ---> 10108 +17465 ---> 10109 +17467 ---> 10110 +17468 ---> 10111 +17469 ---> 10112 +17470 ---> 10113 +17473 ---> 10114 +17474 ---> 10115 +17475 ---> 10116 +17478 ---> 10117 +17480 ---> 10118 +17481 ---> 10119 +17484 ---> 10120 +17486 ---> 10121 +17487 ---> 10122 +17488 ---> 10123 +17490 ---> 10124 +17493 ---> 10125 +17494 ---> 10126 +17495 ---> 10127 +17499 ---> 10128 +17503 ---> 10129 +17510 ---> 10130 +17517 ---> 10131 +17519 ---> 10132 +17525 ---> 10133 +17527 ---> 10134 +17529 ---> 10135 +17534 ---> 10136 +17541 ---> 10137 +17544 ---> 10138 +17545 ---> 10139 +17547 ---> 10140 +17548 ---> 10141 +17550 ---> 10142 +17552 ---> 10143 +17553 ---> 10144 +17554 ---> 10145 +17557 ---> 10146 +17558 ---> 10147 +17563 ---> 10148 +17564 ---> 10149 +17565 ---> 10150 +17566 ---> 10151 +17568 ---> 10152 +17570 ---> 10153 +17571 ---> 10154 +17572 ---> 10155 +17573 ---> 10156 +17574 ---> 10157 +17576 ---> 10158 +17582 ---> 10159 +17583 ---> 10160 +17584 ---> 10161 +17585 ---> 10162 +17587 ---> 10163 +17588 ---> 10164 +17591 ---> 10165 +17598 ---> 10166 +17600 ---> 10167 +17603 ---> 10168 +17604 ---> 10169 +17605 ---> 10170 +17609 ---> 10171 +17610 ---> 10172 +17611 ---> 10173 +17612 ---> 10174 +17619 ---> 10175 +17626 ---> 10176 +17628 ---> 10177 +17629 ---> 10178 +17630 ---> 10179 +17631 ---> 10180 +17632 ---> 10181 +17634 ---> 10182 +17640 ---> 10183 +17645 ---> 10184 +17646 ---> 10185 +17647 ---> 10186 +17649 ---> 10187 +17650 ---> 10188 +17651 ---> 10189 +17653 ---> 10190 +17654 ---> 10191 +17661 ---> 10192 +17666 ---> 10193 +17669 ---> 10194 +17670 ---> 10195 +17674 ---> 10196 +17676 ---> 10197 +17679 ---> 10198 +17681 ---> 10199 +17684 ---> 10200 +17686 ---> 10201 +17687 ---> 10202 +17689 ---> 10203 +17690 ---> 10204 +17692 ---> 10205 +17693 ---> 10206 +17695 ---> 10207 +17698 ---> 10208 +17701 ---> 10209 +17702 ---> 10210 +17703 ---> 10211 +17704 ---> 10212 +17706 ---> 10213 +17715 ---> 10214 +17716 ---> 10215 +17726 ---> 10216 +17731 ---> 10217 +17735 ---> 10218 +17736 ---> 10219 +17738 ---> 10220 +17739 ---> 10221 +17740 ---> 10222 +17741 ---> 10223 +17744 ---> 10224 +17750 ---> 10225 +17751 ---> 10226 +17753 ---> 10227 +17754 ---> 10228 +17755 ---> 10229 +17756 ---> 10230 +17758 ---> 10231 +17760 ---> 10232 +17761 ---> 10233 +17768 ---> 10234 +17770 ---> 10235 +17771 ---> 10236 +17772 ---> 10237 +17774 ---> 10238 +17777 ---> 10239 +17778 ---> 10240 +17782 ---> 10241 +17783 ---> 10242 +17787 ---> 10243 +17789 ---> 10244 +17790 ---> 10245 +17794 ---> 10246 +17795 ---> 10247 +17796 ---> 10248 +17797 ---> 10249 +17798 ---> 10250 +17799 ---> 10251 +17801 ---> 10252 +17805 ---> 10253 +17809 ---> 10254 +17810 ---> 10255 +17812 ---> 10256 +17815 ---> 10257 +17816 ---> 10258 +17817 ---> 10259 +17818 ---> 10260 +17822 ---> 10261 +17823 ---> 10262 +17824 ---> 10263 +17825 ---> 10264 +17827 ---> 10265 +17828 ---> 10266 +17835 ---> 10267 +17838 ---> 10268 +17841 ---> 10269 +17850 ---> 10270 +17851 ---> 10271 +17858 ---> 10272 +17861 ---> 10273 +17862 ---> 10274 +17864 ---> 10275 +17869 ---> 10276 +17870 ---> 10277 +17871 ---> 10278 +17880 ---> 10279 +17882 ---> 10280 +17884 ---> 10281 +17886 ---> 10282 +17893 ---> 10283 +17895 ---> 10284 +17896 ---> 10285 +17897 ---> 10286 +17898 ---> 10287 +17899 ---> 10288 +17900 ---> 10289 +17901 ---> 10290 +17902 ---> 10291 +17903 ---> 10292 +17904 ---> 10293 +17905 ---> 10294 +17906 ---> 10295 +17907 ---> 10296 +17909 ---> 10297 +17924 ---> 10298 +17929 ---> 10299 +17931 ---> 10300 +17932 ---> 10301 +17933 ---> 10302 +17935 ---> 10303 +17943 ---> 10304 +17944 ---> 10305 +17946 ---> 10306 +17949 ---> 10307 +17950 ---> 10308 +17951 ---> 10309 +17952 ---> 10310 +17955 ---> 10311 +17957 ---> 10312 +17958 ---> 10313 +17959 ---> 10314 +17963 ---> 10315 +17966 ---> 10316 +17967 ---> 10317 +17968 ---> 10318 +17969 ---> 10319 +17976 ---> 10320 +17979 ---> 10321 +17980 ---> 10322 +17981 ---> 10323 +17983 ---> 10324 +17984 ---> 10325 +17986 ---> 10327 +17992 ---> 10328 +17999 ---> 10329 +18001 ---> 10330 +18004 ---> 10331 +18005 ---> 10332 +18013 ---> 10333 +18017 ---> 10334 +18019 ---> 10335 +18020 ---> 10336 +18022 ---> 10337 +18023 ---> 10338 +18026 ---> 10339 +18030 ---> 10340 +18033 ---> 10341 +18034 ---> 10342 +18037 ---> 10343 +18039 ---> 10344 +18040 ---> 10345 +18041 ---> 10346 +18042 ---> 10347 +18043 ---> 10348 +18044 ---> 851 +18045 ---> 10349 +18047 ---> 10350 +18048 ---> 10351 +18052 ---> 10352 +18054 ---> 10353 +18056 ---> 10354 +18067 ---> 10355 +18068 ---> 10356 +18069 ---> 10357 +18070 ---> 10358 +18071 ---> 10359 +18076 ---> 10360 +18081 ---> 10361 +18083 ---> 10362 +18084 ---> 10363 +18088 ---> 10364 +18091 ---> 10365 +18094 ---> 10366 +18095 ---> 10367 +18097 ---> 10368 +18100 ---> 10369 +18104 ---> 10370 +18106 ---> 10371 +18110 ---> 10372 +18111 ---> 10373 +18113 ---> 10374 +18114 ---> 10375 +18117 ---> 10376 +18119 ---> 10377 +18123 ---> 10378 +18128 ---> 10379 +18131 ---> 10380 +18133 ---> 10381 +18137 ---> 10382 +18143 ---> 10383 +18144 ---> 10384 +18145 ---> 10385 +18146 ---> 10386 +18147 ---> 10387 +18148 ---> 10388 +18149 ---> 10389 +18150 ---> 10390 +18151 ---> 10391 +18152 ---> 10392 +18153 ---> 10393 +18155 ---> 10394 +18156 ---> 10395 +18157 ---> 10396 +18162 ---> 10397 +18164 ---> 10398 +18165 ---> 10399 +18166 ---> 10400 +18167 ---> 10401 +18168 ---> 10402 +18169 ---> 10403 +18170 ---> 10404 +18172 ---> 10405 +18174 ---> 10406 +18175 ---> 10407 +18176 ---> 10408 +18177 ---> 10409 +18178 ---> 10410 +18179 ---> 10411 +18181 ---> 10412 +18182 ---> 10413 +18185 ---> 10414 +18187 ---> 10415 +18190 ---> 10416 +18192 ---> 10417 +18196 ---> 10418 +18197 ---> 10419 +18198 ---> 10420 +18201 ---> 10421 +18202 ---> 10422 +18208 ---> 10423 +18211 ---> 10424 +18212 ---> 10425 +18215 ---> 10426 +18218 ---> 10427 +18225 ---> 10428 +18226 ---> 10429 +18228 ---> 10430 +18229 ---> 10431 +18232 ---> 10432 +18235 ---> 10433 +18237 ---> 10434 +18238 ---> 10435 +18244 ---> 10436 +18249 ---> 10437 +18252 ---> 10438 +18256 ---> 10439 +18259 ---> 10440 +18269 ---> 10441 +18270 ---> 10442 +18273 ---> 10443 +18277 ---> 10444 +18278 ---> 10445 +18280 ---> 10446 +18284 ---> 10447 +18285 ---> 10448 +18286 ---> 10449 +18291 ---> 10450 +18295 ---> 10451 +18299 ---> 10452 +18300 ---> 10453 +18307 ---> 10454 +18314 ---> 10455 +18315 ---> 10456 +18319 ---> 10457 +18321 ---> 10458 +18323 ---> 10459 +18324 ---> 10460 +18327 ---> 10461 +18330 ---> 10462 +18331 ---> 10463 +18332 ---> 10464 +18338 ---> 10465 +18339 ---> 10466 +18341 ---> 10467 +18342 ---> 10468 +18353 ---> 10469 +18361 ---> 10470 +18362 ---> 10471 +18367 ---> 10472 +18368 ---> 10473 +18369 ---> 10474 +18370 ---> 10475 +18371 ---> 10476 +18375 ---> 10477 +18377 ---> 10478 +18381 ---> 10479 +18386 ---> 10480 +18389 ---> 10481 +18396 ---> 10482 +18399 ---> 10483 +18400 ---> 10484 +18401 ---> 10485 +18405 ---> 10486 +18406 ---> 10487 +18407 ---> 10488 +18408 ---> 10489 +18410 ---> 10490 +18413 ---> 10491 +18420 ---> 10492 +18428 ---> 10493 +18430 ---> 10494 +18431 ---> 10495 +18434 ---> 10496 +18436 ---> 10497 +18437 ---> 10498 +18439 ---> 10499 +18440 ---> 10500 +18441 ---> 10501 +18443 ---> 10502 +18445 ---> 10503 +18446 ---> 10504 +18447 ---> 10505 +18448 ---> 10506 +18449 ---> 10507 +18450 ---> 10508 +18452 ---> 10509 +18453 ---> 10510 +18454 ---> 10511 +18459 ---> 10512 +18463 ---> 10513 +18464 ---> 10514 +18465 ---> 10515 +18466 ---> 10516 +18467 ---> 10517 +18478 ---> 10518 +18481 ---> 10519 +18482 ---> 10520 +18484 ---> 10521 +18485 ---> 10522 +18486 ---> 10523 +18488 ---> 10524 +18490 ---> 10525 +18491 ---> 10526 +18497 ---> 10527 +18498 ---> 10528 +18501 ---> 10529 +18521 ---> 10530 +18522 ---> 10531 +18525 ---> 10532 +18532 ---> 10533 +18533 ---> 10534 +18536 ---> 10535 +18537 ---> 10536 +18538 ---> 10537 +18539 ---> 10538 +18541 ---> 10539 +18542 ---> 10540 +18543 ---> 10541 +18544 ---> 10542 +18545 ---> 10543 +18547 ---> 10544 +18549 ---> 10545 +18553 ---> 10546 +18560 ---> 10547 +18562 ---> 10548 +18564 ---> 10549 +18565 ---> 10550 +18566 ---> 10551 +18575 ---> 10552 +18577 ---> 10553 +18579 ---> 10555 +18580 ---> 10556 +18594 ---> 10557 +18599 ---> 10558 +18602 ---> 10559 +18603 ---> 10560 +18607 ---> 10561 +18617 ---> 10562 +18618 ---> 10563 +18619 ---> 10564 +18630 ---> 10565 +18632 ---> 10566 +18633 ---> 10567 +18634 ---> 10568 +18635 ---> 10569 +18637 ---> 10570 +18639 ---> 10571 +18640 ---> 10572 +18641 ---> 10573 +18642 ---> 10574 +18643 ---> 10575 +18646 ---> 10576 +18647 ---> 10577 +18648 ---> 10578 +18654 ---> 10579 +18655 ---> 10580 +18656 ---> 10581 +18658 ---> 10582 +18659 ---> 10583 +18660 ---> 10584 +18661 ---> 10585 +18669 ---> 10586 +18672 ---> 10587 +18673 ---> 10588 +18674 ---> 10589 +18675 ---> 10590 +18678 ---> 10591 +18679 ---> 10592 +18680 ---> 10593 +18682 ---> 10594 +18683 ---> 10595 +18688 ---> 10596 +18690 ---> 10597 +18692 ---> 10598 +18699 ---> 10599 +18700 ---> 10600 +18701 ---> 10601 +18702 ---> 10602 +18703 ---> 10603 +18704 ---> 10604 +18705 ---> 10605 +18709 ---> 10606 +18710 ---> 10607 +18712 ---> 10608 +18717 ---> 10609 +18719 ---> 10610 +18723 ---> 10611 +18727 ---> 10612 +18732 ---> 10613 +18739 ---> 10614 +18741 ---> 10615 +18743 ---> 10616 +18744 ---> 10617 +18746 ---> 10618 +18748 ---> 10619 +18752 ---> 10620 +18754 ---> 10621 +18755 ---> 10622 +18756 ---> 10623 +18758 ---> 10624 +18759 ---> 10625 +18765 ---> 10626 +18767 ---> 10627 +18770 ---> 10628 +18772 ---> 10629 +18777 ---> 10630 +18779 ---> 10631 +18780 ---> 10632 +18781 ---> 10633 +18786 ---> 10634 +18787 ---> 10635 +18788 ---> 10636 +18789 ---> 10637 +18790 ---> 10638 +18802 ---> 10639 +18815 ---> 10640 +18822 ---> 10641 +18823 ---> 10642 +18824 ---> 10643 +18827 ---> 10644 +18829 ---> 10645 +18831 ---> 10646 +18836 ---> 10647 +18840 ---> 10648 +18842 ---> 10649 +18846 ---> 10650 +18847 ---> 10651 +18850 ---> 10652 +18852 ---> 10653 +18855 ---> 10654 +18856 ---> 10655 +18857 ---> 10656 +18858 ---> 10657 +18863 ---> 10658 +18865 ---> 10659 +18867 ---> 10660 +18869 ---> 10661 +18872 ---> 10662 +18875 ---> 10663 +18877 ---> 10664 +18884 ---> 10665 +18885 ---> 10666 +18886 ---> 10667 +18889 ---> 10668 +18892 ---> 10669 +18893 ---> 10670 +18894 ---> 10671 +18895 ---> 10672 +18898 ---> 10673 +18903 ---> 10674 +18905 ---> 10675 +18906 ---> 10676 +18907 ---> 10677 +18908 ---> 10678 +18910 ---> 10679 +18912 ---> 10680 +18913 ---> 10681 +18914 ---> 10682 +18920 ---> 10683 +18925 ---> 10684 +18926 ---> 10685 +18934 ---> 10686 +18937 ---> 10687 +18939 ---> 10688 +18940 ---> 10689 +18943 ---> 10690 +18944 ---> 10691 +18945 ---> 10692 +18949 ---> 10693 +18954 ---> 10694 +18957 ---> 10695 +18958 ---> 10696 +18959 ---> 10697 +18960 ---> 10698 +18963 ---> 10699 +18966 ---> 10700 +18968 ---> 10701 +18969 ---> 10702 +18971 ---> 10703 +18973 ---> 10704 +18974 ---> 10705 +18977 ---> 10706 +18984 ---> 10707 +18986 ---> 10708 +18987 ---> 10709 +18988 ---> 10710 +18989 ---> 10711 +18991 ---> 10712 +18993 ---> 10713 +18997 ---> 10714 +19000 ---> 10715 +19001 ---> 10716 +19003 ---> 10717 +19007 ---> 10718 +19008 ---> 10719 +19009 ---> 10720 +19010 ---> 10721 +19011 ---> 10722 +19017 ---> 10723 +19018 ---> 10724 +19020 ---> 10725 +19022 ---> 10726 +19023 ---> 10727 +19025 ---> 10728 +19026 ---> 10729 +19027 ---> 10730 +19029 ---> 10731 +19030 ---> 10732 +19034 ---> 10733 +19036 ---> 10734 +19037 ---> 10735 +19038 ---> 10736 +19048 ---> 10737 +19056 ---> 10738 +19060 ---> 10739 +19061 ---> 10740 +19071 ---> 10741 +19074 ---> 10742 +19075 ---> 10743 +19076 ---> 10744 +19078 ---> 10745 +19080 ---> 10746 +19081 ---> 10747 +19082 ---> 10748 +19084 ---> 10749 +19085 ---> 10750 +19086 ---> 10751 +19088 ---> 10752 +19089 ---> 10753 +19090 ---> 10754 +19091 ---> 10755 +19093 ---> 10756 +19108 ---> 10757 +19110 ---> 10758 +19112 ---> 10759 +19116 ---> 10760 +19117 ---> 10761 +19118 ---> 10762 +19119 ---> 10763 +19120 ---> 10764 +19124 ---> 10765 +19127 ---> 10766 +19129 ---> 10767 +19131 ---> 10768 +19132 ---> 10769 +19133 ---> 10770 +19134 ---> 10771 +19138 ---> 10772 +19139 ---> 10773 +19140 ---> 10774 +19142 ---> 10775 +19147 ---> 10776 +19148 ---> 10777 +19149 ---> 10778 +19159 ---> 10779 +19160 ---> 10780 +19161 ---> 10781 +19164 ---> 10782 +19166 ---> 10783 +19167 ---> 10784 +19171 ---> 10785 +19174 ---> 10786 +19175 ---> 10787 +19178 ---> 10788 +19179 ---> 10789 +19182 ---> 10790 +19183 ---> 10791 +19185 ---> 10792 +19190 ---> 10793 +19192 ---> 10794 +19194 ---> 10795 +19197 ---> 10796 +19199 ---> 10797 +19203 ---> 10798 +19204 ---> 10799 +19209 ---> 10800 +19211 ---> 10801 +19214 ---> 10802 +19215 ---> 10803 +19216 ---> 10804 +19217 ---> 10805 +19218 ---> 10806 +19220 ---> 10807 +19221 ---> 10808 +19222 ---> 10809 +19225 ---> 10810 +19229 ---> 10811 +19231 ---> 10812 +19243 ---> 10813 +19245 ---> 10814 +19246 ---> 10815 +19248 ---> 10816 +19250 ---> 10817 +19253 ---> 10818 +19255 ---> 10819 +19256 ---> 10820 +19257 ---> 10821 +19267 ---> 10822 +19268 ---> 10823 +19271 ---> 10824 +19272 ---> 10825 +19273 ---> 10826 +19277 ---> 10827 +19279 ---> 10828 +19280 ---> 10829 +19283 ---> 10830 +19285 ---> 10831 +19286 ---> 10832 +19288 ---> 10833 +19289 ---> 10834 +19292 ---> 10835 +19293 ---> 10836 +19295 ---> 10837 +19299 ---> 10838 +19300 ---> 10839 +19302 ---> 10840 +19305 ---> 10841 +19307 ---> 10842 +19308 ---> 10843 +19317 ---> 10844 +19322 ---> 10845 +19337 ---> 10846 +19339 ---> 10847 +19340 ---> 10848 +19346 ---> 10849 +19347 ---> 10850 +19353 ---> 10851 +19355 ---> 10852 +19357 ---> 10853 +19358 ---> 10854 +19360 ---> 10855 +19361 ---> 10856 +19368 ---> 10857 +19370 ---> 10858 +19374 ---> 10859 +19376 ---> 10860 +19381 ---> 10861 +19386 ---> 10862 +19397 ---> 10863 +19400 ---> 10864 +19402 ---> 10865 +19403 ---> 10866 +19404 ---> 10867 +19405 ---> 10868 +19406 ---> 10869 +19407 ---> 10870 +19408 ---> 10871 +19411 ---> 10872 +19412 ---> 10873 +19413 ---> 10874 +19415 ---> 10875 +19416 ---> 10876 +19417 ---> 10877 +19424 ---> 10878 +19425 ---> 10879 +19426 ---> 10880 +19428 ---> 10881 +19432 ---> 10882 +19435 ---> 10883 +19437 ---> 10884 +19438 ---> 10885 +19439 ---> 10886 +19440 ---> 10887 +19441 ---> 10888 +19443 ---> 10889 +19444 ---> 10890 +19447 ---> 10891 +19448 ---> 10892 +19450 ---> 10893 +19454 ---> 10894 +19457 ---> 10895 +19460 ---> 10896 +19462 ---> 10897 +19464 ---> 10898 +19467 ---> 10899 +19468 ---> 10900 +19474 ---> 10901 +19478 ---> 10902 +19480 ---> 10903 +19481 ---> 10904 +19483 ---> 10905 +19492 ---> 10906 +19498 ---> 10907 +19499 ---> 10908 +19502 ---> 10909 +19506 ---> 10910 +19511 ---> 10911 +19515 ---> 10912 +19517 ---> 10913 +19519 ---> 10914 +19521 ---> 10915 +19522 ---> 10916 +19529 ---> 10917 +19537 ---> 10918 +19538 ---> 10919 +19540 ---> 10920 +19547 ---> 10921 +19549 ---> 10922 +19550 ---> 10923 +19555 ---> 10924 +19558 ---> 10925 +19562 ---> 10926 +19563 ---> 10927 +19564 ---> 10928 +19566 ---> 10929 +19568 ---> 10930 +19569 ---> 10931 +19574 ---> 10932 +19578 ---> 10933 +19579 ---> 10934 +19583 ---> 10935 +19587 ---> 10936 +19591 ---> 10937 +19592 ---> 10938 +19596 ---> 10939 +19597 ---> 10940 +19599 ---> 10941 +19600 ---> 10942 +19601 ---> 10943 +19609 ---> 10944 +19611 ---> 10945 +19614 ---> 10946 +19615 ---> 10947 +19616 ---> 10948 +19617 ---> 10949 +19620 ---> 10950 +19622 ---> 10951 +19624 ---> 10952 +19625 ---> 10953 +19626 ---> 10954 +19627 ---> 10955 +19628 ---> 10956 +19629 ---> 10957 +19632 ---> 10958 +19637 ---> 10959 +19641 ---> 10960 +19642 ---> 10961 +19648 ---> 10962 +19649 ---> 10963 +19651 ---> 10964 +19654 ---> 10965 +19657 ---> 10966 +19661 ---> 10967 +19668 ---> 10968 +19669 ---> 10969 +19671 ---> 10970 +19672 ---> 10971 +19674 ---> 10972 +19676 ---> 10973 +19679 ---> 10974 +19680 ---> 10975 +19682 ---> 10976 +19683 ---> 10977 +19684 ---> 10978 +19685 ---> 10979 +19686 ---> 10980 +19688 ---> 10981 +19689 ---> 10982 +19690 ---> 10983 +19694 ---> 10984 +19696 ---> 10985 +19698 ---> 10986 +19699 ---> 10987 +19704 ---> 10988 +19705 ---> 10989 +19706 ---> 10990 +19710 ---> 10991 +19711 ---> 10992 +19714 ---> 10993 +19715 ---> 10994 +19721 ---> 10995 +19722 ---> 10996 +19724 ---> 10997 +19731 ---> 10998 +19732 ---> 10999 +19733 ---> 11000 +19734 ---> 11001 +19735 ---> 11002 +19739 ---> 11003 +19741 ---> 11004 +19746 ---> 11005 +19751 ---> 11006 +19752 ---> 11007 +19754 ---> 11008 +19757 ---> 11009 +19758 ---> 11010 +19759 ---> 11011 +19762 ---> 11012 +19764 ---> 11013 +19765 ---> 11014 +19767 ---> 11015 +19769 ---> 11016 +19786 ---> 11017 +19787 ---> 11018 +19791 ---> 11019 +19795 ---> 11020 +19796 ---> 11021 +19797 ---> 11022 +19799 ---> 11023 +19802 ---> 11024 +19805 ---> 11025 +19806 ---> 11026 +19807 ---> 11027 +19809 ---> 11028 +19810 ---> 11029 +19814 ---> 11030 +19816 ---> 11031 +19817 ---> 11032 +19821 ---> 11033 +19825 ---> 11034 +19828 ---> 11035 +19829 ---> 11036 +19832 ---> 11037 +19834 ---> 11038 +19836 ---> 11039 +19837 ---> 11040 +19839 ---> 11041 +19843 ---> 11042 +19846 ---> 11043 +19847 ---> 11044 +19850 ---> 11045 +19851 ---> 11046 +19852 ---> 11047 +19853 ---> 11048 +19854 ---> 11049 +19856 ---> 11050 +19859 ---> 11051 +19860 ---> 11052 +19862 ---> 11053 +19865 ---> 11054 +19871 ---> 11055 +19873 ---> 11056 +19875 ---> 11057 +19876 ---> 11058 +19877 ---> 11059 +19880 ---> 11060 +19882 ---> 11061 +19888 ---> 11062 +19890 ---> 11063 +19893 ---> 11064 +19894 ---> 11065 +19896 ---> 11066 +19902 ---> 11067 +19906 ---> 11068 +19907 ---> 11069 +19908 ---> 11070 +19910 ---> 11071 +19912 ---> 11072 +19915 ---> 11073 +19916 ---> 11074 +19919 ---> 11075 +19920 ---> 11076 +19922 ---> 11077 +19923 ---> 11078 +19924 ---> 11079 +19925 ---> 11080 +19931 ---> 11081 +19932 ---> 11082 +19936 ---> 11083 +19937 ---> 11084 +19938 ---> 11085 +19940 ---> 11086 +19952 ---> 11087 +19953 ---> 11088 +19954 ---> 11089 +19965 ---> 11090 +19966 ---> 11091 +19969 ---> 11092 +19971 ---> 11093 +19982 ---> 11094 +19983 ---> 11095 +19984 ---> 11096 +19985 ---> 11097 +19986 ---> 11098 +19987 ---> 11099 +19989 ---> 11100 +19997 ---> 11101 +20001 ---> 11102 +20003 ---> 11103 +20004 ---> 11104 +20012 ---> 11105 +20015 ---> 11106 +20016 ---> 11107 +20022 ---> 11108 +20023 ---> 11109 +20024 ---> 11110 +20025 ---> 11111 +20026 ---> 11112 +20029 ---> 11113 +20031 ---> 11114 +20032 ---> 11115 +20034 ---> 11116 +20039 ---> 11117 +20040 ---> 11119 +20041 ---> 11120 +20046 ---> 11121 +20057 ---> 11122 +20060 ---> 11123 +20062 ---> 11124 +20063 ---> 11125 +20066 ---> 11126 +20074 ---> 11127 +20075 ---> 11128 +20076 ---> 11129 +20077 ---> 11130 +20086 ---> 11131 +20087 ---> 11132 +20088 ---> 11133 +20089 ---> 11134 +20092 ---> 11135 +20102 ---> 11136 +20103 ---> 11137 +20106 ---> 11138 +20110 ---> 11139 +20112 ---> 11140 +20114 ---> 11141 +20122 ---> 11142 +20123 ---> 11143 +20128 ---> 11144 +20131 ---> 11145 +20138 ---> 11146 +20140 ---> 11147 +20149 ---> 11148 +20150 ---> 11149 +20154 ---> 11150 +20155 ---> 11151 +20156 ---> 11152 +20161 ---> 11153 +20162 ---> 11154 +20164 ---> 11155 +20165 ---> 11156 +20166 ---> 11157 +20168 ---> 11158 +20169 ---> 11159 +20170 ---> 11160 +20171 ---> 11161 +20174 ---> 11162 +20176 ---> 11163 +20177 ---> 11164 +20178 ---> 11165 +20179 ---> 11166 +20182 ---> 11167 +20185 ---> 11168 +20195 ---> 11169 +20197 ---> 11170 +20200 ---> 11171 +20205 ---> 11172 +20208 ---> 11173 +20209 ---> 11174 +20211 ---> 11175 +20212 ---> 11176 +20215 ---> 11177 +20217 ---> 11178 +20220 ---> 11179 +20222 ---> 11180 +20223 ---> 11181 +20224 ---> 11182 +20225 ---> 11183 +20226 ---> 11184 +20229 ---> 11185 +20232 ---> 11186 +20234 ---> 11187 +20236 ---> 11188 +20244 ---> 11189 +20245 ---> 11190 +20246 ---> 11191 +20253 ---> 11192 +20260 ---> 11193 +20261 ---> 11194 +20262 ---> 11195 +20269 ---> 11196 +20273 ---> 11197 +20279 ---> 11198 +20281 ---> 11199 +20282 ---> 965 +20284 ---> 11200 +20287 ---> 11201 +20295 ---> 11202 +20296 ---> 11203 +20299 ---> 11204 +20300 ---> 11205 +20307 ---> 11206 +20312 ---> 11207 +20313 ---> 11208 +20314 ---> 11209 +20317 ---> 11210 +20319 ---> 11211 +20320 ---> 11212 +20322 ---> 11213 +20323 ---> 11214 +20324 ---> 11215 +20328 ---> 11216 +20329 ---> 11217 +20330 ---> 11218 +20339 ---> 11219 +20340 ---> 11220 +20352 ---> 11221 +20353 ---> 11222 +20354 ---> 11223 +20355 ---> 11224 +20358 ---> 11225 +20369 ---> 11226 +20372 ---> 11227 +20373 ---> 11228 +20379 ---> 11229 +20388 ---> 11230 +20389 ---> 11231 +20392 ---> 11232 +20397 ---> 11233 +20401 ---> 11234 +20405 ---> 11235 +20413 ---> 11236 +20414 ---> 11237 +20416 ---> 11238 +20421 ---> 11239 +20424 ---> 11240 +20426 ---> 11241 +20427 ---> 11242 +20434 ---> 11243 +20435 ---> 11244 +20437 ---> 11245 +20439 ---> 11246 +20449 ---> 11247 +20452 ---> 11248 +20454 ---> 11249 +20456 ---> 11250 +20457 ---> 11251 +20460 ---> 11252 +20461 ---> 11253 +20462 ---> 11254 +20465 ---> 11255 +20468 ---> 11256 +20473 ---> 11257 +20474 ---> 11258 +20478 ---> 825 +20479 ---> 11259 +20480 ---> 11260 +20482 ---> 11261 +20484 ---> 11262 +20486 ---> 11263 +20487 ---> 11264 +20488 ---> 11265 +20489 ---> 11266 +20492 ---> 11267 +20493 ---> 11268 +20494 ---> 11269 +20498 ---> 11270 +20499 ---> 11271 +20504 ---> 11272 +20505 ---> 11273 +20507 ---> 11274 +20510 ---> 11275 +20514 ---> 11276 +20515 ---> 11277 +20516 ---> 11278 +20517 ---> 11279 +20518 ---> 11280 +20519 ---> 11281 +20520 ---> 11282 +20521 ---> 11283 +20522 ---> 11284 +20523 ---> 11285 +20524 ---> 11286 +20526 ---> 11287 +20531 ---> 11288 +20533 ---> 11289 +20534 ---> 11290 +20536 ---> 11291 +20538 ---> 11292 +20539 ---> 11293 +20540 ---> 11294 +20541 ---> 11295 +20542 ---> 11296 +20543 ---> 11297 +20544 ---> 11298 +20549 ---> 11299 +20550 ---> 11300 +20555 ---> 11301 +20556 ---> 11302 +20557 ---> 11303 +20561 ---> 11304 +20562 ---> 11305 +20563 ---> 11306 +20564 ---> 11307 +20565 ---> 11308 +20566 ---> 11309 +20568 ---> 11310 +20571 ---> 11311 +20580 ---> 11312 +20582 ---> 11313 +20583 ---> 11314 +20585 ---> 11315 +20586 ---> 11316 +20590 ---> 11317 +20592 ---> 11318 +20593 ---> 11319 +20594 ---> 11320 +20595 ---> 11321 +20596 ---> 11322 +20597 ---> 11323 +20598 ---> 11324 +20599 ---> 11325 +20600 ---> 11326 +20601 ---> 11327 +20602 ---> 11328 +20603 ---> 11329 +20605 ---> 11330 +20606 ---> 11331 +20607 ---> 11332 +20608 ---> 11333 +20610 ---> 11334 +20616 ---> 11335 +20620 ---> 11336 +20624 ---> 11337 +20625 ---> 11338 +20626 ---> 11339 +20627 ---> 11340 +20629 ---> 11341 +20630 ---> 11342 +20631 ---> 11343 +20632 ---> 11344 +20636 ---> 11345 +20642 ---> 11346 +20647 ---> 11347 +20651 ---> 11348 +20656 ---> 11349 +20657 ---> 11350 +20663 ---> 11351 +20664 ---> 11352 +20666 ---> 11353 +20668 ---> 11354 +20669 ---> 11355 +20671 ---> 11356 +20672 ---> 11357 +20677 ---> 11358 +20678 ---> 11359 +20682 ---> 11360 +20684 ---> 11361 +20688 ---> 11362 +20689 ---> 11363 +20690 ---> 11364 +20691 ---> 11365 +20694 ---> 11366 +20700 ---> 11367 +20702 ---> 11368 +20705 ---> 11369 +20706 ---> 11370 +20708 ---> 11371 +20714 ---> 11372 +20715 ---> 11373 +20716 ---> 11374 +20717 ---> 11375 +20718 ---> 11376 +20719 ---> 11377 +20721 ---> 11378 +20722 ---> 11379 +20726 ---> 11380 +20732 ---> 11381 +20737 ---> 11382 +20739 ---> 11383 +20744 ---> 11384 +20747 ---> 11385 +20751 ---> 11386 +20754 ---> 11387 +20757 ---> 11388 +20761 ---> 11389 +20763 ---> 11390 +20765 ---> 11391 +20766 ---> 11392 +20767 ---> 11393 +20776 ---> 11394 +20777 ---> 11395 +20778 ---> 11396 +20784 ---> 11397 +20786 ---> 11398 +20791 ---> 11399 +20794 ---> 11400 +20797 ---> 11401 +20798 ---> 11402 +20799 ---> 11403 +20800 ---> 11404 +20801 ---> 11405 +20802 ---> 11406 +20803 ---> 11407 +20804 ---> 27815 +20806 ---> 11408 +20811 ---> 11409 +20813 ---> 11410 +20816 ---> 11411 +20819 ---> 11412 +20820 ---> 11413 +20821 ---> 11414 +20823 ---> 11415 +20826 ---> 11416 +20829 ---> 11417 +20831 ---> 11418 +20833 ---> 11419 +20835 ---> 11420 +20837 ---> 11421 +20849 ---> 11422 +20850 ---> 11423 +20858 ---> 11424 +20860 ---> 11425 +20862 ---> 11426 +20881 ---> 11427 +20894 ---> 11428 +20902 ---> 11429 +20904 ---> 11430 +20905 ---> 11431 +20909 ---> 11432 +20911 ---> 3516 +20913 ---> 11433 +20915 ---> 11434 +20917 ---> 11435 +20922 ---> 11436 +20924 ---> 11437 +20926 ---> 11438 +20928 ---> 11439 +20930 ---> 11440 +20931 ---> 11441 +20933 ---> 11442 +20937 ---> 11443 +20938 ---> 11444 +20939 ---> 11445 +20941 ---> 11446 +20942 ---> 11447 +20943 ---> 11448 +20944 ---> 11449 +20946 ---> 11450 +20948 ---> 11451 +20951 ---> 11452 +20952 ---> 11453 +20955 ---> 11454 +20957 ---> 11455 +20958 ---> 11456 +20965 ---> 11457 +20966 ---> 11458 +20970 ---> 11459 +20972 ---> 11460 +20973 ---> 11461 +20977 ---> 11462 +20979 ---> 11463 +20984 ---> 11464 +20986 ---> 11465 +20988 ---> 11466 +20989 ---> 11467 +20990 ---> 11468 +20991 ---> 11469 +20992 ---> 11470 +20996 ---> 11471 +20999 ---> 11472 +21001 ---> 11473 +21003 ---> 11474 +21006 ---> 11475 +21009 ---> 11476 +21011 ---> 11477 +21014 ---> 11478 +21022 ---> 11479 +21025 ---> 11480 +21027 ---> 11481 +21028 ---> 11482 +21032 ---> 11483 +21033 ---> 11484 +21042 ---> 11485 +21043 ---> 11486 +21044 ---> 11487 +21046 ---> 11488 +21047 ---> 11489 +21049 ---> 11490 +21050 ---> 11491 +21051 ---> 11492 +21055 ---> 11493 +21057 ---> 11494 +21061 ---> 11495 +21062 ---> 11496 +21064 ---> 11497 +21065 ---> 11498 +21066 ---> 11499 +21069 ---> 11500 +21070 ---> 11501 +21075 ---> 11502 +21078 ---> 11503 +21079 ---> 11504 +21080 ---> 11505 +21085 ---> 11506 +21088 ---> 11507 +21089 ---> 11508 +21090 ---> 11509 +21092 ---> 27960 +21095 ---> 11510 +21096 ---> 11511 +21100 ---> 11512 +21105 ---> 11513 +21107 ---> 11514 +21108 ---> 11515 +21110 ---> 11516 +21112 ---> 11517 +21113 ---> 2408 +21114 ---> 11518 +21115 ---> 11519 +21117 ---> 11520 +21124 ---> 11521 +21126 ---> 11522 +21130 ---> 11523 +21132 ---> 11524 +21133 ---> 11525 +21134 ---> 11526 +21139 ---> 11527 +21143 ---> 11528 +21144 ---> 11529 +21145 ---> 11530 +21152 ---> 11531 +21153 ---> 11532 +21154 ---> 11533 +21161 ---> 11534 +21167 ---> 11535 +21168 ---> 11536 +21172 ---> 11537 +21173 ---> 11538 +21174 ---> 11539 +21176 ---> 11540 +21182 ---> 11541 +21183 ---> 11542 +21185 ---> 11543 +21186 ---> 11544 +21187 ---> 11545 +21190 ---> 11546 +21191 ---> 11547 +21195 ---> 11548 +21199 ---> 11549 +21200 ---> 11550 +21208 ---> 11551 +21209 ---> 11552 +21210 ---> 11553 +21212 ---> 11554 +21213 ---> 11555 +21221 ---> 11556 +21223 ---> 11557 +21224 ---> 11558 +21231 ---> 11559 +21235 ---> 11560 +21236 ---> 11561 +21240 ---> 11562 +21241 ---> 11563 +21243 ---> 11564 +21244 ---> 11565 +21246 ---> 11566 +21247 ---> 11567 +21253 ---> 11568 +21257 ---> 11569 +21266 ---> 11570 +21268 ---> 11571 +21269 ---> 11572 +21271 ---> 11573 +21272 ---> 11574 +21273 ---> 11575 +21276 ---> 11576 +21277 ---> 11577 +21279 ---> 11578 +21282 ---> 11579 +21283 ---> 11580 +21288 ---> 11581 +21295 ---> 11582 +21296 ---> 11583 +21297 ---> 11584 +21298 ---> 11585 +21299 ---> 11586 +21301 ---> 11587 +21302 ---> 28033 +21303 ---> 11588 +21305 ---> 11589 +21306 ---> 11590 +21307 ---> 11591 +21308 ---> 11592 +21323 ---> 11593 +21330 ---> 11595 +21333 ---> 11596 +21334 ---> 11597 +21335 ---> 11598 +21339 ---> 11599 +21341 ---> 11600 +21347 ---> 11601 +21348 ---> 11602 +21349 ---> 11603 +21354 ---> 11604 +21357 ---> 11605 +21363 ---> 11606 +21370 ---> 11607 +21373 ---> 11608 +21375 ---> 11609 +21376 ---> 11610 +21377 ---> 11611 +21379 ---> 11612 +21380 ---> 11613 +21381 ---> 11614 +21382 ---> 11615 +21383 ---> 11616 +21385 ---> 11617 +21392 ---> 11618 +21398 ---> 11619 +21399 ---> 11620 +21402 ---> 11621 +21404 ---> 11622 +21408 ---> 11623 +21413 ---> 11624 +21422 ---> 11625 +21424 ---> 11626 +21427 ---> 11627 +21433 ---> 11628 +21434 ---> 11629 +21440 ---> 11630 +21441 ---> 11631 +21444 ---> 11632 +21445 ---> 11633 +21450 ---> 11634 +21454 ---> 11635 +21455 ---> 11636 +21456 ---> 11637 +21461 ---> 11638 +21464 ---> 11639 +21465 ---> 11640 +21466 ---> 11641 +21472 ---> 11642 +21473 ---> 11643 +21483 ---> 11644 +21484 ---> 11645 +21485 ---> 11646 +21486 ---> 11647 +21489 ---> 11648 +21490 ---> 11649 +21491 ---> 11650 +21494 ---> 11651 +21495 ---> 11652 +21500 ---> 11653 +21504 ---> 11654 +21506 ---> 11655 +21510 ---> 11656 +21514 ---> 11657 +21516 ---> 11658 +21517 ---> 11659 +21519 ---> 11660 +21521 ---> 11661 +21522 ---> 11662 +21524 ---> 11663 +21530 ---> 11664 +21531 ---> 11665 +21538 ---> 28206 +21542 ---> 11666 +21544 ---> 11667 +21546 ---> 11668 +21548 ---> 11669 +21550 ---> 11670 +21552 ---> 11671 +21559 ---> 11672 +21563 ---> 11673 +21576 ---> 11674 +21577 ---> 11675 +21578 ---> 11676 +21579 ---> 11677 +21581 ---> 11678 +21582 ---> 11679 +21583 ---> 11680 +21584 ---> 11681 +21585 ---> 11682 +21593 ---> 11683 +21594 ---> 11684 +21595 ---> 11685 +21596 ---> 11686 +21597 ---> 11687 +21599 ---> 11688 +21603 ---> 11689 +21609 ---> 11690 +21610 ---> 11691 +21611 ---> 11692 +21612 ---> 11693 +21616 ---> 11694 +21625 ---> 11695 +21626 ---> 11696 +21627 ---> 11697 +21629 ---> 11698 +21630 ---> 11699 +21631 ---> 11700 +21635 ---> 11701 +21644 ---> 11702 +21648 ---> 11703 +21651 ---> 11704 +21660 ---> 11705 +21662 ---> 11706 +21664 ---> 11707 +21665 ---> 11708 +21666 ---> 11709 +21667 ---> 11710 +21668 ---> 11711 +21670 ---> 28264 +21673 ---> 11712 +21676 ---> 11713 +21677 ---> 11714 +21680 ---> 11715 +21684 ---> 11716 +21685 ---> 11717 +21688 ---> 11718 +21690 ---> 11719 +21692 ---> 11720 +21693 ---> 11721 +21696 ---> 11722 +21698 ---> 11723 +21701 ---> 11724 +21708 ---> 11725 +21723 ---> 11726 +21731 ---> 11727 +21739 ---> 11728 +21740 ---> 11729 +21742 ---> 11730 +21743 ---> 11731 +21744 ---> 11732 +21746 ---> 28308 +21750 ---> 11733 +21761 ---> 11734 +21762 ---> 11735 +21772 ---> 11736 +21773 ---> 11737 +21775 ---> 11738 +21778 ---> 11739 +21780 ---> 11740 +21784 ---> 11741 +21790 ---> 11742 +21791 ---> 11743 +21794 ---> 11744 +21796 ---> 11745 +21798 ---> 11746 +21799 ---> 11747 +21801 ---> 11748 +21802 ---> 11749 +21807 ---> 11750 +21810 ---> 11751 +21823 ---> 11752 +21827 ---> 11753 +21834 ---> 11754 +21839 ---> 11755 +21840 ---> 11756 +21841 ---> 11757 +21842 ---> 11758 +21843 ---> 11759 +21844 ---> 11760 +21845 ---> 11761 +21846 ---> 11762 +21849 ---> 11763 +21854 ---> 11764 +21855 ---> 11765 +21856 ---> 11766 +21862 ---> 11767 +21863 ---> 11768 +21865 ---> 11769 +21870 ---> 11770 +21871 ---> 11771 +21873 ---> 11772 +21874 ---> 11773 +21879 ---> 11774 +21881 ---> 11775 +21883 ---> 11776 +21885 ---> 11777 +21890 ---> 11778 +21892 ---> 11779 +21897 ---> 11780 +21898 ---> 11781 +21899 ---> 11782 +21903 ---> 11783 +21904 ---> 11784 +21906 ---> 11785 +21907 ---> 11786 +21910 ---> 11787 +21921 ---> 11788 +21923 ---> 11789 +21932 ---> 11790 +21935 ---> 11791 +21938 ---> 11792 +21941 ---> 11793 +21942 ---> 11794 +21946 ---> 11795 +21949 ---> 11796 +21951 ---> 11797 +21952 ---> 11798 +21953 ---> 11799 +21958 ---> 11800 +21964 ---> 11801 +21969 ---> 11802 +21970 ---> 11803 +21971 ---> 11804 +21972 ---> 11805 +21973 ---> 11806 +21974 ---> 11807 +21975 ---> 11808 +21976 ---> 11809 +21977 ---> 11810 +21985 ---> 11811 +21990 ---> 11812 +21994 ---> 11813 +21995 ---> 11814 +22000 ---> 11815 +22001 ---> 11816 +22004 ---> 11817 +22005 ---> 11818 +22009 ---> 11819 +22010 ---> 11820 +22014 ---> 28438 +22015 ---> 11821 +22016 ---> 11822 +22020 ---> 11823 +22021 ---> 11824 +22024 ---> 11825 +22026 ---> 11826 +22027 ---> 11827 +22028 ---> 11828 +22029 ---> 11829 +22031 ---> 11830 +22033 ---> 11831 +22045 ---> 11832 +22046 ---> 11833 +22055 ---> 11834 +22056 ---> 11835 +22057 ---> 11836 +22058 ---> 11837 +22059 ---> 11838 +22063 ---> 11839 +22066 ---> 11840 +22069 ---> 11841 +22073 ---> 11842 +22074 ---> 11843 +22075 ---> 11844 +22076 ---> 11845 +22077 ---> 11846 +22078 ---> 11847 +22079 ---> 11848 +22082 ---> 11849 +22086 ---> 11850 +22087 ---> 11851 +22090 ---> 11852 +22092 ---> 11853 +22093 ---> 11854 +22094 ---> 11855 +22095 ---> 11856 +22098 ---> 11857 +22103 ---> 11858 +22107 ---> 11859 +22108 ---> 11860 +22109 ---> 11861 +22110 ---> 11862 +22113 ---> 11863 +22114 ---> 11864 +22121 ---> 11865 +22123 ---> 11866 +22124 ---> 11867 +22125 ---> 11868 +22128 ---> 11869 +22130 ---> 11870 +22132 ---> 11871 +22134 ---> 11872 +22137 ---> 11873 +22139 ---> 11874 +22140 ---> 11875 +22142 ---> 11876 +22150 ---> 11877 +22151 ---> 11878 +22159 ---> 11879 +22163 ---> 11880 +22165 ---> 11881 +22169 ---> 11882 +22170 ---> 11883 +22174 ---> 11884 +22176 ---> 11885 +22177 ---> 28496 +22179 ---> 11886 +22190 ---> 11887 +22199 ---> 11888 +22200 ---> 11889 +22201 ---> 11890 +22208 ---> 11891 +22209 ---> 11892 +22210 ---> 11893 +22212 ---> 11894 +22213 ---> 11895 +22215 ---> 11896 +22217 ---> 11897 +22219 ---> 11898 +22224 ---> 11899 +22226 ---> 11900 +22227 ---> 11901 +22232 ---> 11902 +22235 ---> 11903 +22239 ---> 11904 +22240 ---> 11905 +22242 ---> 11906 +22244 ---> 11907 +22245 ---> 11908 +22246 ---> 11909 +22247 ---> 11910 +22248 ---> 11911 +22250 ---> 11912 +22253 ---> 11913 +22256 ---> 11914 +22259 ---> 11915 +22260 ---> 11916 +22262 ---> 11917 +22264 ---> 11918 +22265 ---> 11919 +22267 ---> 11920 +22268 ---> 11921 +22269 ---> 11922 +22270 ---> 11923 +22271 ---> 11924 +22276 ---> 11925 +22278 ---> 11926 +22282 ---> 28562 +22284 ---> 11927 +22286 ---> 11928 +22287 ---> 11929 +22288 ---> 11930 +22293 ---> 11931 +22299 ---> 11932 +22302 ---> 11933 +22303 ---> 11934 +22306 ---> 11935 +22308 ---> 11936 +22314 ---> 11937 +22315 ---> 11938 +22316 ---> 11939 +22319 ---> 11940 +22320 ---> 11941 +22323 ---> 11942 +22324 ---> 11943 +22326 ---> 11944 +22330 ---> 11945 +22337 ---> 11946 +22339 ---> 11947 +22341 ---> 11948 +22342 ---> 11949 +22343 ---> 11950 +22344 ---> 11951 +22345 ---> 11952 +22348 ---> 11953 +22361 ---> 11954 +22365 ---> 11955 +22366 ---> 11956 +22367 ---> 11957 +22368 ---> 11958 +22374 ---> 11959 +22379 ---> 11960 +22382 ---> 11961 +22384 ---> 11962 +22385 ---> 11963 +22386 ---> 11964 +22388 ---> 11965 +22391 ---> 11966 +22393 ---> 11967 +22394 ---> 11968 +22398 ---> 11969 +22399 ---> 11970 +22400 ---> 11971 +22401 ---> 11972 +22402 ---> 11973 +22404 ---> 11974 +22405 ---> 11975 +22407 ---> 11976 +22409 ---> 11977 +22410 ---> 11978 +22413 ---> 11979 +22414 ---> 11980 +22419 ---> 11981 +22422 ---> 11982 +22423 ---> 11983 +22424 ---> 11984 +22426 ---> 11985 +22430 ---> 11986 +22436 ---> 11987 +22440 ---> 11988 +22441 ---> 11989 +22442 ---> 11990 +22443 ---> 11991 +22445 ---> 11992 +22446 ---> 11993 +22448 ---> 11994 +22449 ---> 11995 +22457 ---> 11996 +22458 ---> 11997 +22459 ---> 11998 +22461 ---> 28637 +22463 ---> 11999 +22467 ---> 12000 +22473 ---> 12001 +22476 ---> 12002 +22478 ---> 12003 +22482 ---> 12004 +22484 ---> 12005 +22486 ---> 12006 +22502 ---> 12007 +22508 ---> 12008 +22509 ---> 12009 +22510 ---> 12010 +22511 ---> 12011 +22512 ---> 12012 +22513 ---> 12013 +22514 ---> 12014 +22517 ---> 12015 +22521 ---> 12016 +22526 ---> 12017 +22529 ---> 12018 +22537 ---> 12019 +22538 ---> 12020 +22545 ---> 12021 +22547 ---> 12022 +22549 ---> 12023 +22553 ---> 12024 +22554 ---> 12025 +22555 ---> 12026 +22556 ---> 12027 +22561 ---> 12028 +22562 ---> 12029 +22566 ---> 12030 +22569 ---> 12031 +22571 ---> 12032 +22583 ---> 12033 +22585 ---> 12034 +22587 ---> 12035 +22588 ---> 12036 +22592 ---> 12037 +22597 ---> 12038 +22598 ---> 12039 +22600 ---> 12040 +22601 ---> 12041 +22614 ---> 12042 +22615 ---> 12043 +22616 ---> 12044 +22620 ---> 12045 +22624 ---> 12046 +22627 ---> 12047 +22629 ---> 12048 +22631 ---> 12049 +22640 ---> 12050 +22641 ---> 12051 +22642 ---> 12052 +22644 ---> 12053 +22646 ---> 12054 +22651 ---> 12055 +22653 ---> 12056 +22654 ---> 12057 +22655 ---> 12058 +22658 ---> 12059 +22661 ---> 12060 +22663 ---> 12061 +22667 ---> 12062 +22671 ---> 12063 +22673 ---> 12064 +22674 ---> 12065 +22675 ---> 12066 +22676 ---> 12067 +22677 ---> 12068 +22684 ---> 12069 +22690 ---> 12070 +22694 ---> 12071 +22698 ---> 12072 +22700 ---> 12073 +22709 ---> 12074 +22710 ---> 12075 +22719 ---> 12076 +22722 ---> 12077 +22724 ---> 12078 +22726 ---> 12079 +22727 ---> 12080 +22728 ---> 12081 +22729 ---> 12082 +22739 ---> 12083 +22740 ---> 12084 +22745 ---> 12085 +22747 ---> 12086 +22748 ---> 12087 +22749 ---> 12088 +22750 ---> 12089 +22757 ---> 12090 +22758 ---> 12091 +22762 ---> 12092 +22763 ---> 12093 +22764 ---> 12094 +22765 ---> 12095 +22766 ---> 12096 +22767 ---> 12097 +22768 ---> 12098 +22772 ---> 12099 +22777 ---> 12100 +22778 ---> 12101 +22780 ---> 12102 +22783 ---> 12103 +22784 ---> 12104 +22787 ---> 12105 +22790 ---> 12106 +22792 ---> 12107 +22797 ---> 12108 +22812 ---> 12109 +22813 ---> 12110 +22814 ---> 12111 +22815 ---> 12112 +22820 ---> 12113 +22823 ---> 12114 +22824 ---> 12115 +22826 ---> 12116 +22827 ---> 12117 +22828 ---> 12118 +22833 ---> 12119 +22836 ---> 12120 +22837 ---> 12121 +22838 ---> 12122 +22842 ---> 12123 +22844 ---> 12124 +22845 ---> 12125 +22847 ---> 12126 +22849 ---> 12127 +22850 ---> 12128 +22851 ---> 12129 +22855 ---> 12130 +22858 ---> 12131 +22862 ---> 12132 +22863 ---> 12133 +22868 ---> 12134 +22873 ---> 12135 +22874 ---> 12136 +22888 ---> 12137 +22891 ---> 12138 +22893 ---> 12139 +22897 ---> 12140 +22898 ---> 12141 +22900 ---> 12142 +22902 ---> 12143 +22904 ---> 12144 +22907 ---> 12145 +22908 ---> 12146 +22909 ---> 12147 +22911 ---> 12148 +22916 ---> 12149 +22919 ---> 12150 +22920 ---> 12151 +22933 ---> 12152 +22936 ---> 12153 +22939 ---> 12154 +22940 ---> 12155 +22945 ---> 12156 +22946 ---> 12157 +22947 ---> 12158 +22951 ---> 12159 +22957 ---> 12160 +22961 ---> 12161 +22962 ---> 12162 +22964 ---> 12163 +22971 ---> 12164 +22974 ---> 12165 +22975 ---> 12166 +22986 ---> 12167 +22987 ---> 12168 +22988 ---> 12169 +22989 ---> 12170 +22990 ---> 12171 +22991 ---> 12172 +22995 ---> 12173 +22996 ---> 12174 +22998 ---> 12175 +23000 ---> 12176 +23001 ---> 12177 +23006 ---> 12178 +23008 ---> 12179 +23009 ---> 12180 +23011 ---> 12181 +23016 ---> 12182 +23020 ---> 12183 +23024 ---> 12184 +23027 ---> 12185 +23034 ---> 12186 +23037 ---> 12187 +23039 ---> 12188 +23040 ---> 12189 +23042 ---> 12190 +23045 ---> 12191 +23049 ---> 12192 +23050 ---> 12193 +23055 ---> 12194 +23059 ---> 12195 +23060 ---> 12196 +23064 ---> 12197 +23065 ---> 12198 +23066 ---> 12199 +23069 ---> 12200 +23071 ---> 12201 +23081 ---> 12202 +23083 ---> 12203 +23087 ---> 12204 +23089 ---> 12205 +23096 ---> 12206 +23097 ---> 12207 +23102 ---> 12208 +23103 ---> 12209 +23107 ---> 12210 +23112 ---> 12211 +23115 ---> 12212 +23118 ---> 12213 +23122 ---> 12214 +23123 ---> 12215 +23124 ---> 12216 +23126 ---> 12217 +23127 ---> 12218 +23129 ---> 12219 +23131 ---> 12220 +23132 ---> 12221 +23136 ---> 12222 +23139 ---> 12223 +23144 ---> 12224 +23147 ---> 12225 +23150 ---> 12226 +23151 ---> 12227 +23158 ---> 12228 +23159 ---> 12229 +23167 ---> 12230 +23168 ---> 12231 +23171 ---> 12232 +23172 ---> 12233 +23176 ---> 12234 +23181 ---> 12235 +23184 ---> 12236 +23189 ---> 12237 +23190 ---> 12238 +23191 ---> 12239 +23192 ---> 12240 +23194 ---> 12241 +23196 ---> 12242 +23197 ---> 12243 +23198 ---> 12244 +23199 ---> 12245 +23201 ---> 12246 +23207 ---> 12247 +23208 ---> 12248 +23211 ---> 12249 +23213 ---> 12250 +23214 ---> 12251 +23217 ---> 12252 +23218 ---> 3503 +23221 ---> 12253 +23222 ---> 12254 +23223 ---> 12255 +23224 ---> 12256 +23228 ---> 12257 +23230 ---> 12258 +23235 ---> 12259 +23241 ---> 12260 +23242 ---> 12261 +23248 ---> 12262 +23252 ---> 12263 +23253 ---> 12264 +23254 ---> 12265 +23262 ---> 12266 +23265 ---> 12267 +23268 ---> 12268 +23273 ---> 12269 +23274 ---> 12270 +23277 ---> 12271 +23278 ---> 12272 +23279 ---> 12273 +23280 ---> 12274 +23281 ---> 12275 +23283 ---> 28983 +23284 ---> 12276 +23285 ---> 12277 +23293 ---> 12278 +23296 ---> 12279 +23299 ---> 12280 +23304 ---> 12281 +23305 ---> 12282 +23309 ---> 12283 +23310 ---> 12284 +23312 ---> 12285 +23315 ---> 12286 +23316 ---> 12287 +23317 ---> 12288 +23319 ---> 12289 +23322 ---> 12290 +23324 ---> 12291 +23330 ---> 12292 +23337 ---> 12293 +23338 ---> 12294 +23340 ---> 12295 +23342 ---> 12296 +23343 ---> 12297 +23355 ---> 12298 +23358 ---> 12299 +23359 ---> 12300 +23362 ---> 12301 +23364 ---> 12302 +23365 ---> 12303 +23370 ---> 12304 +23375 ---> 12305 +23376 ---> 12306 +23378 ---> 12307 +23380 ---> 12308 +23382 ---> 12309 +23383 ---> 12310 +23386 ---> 12311 +23392 ---> 12312 +23393 ---> 12313 +23394 ---> 12314 +23395 ---> 12315 +23397 ---> 12316 +23400 ---> 12317 +23403 ---> 12318 +23404 ---> 12319 +23408 ---> 12320 +23409 ---> 12321 +23411 ---> 12322 +23412 ---> 12323 +23414 ---> 12324 +23417 ---> 12325 +23424 ---> 12326 +23425 ---> 12327 +23426 ---> 12328 +23427 ---> 12329 +23429 ---> 12330 +23431 ---> 3517 +23432 ---> 12331 +23437 ---> 12332 +23438 ---> 12333 +23439 ---> 12334 +23441 ---> 12335 +23442 ---> 12336 +23444 ---> 12337 +23445 ---> 12338 +23447 ---> 12339 +23452 ---> 12340 +23453 ---> 12341 +23456 ---> 29105 +23457 ---> 12342 +23464 ---> 12343 +23465 ---> 12344 +23467 ---> 12345 +23473 ---> 12346 +23474 ---> 12347 +23475 ---> 12348 +23477 ---> 12349 +23482 ---> 12350 +23484 ---> 12351 +23485 ---> 12352 +23496 ---> 12353 +23497 ---> 12354 +23500 ---> 12355 +23504 ---> 12356 +23507 ---> 12357 +23508 ---> 12358 +23509 ---> 12359 +23516 ---> 12360 +23520 ---> 12361 +23525 ---> 12362 +23527 ---> 12363 +23528 ---> 12364 +23530 ---> 12365 +23534 ---> 12366 +23538 ---> 12367 +23541 ---> 12368 +23542 ---> 12369 +23543 ---> 12370 +23544 ---> 12371 +23545 ---> 12372 +23546 ---> 12373 +23562 ---> 12374 +23563 ---> 12375 +23564 ---> 12376 +23567 ---> 12377 +23569 ---> 12378 +23573 ---> 12379 +23575 ---> 12380 +23577 ---> 12381 +23580 ---> 12382 +23582 ---> 12383 +23583 ---> 12384 +23596 ---> 12385 +23606 ---> 12386 +23607 ---> 12387 +23608 ---> 12388 +23612 ---> 12389 +23620 ---> 12390 +23621 ---> 12391 +23624 ---> 12392 +23640 ---> 12393 +23643 ---> 12394 +23644 ---> 12395 +23645 ---> 12396 +23646 ---> 12397 +23647 ---> 12398 +23648 ---> 12399 +23649 ---> 12400 +23650 ---> 12401 +23666 ---> 12402 +23669 ---> 12403 +23672 ---> 12404 +23681 ---> 12405 +23682 ---> 12406 +23683 ---> 12407 +23684 ---> 12408 +23685 ---> 12409 +23689 ---> 12410 +23693 ---> 12411 +23694 ---> 12412 +23701 ---> 12413 +23707 ---> 12414 +23711 ---> 12415 +23712 ---> 12416 +23713 ---> 12417 +23716 ---> 12418 +23720 ---> 12419 +23722 ---> 12420 +23723 ---> 12421 +23724 ---> 12422 +23727 ---> 12423 +23730 ---> 12424 +23736 ---> 12425 +23741 ---> 12426 +23749 ---> 12427 +23754 ---> 12428 +23756 ---> 12429 +23757 ---> 12430 +23760 ---> 12431 +23761 ---> 12432 +23766 ---> 12433 +23773 ---> 12434 +23780 ---> 12435 +23790 ---> 12436 +23791 ---> 12437 +23792 ---> 12438 +23794 ---> 12439 +23795 ---> 12440 +23796 ---> 12441 +23802 ---> 12442 +23803 ---> 12443 +23804 ---> 12444 +23805 ---> 12445 +23806 ---> 12446 +23807 ---> 12447 +23811 ---> 12448 +23815 ---> 12449 +23820 ---> 12450 +23821 ---> 12451 +23823 ---> 29210 +23831 ---> 12452 +23832 ---> 12453 +23837 ---> 12454 +23840 ---> 12455 +23842 ---> 12456 +23845 ---> 12457 +23846 ---> 12458 +23847 ---> 12459 +23860 ---> 12460 +23861 ---> 12461 +23862 ---> 12462 +23864 ---> 12463 +23866 ---> 12464 +23868 ---> 12465 +23872 ---> 12466 +23873 ---> 12467 +23882 ---> 12468 +23883 ---> 12469 +23885 ---> 12470 +23892 ---> 12471 +23903 ---> 12472 +23904 ---> 12473 +23905 ---> 12474 +23909 ---> 12475 +23915 ---> 12476 +23918 ---> 12477 +23919 ---> 12478 +23920 ---> 12479 +23929 ---> 12480 +23939 ---> 12481 +23941 ---> 12482 +23943 ---> 12483 +23949 ---> 12484 +23950 ---> 12485 +23951 ---> 12486 +23952 ---> 12487 +23954 ---> 12488 +23960 ---> 12489 +23963 ---> 12490 +23968 ---> 12491 +23969 ---> 12492 +23975 ---> 12493 +23986 ---> 12494 +23992 ---> 12495 +24008 ---> 12496 +24019 ---> 12497 +24021 ---> 12498 +24022 ---> 12499 +24023 ---> 12500 +24024 ---> 12501 +24025 ---> 12502 +24026 ---> 12503 +24028 ---> 12504 +24033 ---> 12505 +24035 ---> 12506 +24038 ---> 12507 +24040 ---> 12508 +24046 ---> 12509 +24050 ---> 12510 +24051 ---> 12511 +24053 ---> 12512 +24055 ---> 12513 +24061 ---> 12514 +24064 ---> 12515 +24073 ---> 12516 +24077 ---> 12517 +24078 ---> 12518 +24083 ---> 12519 +24084 ---> 12520 +24086 ---> 12521 +24087 ---> 12522 +24089 ---> 12523 +24092 ---> 12524 +24093 ---> 12525 +24097 ---> 12526 +24104 ---> 12527 +24106 ---> 12528 +24107 ---> 12529 +24108 ---> 12530 +24109 ---> 12531 +24111 ---> 12532 +24112 ---> 12533 +24114 ---> 12534 +24117 ---> 29317 +24122 ---> 12535 +24125 ---> 12536 +24128 ---> 12537 +24130 ---> 12538 +24132 ---> 12539 +24134 ---> 12540 +24135 ---> 12541 +24136 ---> 12542 +24140 ---> 12543 +24144 ---> 12544 +24146 ---> 12545 +24151 ---> 12546 +24153 ---> 12547 +24155 ---> 12548 +24158 ---> 12549 +24159 ---> 12550 +24161 ---> 12551 +24164 ---> 12552 +24165 ---> 12553 +24166 ---> 12554 +24167 ---> 12555 +24170 ---> 12556 +24171 ---> 29345 +24172 ---> 12557 +24173 ---> 12558 +24175 ---> 12559 +24179 ---> 12560 +24180 ---> 12561 +24181 ---> 12562 +24183 ---> 12563 +24184 ---> 12564 +24185 ---> 12565 +24187 ---> 12566 +24188 ---> 12567 +24189 ---> 12568 +24207 ---> 12569 +24208 ---> 12570 +24209 ---> 12571 +24211 ---> 12572 +24212 ---> 12573 +24216 ---> 12574 +24217 ---> 12575 +24220 ---> 12576 +24223 ---> 12577 +24224 ---> 12578 +24228 ---> 12579 +24231 ---> 12580 +24234 ---> 12581 +24236 ---> 12582 +24237 ---> 29396 +24238 ---> 12583 +24240 ---> 12584 +24241 ---> 12585 +24243 ---> 12586 +24246 ---> 12587 +24247 ---> 12588 +24249 ---> 12589 +24253 ---> 12590 +24260 ---> 12591 +24263 ---> 12592 +24264 ---> 12593 +24265 ---> 12594 +24266 ---> 12595 +24268 ---> 12596 +24269 ---> 12597 +24274 ---> 12598 +24275 ---> 12599 +24278 ---> 12600 +24287 ---> 12601 +24290 ---> 12602 +24296 ---> 12603 +24297 ---> 12604 +24298 ---> 12605 +24300 ---> 12606 +24301 ---> 12607 +24305 ---> 12608 +24309 ---> 12609 +24310 ---> 12610 +24318 ---> 12611 +24319 ---> 12612 +24323 ---> 12613 +24324 ---> 12614 +24330 ---> 2411 +24336 ---> 12615 +24338 ---> 12616 +24344 ---> 12617 +24346 ---> 12618 +24350 ---> 12619 +24354 ---> 12620 +24355 ---> 12621 +24358 ---> 12622 +24368 ---> 12623 +24372 ---> 12624 +24380 ---> 12625 +24385 ---> 12626 +24394 ---> 12627 +24395 ---> 12628 +24397 ---> 12629 +24398 ---> 12630 +24399 ---> 12631 +24402 ---> 12632 +24407 ---> 12633 +24408 ---> 12634 +24409 ---> 12635 +24410 ---> 12636 +24412 ---> 12637 +24413 ---> 12638 +24414 ---> 12639 +24416 ---> 12640 +24418 ---> 12641 +24423 ---> 12642 +24424 ---> 12643 +24425 ---> 12644 +24435 ---> 12645 +24436 ---> 12646 +24438 ---> 12647 +24439 ---> 12648 +24440 ---> 12649 +24441 ---> 12650 +24442 ---> 12651 +24445 ---> 12652 +24446 ---> 12653 +24448 ---> 12654 +24453 ---> 12655 +24454 ---> 12656 +24458 ---> 12657 +24459 ---> 12658 +24464 ---> 12659 +24465 ---> 12660 +24468 ---> 12661 +24469 ---> 12662 +24470 ---> 12663 +24471 ---> 12664 +24472 ---> 12665 +24476 ---> 12666 +24480 ---> 12667 +24483 ---> 12668 +24487 ---> 12669 +24489 ---> 12670 +24490 ---> 12671 +24491 ---> 12672 +24492 ---> 12673 +24499 ---> 12674 +24500 ---> 12675 +24501 ---> 12676 +24502 ---> 12677 +24506 ---> 12678 +24509 ---> 12679 +24510 ---> 12680 +24514 ---> 12681 +24515 ---> 12682 +24517 ---> 12683 +24518 ---> 12684 +24527 ---> 12685 +24538 ---> 12686 +24543 ---> 12687 +24545 ---> 12688 +24546 ---> 12689 +24548 ---> 12690 +24549 ---> 12691 +24564 ---> 12692 +24565 ---> 12693 +24566 ---> 12694 +24567 ---> 12695 +24568 ---> 12696 +24571 ---> 12697 +24573 ---> 12698 +24580 ---> 12699 +24583 ---> 12700 +24599 ---> 12701 +24601 ---> 12702 +24602 ---> 12703 +24606 ---> 29571 +24615 ---> 12704 +24622 ---> 12705 +24626 ---> 12706 +24627 ---> 12707 +24629 ---> 12708 +24633 ---> 12709 +24634 ---> 12710 +24643 ---> 12711 +24648 ---> 12712 +24651 ---> 12713 +24654 ---> 12714 +24657 ---> 12716 +24658 ---> 12717 +24659 ---> 12718 +24660 ---> 12719 +24661 ---> 12720 +24663 ---> 12721 +24668 ---> 29631 +24676 ---> 12722 +24677 ---> 12723 +24680 ---> 12724 +24682 ---> 12725 +24683 ---> 12726 +24686 ---> 12727 +24691 ---> 12728 +24692 ---> 12729 +24694 ---> 12730 +24701 ---> 12731 +24705 ---> 12732 +24710 ---> 12733 +24711 ---> 12734 +24712 ---> 12735 +24713 ---> 12736 +24714 ---> 12737 +24716 ---> 12738 +24720 ---> 12739 +24724 ---> 12740 +24727 ---> 12741 +24728 ---> 12742 +24742 ---> 12743 +24748 ---> 12744 +24751 ---> 12745 +24753 ---> 12746 +24757 ---> 12747 +24766 ---> 12748 +24772 ---> 12749 +24773 ---> 12750 +24778 ---> 12751 +24779 ---> 12752 +24784 ---> 12753 +24786 ---> 12754 +24787 ---> 12755 +24789 ---> 12756 +24791 ---> 12757 +24794 ---> 12758 +24799 ---> 12759 +24803 ---> 12760 +24806 ---> 12761 +24807 ---> 12762 +24813 ---> 12763 +24816 ---> 12764 +24820 ---> 12765 +24821 ---> 12766 +24824 ---> 12767 +24828 ---> 12768 +24835 ---> 12769 +24836 ---> 12770 +24837 ---> 12771 +24839 ---> 12772 +24846 ---> 12773 +24849 ---> 12774 +24850 ---> 12775 +24851 ---> 12776 +24852 ---> 12777 +24859 ---> 12778 +24866 ---> 12779 +24867 ---> 12780 +24873 ---> 12781 +24877 ---> 12782 +24879 ---> 12783 +24885 ---> 12784 +24888 ---> 12785 +24900 ---> 12786 +24903 ---> 12787 +24907 ---> 12788 +24908 ---> 12789 +24911 ---> 12790 +24912 ---> 12791 +24914 ---> 12792 +24916 ---> 12793 +24919 ---> 12794 +24920 ---> 12795 +24921 ---> 12796 +24922 ---> 12797 +24923 ---> 12798 +24925 ---> 12799 +24926 ---> 12800 +24933 ---> 12801 +24934 ---> 12802 +24940 ---> 12803 +24943 ---> 12804 +24946 ---> 29765 +24947 ---> 12805 +24948 ---> 12806 +24953 ---> 12807 +24956 ---> 12808 +24963 ---> 12809 +24966 ---> 12810 +24974 ---> 12811 +24975 ---> 12812 +24976 ---> 12813 +24977 ---> 12814 +24985 ---> 12815 +24994 ---> 12816 +24996 ---> 12817 +24997 ---> 12818 +24999 ---> 12819 +25000 ---> 12820 +25001 ---> 12821 +25002 ---> 12822 +25008 ---> 12823 +25009 ---> 12824 +25010 ---> 12825 +25013 ---> 12826 +25014 ---> 12827 +25015 ---> 12828 +25016 ---> 12829 +25018 ---> 12830 +25020 ---> 12831 +25026 ---> 12832 +25027 ---> 12833 +25030 ---> 12834 +25039 ---> 12835 +25041 ---> 12836 +25046 ---> 12837 +25048 ---> 12838 +25049 ---> 12839 +25050 ---> 12840 +25052 ---> 12841 +25057 ---> 12842 +25058 ---> 12843 +25060 ---> 12844 +25063 ---> 12845 +25067 ---> 12846 +25068 ---> 12847 +25069 ---> 12848 +25070 ---> 12849 +25071 ---> 12850 +25072 ---> 12851 +25080 ---> 12852 +25081 ---> 12853 +25082 ---> 12854 +25083 ---> 12855 +25086 ---> 12856 +25090 ---> 12857 +25091 ---> 12858 +25094 ---> 12859 +25095 ---> 12860 +25098 ---> 12861 +25099 ---> 12862 +25100 ---> 12863 +25103 ---> 12864 +25107 ---> 12865 +25108 ---> 12866 +25109 ---> 12867 +25110 ---> 12868 +25116 ---> 12869 +25118 ---> 12870 +25123 ---> 12871 +25124 ---> 12872 +25127 ---> 12873 +25131 ---> 12874 +25132 ---> 12875 +25133 ---> 12876 +25134 ---> 12877 +25142 ---> 12878 +25143 ---> 12879 +25146 ---> 12880 +25148 ---> 12881 +25149 ---> 12882 +25152 ---> 12883 +25153 ---> 12884 +25156 ---> 12886 +25157 ---> 12887 +25163 ---> 12888 +25164 ---> 12889 +25165 ---> 12890 +25166 ---> 12891 +25167 ---> 12892 +25175 ---> 12893 +25178 ---> 12894 +25182 ---> 12895 +25189 ---> 12896 +25190 ---> 12897 +25191 ---> 30071 +25192 ---> 12898 +25193 ---> 12899 +25194 ---> 12900 +25195 ---> 12901 +25203 ---> 12902 +25211 ---> 12903 +25217 ---> 12904 +25225 ---> 12905 +25226 ---> 12906 +25228 ---> 12907 +25229 ---> 12908 +25231 ---> 12909 +25232 ---> 12910 +25233 ---> 12911 +25237 ---> 12912 +25238 ---> 12913 +25239 ---> 12914 +25241 ---> 12915 +25242 ---> 12916 +25243 ---> 12917 +25244 ---> 12918 +25245 ---> 12919 +25246 ---> 12920 +25248 ---> 12921 +25250 ---> 12922 +25252 ---> 12923 +25256 ---> 12924 +25258 ---> 12925 +25262 ---> 12926 +25263 ---> 30015 +25269 ---> 12927 +25271 ---> 12928 +25272 ---> 12929 +25273 ---> 12930 +25274 ---> 12931 +25275 ---> 12932 +25279 ---> 12933 +25283 ---> 12934 +25286 ---> 12935 +25287 ---> 12936 +25288 ---> 12937 +25289 ---> 12938 +25290 ---> 12939 +25296 ---> 12940 +25298 ---> 12941 +25300 ---> 12942 +25301 ---> 12943 +25309 ---> 12944 +25312 ---> 12945 +25313 ---> 12946 +25315 ---> 12947 +25319 ---> 12948 +25322 ---> 12949 +25324 ---> 12950 +25334 ---> 12951 +25340 ---> 30034 +25342 ---> 12952 +25345 ---> 12953 +25346 ---> 12954 +25355 ---> 29999 +25360 ---> 12955 +25367 ---> 12956 +25370 ---> 12957 +25372 ---> 12958 +25375 ---> 12959 +25376 ---> 12960 +25383 ---> 12961 +25388 ---> 12962 +25394 ---> 12963 +25396 ---> 12964 +25405 ---> 12965 +25406 ---> 12966 +25410 ---> 12967 +25411 ---> 12968 +25412 ---> 12969 +25413 ---> 12970 +25414 ---> 12971 +25415 ---> 12972 +25416 ---> 12973 +25417 ---> 12974 +25418 ---> 12975 +25421 ---> 12976 +25422 ---> 12977 +25427 ---> 12978 +25428 ---> 12979 +25430 ---> 12980 +25431 ---> 12981 +25432 ---> 12982 +25433 ---> 12983 +25434 ---> 12984 +25435 ---> 12985 +25440 ---> 12986 +25447 ---> 12987 +25448 ---> 12988 +25449 ---> 12989 +25461 ---> 12990 +25463 ---> 12991 +25467 ---> 12992 +25468 ---> 12993 +25470 ---> 12994 +25474 ---> 12995 +25475 ---> 12996 +25478 ---> 12997 +25480 ---> 12998 +25481 ---> 12999 +25483 ---> 13000 +25484 ---> 13001 +25485 ---> 13002 +25486 ---> 13003 +25487 ---> 13004 +25488 ---> 13005 +25492 ---> 13006 +25494 ---> 3664 +25499 ---> 13007 +25502 ---> 13008 +25505 ---> 13009 +25506 ---> 13010 +25509 ---> 13011 +25510 ---> 13012 +25511 ---> 13013 +25515 ---> 13014 +25516 ---> 13015 +25519 ---> 13016 +25521 ---> 13017 +25522 ---> 13018 +25524 ---> 13019 +25527 ---> 13020 +25528 ---> 13021 +25529 ---> 13022 +25532 ---> 13023 +25534 ---> 13024 +25542 ---> 13025 +25550 ---> 13026 +25552 ---> 853 +25553 ---> 13027 +25554 ---> 13028 +25556 ---> 30156 +25557 ---> 13029 +25559 ---> 13030 +25561 ---> 13031 +25567 ---> 13032 +25568 ---> 13033 +25571 ---> 13034 +25575 ---> 13035 +25580 ---> 13036 +25581 ---> 13037 +25585 ---> 30184 +25586 ---> 13038 +25587 ---> 13039 +25588 ---> 13040 +25589 ---> 13041 +25590 ---> 13042 +25595 ---> 770 +25599 ---> 13043 +25600 ---> 13044 +25603 ---> 13045 +25605 ---> 13046 +25607 ---> 13047 +25609 ---> 13048 +25610 ---> 13049 +25619 ---> 13050 +25623 ---> 13051 +25625 ---> 13052 +25629 ---> 13053 +25630 ---> 13054 +25632 ---> 13055 +25634 ---> 13056 +25635 ---> 13057 +25641 ---> 13058 +25642 ---> 13059 +25643 ---> 13060 +25644 ---> 13061 +25645 ---> 13062 +25646 ---> 13063 +25647 ---> 13064 +25648 ---> 13065 +25651 ---> 13066 +25652 ---> 13067 +25676 ---> 13068 +25680 ---> 13069 +25681 ---> 13070 +25682 ---> 13071 +25683 ---> 13072 +25684 ---> 13073 +25689 ---> 13074 +25690 ---> 13075 +25694 ---> 13076 +25697 ---> 13077 +25698 ---> 13078 +25701 ---> 13079 +25703 ---> 13080 +25705 ---> 13081 +25706 ---> 13082 +25707 ---> 13083 +25709 ---> 13084 +25713 ---> 13085 +25714 ---> 13086 +25718 ---> 13087 +25722 ---> 13088 +25723 ---> 13089 +25726 ---> 13090 +25728 ---> 13091 +25730 ---> 13092 +25731 ---> 13093 +25732 ---> 13094 +25733 ---> 13095 +25735 ---> 13096 +25738 ---> 13097 +25740 ---> 13098 +25753 ---> 13099 +25754 ---> 13100 +25755 ---> 13101 +25756 ---> 13102 +25758 ---> 13103 +25762 ---> 13104 +25767 ---> 13105 +25769 ---> 13106 +25774 ---> 13107 +25778 ---> 13108 +25785 ---> 13109 +25787 ---> 13110 +25789 ---> 13111 +25798 ---> 13112 +25805 ---> 13113 +25809 ---> 13114 +25810 ---> 13115 +25811 ---> 13116 +25812 ---> 13117 +25813 ---> 13118 +25814 ---> 13119 +25815 ---> 13120 +25818 ---> 13121 +25819 ---> 13122 +25820 ---> 13123 +25821 ---> 854 +25823 ---> 13124 +25824 ---> 13125 +25825 ---> 13126 +25826 ---> 13127 +25827 ---> 13128 +25829 ---> 13129 +25834 ---> 13130 +25835 ---> 13131 +25836 ---> 13132 +25837 ---> 13133 +25838 ---> 13134 +25840 ---> 13135 +25841 ---> 13136 +25842 ---> 13137 +25843 ---> 30367 +25846 ---> 13138 +25847 ---> 13139 +25849 ---> 13140 +25850 ---> 13141 +25851 ---> 13142 +25852 ---> 13143 +25857 ---> 13144 +25859 ---> 13145 +25861 ---> 30357 +25865 ---> 13146 +25870 ---> 13147 +25871 ---> 13148 +25872 ---> 13149 +25873 ---> 13150 +25874 ---> 13151 +25875 ---> 13152 +25876 ---> 13153 +25877 ---> 13154 +25881 ---> 13155 +25882 ---> 13156 +25884 ---> 13157 +25889 ---> 13158 +25894 ---> 13159 +25897 ---> 13160 +25899 ---> 13161 +25903 ---> 13162 +25904 ---> 13163 +25907 ---> 13164 +25916 ---> 13165 +25917 ---> 13166 +25918 ---> 13167 +25920 ---> 13168 +25921 ---> 13169 +25922 ---> 13170 +25923 ---> 13171 +25924 ---> 13172 +25929 ---> 13173 +25931 ---> 13174 +25933 ---> 13175 +25934 ---> 13176 +25935 ---> 13177 +25938 ---> 13178 +25943 ---> 13179 +25944 ---> 13180 +25945 ---> 13181 +25946 ---> 13182 +25947 ---> 13183 +25949 ---> 13184 +25950 ---> 13185 +25952 ---> 13186 +25959 ---> 13187 +25960 ---> 13188 +25961 ---> 13189 +25964 ---> 13190 +25965 ---> 13191 +25966 ---> 13192 +25967 ---> 13193 +25968 ---> 13194 +25969 ---> 13195 +25971 ---> 13196 +25973 ---> 13197 +25974 ---> 13198 +25982 ---> 13199 +25983 ---> 13200 +25985 ---> 13201 +25990 ---> 13202 +25993 ---> 13203 +26001 ---> 13204 +26002 ---> 13205 +26003 ---> 13206 +26008 ---> 13207 +26010 ---> 13208 +26011 ---> 13209 +26012 ---> 13210 +26013 ---> 13211 +26014 ---> 13212 +26016 ---> 13213 +26022 ---> 13214 +26025 ---> 13215 +26026 ---> 13216 +26028 ---> 13217 +26034 ---> 13218 +26038 ---> 13219 +26039 ---> 13220 +26049 ---> 13221 +26050 ---> 13222 +26051 ---> 13223 +26053 ---> 13224 +26054 ---> 13225 +26055 ---> 13226 +26057 ---> 13227 +26059 ---> 13228 +26061 ---> 13229 +26062 ---> 13289 +26063 ---> 13230 +26075 ---> 13231 +26077 ---> 13232 +26078 ---> 13233 +26081 ---> 13234 +26084 ---> 13235 +26088 ---> 13236 +26093 ---> 13237 +26095 ---> 13238 +26101 ---> 13239 +26103 ---> 13240 +26105 ---> 13241 +26110 ---> 13242 +26117 ---> 13243 +26121 ---> 13244 +26122 ---> 13245 +26123 ---> 13246 +26124 ---> 13247 +26125 ---> 13248 +26126 ---> 13249 +26131 ---> 13250 +26139 ---> 13251 +26146 ---> 13252 +26147 ---> 13253 +26162 ---> 13254 +26163 ---> 13255 +26173 ---> 13256 +26175 ---> 13257 +26181 ---> 13258 +26182 ---> 13259 +26184 ---> 13260 +26187 ---> 13261 +26189 ---> 30647 +26196 ---> 13262 +26201 ---> 13263 +26207 ---> 13264 +26213 ---> 13265 +26223 ---> 13266 +26231 ---> 13267 +26232 ---> 13268 +26239 ---> 13269 +26240 ---> 13270 +26241 ---> 13271 +26242 ---> 13272 +26243 ---> 13273 +26245 ---> 13274 +26246 ---> 13275 +26249 ---> 13276 +26252 ---> 13277 +26254 ---> 13278 +26257 ---> 13279 +26265 ---> 13280 +26267 ---> 13281 +26269 ---> 13282 +26271 ---> 13283 +26281 ---> 13284 +26286 ---> 13285 +26293 ---> 13286 +26294 ---> 13287 +26296 ---> 13288 +26297 ---> 13289 +26301 ---> 13290 +26303 ---> 13291 +26304 ---> 13292 +26307 ---> 13293 +26308 ---> 13294 +26309 ---> 13295 +26311 ---> 13296 +26312 ---> 13297 +26313 ---> 13298 +26315 ---> 13299 +26319 ---> 13300 +26320 ---> 13301 +26326 ---> 13302 +26330 ---> 13303 +26332 ---> 13304 +26333 ---> 13305 +26335 ---> 13306 +26337 ---> 13307 +26339 ---> 13308 +26344 ---> 13309 +26345 ---> 13310 +26355 ---> 13311 +26358 ---> 13312 +26365 ---> 13313 +26367 ---> 13314 +26368 ---> 13315 +26370 ---> 13316 +26371 ---> 13317 +26374 ---> 13318 +26375 ---> 13319 +26376 ---> 13320 +26377 ---> 13321 +26378 ---> 13322 +26386 ---> 13323 +26400 ---> 13324 +26401 ---> 13325 +26408 ---> 13326 +26415 ---> 13327 +26417 ---> 13328 +26419 ---> 13329 +26420 ---> 13330 +26424 ---> 13331 +26425 ---> 13332 +26426 ---> 13333 +26427 ---> 13334 +26431 ---> 13335 +26434 ---> 13336 +26435 ---> 13337 +26436 ---> 30715 +26437 ---> 13338 +26438 ---> 13339 +26440 ---> 13340 +26441 ---> 13341 +26444 ---> 13342 +26459 ---> 13343 +26461 ---> 13344 +26465 ---> 13345 +26468 ---> 13346 +26469 ---> 13347 +26471 ---> 13348 +26472 ---> 13349 +26474 ---> 13350 +26476 ---> 13351 +26479 ---> 13352 +26482 ---> 13353 +26483 ---> 13354 +26491 ---> 13355 +26493 ---> 13356 +26497 ---> 13357 +26498 ---> 13358 +26505 ---> 30759 +26520 ---> 13359 +26534 ---> 13360 +26535 ---> 13361 +26537 ---> 13362 +26538 ---> 13363 +26539 ---> 13364 +26540 ---> 13365 +26550 ---> 13366 +26554 ---> 13367 +26555 ---> 13368 +26556 ---> 13369 +26566 ---> 13370 +26568 ---> 13371 +26569 ---> 1342 +26571 ---> 13372 +26576 ---> 13373 +26577 ---> 13374 +26578 ---> 13375 +26579 ---> 13376 +26582 ---> 13377 +26585 ---> 13378 +26590 ---> 13379 +26591 ---> 13380 +26592 ---> 13381 +26608 ---> 13382 +26609 ---> 13383 +26611 ---> 30861 +26623 ---> 13384 +26624 ---> 13385 +26625 ---> 13386 +26626 ---> 13387 +26627 ---> 13388 +26628 ---> 13389 +26629 ---> 13390 +26630 ---> 13391 +26631 ---> 13392 +26632 ---> 13393 +26633 ---> 13394 +26634 ---> 13395 +26635 ---> 13396 +26636 ---> 13397 +26638 ---> 13398 +26645 ---> 13399 +26647 ---> 13400 +26648 ---> 13401 +26658 ---> 13402 +26659 ---> 13403 +26660 ---> 13404 +26661 ---> 13405 +26665 ---> 13406 +26671 ---> 13407 +26672 ---> 13408 +26673 ---> 13409 +26674 ---> 13410 +26685 ---> 13411 +26686 ---> 13412 +26687 ---> 13413 +26694 ---> 13414 +26696 ---> 13415 +26702 ---> 13416 +26710 ---> 13417 +26712 ---> 30873 +26713 ---> 13418 +26723 ---> 13419 +26724 ---> 13420 +26725 ---> 13421 +26726 ---> 13422 +26729 ---> 13423 +26730 ---> 13424 +26731 ---> 13425 +26733 ---> 13426 +26735 ---> 13427 +26736 ---> 13428 +26745 ---> 13429 +26749 ---> 13430 +26751 ---> 13431 +26752 ---> 13432 +26753 ---> 13433 +26758 ---> 13434 +26760 ---> 13435 +26761 ---> 13436 +26771 ---> 13437 +26775 ---> 13438 +26783 ---> 13439 +26786 ---> 13440 +26788 ---> 13441 +26790 ---> 13442 +26791 ---> 13443 +26795 ---> 13444 +26796 ---> 13445 +26799 ---> 13446 +26811 ---> 13447 +26812 ---> 3775 +26816 ---> 13448 +26822 ---> 13449 +26824 ---> 13450 +26825 ---> 13451 +26826 ---> 13452 +26827 ---> 13453 +26828 ---> 13454 +26829 ---> 13455 +26830 ---> 13456 +26831 ---> 13457 +26832 ---> 13458 +26833 ---> 13459 +26838 ---> 13460 +26841 ---> 13461 +26842 ---> 13462 +26844 ---> 13463 +26845 ---> 13464 +26846 ---> 13465 +26847 ---> 13466 +26849 ---> 13467 +26851 ---> 13468 +26852 ---> 13469 +26857 ---> 1388 +26859 ---> 13470 +26861 ---> 13471 +26864 ---> 13472 +26865 ---> 13473 +26870 ---> 13474 +26873 ---> 13475 +26874 ---> 13476 +26877 ---> 13477 +26878 ---> 13478 +26879 ---> 13479 +26880 ---> 13480 +26881 ---> 13481 +26882 ---> 13482 +26883 ---> 13483 +26890 ---> 13484 +26894 ---> 13485 +26896 ---> 13486 +26901 ---> 13487 +26902 ---> 13488 +26907 ---> 13489 +26909 ---> 13490 +26917 ---> 13491 +26919 ---> 13492 +26921 ---> 13493 +26924 ---> 13494 +26925 ---> 13495 +26928 ---> 13496 +26929 ---> 13497 +26931 ---> 13498 +26932 ---> 3783 +26935 ---> 13499 +26939 ---> 13500 +26941 ---> 13501 +26942 ---> 13502 +26945 ---> 13503 +26946 ---> 13504 +26947 ---> 13505 +26949 ---> 13506 +26951 ---> 13507 +26955 ---> 13508 +26964 ---> 13509 +26970 ---> 13510 +26972 ---> 13511 +26973 ---> 13512 +26974 ---> 13513 +26976 ---> 13514 +26988 ---> 13515 +26989 ---> 13516 +26990 ---> 13517 +26995 ---> 13518 +26996 ---> 13519 +26998 ---> 13520 +26999 ---> 13521 +27000 ---> 13522 +27002 ---> 13523 +27008 ---> 13524 +27015 ---> 13525 +27016 ---> 13526 +27018 ---> 13527 +27021 ---> 13528 +27024 ---> 13529 +27027 ---> 13530 +27033 ---> 13531 +27039 ---> 13532 +27040 ---> 13533 +27047 ---> 13534 +27051 ---> 13535 +27057 ---> 13536 +27061 ---> 13537 +27064 ---> 13538 +27065 ---> 13539 +27066 ---> 13540 +27070 ---> 13541 +27071 ---> 13542 +27072 ---> 13543 +27076 ---> 13544 +27081 ---> 13545 +27082 ---> 13546 +27083 ---> 31098 +27085 ---> 13547 +27091 ---> 31115 +27092 ---> 13548 +27094 ---> 13549 +27096 ---> 13550 +27098 ---> 13551 +27101 ---> 13552 +27105 ---> 13553 +27106 ---> 13554 +27107 ---> 13555 +27110 ---> 31140 +27111 ---> 13556 +27112 ---> 13557 +27116 ---> 13558 +27118 ---> 13559 +27124 ---> 13560 +27125 ---> 13561 +27126 ---> 13562 +27128 ---> 13563 +27129 ---> 13564 +27131 ---> 13565 +27132 ---> 13566 +27133 ---> 13567 +27134 ---> 13568 +27135 ---> 13569 +27139 ---> 13570 +27142 ---> 13571 +27143 ---> 13572 +27148 ---> 13573 +27150 ---> 13574 +27152 ---> 13575 +27154 ---> 13576 +27155 ---> 13577 +27168 ---> 13578 +27169 ---> 13579 +27174 ---> 13580 +27185 ---> 13581 +27186 ---> 13582 +27187 ---> 13583 +27188 ---> 13584 +27191 ---> 13585 +27199 ---> 13586 +27200 ---> 13587 +27202 ---> 13588 +27203 ---> 13589 +27205 ---> 13590 +27206 ---> 13591 +27211 ---> 13592 +27224 ---> 31288 +27225 ---> 13593 +27226 ---> 13594 +27231 ---> 702 +27232 ---> 13595 +27236 ---> 13596 +27237 ---> 13597 +27247 ---> 13598 +27251 ---> 13599 +27252 ---> 13600 +27253 ---> 13601 +27258 ---> 13602 +27269 ---> 13603 +27270 ---> 31325 +27275 ---> 13604 +27279 ---> 13605 +27287 ---> 13606 +27289 ---> 13607 +27290 ---> 13608 +27303 ---> 13609 +27305 ---> 13610 +27326 ---> 13611 +27327 ---> 13612 +27328 ---> 13613 +27331 ---> 13614 +27332 ---> 13615 +27334 ---> 13616 +27335 ---> 13617 +27345 ---> 13618 +27353 ---> 13619 +27357 ---> 13620 +27360 ---> 13621 +27362 ---> 13622 +27371 ---> 13623 +27374 ---> 13624 +27379 ---> 13625 +27380 ---> 13625 +27386 ---> 13626 +27387 ---> 13627 +27392 ---> 13628 +27395 ---> 13629 +27396 ---> 31272 +27399 ---> 13630 +27400 ---> 13631 +27402 ---> 13632 +27403 ---> 13633 +27404 ---> 13634 +27405 ---> 13635 +27407 ---> 13636 +27408 ---> 13637 +27411 ---> 13638 +27412 ---> 13639 +27416 ---> 13640 +27418 ---> 13641 +27428 ---> 13642 +27429 ---> 13643 +27433 ---> 13644 +27434 ---> 13645 +27435 ---> 13646 +27442 ---> 13647 +27446 ---> 13648 +27447 ---> 13649 +27453 ---> 13650 +27458 ---> 13651 +27461 ---> 13652 +27463 ---> 13653 +27465 ---> 13654 +27468 ---> 13655 +27472 ---> 13656 +27478 ---> 13657 +27486 ---> 13658 +27490 ---> 13659 +27491 ---> 13660 +27492 ---> 13661 +27493 ---> 31319 +27494 ---> 13662 +27495 ---> 13663 +27496 ---> 13664 +27497 ---> 13665 +27498 ---> 13666 +27499 ---> 13667 +27503 ---> 13668 +27504 ---> 13669 +27508 ---> 13670 +27510 ---> 13671 +27511 ---> 13672 +27518 ---> 13673 +27519 ---> 13674 +27524 ---> 13675 +27525 ---> 13676 +27528 ---> 13677 +27529 ---> 1002 +27530 ---> 13678 +27531 ---> 13679 +27538 ---> 13680 +27539 ---> 13681 +27541 ---> 13682 +27544 ---> 13683 +27545 ---> 13684 +27546 ---> 13685 +27547 ---> 13686 +27548 ---> 13687 +27549 ---> 13688 +27550 ---> 13689 +27551 ---> 13690 +27556 ---> 13691 +27557 ---> 13692 +27559 ---> 13693 +27560 ---> 13694 +27564 ---> 13695 +27569 ---> 13696 +27570 ---> 13697 +27573 ---> 13698 +27575 ---> 13699 +27586 ---> 13700 +27590 ---> 13701 +27593 ---> 13702 +27595 ---> 13703 +27596 ---> 13704 +27599 ---> 13705 +27602 ---> 13706 +27604 ---> 13707 +27608 ---> 13708 +27609 ---> 31366 +27610 ---> 13709 +27611 ---> 13710 +27617 ---> 13711 +27619 ---> 13712 +27622 ---> 13713 +27630 ---> 13714 +27650 ---> 13715 +27652 ---> 13716 +27653 ---> 13717 +27655 ---> 13718 +27656 ---> 13719 +27657 ---> 13720 +27658 ---> 13721 +27659 ---> 13722 +27664 ---> 13723 +27665 ---> 13724 +27666 ---> 13725 +27671 ---> 13726 +27675 ---> 13727 +27677 ---> 13728 +27678 ---> 13729 +27683 ---> 13730 +27686 ---> 13731 +27687 ---> 13732 +27689 ---> 13733 +27691 ---> 13734 +27692 ---> 13735 +27693 ---> 13736 +27694 ---> 13737 +27695 ---> 13738 +27696 ---> 13739 +27699 ---> 13740 +27710 ---> 13741 +27711 ---> 13742 +27712 ---> 13743 +27713 ---> 31416 +27714 ---> 13744 +27715 ---> 13745 +27722 ---> 13746 +27723 ---> 13747 +27725 ---> 13748 +27728 ---> 31422 +27734 ---> 13749 +27739 ---> 13750 +27745 ---> 13751 +27747 ---> 13752 +27749 ---> 13753 +27750 ---> 13754 +27752 ---> 13755 +27754 ---> 13756 +27757 ---> 13757 +27760 ---> 13758 +27761 ---> 13759 +27762 ---> 13760 +27763 ---> 13761 +27764 ---> 13762 +27765 ---> 13763 +27769 ---> 13764 +27770 ---> 13765 +27772 ---> 13766 +27780 ---> 13767 +27781 ---> 13768 +27782 ---> 13769 +27784 ---> 13770 +27785 ---> 13771 +27800 ---> 13772 +27803 ---> 13773 +27804 ---> 13774 +27805 ---> 13775 +27808 ---> 13776 +27809 ---> 13777 +27810 ---> 13778 +27812 ---> 13779 +27813 ---> 13780 +27814 ---> 13781 +27821 ---> 13782 +27828 ---> 13783 +27829 ---> 13784 +27830 ---> 13785 +27831 ---> 13786 +27838 ---> 13787 +27844 ---> 13788 +27845 ---> 13789 +27847 ---> 13790 +27848 ---> 13791 +27860 ---> 13792 +27864 ---> 13793 +27877 ---> 13794 +27878 ---> 13795 +27882 ---> 13796 +27883 ---> 31501 +27884 ---> 13797 +27886 ---> 13798 +27888 ---> 13799 +27891 ---> 13800 +27892 ---> 13801 +27893 ---> 13802 +27894 ---> 13803 +27895 ---> 13804 +27897 ---> 13805 +27898 ---> 13806 +27901 ---> 13807 +27902 ---> 13808 +27903 ---> 13809 +27904 ---> 2409 +27908 ---> 13810 +27909 ---> 13811 +27912 ---> 13812 +27913 ---> 13813 +27917 ---> 13814 +27918 ---> 13815 +27919 ---> 13816 +27923 ---> 13817 +27924 ---> 13818 +27929 ---> 13819 +27930 ---> 13820 +27931 ---> 13821 +27932 ---> 13822 +27934 ---> 13823 +27935 ---> 13824 +27937 ---> 13826 +27939 ---> 13827 +27940 ---> 13828 +27941 ---> 13829 +27943 ---> 13830 +27944 ---> 302 +27945 ---> 13831 +27951 ---> 2407 +27953 ---> 13832 +27955 ---> 13833 +27960 ---> 13834 +27961 ---> 13835 +27962 ---> 13836 +27966 ---> 13837 +27968 ---> 13838 +27970 ---> 13839 +27974 ---> 13840 +27976 ---> 13841 +27977 ---> 13842 +27978 ---> 13843 +27980 ---> 13844 +27982 ---> 13845 +27987 ---> 13846 +27988 ---> 13847 +27989 ---> 1791 +27991 ---> 1792 +27992 ---> 13848 +28005 ---> 13849 diff --git a/docs/issue-mappings/corefx.mapping.txt b/docs/issue-mappings/corefx.mapping.txt new file mode 100644 index 00000000000000..41510e9bb11eb9 --- /dev/null +++ b/docs/issue-mappings/corefx.mapping.txt @@ -0,0 +1,16561 @@ +https://github.com/dotnet/corefx/issues/XXXX ---> https://github.com/dotnet/runtime/issues/YYYY +17 ---> 13850 +18 ---> 13851 +20 ---> 13852 +22 ---> 13853 +26 ---> 13854 +35 ---> 13855 +36 ---> 13856 +41 ---> 13857 +43 ---> 13858 +44 ---> 13859 +48 ---> 13860 +49 ---> 13861 +52 ---> 13862 +54 ---> 13863 +57 ---> 13864 +58 ---> 13865 +60 ---> 13866 +62 ---> 13867 +63 ---> 13868 +69 ---> 13869 +70 ---> 13870 +71 ---> 13871 +72 ---> 13872 +77 ---> 13873 +82 ---> 13874 +83 ---> 13875 +84 ---> 13876 +85 ---> 13877 +89 ---> 13878 +94 ---> 13879 +96 ---> 13880 +99 ---> 13881 +102 ---> 13882 +103 ---> 13883 +105 ---> 13884 +108 ---> 13885 +114 ---> 13886 +116 ---> 13887 +117 ---> 13888 +118 ---> 13889 +119 ---> 13890 +126 ---> 13891 +128 ---> 13892 +129 ---> 13893 +130 ---> 13894 +136 ---> 13895 +137 ---> 13896 +142 ---> 2405 +144 ---> 13897 +149 ---> 13898 +157 ---> 13899 +158 ---> 13900 +159 ---> 13901 +161 ---> 13902 +163 ---> 13903 +165 ---> 13904 +171 ---> 13905 +176 ---> 13906 +187 ---> 13907 +191 ---> 13908 +193 ---> 13909 +195 ---> 13910 +201 ---> 13911 +202 ---> 13912 +206 ---> 13913 +208 ---> 13914 +211 ---> 13915 +214 ---> 13916 +218 ---> 13917 +219 ---> 13918 +222 ---> 13919 +228 ---> 13920 +230 ---> 13921 +234 ---> 13922 +235 ---> 13923 +240 ---> 13924 +243 ---> 13925 +247 ---> 13926 +249 ---> 13927 +257 ---> 13928 +258 ---> 13929 +260 ---> 13930 +262 ---> 13931 +264 ---> 13932 +271 ---> 13933 +281 ---> 13934 +283 ---> 13935 +284 ---> 13936 +287 ---> 13937 +294 ---> 13938 +299 ---> 13939 +300 ---> 13940 +302 ---> 13941 +304 ---> 13942 +306 ---> 13943 +307 ---> 13944 +311 ---> 13945 +312 ---> 13946 +313 ---> 13947 +315 ---> 13948 +318 ---> 13949 +320 ---> 13950 +322 ---> 13951 +323 ---> 13952 +326 ---> 13953 +327 ---> 13954 +329 ---> 13955 +334 ---> 13956 +335 ---> 13957 +340 ---> 13958 +343 ---> 13959 +344 ---> 13960 +345 ---> 13961 +352 ---> 13962 +361 ---> 13963 +367 ---> 13964 +370 ---> 13965 +371 ---> 13966 +373 ---> 13967 +376 ---> 13968 +377 ---> 13969 +381 ---> 13970 +382 ---> 13971 +383 ---> 13972 +384 ---> 13973 +386 ---> 13974 +387 ---> 13975 +391 ---> 13976 +392 ---> 13977 +394 ---> 13978 +395 ---> 13979 +400 ---> 13980 +405 ---> 13981 +409 ---> 13982 +415 ---> 13983 +423 ---> 13984 +424 ---> 13985 +428 ---> 13986 +430 ---> 13987 +439 ---> 13988 +449 ---> 13989 +450 ---> 13990 +451 ---> 13991 +455 ---> 13992 +461 ---> 13993 +467 ---> 13994 +470 ---> 13995 +473 ---> 13996 +478 ---> 13997 +483 ---> 13998 +489 ---> 13999 +490 ---> 14000 +492 ---> 14001 +493 ---> 14002 +494 ---> 14003 +495 ---> 14004 +496 ---> 14005 +497 ---> 14006 +498 ---> 14007 +503 ---> 14008 +507 ---> 14009 +509 ---> 14010 +511 ---> 14011 +514 ---> 14012 +516 ---> 14013 +519 ---> 14014 +522 ---> 14015 +525 ---> 14016 +526 ---> 14017 +528 ---> 14018 +529 ---> 14019 +530 ---> 14020 +534 ---> 14021 +535 ---> 14022 +536 ---> 14023 +538 ---> 14024 +541 ---> 14025 +542 ---> 14026 +549 ---> 14027 +553 ---> 14028 +560 ---> 14029 +564 ---> 14030 +566 ---> 14031 +574 ---> 14032 +579 ---> 14033 +580 ---> 14034 +584 ---> 14035 +587 ---> 14036 +588 ---> 14037 +592 ---> 14038 +594 ---> 14039 +597 ---> 14040 +600 ---> 14041 +606 ---> 14042 +610 ---> 14043 +612 ---> 14044 +614 ---> 14045 +615 ---> 14046 +616 ---> 14047 +617 ---> 14048 +619 ---> 14049 +621 ---> 14050 +625 ---> 14051 +626 ---> 14052 +628 ---> 14053 +632 ---> 14054 +633 ---> 14055 +636 ---> 14056 +637 ---> 14057 +638 ---> 14058 +641 ---> 14059 +642 ---> 14060 +644 ---> 14061 +645 ---> 14062 +646 ---> 14063 +647 ---> 14064 +649 ---> 14065 +652 ---> 14066 +653 ---> 14067 +655 ---> 14068 +657 ---> 14069 +659 ---> 14070 +661 ---> 14071 +663 ---> 14072 +666 ---> 14073 +668 ---> 14074 +670 ---> 14075 +674 ---> 14076 +678 ---> 14077 +679 ---> 14078 +682 ---> 14079 +683 ---> 14080 +684 ---> 14081 +686 ---> 14082 +692 ---> 14083 +693 ---> 14084 +694 ---> 14085 +696 ---> 14086 +697 ---> 14087 +699 ---> 14088 +700 ---> 14089 +701 ---> 14090 +702 ---> 14091 +703 ---> 14092 +704 ---> 14093 +705 ---> 14094 +706 ---> 14095 +707 ---> 14096 +708 ---> 14097 +709 ---> 14098 +715 ---> 14099 +717 ---> 14100 +721 ---> 14101 +722 ---> 14102 +723 ---> 14103 +728 ---> 14104 +729 ---> 14105 +733 ---> 14106 +735 ---> 14107 +737 ---> 14108 +738 ---> 14109 +743 ---> 14110 +744 ---> 14111 +745 ---> 14112 +746 ---> 14113 +748 ---> 14114 +751 ---> 14115 +753 ---> 14116 +754 ---> 14117 +756 ---> 14118 +758 ---> 14119 +761 ---> 14120 +764 ---> 14121 +770 ---> 14122 +779 ---> 14123 +780 ---> 14124 +790 ---> 14125 +794 ---> 14126 +804 ---> 14127 +805 ---> 14128 +806 ---> 14129 +807 ---> 14130 +809 ---> 14131 +810 ---> 14132 +811 ---> 14133 +812 ---> 14134 +814 ---> 14135 +815 ---> 14136 +816 ---> 14137 +817 ---> 14138 +820 ---> 14139 +821 ---> 14140 +822 ---> 14141 +823 ---> 14142 +824 ---> 14143 +825 ---> 14144 +826 ---> 14145 +827 ---> 14146 +828 ---> 14147 +829 ---> 14148 +830 ---> 14149 +831 ---> 14150 +832 ---> 14151 +833 ---> 14152 +834 ---> 14153 +835 ---> 14154 +836 ---> 14155 +837 ---> 14156 +838 ---> 14157 +839 ---> 14158 +840 ---> 14159 +841 ---> 14160 +842 ---> 14161 +843 ---> 14162 +844 ---> 14163 +845 ---> 14164 +846 ---> 14165 +847 ---> 14166 +848 ---> 14167 +849 ---> 14168 +850 ---> 14169 +851 ---> 14170 +852 ---> 14171 +853 ---> 14172 +854 ---> 14173 +855 ---> 14174 +856 ---> 14175 +857 ---> 14176 +858 ---> 14177 +859 ---> 14178 +860 ---> 14179 +861 ---> 14180 +862 ---> 14181 +863 ---> 14182 +864 ---> 14183 +865 ---> 14184 +866 ---> 14185 +867 ---> 14186 +868 ---> 14187 +869 ---> 14188 +870 ---> 14189 +871 ---> 14190 +872 ---> 14191 +873 ---> 14192 +874 ---> 14193 +875 ---> 14194 +877 ---> 14195 +879 ---> 14196 +880 ---> 14197 +881 ---> 14198 +882 ---> 14199 +883 ---> 14200 +884 ---> 14201 +885 ---> 14202 +886 ---> 14203 +887 ---> 14204 +888 ---> 14205 +889 ---> 14206 +890 ---> 14207 +891 ---> 14208 +892 ---> 14209 +893 ---> 14210 +894 ---> 14211 +895 ---> 14212 +896 ---> 14213 +897 ---> 14214 +898 ---> 14215 +899 ---> 14216 +900 ---> 14217 +901 ---> 14218 +902 ---> 14219 +903 ---> 14220 +904 ---> 14221 +905 ---> 14222 +906 ---> 14223 +907 ---> 14224 +908 ---> 14225 +909 ---> 14226 +910 ---> 14227 +911 ---> 14228 +914 ---> 14229 +915 ---> 14230 +918 ---> 14231 +919 ---> 14232 +920 ---> 14233 +921 ---> 14234 +922 ---> 14235 +923 ---> 14236 +924 ---> 14237 +925 ---> 14238 +926 ---> 14239 +927 ---> 14240 +928 ---> 14241 +929 ---> 14242 +930 ---> 14243 +931 ---> 14244 +932 ---> 14245 +933 ---> 14246 +934 ---> 14247 +935 ---> 14248 +936 ---> 14249 +937 ---> 14250 +938 ---> 14251 +942 ---> 14252 +947 ---> 14253 +948 ---> 14254 +949 ---> 14255 +950 ---> 14256 +956 ---> 14257 +957 ---> 14258 +959 ---> 14259 +962 ---> 14260 +963 ---> 14261 +964 ---> 14262 +965 ---> 14263 +966 ---> 14264 +967 ---> 14265 +968 ---> 14266 +970 ---> 14267 +973 ---> 14268 +975 ---> 14269 +976 ---> 14270 +977 ---> 14271 +978 ---> 14272 +980 ---> 14273 +982 ---> 14274 +984 ---> 14275 +987 ---> 14276 +988 ---> 14277 +990 ---> 14278 +991 ---> 14279 +992 ---> 14280 +993 ---> 14281 +996 ---> 14282 +998 ---> 14283 +999 ---> 14284 +1000 ---> 14285 +1001 ---> 14286 +1002 ---> 14287 +1006 ---> 14288 +1008 ---> 14289 +1009 ---> 14290 +1010 ---> 14291 +1011 ---> 14292 +1016 ---> 14293 +1017 ---> 14294 +1019 ---> 14295 +1021 ---> 14296 +1022 ---> 14297 +1030 ---> 14298 +1032 ---> 14299 +1034 ---> 14300 +1037 ---> 14301 +1039 ---> 14302 +1041 ---> 14303 +1043 ---> 14305 +1044 ---> 14306 +1045 ---> 14307 +1050 ---> 14308 +1051 ---> 14309 +1053 ---> 14310 +1054 ---> 14311 +1057 ---> 14312 +1058 ---> 14313 +1061 ---> 14314 +1063 ---> 14315 +1066 ---> 14316 +1070 ---> 14317 +1079 ---> 14318 +1081 ---> 14319 +1085 ---> 14320 +1086 ---> 14321 +1089 ---> 14322 +1090 ---> 14323 +1091 ---> 14324 +1093 ---> 14325 +1097 ---> 14326 +1098 ---> 14327 +1099 ---> 14328 +1100 ---> 14329 +1103 ---> 14330 +1105 ---> 14331 +1106 ---> 14332 +1107 ---> 14333 +1110 ---> 14334 +1115 ---> 14335 +1118 ---> 14336 +1120 ---> 14337 +1121 ---> 14338 +1122 ---> 14339 +1124 ---> 14340 +1127 ---> 14341 +1129 ---> 14342 +1132 ---> 14343 +1136 ---> 14344 +1139 ---> 14345 +1140 ---> 14346 +1142 ---> 14347 +1143 ---> 14348 +1146 ---> 14349 +1147 ---> 14350 +1148 ---> 14351 +1149 ---> 14352 +1151 ---> 14353 +1153 ---> 14354 +1155 ---> 14355 +1156 ---> 14356 +1157 ---> 14357 +1158 ---> 14358 +1159 ---> 14359 +1160 ---> 14360 +1165 ---> 14361 +1168 ---> 14362 +1170 ---> 14363 +1174 ---> 14364 +1181 ---> 14365 +1182 ---> 14366 +1188 ---> 14367 +1191 ---> 14368 +1196 ---> 14369 +1198 ---> 14370 +1199 ---> 14371 +1205 ---> 14372 +1208 ---> 14373 +1211 ---> 14374 +1216 ---> 14375 +1218 ---> 14376 +1220 ---> 14377 +1221 ---> 14378 +1222 ---> 14379 +1223 ---> 14380 +1230 ---> 14382 +1238 ---> 14383 +1240 ---> 14384 +1243 ---> 14385 +1244 ---> 14386 +1247 ---> 14387 +1254 ---> 14388 +1255 ---> 14389 +1256 ---> 14390 +1257 ---> 14391 +1263 ---> 14392 +1267 ---> 14393 +1271 ---> 14394 +1272 ---> 14395 +1275 ---> 14396 +1277 ---> 14397 +1281 ---> 14398 +1286 ---> 14399 +1290 ---> 14400 +1291 ---> 14401 +1293 ---> 14402 +1298 ---> 14403 +1303 ---> 14404 +1305 ---> 14405 +1306 ---> 14406 +1307 ---> 14407 +1308 ---> 14408 +1313 ---> 14409 +1314 ---> 14410 +1316 ---> 14411 +1318 ---> 14412 +1320 ---> 14413 +1326 ---> 14414 +1329 ---> 14415 +1330 ---> 14416 +1331 ---> 14417 +1332 ---> 14418 +1333 ---> 14419 +1334 ---> 14420 +1336 ---> 14421 +1339 ---> 14422 +1342 ---> 14423 +1345 ---> 14424 +1346 ---> 14425 +1347 ---> 14426 +1348 ---> 14427 +1355 ---> 14428 +1358 ---> 14429 +1360 ---> 14430 +1363 ---> 14431 +1367 ---> 14432 +1368 ---> 14433 +1370 ---> 14434 +1373 ---> 14435 +1375 ---> 14436 +1378 ---> 14437 +1387 ---> 14438 +1390 ---> 14439 +1391 ---> 14440 +1395 ---> 14441 +1407 ---> 14442 +1408 ---> 14443 +1412 ---> 14444 +1414 ---> 14445 +1415 ---> 14446 +1420 ---> 14447 +1422 ---> 14448 +1427 ---> 14449 +1429 ---> 14450 +1432 ---> 14451 +1434 ---> 14452 +1438 ---> 14453 +1440 ---> 14454 +1445 ---> 14455 +1448 ---> 14456 +1450 ---> 14457 +1459 ---> 14458 +1460 ---> 14459 +1461 ---> 14460 +1462 ---> 14461 +1463 ---> 14462 +1465 ---> 14463 +1471 ---> 14464 +1474 ---> 14465 +1476 ---> 14466 +1477 ---> 14467 +1479 ---> 14468 +1480 ---> 14469 +1485 ---> 14470 +1487 ---> 14471 +1490 ---> 14472 +1491 ---> 14473 +1497 ---> 14474 +1499 ---> 14475 +1501 ---> 14476 +1502 ---> 14477 +1504 ---> 14478 +1508 ---> 14479 +1509 ---> 14480 +1511 ---> 14481 +1512 ---> 14482 +1513 ---> 14483 +1514 ---> 14484 +1515 ---> 14485 +1520 ---> 14486 +1525 ---> 14487 +1526 ---> 14488 +1527 ---> 14489 +1528 ---> 14490 +1530 ---> 14491 +1531 ---> 14492 +1533 ---> 14493 +1534 ---> 14494 +1535 ---> 14495 +1538 ---> 14496 +1544 ---> 14497 +1545 ---> 14498 +1547 ---> 14499 +1553 ---> 14500 +1556 ---> 14501 +1561 ---> 14502 +1563 ---> 14503 +1565 ---> 14504 +1571 ---> 14505 +1575 ---> 14506 +1576 ---> 14507 +1577 ---> 14508 +1582 ---> 14509 +1583 ---> 14510 +1585 ---> 14511 +1588 ---> 14512 +1590 ---> 14513 +1591 ---> 14514 +1593 ---> 14515 +1595 ---> 2404 +1596 ---> 14516 +1597 ---> 14517 +1598 ---> 14518 +1603 ---> 14519 +1604 ---> 14520 +1605 ---> 14521 +1608 ---> 14522 +1609 ---> 14523 +1610 ---> 14524 +1611 ---> 14525 +1612 ---> 14526 +1613 ---> 14527 +1614 ---> 14528 +1615 ---> 14529 +1616 ---> 14530 +1617 ---> 14531 +1621 ---> 14532 +1622 ---> 14533 +1623 ---> 14534 +1624 ---> 14535 +1625 ---> 14536 +1626 ---> 14537 +1627 ---> 14538 +1628 ---> 14539 +1633 ---> 14540 +1634 ---> 14541 +1635 ---> 14542 +1640 ---> 14543 +1641 ---> 14544 +1642 ---> 14545 +1645 ---> 14546 +1647 ---> 14547 +1650 ---> 14548 +1651 ---> 14549 +1652 ---> 14550 +1653 ---> 14551 +1655 ---> 14552 +1656 ---> 14553 +1657 ---> 14554 +1661 ---> 14555 +1664 ---> 14556 +1665 ---> 14557 +1669 ---> 14558 +1670 ---> 14559 +1672 ---> 14560 +1677 ---> 14561 +1678 ---> 14562 +1681 ---> 14563 +1683 ---> 14564 +1685 ---> 14565 +1687 ---> 14566 +1689 ---> 14567 +1690 ---> 14568 +1691 ---> 14569 +1696 ---> 14570 +1701 ---> 14571 +1706 ---> 14572 +1710 ---> 14573 +1711 ---> 14574 +1712 ---> 14575 +1723 ---> 14576 +1724 ---> 14577 +1725 ---> 14578 +1726 ---> 14579 +1727 ---> 14580 +1728 ---> 14581 +1729 ---> 14582 +1730 ---> 14583 +1731 ---> 14584 +1733 ---> 14585 +1734 ---> 14586 +1738 ---> 14587 +1739 ---> 14588 +1742 ---> 14589 +1745 ---> 14590 +1748 ---> 14591 +1751 ---> 14592 +1753 ---> 14593 +1755 ---> 14594 +1761 ---> 14595 +1762 ---> 14596 +1763 ---> 14597 +1764 ---> 14598 +1765 ---> 14599 +1766 ---> 14600 +1768 ---> 14601 +1772 ---> 14602 +1774 ---> 14603 +1775 ---> 14604 +1776 ---> 14605 +1781 ---> 14606 +1784 ---> 14607 +1787 ---> 14608 +1790 ---> 14609 +1791 ---> 14610 +1793 ---> 14611 +1794 ---> 14612 +1797 ---> 14613 +1805 ---> 14614 +1806 ---> 14615 +1807 ---> 14616 +1808 ---> 14617 +1812 ---> 14618 +1813 ---> 14619 +1815 ---> 14620 +1817 ---> 14621 +1820 ---> 14622 +1825 ---> 14623 +1827 ---> 14624 +1828 ---> 14625 +1831 ---> 14626 +1836 ---> 14627 +1838 ---> 14628 +1840 ---> 14629 +1841 ---> 14630 +1844 ---> 14631 +1848 ---> 14632 +1849 ---> 14633 +1853 ---> 14634 +1854 ---> 14635 +1856 ---> 14636 +1861 ---> 14637 +1863 ---> 14638 +1866 ---> 14639 +1872 ---> 14640 +1873 ---> 14641 +1874 ---> 14642 +1877 ---> 14643 +1878 ---> 14644 +1880 ---> 14645 +1883 ---> 14646 +1887 ---> 14647 +1888 ---> 14648 +1891 ---> 14649 +1892 ---> 14650 +1894 ---> 14651 +1896 ---> 14652 +1897 ---> 14653 +1899 ---> 14654 +1900 ---> 14655 +1903 ---> 14656 +1904 ---> 14657 +1906 ---> 14658 +1907 ---> 14659 +1914 ---> 14660 +1915 ---> 14661 +1920 ---> 14662 +1921 ---> 14663 +1922 ---> 14664 +1925 ---> 14665 +1926 ---> 14666 +1927 ---> 14667 +1929 ---> 14668 +1930 ---> 14669 +1931 ---> 14670 +1932 ---> 14671 +1934 ---> 14672 +1935 ---> 14673 +1936 ---> 14674 +1937 ---> 14675 +1942 ---> 14676 +1943 ---> 14677 +1945 ---> 14678 +1953 ---> 14679 +1956 ---> 14680 +1958 ---> 14681 +1961 ---> 14682 +1963 ---> 14683 +1964 ---> 14684 +1965 ---> 14685 +1967 ---> 14686 +1968 ---> 14687 +1972 ---> 14688 +1973 ---> 2293 +1977 ---> 14689 +1981 ---> 14690 +1983 ---> 14691 +1984 ---> 14692 +1985 ---> 14693 +1986 ---> 14694 +1991 ---> 14695 +1993 ---> 14696 +1994 ---> 14697 +1995 ---> 14698 +1996 ---> 14699 +2002 ---> 14700 +2003 ---> 14701 +2008 ---> 14702 +2009 ---> 14703 +2010 ---> 14704 +2011 ---> 14705 +2020 ---> 14706 +2022 ---> 14707 +2024 ---> 14708 +2025 ---> 14709 +2028 ---> 14710 +2029 ---> 14711 +2034 ---> 14712 +2035 ---> 14713 +2036 ---> 14714 +2042 ---> 14715 +2046 ---> 14716 +2050 ---> 14717 +2056 ---> 14718 +2057 ---> 14719 +2059 ---> 14720 +2061 ---> 14721 +2062 ---> 14722 +2064 ---> 14723 +2065 ---> 14724 +2070 ---> 14725 +2072 ---> 14726 +2073 ---> 14727 +2075 ---> 14728 +2076 ---> 14729 +2077 ---> 14730 +2079 ---> 14731 +2084 ---> 14732 +2088 ---> 14733 +2089 ---> 14734 +2093 ---> 14735 +2101 ---> 14736 +2102 ---> 14737 +2103 ---> 14738 +2104 ---> 14739 +2105 ---> 14740 +2106 ---> 14741 +2108 ---> 14742 +2114 ---> 14743 +2116 ---> 14744 +2117 ---> 14745 +2119 ---> 14746 +2124 ---> 14747 +2127 ---> 14748 +2131 ---> 14749 +2134 ---> 14750 +2135 ---> 14751 +2137 ---> 14752 +2146 ---> 14753 +2150 ---> 14754 +2152 ---> 14755 +2155 ---> 14756 +2157 ---> 14757 +2159 ---> 14758 +2161 ---> 14759 +2163 ---> 14760 +2165 ---> 14761 +2167 ---> 14762 +2168 ---> 14763 +2171 ---> 14764 +2172 ---> 14765 +2173 ---> 14766 +2174 ---> 14767 +2177 ---> 14768 +2183 ---> 14769 +2184 ---> 14770 +2189 ---> 14771 +2190 ---> 14772 +2195 ---> 14773 +2199 ---> 14774 +2203 ---> 14775 +2204 ---> 14776 +2205 ---> 14777 +2206 ---> 14778 +2207 ---> 14779 +2208 ---> 14780 +2209 ---> 14781 +2210 ---> 14782 +2211 ---> 14783 +2214 ---> 14784 +2217 ---> 14785 +2221 ---> 14786 +2223 ---> 14787 +2227 ---> 14788 +2228 ---> 14789 +2229 ---> 14790 +2236 ---> 14791 +2238 ---> 14792 +2239 ---> 14793 +2241 ---> 14794 +2243 ---> 14795 +2244 ---> 14796 +2246 ---> 14797 +2249 ---> 14798 +2251 ---> 14799 +2252 ---> 14800 +2253 ---> 14801 +2254 ---> 14802 +2255 ---> 14803 +2257 ---> 14804 +2258 ---> 14805 +2261 ---> 14806 +2266 ---> 14807 +2271 ---> 14808 +2273 ---> 14809 +2274 ---> 14810 +2275 ---> 14811 +2276 ---> 14812 +2278 ---> 14813 +2279 ---> 14814 +2280 ---> 14815 +2285 ---> 14816 +2286 ---> 14817 +2287 ---> 14818 +2295 ---> 14819 +2301 ---> 14820 +2302 ---> 14821 +2304 ---> 14822 +2312 ---> 14823 +2314 ---> 14824 +2315 ---> 14825 +2316 ---> 14826 +2317 ---> 14827 +2320 ---> 14828 +2321 ---> 14829 +2323 ---> 14830 +2324 ---> 14831 +2327 ---> 14832 +2329 ---> 14833 +2331 ---> 14834 +2335 ---> 14835 +2336 ---> 14836 +2337 ---> 14837 +2338 ---> 14838 +2339 ---> 14839 +2342 ---> 14840 +2345 ---> 14841 +2349 ---> 14842 +2352 ---> 14843 +2353 ---> 14844 +2355 ---> 14845 +2357 ---> 14846 +2359 ---> 14847 +2363 ---> 14848 +2368 ---> 14849 +2369 ---> 14850 +2370 ---> 14851 +2375 ---> 14852 +2376 ---> 14853 +2378 ---> 14854 +2379 ---> 14855 +2383 ---> 14856 +2384 ---> 14857 +2385 ---> 14858 +2391 ---> 14859 +2392 ---> 14860 +2393 ---> 14861 +2394 ---> 14862 +2395 ---> 14863 +2396 ---> 14864 +2398 ---> 14865 +2399 ---> 14866 +2400 ---> 14867 +2402 ---> 14868 +2403 ---> 14869 +2406 ---> 14870 +2409 ---> 14871 +2411 ---> 14872 +2413 ---> 14873 +2414 ---> 14874 +2416 ---> 14875 +2427 ---> 14876 +2435 ---> 14877 +2441 ---> 14878 +2444 ---> 14879 +2448 ---> 14880 +2449 ---> 14881 +2454 ---> 14882 +2458 ---> 14883 +2459 ---> 14884 +2460 ---> 14885 +2461 ---> 14886 +2465 ---> 14887 +2471 ---> 14888 +2474 ---> 14889 +2479 ---> 14890 +2480 ---> 14891 +2481 ---> 14892 +2482 ---> 14893 +2483 ---> 14894 +2484 ---> 14895 +2485 ---> 14896 +2486 ---> 14897 +2487 ---> 14898 +2488 ---> 14899 +2489 ---> 14900 +2490 ---> 14901 +2492 ---> 14902 +2497 ---> 14903 +2498 ---> 14904 +2499 ---> 14905 +2500 ---> 14906 +2501 ---> 14907 +2502 ---> 14908 +2503 ---> 14909 +2504 ---> 14910 +2505 ---> 14911 +2506 ---> 14912 +2507 ---> 14913 +2508 ---> 14914 +2509 ---> 14915 +2516 ---> 14916 +2517 ---> 14917 +2519 ---> 14918 +2520 ---> 14919 +2521 ---> 14920 +2522 ---> 14921 +2523 ---> 14922 +2525 ---> 14923 +2526 ---> 14924 +2527 ---> 14925 +2528 ---> 14926 +2535 ---> 14927 +2537 ---> 14928 +2538 ---> 14929 +2539 ---> 14930 +2542 ---> 14931 +2544 ---> 14932 +2545 ---> 14933 +2546 ---> 14934 +2549 ---> 14935 +2555 ---> 14936 +2556 ---> 14937 +2562 ---> 14938 +2563 ---> 14939 +2565 ---> 14940 +2569 ---> 14941 +2570 ---> 14942 +2571 ---> 14943 +2573 ---> 14944 +2575 ---> 14945 +2576 ---> 14946 +2578 ---> 14947 +2579 ---> 14948 +2580 ---> 14949 +2581 ---> 14950 +2582 ---> 14951 +2583 ---> 14952 +2584 ---> 14953 +2586 ---> 14954 +2593 ---> 14955 +2599 ---> 14956 +2600 ---> 14957 +2601 ---> 14958 +2602 ---> 14959 +2603 ---> 14960 +2604 ---> 14961 +2605 ---> 14962 +2607 ---> 14963 +2610 ---> 14964 +2613 ---> 14965 +2618 ---> 14966 +2619 ---> 14967 +2626 ---> 14968 +2627 ---> 14969 +2632 ---> 14970 +2634 ---> 14971 +2635 ---> 14972 +2636 ---> 14973 +2640 ---> 14974 +2645 ---> 14975 +2647 ---> 14976 +2648 ---> 14977 +2652 ---> 14978 +2653 ---> 14979 +2659 ---> 14980 +2660 ---> 14981 +2667 ---> 14982 +2670 ---> 14983 +2672 ---> 14984 +2679 ---> 14985 +2684 ---> 14986 +2686 ---> 14987 +2688 ---> 14988 +2699 ---> 14989 +2703 ---> 14990 +2704 ---> 14991 +2714 ---> 14992 +2715 ---> 14993 +2717 ---> 14994 +2722 ---> 14995 +2723 ---> 14996 +2724 ---> 14997 +2727 ---> 14998 +2731 ---> 14999 +2732 ---> 15000 +2736 ---> 15001 +2740 ---> 15002 +2741 ---> 15003 +2743 ---> 15004 +2745 ---> 15005 +2746 ---> 15006 +2748 ---> 15007 +2750 ---> 15008 +2751 ---> 15009 +2756 ---> 15010 +2757 ---> 15011 +2760 ---> 15012 +2761 ---> 15013 +2762 ---> 15014 +2764 ---> 15015 +2765 ---> 15016 +2768 ---> 15017 +2769 ---> 15018 +2770 ---> 15019 +2772 ---> 15020 +2773 ---> 15021 +2774 ---> 15022 +2777 ---> 15023 +2778 ---> 15024 +2779 ---> 15025 +2782 ---> 15026 +2787 ---> 15027 +2788 ---> 15028 +2791 ---> 15029 +2793 ---> 15030 +2797 ---> 15031 +2799 ---> 15032 +2800 ---> 15033 +2801 ---> 15034 +2804 ---> 15035 +2807 ---> 15036 +2808 ---> 15037 +2812 ---> 15038 +2813 ---> 15039 +2816 ---> 15040 +2817 ---> 15041 +2818 ---> 15042 +2819 ---> 15043 +2820 ---> 15044 +2821 ---> 15045 +2836 ---> 15046 +2837 ---> 15047 +2843 ---> 15048 +2844 ---> 15049 +2848 ---> 15050 +2849 ---> 15051 +2851 ---> 15052 +2852 ---> 15053 +2857 ---> 15054 +2858 ---> 15055 +2860 ---> 15056 +2865 ---> 15057 +2869 ---> 15058 +2877 ---> 15059 +2879 ---> 15060 +2881 ---> 15061 +2882 ---> 15062 +2885 ---> 15063 +2886 ---> 15064 +2888 ---> 15065 +2891 ---> 15066 +2893 ---> 15067 +2894 ---> 15068 +2895 ---> 15069 +2897 ---> 15070 +2898 ---> 15071 +2904 ---> 15072 +2910 ---> 15073 +2913 ---> 15074 +2914 ---> 15075 +2926 ---> 15076 +2928 ---> 15077 +2930 ---> 15078 +2934 ---> 15079 +2935 ---> 15080 +2936 ---> 15081 +2937 ---> 15082 +2938 ---> 15083 +2942 ---> 15084 +2947 ---> 15085 +2949 ---> 15086 +2953 ---> 15087 +2961 ---> 15088 +2962 ---> 15089 +2963 ---> 15090 +2965 ---> 15091 +2968 ---> 15092 +2982 ---> 15093 +2984 ---> 15094 +2988 ---> 15095 +2991 ---> 15096 +2995 ---> 15097 +2996 ---> 15098 +3000 ---> 15099 +3003 ---> 15100 +3007 ---> 15101 +3008 ---> 15102 +3009 ---> 15103 +3011 ---> 15104 +3012 ---> 15105 +3014 ---> 15106 +3015 ---> 15107 +3016 ---> 15108 +3018 ---> 15109 +3025 ---> 15110 +3028 ---> 15111 +3032 ---> 15112 +3034 ---> 15113 +3035 ---> 15114 +3037 ---> 15115 +3039 ---> 15116 +3040 ---> 15117 +3043 ---> 15118 +3045 ---> 15119 +3049 ---> 15120 +3051 ---> 15121 +3054 ---> 15122 +3055 ---> 15123 +3056 ---> 15124 +3061 ---> 15125 +3062 ---> 15126 +3063 ---> 15127 +3065 ---> 15128 +3066 ---> 15129 +3067 ---> 15130 +3070 ---> 15131 +3072 ---> 15132 +3075 ---> 15133 +3077 ---> 15134 +3089 ---> 15135 +3093 ---> 15136 +3099 ---> 15137 +3103 ---> 15138 +3106 ---> 15139 +3107 ---> 15140 +3114 ---> 15141 +3116 ---> 15142 +3124 ---> 15143 +3125 ---> 15144 +3126 ---> 15145 +3128 ---> 15146 +3133 ---> 15147 +3134 ---> 15148 +3135 ---> 15149 +3136 ---> 15150 +3137 ---> 15151 +3140 ---> 15152 +3141 ---> 15153 +3144 ---> 15154 +3147 ---> 15155 +3149 ---> 15156 +3150 ---> 15157 +3151 ---> 15158 +3153 ---> 15159 +3154 ---> 15160 +3155 ---> 15161 +3156 ---> 15162 +3162 ---> 15163 +3163 ---> 15164 +3164 ---> 15165 +3165 ---> 15166 +3166 ---> 15167 +3168 ---> 15168 +3172 ---> 15169 +3173 ---> 15170 +3179 ---> 15171 +3180 ---> 15172 +3183 ---> 15173 +3184 ---> 15174 +3185 ---> 15175 +3186 ---> 15176 +3187 ---> 15177 +3188 ---> 15178 +3189 ---> 15179 +3190 ---> 15180 +3192 ---> 15181 +3196 ---> 15182 +3197 ---> 15183 +3202 ---> 15184 +3205 ---> 15185 +3206 ---> 15186 +3207 ---> 15187 +3211 ---> 15188 +3213 ---> 15189 +3215 ---> 15190 +3217 ---> 15191 +3218 ---> 15192 +3220 ---> 15193 +3223 ---> 15194 +3224 ---> 15195 +3225 ---> 15196 +3226 ---> 15197 +3232 ---> 15198 +3233 ---> 15199 +3237 ---> 15200 +3242 ---> 15201 +3243 ---> 15202 +3244 ---> 15203 +3245 ---> 15204 +3247 ---> 15205 +3248 ---> 15206 +3249 ---> 15207 +3253 ---> 1540 +3256 ---> 15208 +3258 ---> 15209 +3260 ---> 15210 +3262 ---> 15211 +3266 ---> 15212 +3268 ---> 15213 +3269 ---> 15214 +3270 ---> 15215 +3272 ---> 15216 +3275 ---> 15217 +3277 ---> 15218 +3281 ---> 15219 +3282 ---> 15220 +3284 ---> 15221 +3285 ---> 15222 +3287 ---> 15223 +3289 ---> 15224 +3290 ---> 15225 +3292 ---> 15226 +3293 ---> 15227 +3294 ---> 15228 +3297 ---> 15229 +3301 ---> 15230 +3302 ---> 15231 +3308 ---> 15232 +3310 ---> 15233 +3311 ---> 15234 +3312 ---> 15235 +3316 ---> 15236 +3318 ---> 15237 +3319 ---> 15238 +3320 ---> 15239 +3321 ---> 15240 +3322 ---> 15241 +3324 ---> 15242 +3332 ---> 15243 +3334 ---> 15244 +3336 ---> 15245 +3337 ---> 15246 +3343 ---> 15247 +3349 ---> 15248 +3357 ---> 15249 +3362 ---> 15250 +3364 ---> 15251 +3374 ---> 15252 +3378 ---> 15253 +3382 ---> 15254 +3383 ---> 15255 +3384 ---> 15256 +3388 ---> 15257 +3389 ---> 15258 +3390 ---> 15259 +3391 ---> 15260 +3392 ---> 15261 +3393 ---> 15262 +3394 ---> 15263 +3397 ---> 15264 +3406 ---> 15265 +3418 ---> 15266 +3419 ---> 15267 +3421 ---> 15268 +3423 ---> 15269 +3431 ---> 15270 +3439 ---> 15271 +3441 ---> 15272 +3444 ---> 15273 +3445 ---> 15274 +3446 ---> 15275 +3447 ---> 15276 +3454 ---> 15277 +3460 ---> 15278 +3461 ---> 15279 +3464 ---> 15280 +3465 ---> 15281 +3467 ---> 15282 +3468 ---> 15283 +3473 ---> 15284 +3474 ---> 15285 +3475 ---> 15286 +3476 ---> 15287 +3480 ---> 15288 +3481 ---> 15289 +3482 ---> 15290 +3483 ---> 15291 +3484 ---> 15292 +3489 ---> 15293 +3494 ---> 15294 +3495 ---> 15295 +3496 ---> 15296 +3497 ---> 15297 +3501 ---> 15298 +3502 ---> 15299 +3504 ---> 15300 +3505 ---> 15301 +3506 ---> 15302 +3512 ---> 15303 +3515 ---> 15304 +3518 ---> 15305 +3520 ---> 15306 +3529 ---> 15307 +3530 ---> 15308 +3532 ---> 15309 +3533 ---> 15310 +3534 ---> 15311 +3535 ---> 15312 +3537 ---> 15313 +3538 ---> 15314 +3542 ---> 15315 +3543 ---> 15316 +3544 ---> 15317 +3546 ---> 15318 +3550 ---> 15319 +3555 ---> 15320 +3556 ---> 15321 +3557 ---> 15322 +3558 ---> 15323 +3559 ---> 15324 +3562 ---> 15325 +3563 ---> 15326 +3565 ---> 15327 +3566 ---> 15328 +3568 ---> 15329 +3569 ---> 15330 +3570 ---> 15331 +3571 ---> 15332 +3572 ---> 15333 +3573 ---> 15334 +3574 ---> 15335 +3576 ---> 15336 +3577 ---> 15337 +3580 ---> 15338 +3581 ---> 15339 +3583 ---> 15340 +3588 ---> 15341 +3590 ---> 15342 +3591 ---> 15343 +3592 ---> 15344 +3596 ---> 15345 +3603 ---> 15346 +3607 ---> 15347 +3609 ---> 15348 +3610 ---> 15349 +3616 ---> 15350 +3620 ---> 15351 +3621 ---> 15352 +3622 ---> 15353 +3623 ---> 15354 +3624 ---> 15355 +3625 ---> 15356 +3629 ---> 15357 +3630 ---> 15358 +3633 ---> 15359 +3634 ---> 15360 +3635 ---> 15361 +3636 ---> 15362 +3641 ---> 15363 +3642 ---> 15364 +3646 ---> 15365 +3656 ---> 15366 +3657 ---> 15367 +3658 ---> 15368 +3661 ---> 15369 +3667 ---> 15370 +3669 ---> 15371 +3672 ---> 15372 +3674 ---> 15373 +3682 ---> 15374 +3688 ---> 15375 +3689 ---> 15376 +3690 ---> 15377 +3691 ---> 15378 +3693 ---> 15379 +3695 ---> 15380 +3697 ---> 15381 +3698 ---> 15382 +3699 ---> 15383 +3701 ---> 15384 +3705 ---> 15385 +3708 ---> 15386 +3709 ---> 15387 +3711 ---> 15388 +3712 ---> 15389 +3715 ---> 15390 +3716 ---> 15391 +3717 ---> 15392 +3718 ---> 15393 +3725 ---> 15394 +3726 ---> 15395 +3729 ---> 15396 +3737 ---> 15397 +3739 ---> 15398 +3740 ---> 15399 +3741 ---> 15400 +3744 ---> 15401 +3748 ---> 15402 +3749 ---> 15403 +3750 ---> 15404 +3753 ---> 15405 +3758 ---> 15406 +3760 ---> 15407 +3766 ---> 15408 +3769 ---> 15409 +3771 ---> 15410 +3772 ---> 15411 +3777 ---> 15412 +3778 ---> 15413 +3779 ---> 15414 +3780 ---> 15415 +3784 ---> 15416 +3785 ---> 15417 +3787 ---> 15418 +3788 ---> 15419 +3789 ---> 15420 +3790 ---> 15421 +3793 ---> 15422 +3797 ---> 15423 +3799 ---> 15424 +3802 ---> 15425 +3810 ---> 15426 +3811 ---> 15427 +3813 ---> 15428 +3814 ---> 15429 +3815 ---> 15430 +3816 ---> 15431 +3818 ---> 15432 +3819 ---> 15433 +3823 ---> 15434 +3826 ---> 15435 +3831 ---> 15436 +3832 ---> 15437 +3833 ---> 15438 +3834 ---> 15439 +3836 ---> 15440 +3838 ---> 15441 +3839 ---> 15442 +3840 ---> 15443 +3841 ---> 15444 +3843 ---> 15445 +3844 ---> 15446 +3845 ---> 15447 +3849 ---> 15448 +3850 ---> 15449 +3858 ---> 15450 +3862 ---> 15451 +3863 ---> 15452 +3865 ---> 15453 +3866 ---> 15454 +3872 ---> 15455 +3873 ---> 15456 +3881 ---> 15457 +3882 ---> 15458 +3883 ---> 15459 +3888 ---> 15460 +3889 ---> 15461 +3891 ---> 15462 +3892 ---> 15463 +3893 ---> 15464 +3894 ---> 15465 +3895 ---> 15466 +3897 ---> 15467 +3906 ---> 15468 +3908 ---> 15469 +3909 ---> 15470 +3913 ---> 15471 +3915 ---> 15472 +3918 ---> 15473 +3924 ---> 15474 +3927 ---> 15475 +3930 ---> 15476 +3934 ---> 15477 +3935 ---> 15478 +3936 ---> 15479 +3942 ---> 15480 +3948 ---> 15481 +3952 ---> 15482 +3954 ---> 15483 +3956 ---> 15484 +3957 ---> 15485 +3958 ---> 15486 +3963 ---> 15487 +3967 ---> 15488 +3968 ---> 15489 +3969 ---> 15490 +3972 ---> 15491 +3973 ---> 15492 +3974 ---> 15493 +3975 ---> 15494 +3982 ---> 15495 +3986 ---> 15496 +3993 ---> 15497 +3995 ---> 15498 +4002 ---> 15499 +4003 ---> 15500 +4004 ---> 15501 +4005 ---> 15502 +4006 ---> 15503 +4007 ---> 15504 +4008 ---> 15505 +4009 ---> 15506 +4014 ---> 15507 +4018 ---> 15508 +4019 ---> 15509 +4020 ---> 15510 +4021 ---> 15511 +4022 ---> 15512 +4027 ---> 15513 +4030 ---> 15514 +4031 ---> 15515 +4033 ---> 15516 +4037 ---> 15517 +4040 ---> 15518 +4044 ---> 15519 +4045 ---> 15520 +4046 ---> 15521 +4047 ---> 15522 +4048 ---> 15523 +4049 ---> 15524 +4052 ---> 15525 +4054 ---> 15526 +4055 ---> 15527 +4056 ---> 15528 +4057 ---> 15529 +4058 ---> 15530 +4059 ---> 15531 +4060 ---> 15532 +4062 ---> 15533 +4063 ---> 15534 +4064 ---> 15535 +4065 ---> 15536 +4068 ---> 15537 +4071 ---> 15538 +4072 ---> 15539 +4074 ---> 15540 +4076 ---> 15541 +4077 ---> 15542 +4083 ---> 15543 +4085 ---> 15544 +4091 ---> 15545 +4093 ---> 15546 +4100 ---> 15547 +4101 ---> 15548 +4104 ---> 15549 +4106 ---> 15550 +4108 ---> 15551 +4110 ---> 15552 +4112 ---> 15553 +4120 ---> 15554 +4123 ---> 15555 +4125 ---> 15556 +4128 ---> 15557 +4129 ---> 15558 +4132 ---> 15559 +4134 ---> 15560 +4135 ---> 15561 +4137 ---> 15562 +4138 ---> 15563 +4142 ---> 15564 +4143 ---> 15565 +4146 ---> 15566 +4148 ---> 15567 +4149 ---> 15568 +4150 ---> 15569 +4152 ---> 15570 +4161 ---> 15571 +4171 ---> 15572 +4172 ---> 15573 +4173 ---> 15574 +4174 ---> 15575 +4177 ---> 15576 +4187 ---> 15577 +4190 ---> 15578 +4191 ---> 15579 +4196 ---> 15580 +4198 ---> 15581 +4200 ---> 15582 +4204 ---> 15583 +4208 ---> 15584 +4213 ---> 15585 +4217 ---> 15586 +4219 ---> 15587 +4222 ---> 15588 +4223 ---> 15589 +4224 ---> 15590 +4227 ---> 15591 +4230 ---> 15592 +4231 ---> 15593 +4233 ---> 15594 +4234 ---> 15595 +4243 ---> 15596 +4244 ---> 15597 +4251 ---> 15598 +4259 ---> 15599 +4261 ---> 15600 +4273 ---> 15601 +4274 ---> 15602 +4278 ---> 15603 +4279 ---> 15604 +4282 ---> 15605 +4283 ---> 15606 +4284 ---> 15607 +4288 ---> 15608 +4289 ---> 15609 +4296 ---> 15610 +4298 ---> 15611 +4299 ---> 15612 +4301 ---> 15613 +4303 ---> 15614 +4305 ---> 15615 +4306 ---> 15616 +4308 ---> 15617 +4314 ---> 15618 +4316 ---> 15619 +4317 ---> 15620 +4318 ---> 15621 +4323 ---> 15622 +4324 ---> 15623 +4325 ---> 15624 +4335 ---> 15625 +4336 ---> 15626 +4337 ---> 15627 +4338 ---> 15628 +4339 ---> 15629 +4341 ---> 15630 +4343 ---> 15631 +4345 ---> 15632 +4346 ---> 15633 +4354 ---> 15634 +4355 ---> 15635 +4357 ---> 15636 +4361 ---> 15637 +4363 ---> 15638 +4364 ---> 15639 +4365 ---> 15640 +4367 ---> 15641 +4368 ---> 15642 +4371 ---> 15643 +4373 ---> 15644 +4375 ---> 15645 +4376 ---> 15646 +4377 ---> 15647 +4378 ---> 15648 +4379 ---> 15649 +4382 ---> 15650 +4384 ---> 15651 +4385 ---> 15652 +4388 ---> 15653 +4391 ---> 15654 +4396 ---> 15655 +4397 ---> 15656 +4399 ---> 15657 +4400 ---> 15658 +4405 ---> 15659 +4406 ---> 15660 +4409 ---> 15661 +4410 ---> 15662 +4411 ---> 15663 +4415 ---> 15664 +4420 ---> 15665 +4423 ---> 15666 +4425 ---> 15667 +4428 ---> 15668 +4429 ---> 15669 +4431 ---> 15670 +4432 ---> 15671 +4434 ---> 15672 +4438 ---> 15673 +4439 ---> 15674 +4441 ---> 15675 +4442 ---> 15676 +4443 ---> 15677 +4445 ---> 15678 +4446 ---> 15679 +4448 ---> 15680 +4450 ---> 15681 +4451 ---> 15682 +4453 ---> 15683 +4454 ---> 15684 +4455 ---> 15685 +4457 ---> 15686 +4458 ---> 15687 +4462 ---> 15688 +4463 ---> 15689 +4465 ---> 15690 +4466 ---> 15691 +4467 ---> 15692 +4468 ---> 15693 +4473 ---> 15694 +4474 ---> 15695 +4475 ---> 15696 +4476 ---> 15697 +4477 ---> 15698 +4479 ---> 15699 +4480 ---> 15700 +4481 ---> 15701 +4487 ---> 15702 +4489 ---> 15703 +4491 ---> 15704 +4497 ---> 15705 +4500 ---> 15706 +4501 ---> 15707 +4502 ---> 15708 +4503 ---> 15709 +4504 ---> 15710 +4507 ---> 15711 +4508 ---> 15712 +4510 ---> 15713 +4511 ---> 15714 +4512 ---> 15715 +4529 ---> 15716 +4530 ---> 15717 +4531 ---> 15718 +4533 ---> 15719 +4535 ---> 15720 +4537 ---> 15721 +4540 ---> 15722 +4543 ---> 15723 +4544 ---> 15724 +4547 ---> 15725 +4553 ---> 15726 +4555 ---> 15727 +4561 ---> 15728 +4563 ---> 15729 +4564 ---> 15730 +4569 ---> 15731 +4571 ---> 15732 +4572 ---> 15733 +4574 ---> 15734 +4577 ---> 15735 +4578 ---> 15736 +4579 ---> 15737 +4581 ---> 15738 +4582 ---> 15739 +4586 ---> 15740 +4587 ---> 15741 +4588 ---> 15742 +4590 ---> 15743 +4591 ---> 15744 +4593 ---> 15745 +4595 ---> 15746 +4596 ---> 15747 +4597 ---> 15748 +4599 ---> 15749 +4602 ---> 15750 +4603 ---> 15751 +4605 ---> 15752 +4606 ---> 15753 +4608 ---> 15754 +4609 ---> 15755 +4610 ---> 15756 +4611 ---> 15757 +4614 ---> 15758 +4616 ---> 15759 +4621 ---> 15760 +4622 ---> 15761 +4628 ---> 15762 +4631 ---> 15763 +4632 ---> 15764 +4636 ---> 15765 +4637 ---> 15766 +4638 ---> 15767 +4641 ---> 15768 +4642 ---> 15769 +4646 ---> 15770 +4647 ---> 15771 +4648 ---> 15772 +4649 ---> 15773 +4650 ---> 15774 +4651 ---> 15775 +4653 ---> 15776 +4654 ---> 15777 +4656 ---> 15778 +4657 ---> 15779 +4658 ---> 15780 +4659 ---> 15781 +4661 ---> 15782 +4663 ---> 15783 +4665 ---> 15784 +4667 ---> 15785 +4668 ---> 15786 +4669 ---> 15787 +4670 ---> 15788 +4671 ---> 15789 +4672 ---> 15790 +4673 ---> 15791 +4676 ---> 15792 +4681 ---> 15793 +4682 ---> 15794 +4686 ---> 15795 +4688 ---> 15796 +4689 ---> 15797 +4690 ---> 15798 +4691 ---> 15799 +4693 ---> 15800 +4694 ---> 15801 +4695 ---> 15802 +4696 ---> 15803 +4697 ---> 15804 +4698 ---> 15805 +4699 ---> 15806 +4702 ---> 15807 +4706 ---> 15808 +4708 ---> 15809 +4714 ---> 15810 +4718 ---> 15811 +4720 ---> 15812 +4721 ---> 15813 +4722 ---> 15814 +4724 ---> 15815 +4726 ---> 15816 +4727 ---> 15817 +4728 ---> 15818 +4732 ---> 15819 +4733 ---> 15820 +4737 ---> 15821 +4738 ---> 15822 +4739 ---> 15823 +4741 ---> 15824 +4742 ---> 15825 +4750 ---> 15826 +4751 ---> 15827 +4754 ---> 15828 +4760 ---> 15829 +4762 ---> 15830 +4767 ---> 15831 +4771 ---> 15832 +4774 ---> 15833 +4776 ---> 15834 +4777 ---> 15835 +4779 ---> 15836 +4782 ---> 15837 +4784 ---> 15838 +4786 ---> 15839 +4792 ---> 15840 +4793 ---> 15841 +4794 ---> 15842 +4795 ---> 15843 +4797 ---> 15844 +4798 ---> 15845 +4801 ---> 15846 +4802 ---> 15847 +4803 ---> 15848 +4804 ---> 15849 +4805 ---> 15850 +4807 ---> 15851 +4813 ---> 15852 +4817 ---> 15853 +4818 ---> 15854 +4820 ---> 15855 +4822 ---> 15856 +4823 ---> 15857 +4824 ---> 15858 +4825 ---> 15859 +4829 ---> 15860 +4830 ---> 15861 +4831 ---> 15862 +4833 ---> 15863 +4834 ---> 15864 +4836 ---> 15865 +4839 ---> 15866 +4845 ---> 15867 +4847 ---> 15868 +4850 ---> 15869 +4854 ---> 15870 +4855 ---> 15871 +4856 ---> 15872 +4864 ---> 15873 +4865 ---> 15874 +4866 ---> 15875 +4867 ---> 15876 +4870 ---> 15877 +4871 ---> 15878 +4872 ---> 15879 +4873 ---> 15880 +4875 ---> 15881 +4877 ---> 15882 +4880 ---> 15883 +4881 ---> 15884 +4882 ---> 15885 +4883 ---> 15886 +4884 ---> 15887 +4887 ---> 15888 +4890 ---> 15889 +4891 ---> 15890 +4895 ---> 15891 +4896 ---> 15892 +4897 ---> 15893 +4899 ---> 15894 +4900 ---> 15895 +4901 ---> 15896 +4907 ---> 15897 +4909 ---> 15898 +4911 ---> 15899 +4916 ---> 15900 +4919 ---> 15901 +4920 ---> 15902 +4923 ---> 15903 +4925 ---> 15904 +4927 ---> 15905 +4928 ---> 15906 +4931 ---> 15907 +4934 ---> 15908 +4935 ---> 15909 +4937 ---> 15910 +4940 ---> 15911 +4941 ---> 15912 +4942 ---> 15913 +4944 ---> 15914 +4945 ---> 15915 +4949 ---> 15916 +4950 ---> 15917 +4953 ---> 15918 +4954 ---> 15919 +4956 ---> 15920 +4960 ---> 15921 +4961 ---> 15922 +4963 ---> 15923 +4964 ---> 15924 +4965 ---> 15925 +4968 ---> 15926 +4969 ---> 15927 +4970 ---> 15928 +4971 ---> 15929 +4974 ---> 15930 +4976 ---> 15931 +4979 ---> 15932 +4980 ---> 15933 +4981 ---> 15934 +4984 ---> 15935 +4986 ---> 15936 +4989 ---> 15937 +4991 ---> 15938 +4992 ---> 15939 +4994 ---> 15940 +4997 ---> 15941 +4998 ---> 15942 +5002 ---> 15943 +5003 ---> 15944 +5008 ---> 15945 +5011 ---> 15946 +5014 ---> 15947 +5015 ---> 15948 +5016 ---> 15949 +5017 ---> 15950 +5021 ---> 15951 +5022 ---> 15952 +5024 ---> 15953 +5025 ---> 15954 +5031 ---> 15955 +5036 ---> 15956 +5037 ---> 15957 +5038 ---> 15958 +5039 ---> 15959 +5040 ---> 15960 +5041 ---> 15961 +5042 ---> 15962 +5044 ---> 15963 +5045 ---> 15964 +5050 ---> 15965 +5054 ---> 15966 +5055 ---> 15967 +5058 ---> 15968 +5060 ---> 15969 +5064 ---> 15970 +5065 ---> 15971 +5066 ---> 15972 +5067 ---> 15973 +5068 ---> 15974 +5072 ---> 15975 +5073 ---> 15976 +5074 ---> 15977 +5077 ---> 15978 +5078 ---> 15979 +5079 ---> 15980 +5082 ---> 15981 +5086 ---> 15982 +5088 ---> 15983 +5089 ---> 15984 +5096 ---> 15985 +5097 ---> 15986 +5102 ---> 15987 +5104 ---> 15988 +5105 ---> 15989 +5106 ---> 15990 +5109 ---> 15991 +5116 ---> 15992 +5118 ---> 15993 +5120 ---> 15994 +5126 ---> 15995 +5127 ---> 15996 +5130 ---> 15997 +5134 ---> 15998 +5137 ---> 15999 +5140 ---> 16000 +5141 ---> 16001 +5144 ---> 16002 +5149 ---> 16003 +5152 ---> 16004 +5153 ---> 16005 +5154 ---> 16006 +5157 ---> 16007 +5159 ---> 16008 +5160 ---> 16009 +5162 ---> 16010 +5164 ---> 16011 +5165 ---> 16012 +5167 ---> 16013 +5168 ---> 16014 +5173 ---> 16015 +5178 ---> 16016 +5182 ---> 16017 +5183 ---> 16018 +5185 ---> 16019 +5187 ---> 16020 +5188 ---> 16021 +5189 ---> 16022 +5190 ---> 16023 +5199 ---> 16024 +5200 ---> 16025 +5202 ---> 16026 +5204 ---> 16027 +5205 ---> 16028 +5206 ---> 16029 +5209 ---> 16030 +5211 ---> 16031 +5212 ---> 16032 +5216 ---> 16033 +5217 ---> 16034 +5221 ---> 16035 +5222 ---> 16036 +5230 ---> 16037 +5233 ---> 16038 +5234 ---> 16039 +5235 ---> 16040 +5236 ---> 16041 +5241 ---> 16042 +5244 ---> 16043 +5246 ---> 16044 +5247 ---> 16045 +5248 ---> 16046 +5251 ---> 16047 +5252 ---> 16048 +5253 ---> 16049 +5255 ---> 16050 +5256 ---> 16051 +5258 ---> 16052 +5260 ---> 16053 +5265 ---> 16054 +5266 ---> 16055 +5267 ---> 16056 +5271 ---> 16057 +5272 ---> 16058 +5281 ---> 16059 +5283 ---> 16060 +5284 ---> 16061 +5286 ---> 16062 +5289 ---> 16063 +5291 ---> 16064 +5293 ---> 16065 +5295 ---> 16066 +5296 ---> 16067 +5297 ---> 16068 +5299 ---> 16069 +5303 ---> 16070 +5306 ---> 16071 +5308 ---> 16072 +5311 ---> 16073 +5314 ---> 16074 +5315 ---> 16075 +5317 ---> 16076 +5320 ---> 16077 +5325 ---> 16078 +5326 ---> 16079 +5330 ---> 16080 +5331 ---> 16081 +5332 ---> 16082 +5333 ---> 16083 +5334 ---> 16084 +5335 ---> 16085 +5337 ---> 16086 +5338 ---> 16087 +5339 ---> 16088 +5340 ---> 16089 +5348 ---> 16090 +5349 ---> 16091 +5352 ---> 16092 +5359 ---> 16093 +5360 ---> 16094 +5364 ---> 16095 +5367 ---> 16096 +5370 ---> 16097 +5377 ---> 16098 +5378 ---> 16099 +5380 ---> 16100 +5381 ---> 16101 +5383 ---> 16102 +5385 ---> 16103 +5389 ---> 16104 +5397 ---> 16105 +5401 ---> 16106 +5406 ---> 16107 +5407 ---> 16108 +5410 ---> 16109 +5411 ---> 16110 +5412 ---> 16111 +5414 ---> 16112 +5415 ---> 16113 +5416 ---> 16114 +5418 ---> 16115 +5420 ---> 16116 +5422 ---> 16117 +5423 ---> 16118 +5424 ---> 16119 +5426 ---> 16120 +5430 ---> 16121 +5432 ---> 16122 +5434 ---> 16123 +5436 ---> 16124 +5439 ---> 16125 +5443 ---> 16126 +5444 ---> 16127 +5446 ---> 16128 +5447 ---> 16129 +5449 ---> 16130 +5450 ---> 16131 +5451 ---> 16132 +5452 ---> 16133 +5453 ---> 16134 +5456 ---> 16135 +5459 ---> 16136 +5460 ---> 16137 +5462 ---> 16138 +5463 ---> 16139 +5467 ---> 16140 +5469 ---> 16141 +5471 ---> 16142 +5474 ---> 16143 +5476 ---> 16144 +5479 ---> 16145 +5482 ---> 16146 +5484 ---> 16147 +5485 ---> 16148 +5487 ---> 16149 +5488 ---> 16150 +5489 ---> 16151 +5493 ---> 16152 +5495 ---> 16153 +5498 ---> 16154 +5501 ---> 16155 +5503 ---> 16156 +5507 ---> 16157 +5508 ---> 16158 +5511 ---> 16159 +5516 ---> 16160 +5521 ---> 16161 +5523 ---> 16162 +5525 ---> 16163 +5530 ---> 16164 +5531 ---> 16165 +5536 ---> 16166 +5538 ---> 16167 +5540 ---> 16168 +5545 ---> 16169 +5546 ---> 16170 +5549 ---> 16171 +5552 ---> 16172 +5555 ---> 16173 +5556 ---> 16174 +5557 ---> 16175 +5558 ---> 16176 +5560 ---> 16177 +5565 ---> 16178 +5566 ---> 16179 +5567 ---> 16180 +5572 ---> 16181 +5574 ---> 16182 +5575 ---> 16183 +5582 ---> 16184 +5584 ---> 16185 +5585 ---> 16186 +5591 ---> 16187 +5593 ---> 16188 +5598 ---> 16189 +5601 ---> 16190 +5606 ---> 16191 +5607 ---> 16192 +5610 ---> 16193 +5611 ---> 16194 +5617 ---> 16195 +5620 ---> 16196 +5625 ---> 16197 +5627 ---> 16198 +5628 ---> 16199 +5630 ---> 16200 +5634 ---> 16201 +5638 ---> 16202 +5645 ---> 16203 +5647 ---> 16204 +5653 ---> 16205 +5654 ---> 16206 +5657 ---> 16207 +5660 ---> 16208 +5662 ---> 16209 +5663 ---> 16210 +5667 ---> 16211 +5668 ---> 16212 +5681 ---> 1541 +5685 ---> 16213 +5689 ---> 16214 +5694 ---> 16215 +5700 ---> 16216 +5701 ---> 16217 +5704 ---> 16218 +5705 ---> 16219 +5706 ---> 16220 +5707 ---> 16221 +5708 ---> 16222 +5715 ---> 16223 +5716 ---> 16224 +5727 ---> 16225 +5730 ---> 16226 +5732 ---> 16227 +5733 ---> 16228 +5737 ---> 16229 +5739 ---> 16230 +5740 ---> 16231 +5741 ---> 16232 +5743 ---> 16233 +5744 ---> 16234 +5745 ---> 16235 +5749 ---> 16236 +5750 ---> 16237 +5754 ---> 16238 +5755 ---> 16239 +5756 ---> 16240 +5757 ---> 16241 +5763 ---> 16242 +5766 ---> 16243 +5768 ---> 16244 +5769 ---> 16245 +5771 ---> 16246 +5780 ---> 16247 +5782 ---> 16248 +5789 ---> 16249 +5793 ---> 16250 +5796 ---> 16251 +5800 ---> 16252 +5805 ---> 16253 +5806 ---> 16254 +5811 ---> 16255 +5813 ---> 16256 +5819 ---> 16257 +5821 ---> 16258 +5822 ---> 16259 +5825 ---> 16260 +5826 ---> 16261 +5828 ---> 16262 +5829 ---> 16263 +5831 ---> 16264 +5832 ---> 16265 +5838 ---> 16266 +5840 ---> 16267 +5841 ---> 16268 +5842 ---> 16269 +5843 ---> 16270 +5844 ---> 16271 +5847 ---> 16272 +5848 ---> 16273 +5849 ---> 16274 +5853 ---> 16275 +5854 ---> 16276 +5858 ---> 16277 +5859 ---> 16278 +5860 ---> 16279 +5861 ---> 16280 +5864 ---> 16281 +5865 ---> 16282 +5868 ---> 16283 +5871 ---> 16284 +5873 ---> 16285 +5874 ---> 16286 +5875 ---> 16287 +5884 ---> 16288 +5886 ---> 16289 +5888 ---> 16290 +5889 ---> 16291 +5890 ---> 16292 +5894 ---> 16293 +5895 ---> 16294 +5896 ---> 16295 +5898 ---> 16296 +5899 ---> 16297 +5900 ---> 16298 +5901 ---> 16299 +5902 ---> 16300 +5903 ---> 16301 +5908 ---> 16302 +5910 ---> 16303 +5912 ---> 16304 +5915 ---> 16305 +5920 ---> 16306 +5921 ---> 16307 +5925 ---> 16308 +5927 ---> 16309 +5930 ---> 16310 +5939 ---> 16311 +5940 ---> 16312 +5941 ---> 16313 +5942 ---> 16314 +5943 ---> 16315 +5945 ---> 16316 +5946 ---> 16317 +5949 ---> 16318 +5950 ---> 16319 +5951 ---> 16320 +5952 ---> 16321 +5955 ---> 16322 +5960 ---> 16323 +5963 ---> 16324 +5964 ---> 16325 +5965 ---> 16326 +5967 ---> 16327 +5969 ---> 16328 +5970 ---> 16329 +5976 ---> 16330 +5980 ---> 16331 +5982 ---> 16332 +5986 ---> 16333 +5987 ---> 16334 +5990 ---> 16335 +5991 ---> 16336 +5993 ---> 16337 +5998 ---> 16338 +5999 ---> 16339 +6006 ---> 16340 +6007 ---> 16341 +6008 ---> 16342 +6009 ---> 16343 +6010 ---> 16344 +6011 ---> 16345 +6017 ---> 16346 +6022 ---> 16347 +6024 ---> 16348 +6026 ---> 16349 +6029 ---> 16350 +6035 ---> 16351 +6036 ---> 16352 +6037 ---> 16353 +6039 ---> 16354 +6045 ---> 16355 +6046 ---> 16356 +6059 ---> 16357 +6063 ---> 16358 +6069 ---> 16359 +6070 ---> 16360 +6072 ---> 16361 +6073 ---> 16362 +6076 ---> 16363 +6078 ---> 16364 +6079 ---> 16365 +6083 ---> 16366 +6085 ---> 16367 +6086 ---> 16368 +6090 ---> 16369 +6091 ---> 16370 +6092 ---> 16371 +6104 ---> 16372 +6105 ---> 16373 +6107 ---> 16374 +6109 ---> 16375 +6110 ---> 16376 +6112 ---> 16377 +6114 ---> 16378 +6115 ---> 16379 +6116 ---> 16380 +6122 ---> 16381 +6123 ---> 16382 +6124 ---> 16383 +6128 ---> 16384 +6132 ---> 16385 +6134 ---> 16386 +6136 ---> 16387 +6142 ---> 16388 +6149 ---> 16389 +6150 ---> 16390 +6153 ---> 16391 +6154 ---> 16392 +6161 ---> 16393 +6162 ---> 16394 +6167 ---> 16395 +6169 ---> 16396 +6170 ---> 16397 +6172 ---> 16398 +6173 ---> 16399 +6177 ---> 16400 +6180 ---> 16401 +6185 ---> 16402 +6187 ---> 16403 +6188 ---> 16404 +6191 ---> 16405 +6195 ---> 16406 +6196 ---> 16407 +6199 ---> 16408 +6204 ---> 16409 +6205 ---> 16410 +6210 ---> 16411 +6211 ---> 16412 +6218 ---> 16413 +6220 ---> 16414 +6223 ---> 16415 +6224 ---> 16416 +6226 ---> 16417 +6230 ---> 16418 +6231 ---> 16419 +6235 ---> 16420 +6239 ---> 16421 +6240 ---> 16422 +6241 ---> 16423 +6242 ---> 16424 +6251 ---> 16425 +6255 ---> 16426 +6258 ---> 16427 +6266 ---> 16428 +6268 ---> 16429 +6276 ---> 16430 +6279 ---> 16431 +6283 ---> 16432 +6286 ---> 16433 +6302 ---> 16434 +6306 ---> 16435 +6309 ---> 16436 +6311 ---> 16437 +6312 ---> 16438 +6313 ---> 16439 +6314 ---> 16440 +6315 ---> 16441 +6316 ---> 16442 +6318 ---> 16443 +6321 ---> 16444 +6326 ---> 16445 +6329 ---> 16446 +6331 ---> 16447 +6333 ---> 16448 +6338 ---> 16449 +6344 ---> 16450 +6351 ---> 16451 +6353 ---> 16452 +6355 ---> 16453 +6361 ---> 16454 +6371 ---> 16455 +6373 ---> 16456 +6374 ---> 16457 +6375 ---> 16458 +6377 ---> 16459 +6378 ---> 16460 +6381 ---> 16461 +6382 ---> 16462 +6383 ---> 16463 +6384 ---> 16464 +6388 ---> 16465 +6393 ---> 16466 +6397 ---> 16467 +6398 ---> 16468 +6399 ---> 16469 +6402 ---> 16470 +6405 ---> 16471 +6406 ---> 16472 +6408 ---> 16473 +6410 ---> 16474 +6414 ---> 16475 +6415 ---> 16476 +6416 ---> 16477 +6417 ---> 16478 +6418 ---> 16479 +6419 ---> 16480 +6420 ---> 16481 +6421 ---> 16482 +6422 ---> 16483 +6423 ---> 16484 +6424 ---> 16485 +6425 ---> 16486 +6426 ---> 16487 +6427 ---> 16488 +6428 ---> 16489 +6429 ---> 16490 +6430 ---> 16491 +6431 ---> 16492 +6432 ---> 16493 +6433 ---> 16494 +6434 ---> 16495 +6435 ---> 16496 +6436 ---> 16497 +6437 ---> 16498 +6438 ---> 16499 +6439 ---> 16500 +6440 ---> 16501 +6441 ---> 16502 +6442 ---> 16503 +6443 ---> 16504 +6444 ---> 16505 +6445 ---> 16506 +6446 ---> 16507 +6447 ---> 16508 +6448 ---> 16509 +6449 ---> 16510 +6450 ---> 16511 +6451 ---> 16512 +6452 ---> 16513 +6453 ---> 16514 +6454 ---> 16515 +6455 ---> 16516 +6456 ---> 16517 +6457 ---> 16518 +6458 ---> 16519 +6459 ---> 16520 +6460 ---> 16521 +6461 ---> 16522 +6462 ---> 16523 +6463 ---> 16524 +6464 ---> 16525 +6465 ---> 16526 +6466 ---> 16527 +6467 ---> 16528 +6468 ---> 16529 +6471 ---> 16530 +6472 ---> 16531 +6476 ---> 16532 +6477 ---> 16533 +6479 ---> 16534 +6485 ---> 16535 +6486 ---> 16536 +6487 ---> 16537 +6489 ---> 16538 +6493 ---> 16539 +6494 ---> 16540 +6495 ---> 16541 +6501 ---> 16542 +6506 ---> 16543 +6513 ---> 16544 +6516 ---> 16545 +6517 ---> 16546 +6518 ---> 16547 +6529 ---> 16548 +6530 ---> 16549 +6531 ---> 16550 +6533 ---> 16551 +6534 ---> 16552 +6535 ---> 16553 +6541 ---> 16554 +6542 ---> 16555 +6546 ---> 16556 +6548 ---> 16557 +6550 ---> 16558 +6555 ---> 16559 +6556 ---> 16560 +6561 ---> 16561 +6562 ---> 16562 +6564 ---> 16563 +6571 ---> 16564 +6573 ---> 16565 +6574 ---> 16566 +6578 ---> 16567 +6579 ---> 16568 +6580 ---> 16569 +6589 ---> 16570 +6592 ---> 16571 +6595 ---> 16572 +6598 ---> 16573 +6602 ---> 16574 +6603 ---> 16575 +6606 ---> 16576 +6614 ---> 16577 +6615 ---> 16578 +6617 ---> 16579 +6618 ---> 16580 +6621 ---> 16581 +6622 ---> 16582 +6623 ---> 16583 +6624 ---> 16584 +6625 ---> 16585 +6626 ---> 16586 +6627 ---> 16587 +6628 ---> 16588 +6629 ---> 16589 +6642 ---> 16590 +6644 ---> 16591 +6645 ---> 16592 +6646 ---> 16593 +6652 ---> 16594 +6653 ---> 16595 +6654 ---> 16596 +6661 ---> 16597 +6663 ---> 16598 +6668 ---> 16599 +6673 ---> 16600 +6675 ---> 16601 +6676 ---> 16602 +6677 ---> 16603 +6681 ---> 16604 +6682 ---> 16605 +6684 ---> 16606 +6685 ---> 16607 +6688 ---> 16608 +6689 ---> 16609 +6691 ---> 16610 +6692 ---> 16611 +6693 ---> 16612 +6695 ---> 16613 +6701 ---> 16614 +6702 ---> 16615 +6704 ---> 16616 +6705 ---> 16617 +6706 ---> 16618 +6707 ---> 16619 +6709 ---> 16620 +6710 ---> 16621 +6712 ---> 16622 +6715 ---> 16623 +6718 ---> 16624 +6720 ---> 16625 +6721 ---> 16626 +6722 ---> 16627 +6725 ---> 16628 +6726 ---> 16629 +6728 ---> 16630 +6729 ---> 16631 +6732 ---> 16632 +6734 ---> 16633 +6737 ---> 16634 +6740 ---> 16635 +6741 ---> 16636 +6742 ---> 16637 +6743 ---> 16638 +6746 ---> 16639 +6751 ---> 16640 +6752 ---> 16641 +6753 ---> 16642 +6755 ---> 16643 +6756 ---> 16644 +6759 ---> 16645 +6760 ---> 16646 +6761 ---> 16647 +6767 ---> 16648 +6770 ---> 16649 +6771 ---> 16650 +6774 ---> 16651 +6775 ---> 16652 +6778 ---> 16653 +6781 ---> 16654 +6782 ---> 16655 +6783 ---> 16656 +6786 ---> 16657 +6791 ---> 16658 +6795 ---> 16659 +6796 ---> 16660 +6798 ---> 16661 +6801 ---> 16662 +6802 ---> 16663 +6803 ---> 16664 +6806 ---> 16665 +6807 ---> 16666 +6809 ---> 16667 +6813 ---> 16668 +6819 ---> 16669 +6820 ---> 16670 +6824 ---> 16671 +6826 ---> 16672 +6827 ---> 16673 +6828 ---> 16674 +6830 ---> 16675 +6831 ---> 16676 +6832 ---> 16677 +6834 ---> 16678 +6842 ---> 16679 +6848 ---> 16680 +6849 ---> 16681 +6850 ---> 16682 +6857 ---> 16683 +6863 ---> 16684 +6866 ---> 16685 +6868 ---> 16686 +6869 ---> 16687 +6871 ---> 16688 +6872 ---> 16689 +6877 ---> 16690 +6883 ---> 16691 +6889 ---> 16692 +6891 ---> 16693 +6892 ---> 16694 +6893 ---> 16695 +6896 ---> 16696 +6897 ---> 16697 +6899 ---> 16698 +6901 ---> 16699 +6903 ---> 16700 +6908 ---> 16701 +6911 ---> 16702 +6912 ---> 16703 +6913 ---> 16704 +6915 ---> 16705 +6917 ---> 16706 +6918 ---> 16707 +6920 ---> 16708 +6921 ---> 16709 +6922 ---> 16710 +6923 ---> 16711 +6924 ---> 16712 +6928 ---> 16713 +6929 ---> 16714 +6930 ---> 16715 +6931 ---> 16716 +6932 ---> 16717 +6934 ---> 16718 +6935 ---> 16719 +6936 ---> 16720 +6937 ---> 16721 +6938 ---> 16722 +6939 ---> 16723 +6942 ---> 16724 +6945 ---> 16725 +6946 ---> 16726 +6947 ---> 16727 +6948 ---> 16728 +6950 ---> 16729 +6953 ---> 16730 +6956 ---> 16731 +6960 ---> 16732 +6973 ---> 16733 +6976 ---> 16734 +6980 ---> 16735 +6994 ---> 16736 +6997 ---> 16737 +6998 ---> 16738 +6999 ---> 16739 +7001 ---> 16740 +7002 ---> 16741 +7010 ---> 16742 +7011 ---> 16743 +7012 ---> 16744 +7019 ---> 16745 +7021 ---> 16746 +7024 ---> 16747 +7026 ---> 16748 +7028 ---> 16749 +7031 ---> 16750 +7032 ---> 16751 +7035 ---> 16752 +7036 ---> 16753 +7037 ---> 16754 +7038 ---> 16755 +7039 ---> 16756 +7040 ---> 16757 +7043 ---> 16758 +7047 ---> 16759 +7051 ---> 16760 +7058 ---> 16761 +7061 ---> 16762 +7062 ---> 16763 +7063 ---> 16764 +7064 ---> 16765 +7072 ---> 16766 +7077 ---> 16767 +7079 ---> 16768 +7080 ---> 16769 +7081 ---> 16770 +7082 ---> 16771 +7083 ---> 16772 +7084 ---> 16773 +7085 ---> 16774 +7086 ---> 16775 +7087 ---> 16776 +7090 ---> 16777 +7091 ---> 16778 +7096 ---> 16779 +7098 ---> 16780 +7104 ---> 16781 +7105 ---> 16782 +7114 ---> 16783 +7125 ---> 16784 +7126 ---> 16785 +7127 ---> 16786 +7129 ---> 16787 +7130 ---> 16788 +7140 ---> 16789 +7141 ---> 16790 +7146 ---> 16791 +7148 ---> 16792 +7150 ---> 16793 +7151 ---> 16794 +7154 ---> 16795 +7155 ---> 16796 +7161 ---> 16797 +7166 ---> 16798 +7169 ---> 16799 +7172 ---> 16800 +7173 ---> 16801 +7175 ---> 16802 +7177 ---> 16803 +7180 ---> 16804 +7187 ---> 16805 +7191 ---> 16806 +7192 ---> 16807 +7193 ---> 16808 +7197 ---> 16809 +7198 ---> 16810 +7201 ---> 16811 +7204 ---> 16812 +7205 ---> 16813 +7206 ---> 16814 +7208 ---> 16815 +7214 ---> 16816 +7217 ---> 16817 +7221 ---> 16818 +7224 ---> 16819 +7230 ---> 16820 +7234 ---> 16821 +7239 ---> 16822 +7244 ---> 16823 +7248 ---> 16824 +7250 ---> 16825 +7252 ---> 16826 +7254 ---> 16827 +7261 ---> 16828 +7264 ---> 16829 +7267 ---> 16830 +7270 ---> 16831 +7274 ---> 16832 +7276 ---> 16833 +7280 ---> 16834 +7281 ---> 16835 +7290 ---> 16836 +7294 ---> 16837 +7295 ---> 16838 +7298 ---> 16839 +7299 ---> 16840 +7304 ---> 16841 +7325 ---> 16842 +7329 ---> 16843 +7335 ---> 16844 +7339 ---> 16845 +7340 ---> 16846 +7342 ---> 16847 +7343 ---> 16848 +7347 ---> 16849 +7351 ---> 16850 +7352 ---> 16851 +7357 ---> 16852 +7358 ---> 16853 +7359 ---> 16854 +7360 ---> 16855 +7362 ---> 16856 +7364 ---> 16857 +7367 ---> 16858 +7369 ---> 16859 +7375 ---> 16860 +7377 ---> 16861 +7380 ---> 16862 +7383 ---> 16863 +7384 ---> 16864 +7387 ---> 16865 +7390 ---> 16866 +7391 ---> 16867 +7397 ---> 16868 +7403 ---> 16869 +7409 ---> 16870 +7410 ---> 16871 +7416 ---> 16872 +7417 ---> 16873 +7424 ---> 16874 +7433 ---> 16875 +7434 ---> 16876 +7435 ---> 16877 +7436 ---> 16878 +7437 ---> 16879 +7439 ---> 16880 +7440 ---> 16881 +7443 ---> 16882 +7444 ---> 16883 +7445 ---> 16884 +7447 ---> 16885 +7448 ---> 16886 +7449 ---> 16887 +7455 ---> 16888 +7457 ---> 16889 +7458 ---> 16890 +7459 ---> 16891 +7465 ---> 16892 +7466 ---> 16893 +7472 ---> 16894 +7473 ---> 16895 +7480 ---> 16896 +7481 ---> 16897 +7484 ---> 16898 +7496 ---> 16899 +7499 ---> 16900 +7501 ---> 16901 +7505 ---> 16902 +7514 ---> 16903 +7517 ---> 16904 +7518 ---> 16905 +7520 ---> 16906 +7522 ---> 16907 +7527 ---> 16908 +7528 ---> 16909 +7538 ---> 16910 +7543 ---> 16911 +7545 ---> 16912 +7547 ---> 16913 +7548 ---> 16914 +7550 ---> 16915 +7551 ---> 16916 +7552 ---> 16917 +7554 ---> 16918 +7556 ---> 16919 +7557 ---> 16920 +7561 ---> 16921 +7569 ---> 16922 +7570 ---> 16923 +7576 ---> 16924 +7577 ---> 16925 +7578 ---> 16926 +7579 ---> 16927 +7580 ---> 16928 +7582 ---> 16929 +7584 ---> 16930 +7585 ---> 16931 +7592 ---> 16932 +7593 ---> 16933 +7594 ---> 16934 +7596 ---> 16935 +7597 ---> 16936 +7599 ---> 16937 +7605 ---> 16938 +7612 ---> 16939 +7622 ---> 16940 +7623 ---> 16941 +7630 ---> 16942 +7632 ---> 16943 +7634 ---> 16944 +7635 ---> 16945 +7637 ---> 16946 +7640 ---> 16947 +7649 ---> 16948 +7652 ---> 16949 +7656 ---> 16950 +7657 ---> 16951 +7658 ---> 16952 +7660 ---> 16953 +7662 ---> 16954 +7666 ---> 16955 +7673 ---> 16956 +7680 ---> 16957 +7683 ---> 16958 +7685 ---> 16959 +7688 ---> 16960 +7695 ---> 16961 +7697 ---> 16962 +7699 ---> 16963 +7700 ---> 16964 +7702 ---> 16965 +7705 ---> 16966 +7706 ---> 16967 +7707 ---> 16968 +7713 ---> 16969 +7719 ---> 16970 +7727 ---> 16971 +7731 ---> 16972 +7732 ---> 16973 +7733 ---> 16974 +7734 ---> 16975 +7735 ---> 16976 +7736 ---> 16977 +7737 ---> 16978 +7742 ---> 16979 +7744 ---> 16980 +7745 ---> 16981 +7748 ---> 16982 +7750 ---> 16983 +7751 ---> 16984 +7754 ---> 16985 +7755 ---> 16986 +7757 ---> 16987 +7758 ---> 16988 +7768 ---> 16989 +7778 ---> 16990 +7779 ---> 16991 +7781 ---> 16992 +7783 ---> 16993 +7787 ---> 16994 +7791 ---> 16995 +7792 ---> 16996 +7793 ---> 16997 +7798 ---> 16998 +7799 ---> 16999 +7804 ---> 17000 +7805 ---> 17001 +7806 ---> 17002 +7807 ---> 17003 +7810 ---> 17004 +7812 ---> 17005 +7814 ---> 17006 +7816 ---> 17007 +7818 ---> 17008 +7820 ---> 17009 +7821 ---> 17010 +7824 ---> 17011 +7825 ---> 17012 +7827 ---> 17013 +7830 ---> 17014 +7833 ---> 17015 +7835 ---> 17016 +7836 ---> 17017 +7837 ---> 17018 +7838 ---> 17019 +7839 ---> 17020 +7847 ---> 17021 +7849 ---> 17022 +7850 ---> 17023 +7851 ---> 17024 +7852 ---> 17025 +7853 ---> 17026 +7854 ---> 17027 +7855 ---> 17028 +7856 ---> 17029 +7858 ---> 17030 +7859 ---> 17031 +7860 ---> 17032 +7861 ---> 17033 +7862 ---> 17034 +7863 ---> 17035 +7864 ---> 17036 +7869 ---> 17037 +7870 ---> 17038 +7873 ---> 17039 +7874 ---> 17040 +7875 ---> 17041 +7877 ---> 17042 +7878 ---> 17043 +7879 ---> 17044 +7881 ---> 17045 +7883 ---> 17046 +7884 ---> 17047 +7885 ---> 17048 +7889 ---> 17049 +7890 ---> 17050 +7893 ---> 17051 +7895 ---> 17052 +7896 ---> 17053 +7899 ---> 17054 +7901 ---> 17055 +7902 ---> 17056 +7904 ---> 17057 +7905 ---> 17058 +7906 ---> 17059 +7908 ---> 17060 +7910 ---> 17061 +7912 ---> 17062 +7913 ---> 17063 +7917 ---> 17064 +7920 ---> 17065 +7921 ---> 17066 +7926 ---> 17067 +7927 ---> 17068 +7930 ---> 17069 +7932 ---> 17070 +7933 ---> 17071 +7935 ---> 17072 +7938 ---> 17073 +7939 ---> 17074 +7942 ---> 17075 +7948 ---> 17076 +7952 ---> 17077 +7953 ---> 17078 +7959 ---> 17079 +7961 ---> 17080 +7962 ---> 17081 +7973 ---> 17082 +7975 ---> 17083 +7980 ---> 17084 +7983 ---> 17085 +7986 ---> 17086 +7991 ---> 17087 +7996 ---> 17088 +8000 ---> 17089 +8001 ---> 17090 +8004 ---> 17091 +8007 ---> 17092 +8012 ---> 17093 +8023 ---> 17094 +8024 ---> 17095 +8027 ---> 17096 +8028 ---> 17097 +8029 ---> 17098 +8032 ---> 17099 +8034 ---> 17100 +8036 ---> 17101 +8038 ---> 17102 +8039 ---> 17103 +8041 ---> 17104 +8042 ---> 17105 +8043 ---> 17106 +8048 ---> 17107 +8050 ---> 17108 +8053 ---> 17109 +8054 ---> 17110 +8059 ---> 17111 +8061 ---> 17112 +8064 ---> 17113 +8066 ---> 17114 +8067 ---> 17115 +8068 ---> 17116 +8070 ---> 17117 +8074 ---> 17118 +8077 ---> 17119 +8079 ---> 17120 +8081 ---> 17121 +8084 ---> 17122 +8086 ---> 17123 +8090 ---> 17124 +8091 ---> 17125 +8099 ---> 17126 +8101 ---> 17127 +8104 ---> 17128 +8108 ---> 17129 +8110 ---> 17130 +8112 ---> 17131 +8113 ---> 17132 +8114 ---> 17133 +8115 ---> 17134 +8117 ---> 17135 +8119 ---> 17136 +8120 ---> 17137 +8121 ---> 17138 +8123 ---> 17139 +8124 ---> 17140 +8126 ---> 17141 +8130 ---> 17142 +8132 ---> 17143 +8133 ---> 17144 +8136 ---> 17145 +8139 ---> 17146 +8141 ---> 17147 +8142 ---> 17148 +8145 ---> 17149 +8146 ---> 17150 +8154 ---> 17151 +8158 ---> 17152 +8162 ---> 17153 +8165 ---> 17154 +8166 ---> 17155 +8171 ---> 17156 +8173 ---> 17157 +8174 ---> 17158 +8176 ---> 17159 +8180 ---> 17160 +8181 ---> 17161 +8182 ---> 17162 +8183 ---> 17163 +8184 ---> 17164 +8185 ---> 17165 +8186 ---> 17166 +8187 ---> 17167 +8188 ---> 17168 +8189 ---> 17169 +8190 ---> 17170 +8193 ---> 17171 +8195 ---> 17172 +8200 ---> 17173 +8201 ---> 17174 +8211 ---> 17175 +8213 ---> 17176 +8214 ---> 17177 +8216 ---> 17178 +8219 ---> 17179 +8220 ---> 17180 +8221 ---> 17181 +8223 ---> 17182 +8226 ---> 17183 +8228 ---> 17184 +8230 ---> 17185 +8234 ---> 17186 +8235 ---> 17187 +8237 ---> 17188 +8238 ---> 1412 +8239 ---> 17189 +8242 ---> 17190 +8258 ---> 17191 +8259 ---> 17192 +8260 ---> 17193 +8262 ---> 17194 +8263 ---> 17195 +8264 ---> 17196 +8274 ---> 17197 +8280 ---> 17198 +8288 ---> 17199 +8291 ---> 17200 +8297 ---> 17201 +8307 ---> 17202 +8311 ---> 17203 +8315 ---> 17204 +8320 ---> 17205 +8324 ---> 17206 +8330 ---> 17207 +8336 ---> 17208 +8337 ---> 17209 +8341 ---> 17210 +8346 ---> 17211 +8348 ---> 17212 +8353 ---> 17213 +8355 ---> 17214 +8356 ---> 17215 +8358 ---> 17216 +8359 ---> 17217 +8360 ---> 17218 +8361 ---> 17219 +8362 ---> 17220 +8366 ---> 17221 +8367 ---> 17222 +8369 ---> 17223 +8371 ---> 17224 +8376 ---> 17225 +8379 ---> 17226 +8380 ---> 17227 +8381 ---> 17228 +8382 ---> 17229 +8385 ---> 17230 +8386 ---> 17231 +8389 ---> 17232 +8390 ---> 17233 +8392 ---> 17234 +8393 ---> 17235 +8396 ---> 17236 +8398 ---> 17237 +8404 ---> 17238 +8410 ---> 17239 +8414 ---> 17240 +8422 ---> 17241 +8423 ---> 17242 +8425 ---> 17243 +8426 ---> 17244 +8429 ---> 17245 +8430 ---> 17246 +8435 ---> 17247 +8436 ---> 17248 +8437 ---> 17249 +8439 ---> 17250 +8440 ---> 17251 +8444 ---> 17252 +8449 ---> 17253 +8450 ---> 17254 +8453 ---> 17255 +8454 ---> 17256 +8455 ---> 17257 +8457 ---> 17258 +8458 ---> 17259 +8464 ---> 17260 +8472 ---> 17261 +8475 ---> 17262 +8478 ---> 17263 +8479 ---> 17264 +8482 ---> 17265 +8487 ---> 17266 +8489 ---> 17267 +8490 ---> 17268 +8491 ---> 17269 +8495 ---> 17270 +8496 ---> 17271 +8501 ---> 17272 +8504 ---> 17273 +8507 ---> 17274 +8509 ---> 17275 +8510 ---> 17276 +8511 ---> 17277 +8514 ---> 17278 +8515 ---> 17279 +8516 ---> 17280 +8517 ---> 17281 +8519 ---> 17282 +8523 ---> 17283 +8524 ---> 17284 +8526 ---> 17285 +8533 ---> 17286 +8538 ---> 17287 +8540 ---> 17288 +8541 ---> 17289 +8547 ---> 17290 +8552 ---> 17291 +8557 ---> 17292 +8560 ---> 17293 +8561 ---> 17294 +8563 ---> 17295 +8567 ---> 17296 +8569 ---> 17297 +8576 ---> 17298 +8577 ---> 17299 +8578 ---> 17300 +8579 ---> 17301 +8581 ---> 17302 +8584 ---> 17303 +8585 ---> 17304 +8592 ---> 17305 +8597 ---> 17306 +8598 ---> 17307 +8601 ---> 17308 +8606 ---> 17309 +8608 ---> 17310 +8610 ---> 17311 +8614 ---> 17312 +8617 ---> 17313 +8622 ---> 17314 +8627 ---> 17315 +8632 ---> 17316 +8633 ---> 17317 +8634 ---> 17318 +8636 ---> 17319 +8638 ---> 17320 +8641 ---> 17321 +8643 ---> 17322 +8647 ---> 1391 +8648 ---> 17323 +8649 ---> 17324 +8650 ---> 17325 +8651 ---> 17326 +8654 ---> 17327 +8655 ---> 17328 +8657 ---> 17329 +8661 ---> 17330 +8662 ---> 17331 +8663 ---> 17332 +8665 ---> 17333 +8668 ---> 17334 +8671 ---> 17335 +8673 ---> 17336 +8675 ---> 17337 +8677 ---> 17338 +8679 ---> 17339 +8681 ---> 17340 +8683 ---> 17341 +8684 ---> 17342 +8686 ---> 17343 +8688 ---> 17344 +8692 ---> 17345 +8694 ---> 17346 +8699 ---> 17347 +8701 ---> 17348 +8703 ---> 17349 +8708 ---> 17350 +8711 ---> 17351 +8712 ---> 17352 +8713 ---> 17353 +8714 ---> 17354 +8715 ---> 17355 +8716 ---> 17356 +8717 ---> 17357 +8718 ---> 17358 +8719 ---> 17359 +8721 ---> 17360 +8727 ---> 17361 +8735 ---> 17362 +8736 ---> 17363 +8744 ---> 17364 +8745 ---> 17365 +8749 ---> 17366 +8752 ---> 17367 +8753 ---> 17368 +8754 ---> 17369 +8755 ---> 17370 +8758 ---> 17371 +8761 ---> 17372 +8763 ---> 17373 +8768 ---> 17374 +8771 ---> 17375 +8773 ---> 17376 +8774 ---> 17377 +8779 ---> 17378 +8783 ---> 17379 +8787 ---> 17380 +8797 ---> 17381 +8798 ---> 17382 +8801 ---> 17383 +8803 ---> 17384 +8806 ---> 17385 +8808 ---> 17386 +8809 ---> 17387 +8810 ---> 17388 +8811 ---> 17389 +8813 ---> 17390 +8815 ---> 17391 +8819 ---> 17392 +8821 ---> 17393 +8822 ---> 17394 +8825 ---> 17395 +8828 ---> 17396 +8835 ---> 17397 +8836 ---> 17398 +8839 ---> 17399 +8841 ---> 17400 +8843 ---> 17401 +8844 ---> 17402 +8845 ---> 17403 +8848 ---> 17404 +8849 ---> 17405 +8855 ---> 17406 +8857 ---> 17407 +8860 ---> 17408 +8864 ---> 17409 +8866 ---> 17410 +8867 ---> 17411 +8868 ---> 17412 +8869 ---> 17413 +8877 ---> 17414 +8880 ---> 17415 +8882 ---> 17416 +8890 ---> 17417 +8895 ---> 17418 +8896 ---> 17420 +8899 ---> 17421 +8901 ---> 17422 +8907 ---> 17423 +8908 ---> 17424 +8910 ---> 17425 +8912 ---> 17426 +8913 ---> 17427 +8916 ---> 17428 +8917 ---> 17429 +8920 ---> 17430 +8924 ---> 17431 +8926 ---> 17432 +8927 ---> 17433 +8928 ---> 17434 +8931 ---> 17435 +8941 ---> 17436 +8944 ---> 17437 +8945 ---> 17438 +8947 ---> 17439 +8948 ---> 17440 +8949 ---> 17441 +8950 ---> 17442 +8951 ---> 17443 +8952 ---> 17444 +8954 ---> 17445 +8955 ---> 17446 +8957 ---> 17447 +8958 ---> 17448 +8960 ---> 17449 +8962 ---> 17450 +8963 ---> 17451 +8965 ---> 17452 +8967 ---> 17453 +8968 ---> 17454 +8971 ---> 17455 +8973 ---> 17456 +8974 ---> 17457 +8979 ---> 17458 +8981 ---> 17459 +8983 ---> 17460 +8984 ---> 17461 +8985 ---> 17462 +8991 ---> 17463 +8992 ---> 17464 +8995 ---> 17465 +9003 ---> 17466 +9006 ---> 17467 +9008 ---> 17468 +9009 ---> 17469 +9011 ---> 17470 +9012 ---> 17471 +9017 ---> 17472 +9018 ---> 17473 +9019 ---> 17474 +9023 ---> 17475 +9027 ---> 17476 +9039 ---> 17477 +9040 ---> 17478 +9044 ---> 17479 +9045 ---> 17480 +9046 ---> 17481 +9048 ---> 17482 +9049 ---> 17483 +9053 ---> 17484 +9058 ---> 17485 +9060 ---> 17486 +9061 ---> 17487 +9063 ---> 17488 +9066 ---> 17489 +9068 ---> 17490 +9070 ---> 17491 +9071 ---> 17492 +9072 ---> 17493 +9075 ---> 17494 +9076 ---> 17495 +9083 ---> 17496 +9085 ---> 17497 +9087 ---> 17498 +9088 ---> 17499 +9091 ---> 17500 +9092 ---> 17501 +9094 ---> 17502 +9108 ---> 17503 +9114 ---> 17504 +9116 ---> 17505 +9118 ---> 17506 +9122 ---> 17507 +9124 ---> 17508 +9127 ---> 17509 +9130 ---> 17510 +9142 ---> 17511 +9143 ---> 17512 +9145 ---> 17513 +9155 ---> 17514 +9156 ---> 17515 +9158 ---> 17516 +9160 ---> 17517 +9162 ---> 17518 +9166 ---> 17519 +9167 ---> 17520 +9168 ---> 17521 +9170 ---> 17522 +9171 ---> 17523 +9180 ---> 17524 +9182 ---> 17525 +9184 ---> 17526 +9187 ---> 17527 +9189 ---> 17528 +9192 ---> 17529 +9197 ---> 17530 +9198 ---> 17531 +9201 ---> 17532 +9202 ---> 17533 +9204 ---> 17534 +9207 ---> 17535 +9212 ---> 17536 +9213 ---> 17537 +9220 ---> 17538 +9222 ---> 17539 +9225 ---> 17540 +9227 ---> 17541 +9228 ---> 17542 +9231 ---> 17543 +9232 ---> 17544 +9234 ---> 17545 +9235 ---> 17546 +9237 ---> 17547 +9240 ---> 17548 +9242 ---> 17549 +9244 ---> 17550 +9246 ---> 17551 +9247 ---> 17552 +9248 ---> 17553 +9249 ---> 17554 +9252 ---> 17555 +9252 ---> 17555 +9253 ---> 17556 +9257 ---> 17557 +9259 ---> 17558 +9263 ---> 17559 +9265 ---> 17560 +9267 ---> 17561 +9268 ---> 17562 +9270 ---> 17563 +9271 ---> 17564 +9272 ---> 17565 +9274 ---> 17566 +9276 ---> 17567 +9278 ---> 17568 +9290 ---> 17569 +9293 ---> 17570 +9294 ---> 17571 +9296 ---> 17572 +9300 ---> 17573 +9303 ---> 17574 +9304 ---> 17575 +9315 ---> 17576 +9320 ---> 17577 +9325 ---> 17578 +9327 ---> 17579 +9328 ---> 17580 +9329 ---> 17581 +9331 ---> 17582 +9337 ---> 17583 +9339 ---> 17584 +9342 ---> 17585 +9347 ---> 17586 +9350 ---> 17587 +9353 ---> 17588 +9357 ---> 17589 +9369 ---> 17590 +9370 ---> 17591 +9376 ---> 17592 +9379 ---> 17593 +9383 ---> 17594 +9389 ---> 17595 +9392 ---> 17596 +9394 ---> 17597 +9397 ---> 17598 +9400 ---> 17599 +9401 ---> 17600 +9402 ---> 17601 +9407 ---> 17602 +9408 ---> 17603 +9409 ---> 17604 +9410 ---> 17605 +9413 ---> 17606 +9416 ---> 17607 +9417 ---> 17608 +9418 ---> 17609 +9420 ---> 17610 +9423 ---> 17611 +9424 ---> 17612 +9425 ---> 17613 +9426 ---> 17614 +9427 ---> 17615 +9428 ---> 17616 +9433 ---> 17617 +9438 ---> 17618 +9439 ---> 17619 +9440 ---> 17620 +9442 ---> 17621 +9444 ---> 17622 +9445 ---> 17623 +9449 ---> 17624 +9451 ---> 17625 +9462 ---> 17626 +9463 ---> 17627 +9464 ---> 17628 +9465 ---> 17629 +9472 ---> 17630 +9478 ---> 17631 +9480 ---> 17632 +9481 ---> 17633 +9482 ---> 17634 +9483 ---> 17635 +9484 ---> 17636 +9485 ---> 17637 +9486 ---> 17638 +9487 ---> 17639 +9489 ---> 17640 +9491 ---> 17641 +9492 ---> 17642 +9500 ---> 17643 +9503 ---> 17644 +9514 ---> 17645 +9516 ---> 17646 +9518 ---> 17647 +9521 ---> 17648 +9533 ---> 17649 +9535 ---> 17650 +9538 ---> 17651 +9539 ---> 17652 +9541 ---> 17653 +9543 ---> 17654 +9545 ---> 17655 +9549 ---> 17656 +9550 ---> 17657 +9551 ---> 17658 +9552 ---> 17659 +9553 ---> 17660 +9554 ---> 17661 +9556 ---> 17662 +9558 ---> 17663 +9559 ---> 17664 +9562 ---> 17665 +9570 ---> 17666 +9572 ---> 17667 +9574 ---> 17668 +9578 ---> 17669 +9581 ---> 17670 +9582 ---> 17671 +9583 ---> 17672 +9596 ---> 17673 +9600 ---> 17674 +9604 ---> 17675 +9605 ---> 17676 +9608 ---> 17677 +9611 ---> 17678 +9620 ---> 17679 +9621 ---> 17680 +9623 ---> 17681 +9626 ---> 17682 +9627 ---> 17683 +9628 ---> 17684 +9629 ---> 17685 +9630 ---> 17686 +9631 ---> 17687 +9632 ---> 17688 +9634 ---> 17689 +9635 ---> 17690 +9636 ---> 17691 +9637 ---> 17692 +9641 ---> 17693 +9643 ---> 17694 +9644 ---> 17695 +9649 ---> 17696 +9650 ---> 17697 +9651 ---> 17698 +9652 ---> 17699 +9657 ---> 1542 +9658 ---> 17700 +9664 ---> 17701 +9669 ---> 17702 +9670 ---> 17703 +9672 ---> 17704 +9673 ---> 17705 +9675 ---> 17706 +9678 ---> 17707 +9680 ---> 17708 +9688 ---> 17709 +9697 ---> 17710 +9698 ---> 17711 +9699 ---> 17712 +9703 ---> 17713 +9704 ---> 17714 +9706 ---> 17715 +9709 ---> 17716 +9710 ---> 17717 +9711 ---> 17718 +9719 ---> 17719 +9722 ---> 17720 +9724 ---> 17721 +9725 ---> 17722 +9728 ---> 17723 +9729 ---> 17724 +9730 ---> 17725 +9735 ---> 17726 +9743 ---> 17727 +9747 ---> 17728 +9748 ---> 17729 +9750 ---> 17730 +9751 ---> 17731 +9754 ---> 17732 +9756 ---> 17733 +9757 ---> 17734 +9761 ---> 17735 +9762 ---> 17736 +9764 ---> 17737 +9766 ---> 17738 +9767 ---> 17739 +9768 ---> 17740 +9769 ---> 17741 +9777 ---> 17742 +9780 ---> 17743 +9785 ---> 17744 +9788 ---> 17745 +9789 ---> 17746 +9792 ---> 17747 +9795 ---> 17748 +9796 ---> 17749 +9798 ---> 17750 +9800 ---> 17751 +9801 ---> 17752 +9802 ---> 17753 +9805 ---> 17754 +9807 ---> 17755 +9809 ---> 17756 +9812 ---> 17757 +9817 ---> 17758 +9820 ---> 17759 +9824 ---> 17760 +9826 ---> 17761 +9832 ---> 17762 +9833 ---> 17763 +9835 ---> 17764 +9838 ---> 17765 +9839 ---> 17766 +9840 ---> 17767 +9842 ---> 17768 +9843 ---> 17769 +9846 ---> 17770 +9848 ---> 17771 +9854 ---> 17772 +9855 ---> 17773 +9859 ---> 17774 +9865 ---> 17775 +9867 ---> 17776 +9868 ---> 17777 +9870 ---> 17778 +9871 ---> 17779 +9872 ---> 17780 +9873 ---> 17781 +9875 ---> 17782 +9876 ---> 17783 +9877 ---> 17784 +9882 ---> 17785 +9884 ---> 17786 +9885 ---> 17787 +9887 ---> 17788 +9889 ---> 17789 +9890 ---> 17790 +9892 ---> 17791 +9893 ---> 17792 +9894 ---> 17793 +9908 ---> 17794 +9910 ---> 17795 +9911 ---> 17796 +9913 ---> 17797 +9915 ---> 17798 +9917 ---> 17799 +9920 ---> 17800 +9924 ---> 17801 +9925 ---> 17802 +9928 ---> 17803 +9932 ---> 17804 +9933 ---> 17805 +9938 ---> 17806 +9946 ---> 17807 +9949 ---> 17808 +9952 ---> 17809 +9958 ---> 17810 +9966 ---> 17811 +9973 ---> 17812 +9975 ---> 17813 +9979 ---> 17814 +9981 ---> 17815 +9982 ---> 17816 +9983 ---> 17817 +9984 ---> 17818 +9985 ---> 17819 +9986 ---> 17820 +9988 ---> 17821 +9989 ---> 17822 +9990 ---> 17823 +9991 ---> 17824 +9992 ---> 17825 +9994 ---> 17826 +9995 ---> 17827 +9996 ---> 17828 +9997 ---> 17829 +9998 ---> 17830 +9999 ---> 17831 +10000 ---> 17832 +10002 ---> 17833 +10010 ---> 17834 +10011 ---> 17835 +10012 ---> 17836 +10013 ---> 17837 +10014 ---> 17838 +10023 ---> 17839 +10024 ---> 17840 +10028 ---> 17841 +10031 ---> 17842 +10032 ---> 17843 +10040 ---> 17844 +10041 ---> 17845 +10046 ---> 17846 +10047 ---> 17847 +10051 ---> 17848 +10054 ---> 17849 +10057 ---> 17850 +10061 ---> 17851 +10062 ---> 17852 +10063 ---> 17853 +10065 ---> 17854 +10066 ---> 17855 +10073 ---> 17856 +10074 ---> 17857 +10075 ---> 17858 +10076 ---> 17859 +10082 ---> 17860 +10084 ---> 17861 +10085 ---> 17862 +10087 ---> 17863 +10090 ---> 17864 +10093 ---> 17865 +10099 ---> 17866 +10107 ---> 17867 +10110 ---> 17868 +10113 ---> 17869 +10114 ---> 17870 +10116 ---> 17871 +10117 ---> 17872 +10120 ---> 17873 +10122 ---> 17874 +10123 ---> 17875 +10124 ---> 17876 +10127 ---> 17877 +10133 ---> 17878 +10137 ---> 17879 +10138 ---> 17880 +10139 ---> 17881 +10140 ---> 17882 +10146 ---> 17883 +10148 ---> 17884 +10149 ---> 17885 +10150 ---> 17886 +10152 ---> 17887 +10154 ---> 17888 +10155 ---> 17889 +10156 ---> 17890 +10157 ---> 17891 +10166 ---> 17892 +10169 ---> 17893 +10172 ---> 17894 +10177 ---> 17895 +10194 ---> 17896 +10195 ---> 17897 +10196 ---> 17898 +10197 ---> 17899 +10198 ---> 17900 +10200 ---> 17901 +10202 ---> 17902 +10206 ---> 17903 +10207 ---> 17904 +10210 ---> 17905 +10211 ---> 17906 +10213 ---> 17907 +10215 ---> 17908 +10216 ---> 17909 +10217 ---> 17910 +10218 ---> 17911 +10223 ---> 17912 +10226 ---> 17913 +10230 ---> 17914 +10261 ---> 17915 +10273 ---> 17916 +10277 ---> 17917 +10289 ---> 17918 +10290 ---> 17919 +10295 ---> 17920 +10298 ---> 17921 +10305 ---> 17922 +10310 ---> 17923 +10311 ---> 17924 +10314 ---> 17925 +10322 ---> 17926 +10325 ---> 17927 +10326 ---> 17928 +10327 ---> 17929 +10330 ---> 17930 +10334 ---> 17931 +10335 ---> 17932 +10338 ---> 17933 +10344 ---> 17934 +10345 ---> 17935 +10346 ---> 17936 +10353 ---> 17937 +10361 ---> 17938 +10365 ---> 17939 +10366 ---> 17940 +10368 ---> 17941 +10373 ---> 17942 +10374 ---> 17943 +10375 ---> 17944 +10376 ---> 17945 +10382 ---> 17946 +10395 ---> 17947 +10396 ---> 17948 +10397 ---> 17949 +10398 ---> 17950 +10399 ---> 17951 +10400 ---> 17952 +10409 ---> 17953 +10416 ---> 17954 +10421 ---> 17955 +10422 ---> 17956 +10426 ---> 17957 +10427 ---> 17958 +10428 ---> 17959 +10430 ---> 17960 +10431 ---> 17961 +10437 ---> 17962 +10439 ---> 17963 +10441 ---> 17964 +10443 ---> 17965 +10445 ---> 17966 +10449 ---> 17967 +10451 ---> 17968 +10454 ---> 17969 +10455 ---> 17970 +10457 ---> 17971 +10466 ---> 17972 +10470 ---> 17973 +10478 ---> 17974 +10481 ---> 17975 +10484 ---> 17976 +10487 ---> 17977 +10488 ---> 17978 +10490 ---> 17979 +10491 ---> 17980 +10493 ---> 17981 +10497 ---> 17982 +10498 ---> 17983 +10499 ---> 17984 +10500 ---> 17985 +10501 ---> 17986 +10502 ---> 17987 +10503 ---> 17988 +10504 ---> 17989 +10505 ---> 17990 +10506 ---> 17991 +10507 ---> 17992 +10508 ---> 17993 +10511 ---> 17994 +10513 ---> 17995 +10515 ---> 17996 +10516 ---> 17997 +10518 ---> 17998 +10519 ---> 17999 +10520 ---> 18000 +10521 ---> 18001 +10523 ---> 18002 +10524 ---> 18003 +10525 ---> 18004 +10526 ---> 18005 +10527 ---> 18006 +10528 ---> 18007 +10530 ---> 18008 +10533 ---> 18009 +10534 ---> 18010 +10535 ---> 18011 +10544 ---> 18012 +10546 ---> 18013 +10547 ---> 18014 +10549 ---> 18015 +10550 ---> 18016 +10555 ---> 18017 +10556 ---> 18018 +10561 ---> 18019 +10563 ---> 18020 +10566 ---> 18021 +10567 ---> 18022 +10570 ---> 18023 +10572 ---> 18024 +10573 ---> 18025 +10574 ---> 18026 +10575 ---> 18027 +10576 ---> 18028 +10577 ---> 18029 +10578 ---> 18030 +10579 ---> 18031 +10580 ---> 18032 +10581 ---> 18033 +10583 ---> 18034 +10586 ---> 1402 +10587 ---> 1401 +10588 ---> 1400 +10589 ---> 1399 +10590 ---> 1398 +10591 ---> 18035 +10592 ---> 18036 +10593 ---> 18037 +10595 ---> 18038 +10597 ---> 18039 +10600 ---> 18040 +10603 ---> 18041 +10606 ---> 18042 +10610 ---> 18043 +10618 ---> 18044 +10621 ---> 18045 +10626 ---> 18046 +10627 ---> 18047 +10632 ---> 909 +10633 ---> 18048 +10641 ---> 18049 +10649 ---> 18050 +10654 ---> 18051 +10656 ---> 18052 +10657 ---> 18053 +10666 ---> 18054 +10671 ---> 18055 +10675 ---> 18056 +10676 ---> 18057 +10678 ---> 18058 +10685 ---> 18059 +10686 ---> 18060 +10687 ---> 18061 +10688 ---> 18062 +10692 ---> 18063 +10694 ---> 18064 +10695 ---> 18065 +10698 ---> 18066 +10700 ---> 18067 +10702 ---> 18068 +10706 ---> 18069 +10709 ---> 18070 +10712 ---> 18071 +10713 ---> 18072 +10714 ---> 18073 +10719 ---> 18074 +10720 ---> 18075 +10721 ---> 18076 +10722 ---> 18077 +10726 ---> 18078 +10727 ---> 18079 +10732 ---> 18080 +10736 ---> 18081 +10737 ---> 18082 +10739 ---> 18083 +10744 ---> 18084 +10747 ---> 18085 +10749 ---> 18086 +10752 ---> 18087 +10760 ---> 18088 +10764 ---> 18089 +10769 ---> 18090 +10772 ---> 18091 +10773 ---> 18092 +10774 ---> 18093 +10775 ---> 18094 +10776 ---> 18095 +10777 ---> 18096 +10778 ---> 18097 +10779 ---> 18098 +10780 ---> 18099 +10781 ---> 18100 +10782 ---> 18101 +10783 ---> 18102 +10784 ---> 18103 +10785 ---> 18104 +10786 ---> 18105 +10787 ---> 18106 +10796 ---> 18107 +10797 ---> 18108 +10799 ---> 18109 +10800 ---> 18110 +10801 ---> 18111 +10804 ---> 18112 +10809 ---> 18113 +10813 ---> 18114 +10814 ---> 18115 +10815 ---> 18116 +10816 ---> 18117 +10817 ---> 18118 +10818 ---> 18119 +10819 ---> 18120 +10820 ---> 18121 +10821 ---> 18122 +10822 ---> 18123 +10823 ---> 18124 +10824 ---> 18125 +10825 ---> 18126 +10826 ---> 18127 +10827 ---> 18128 +10828 ---> 18129 +10829 ---> 18130 +10830 ---> 18131 +10831 ---> 18132 +10832 ---> 18133 +10833 ---> 18134 +10834 ---> 18135 +10835 ---> 18136 +10836 ---> 18137 +10837 ---> 18138 +10838 ---> 18139 +10839 ---> 18140 +10840 ---> 18141 +10842 ---> 18142 +10843 ---> 18143 +10844 ---> 18144 +10845 ---> 18145 +10846 ---> 18146 +10847 ---> 18147 +10848 ---> 18148 +10849 ---> 18149 +10850 ---> 18150 +10851 ---> 29566 +10852 ---> 18151 +10854 ---> 18152 +10856 ---> 18153 +10858 ---> 18154 +10859 ---> 18155 +10860 ---> 18156 +10872 ---> 18157 +10873 ---> 18158 +10875 ---> 18159 +10876 ---> 18160 +10877 ---> 18161 +10878 ---> 18162 +10879 ---> 18163 +10880 ---> 18164 +10881 ---> 18165 +10883 ---> 18166 +10884 ---> 18167 +10885 ---> 18168 +10886 ---> 18169 +10887 ---> 18170 +10888 ---> 18171 +10889 ---> 18172 +10890 ---> 18173 +10891 ---> 18174 +10892 ---> 18175 +10893 ---> 18176 +10894 ---> 18177 +10895 ---> 18178 +10896 ---> 18179 +10897 ---> 18180 +10898 ---> 18181 +10899 ---> 18182 +10900 ---> 18183 +10901 ---> 18184 +10902 ---> 18185 +10903 ---> 18186 +10904 ---> 18187 +10905 ---> 18188 +10906 ---> 18189 +10908 ---> 18190 +10909 ---> 18191 +10910 ---> 18192 +10911 ---> 18193 +10912 ---> 18194 +10913 ---> 18195 +10914 ---> 18196 +10915 ---> 18197 +10916 ---> 18198 +10917 ---> 18199 +10919 ---> 18200 +10920 ---> 18201 +10921 ---> 18202 +10923 ---> 18203 +10925 ---> 18204 +10931 ---> 18205 +10933 ---> 18206 +10934 ---> 18207 +10935 ---> 18208 +10936 ---> 18209 +10943 ---> 18210 +10944 ---> 18211 +10947 ---> 18212 +10949 ---> 18213 +10950 ---> 18214 +10951 ---> 18215 +10954 ---> 18216 +10958 ---> 18217 +10961 ---> 18218 +10962 ---> 18219 +10963 ---> 18220 +10967 ---> 18221 +10969 ---> 18222 +10973 ---> 18223 +10974 ---> 18224 +10975 ---> 18225 +10980 ---> 18226 +10981 ---> 18227 +10984 ---> 18228 +10985 ---> 18229 +10987 ---> 18230 +10989 ---> 18231 +10990 ---> 18232 +10994 ---> 18233 +10998 ---> 18234 +11002 ---> 18235 +11005 ---> 18236 +11009 ---> 18237 +11010 ---> 18238 +11013 ---> 18239 +11016 ---> 18240 +11023 ---> 18241 +11025 ---> 18242 +11029 ---> 18243 +11030 ---> 18244 +11033 ---> 18245 +11035 ---> 18246 +11036 ---> 18247 +11037 ---> 18248 +11038 ---> 18249 +11039 ---> 18250 +11042 ---> 18251 +11044 ---> 18252 +11045 ---> 18253 +11046 ---> 18254 +11048 ---> 18255 +11050 ---> 18256 +11055 ---> 1407 +11056 ---> 18257 +11057 ---> 18258 +11058 ---> 18259 +11062 ---> 18260 +11063 ---> 18261 +11067 ---> 18262 +11071 ---> 18263 +11072 ---> 18264 +11073 ---> 18265 +11075 ---> 18266 +11082 ---> 18267 +11083 ---> 18268 +11084 ---> 18269 +11085 ---> 18270 +11087 ---> 18271 +11088 ---> 18272 +11089 ---> 18273 +11090 ---> 18274 +11093 ---> 18275 +11094 ---> 18276 +11096 ---> 18277 +11097 ---> 18278 +11098 ---> 18279 +11100 ---> 18280 +11103 ---> 18281 +11105 ---> 18282 +11107 ---> 18283 +11109 ---> 18284 +11110 ---> 18285 +11111 ---> 18286 +11112 ---> 18287 +11113 ---> 18288 +11114 ---> 18289 +11115 ---> 18290 +11116 ---> 18291 +11117 ---> 18292 +11118 ---> 18293 +11120 ---> 18294 +11121 ---> 18295 +11122 ---> 18296 +11123 ---> 18297 +11124 ---> 18298 +11125 ---> 18299 +11126 ---> 18300 +11127 ---> 18301 +11128 ---> 18302 +11129 ---> 18303 +11132 ---> 18304 +11135 ---> 18305 +11141 ---> 18306 +11142 ---> 18307 +11144 ---> 18308 +11146 ---> 18309 +11151 ---> 18310 +11154 ---> 18311 +11155 ---> 18312 +11156 ---> 18313 +11157 ---> 18314 +11160 ---> 18315 +11161 ---> 18316 +11163 ---> 18317 +11165 ---> 18318 +11169 ---> 18319 +11170 ---> 18320 +11173 ---> 18321 +11174 ---> 18322 +11175 ---> 18323 +11177 ---> 18324 +11182 ---> 18325 +11183 ---> 18326 +11184 ---> 18327 +11186 ---> 18328 +11188 ---> 18329 +11189 ---> 18330 +11195 ---> 18331 +11196 ---> 18332 +11199 ---> 18333 +11203 ---> 18334 +11204 ---> 18335 +11206 ---> 18336 +11207 ---> 18337 +11211 ---> 18338 +11212 ---> 18339 +11213 ---> 18340 +11216 ---> 18341 +11217 ---> 18342 +11218 ---> 18343 +11220 ---> 18344 +11221 ---> 18345 +11222 ---> 18346 +11223 ---> 18347 +11224 ---> 18348 +11225 ---> 18349 +11228 ---> 18350 +11231 ---> 18351 +11232 ---> 18352 +11241 ---> 18353 +11243 ---> 18354 +11244 ---> 18355 +11254 ---> 18356 +11255 ---> 18357 +11257 ---> 18358 +11260 ---> 18359 +11262 ---> 18360 +11263 ---> 18361 +11266 ---> 18362 +11268 ---> 18363 +11270 ---> 18364 +11271 ---> 18365 +11274 ---> 18366 +11277 ---> 18367 +11278 ---> 18368 +11279 ---> 18369 +11281 ---> 18370 +11282 ---> 18371 +11283 ---> 18372 +11284 ---> 18373 +11286 ---> 18374 +11288 ---> 18375 +11291 ---> 18376 +11292 ---> 18377 +11295 ---> 18378 +11296 ---> 18379 +11297 ---> 18380 +11299 ---> 18381 +11301 ---> 18382 +11303 ---> 18383 +11306 ---> 18384 +11307 ---> 18385 +11309 ---> 18386 +11313 ---> 18387 +11315 ---> 18388 +11317 ---> 18389 +11319 ---> 18390 +11320 ---> 18391 +11321 ---> 18392 +11323 ---> 18393 +11324 ---> 18394 +11325 ---> 18395 +11327 ---> 18396 +11328 ---> 18397 +11331 ---> 18398 +11332 ---> 18399 +11333 ---> 18400 +11335 ---> 18401 +11339 ---> 18402 +11342 ---> 18403 +11343 ---> 18404 +11344 ---> 18405 +11345 ---> 18406 +11360 ---> 18407 +11361 ---> 18408 +11364 ---> 18409 +11367 ---> 18410 +11368 ---> 18411 +11371 ---> 18412 +11373 ---> 18413 +11374 ---> 18414 +11381 ---> 18415 +11388 ---> 18416 +11390 ---> 18417 +11391 ---> 18418 +11392 ---> 18419 +11399 ---> 18420 +11400 ---> 18421 +11401 ---> 18422 +11406 ---> 18423 +11408 ---> 18424 +11409 ---> 18425 +11411 ---> 18426 +11412 ---> 18427 +11414 ---> 18428 +11415 ---> 18429 +11421 ---> 18430 +11426 ---> 18431 +11429 ---> 18432 +11437 ---> 18433 +11440 ---> 18434 +11441 ---> 18435 +11444 ---> 18436 +11445 ---> 18437 +11450 ---> 18438 +11451 ---> 18439 +11452 ---> 18440 +11453 ---> 18441 +11454 ---> 18442 +11455 ---> 18443 +11456 ---> 18444 +11457 ---> 18445 +11459 ---> 18446 +11460 ---> 18447 +11462 ---> 18448 +11463 ---> 18449 +11464 ---> 18450 +11465 ---> 18451 +11467 ---> 18452 +11468 ---> 18453 +11469 ---> 18454 +11471 ---> 18455 +11473 ---> 18456 +11477 ---> 18457 +11494 ---> 18458 +11495 ---> 18459 +11497 ---> 18460 +11499 ---> 18461 +11503 ---> 18462 +11504 ---> 18463 +11516 ---> 18464 +11520 ---> 18465 +11521 ---> 18466 +11528 ---> 18467 +11529 ---> 18468 +11531 ---> 18469 +11532 ---> 18470 +11537 ---> 18471 +11539 ---> 18472 +11541 ---> 18473 +11542 ---> 18474 +11543 ---> 18475 +11545 ---> 18476 +11548 ---> 18477 +11549 ---> 18478 +11551 ---> 18479 +11554 ---> 18480 +11555 ---> 18481 +11556 ---> 18482 +11564 ---> 18483 +11565 ---> 18484 +11566 ---> 18485 +11568 ---> 18486 +11570 ---> 18487 +11571 ---> 18488 +11572 ---> 18489 +11573 ---> 18490 +11575 ---> 18491 +11578 ---> 18492 +11579 ---> 18493 +11580 ---> 18494 +11583 ---> 18495 +11584 ---> 18496 +11588 ---> 18497 +11590 ---> 18498 +11596 ---> 18499 +11598 ---> 18500 +11599 ---> 18501 +11601 ---> 18502 +11604 ---> 18503 +11605 ---> 18504 +11606 ---> 18505 +11608 ---> 18506 +11609 ---> 18507 +11611 ---> 18508 +11612 ---> 18509 +11613 ---> 18510 +11614 ---> 18511 +11615 ---> 18512 +11616 ---> 18513 +11617 ---> 18514 +11619 ---> 18515 +11622 ---> 18516 +11623 ---> 18517 +11624 ---> 18518 +11631 ---> 18519 +11632 ---> 18520 +11633 ---> 18521 +11634 ---> 18522 +11635 ---> 18523 +11636 ---> 18524 +11637 ---> 18525 +11638 ---> 18526 +11639 ---> 18527 +11643 ---> 18528 +11646 ---> 18529 +11647 ---> 18530 +11650 ---> 18531 +11655 ---> 18532 +11656 ---> 18533 +11657 ---> 18534 +11658 ---> 18535 +11660 ---> 18536 +11661 ---> 18537 +11665 ---> 18538 +11667 ---> 18539 +11668 ---> 1543 +11669 ---> 1544 +11670 ---> 18540 +11672 ---> 18541 +11674 ---> 18542 +11680 ---> 18543 +11682 ---> 18544 +11683 ---> 18545 +11685 ---> 18546 +11686 ---> 18547 +11687 ---> 18548 +11692 ---> 18549 +11693 ---> 18550 +11697 ---> 18551 +11702 ---> 18552 +11703 ---> 18553 +11704 ---> 18554 +11705 ---> 18555 +11707 ---> 18556 +11708 ---> 18557 +11712 ---> 18558 +11715 ---> 18559 +11718 ---> 18560 +11723 ---> 18561 +11724 ---> 18562 +11726 ---> 18563 +11727 ---> 18564 +11728 ---> 18565 +11729 ---> 18566 +11730 ---> 18567 +11734 ---> 18568 +11735 ---> 18569 +11736 ---> 18570 +11737 ---> 18571 +11738 ---> 18572 +11739 ---> 18573 +11740 ---> 18574 +11742 ---> 18575 +11743 ---> 18576 +11747 ---> 18577 +11757 ---> 18578 +11762 ---> 18579 +11764 ---> 18580 +11766 ---> 18581 +11768 ---> 18582 +11769 ---> 18583 +11770 ---> 18584 +11771 ---> 18585 +11772 ---> 18586 +11774 ---> 18587 +11780 ---> 18588 +11787 ---> 18589 +11788 ---> 18590 +11789 ---> 18591 +11790 ---> 18592 +11791 ---> 18593 +11792 ---> 18594 +11793 ---> 18595 +11794 ---> 18596 +11795 ---> 18597 +11796 ---> 18598 +11797 ---> 18599 +11802 ---> 18600 +11803 ---> 18601 +11805 ---> 18602 +11806 ---> 18603 +11807 ---> 18604 +11808 ---> 18605 +11809 ---> 18606 +11810 ---> 18607 +11811 ---> 18608 +11812 ---> 18609 +11815 ---> 18610 +11820 ---> 18611 +11825 ---> 18612 +11826 ---> 18613 +11836 ---> 18614 +11837 ---> 18615 +11839 ---> 18616 +11840 ---> 18617 +11842 ---> 18618 +11843 ---> 18619 +11844 ---> 18620 +11846 ---> 18621 +11851 ---> 18622 +11853 ---> 18623 +11856 ---> 18624 +11857 ---> 18625 +11858 ---> 18626 +11861 ---> 18627 +11862 ---> 18628 +11866 ---> 18629 +11869 ---> 18630 +11870 ---> 18631 +11873 ---> 18632 +11874 ---> 18633 +11875 ---> 18634 +11878 ---> 18635 +11881 ---> 18636 +11882 ---> 18637 +11883 ---> 18638 +11884 ---> 18639 +11885 ---> 18640 +11887 ---> 18641 +11888 ---> 18642 +11893 ---> 18643 +11897 ---> 18644 +11898 ---> 18645 +11904 ---> 18646 +11907 ---> 18647 +11908 ---> 18648 +11910 ---> 18649 +11916 ---> 18650 +11917 ---> 18651 +11918 ---> 18652 +11919 ---> 18653 +11926 ---> 18654 +11934 ---> 18655 +11935 ---> 18656 +11936 ---> 18657 +11943 ---> 18658 +11949 ---> 18659 +11952 ---> 1397 +11953 ---> 18660 +11954 ---> 18661 +11958 ---> 18662 +11960 ---> 18663 +11965 ---> 18664 +11967 ---> 18665 +11971 ---> 18666 +11973 ---> 18667 +11976 ---> 18668 +11978 ---> 18669 +11979 ---> 18670 +11980 ---> 18671 +11987 ---> 18672 +11990 ---> 18673 +11991 ---> 18674 +11992 ---> 18675 +11994 ---> 18676 +11995 ---> 18677 +12000 ---> 18678 +12001 ---> 18679 +12002 ---> 18680 +12005 ---> 18681 +12007 ---> 18682 +12011 ---> 18683 +12012 ---> 18684 +12013 ---> 18685 +12015 ---> 18686 +12023 ---> 18687 +12024 ---> 18688 +12025 ---> 18689 +12028 ---> 18690 +12029 ---> 18691 +12032 ---> 18692 +12033 ---> 18693 +12034 ---> 18694 +12037 ---> 18695 +12038 ---> 18696 +12039 ---> 18697 +12048 ---> 18698 +12050 ---> 18699 +12051 ---> 18700 +12052 ---> 18701 +12053 ---> 18702 +12055 ---> 18703 +12058 ---> 18704 +12060 ---> 18705 +12064 ---> 18706 +12066 ---> 1545 +12067 ---> 18707 +12068 ---> 18708 +12070 ---> 18709 +12074 ---> 18710 +12075 ---> 18711 +12078 ---> 18712 +12079 ---> 18713 +12083 ---> 18714 +12084 ---> 18715 +12085 ---> 18716 +12088 ---> 18717 +12093 ---> 18718 +12096 ---> 18719 +12102 ---> 18720 +12103 ---> 18721 +12107 ---> 18722 +12114 ---> 18723 +12115 ---> 18724 +12122 ---> 18725 +12124 ---> 18726 +12125 ---> 18727 +12126 ---> 18728 +12127 ---> 18729 +12128 ---> 18730 +12129 ---> 18731 +12130 ---> 18732 +12131 ---> 18733 +12132 ---> 18734 +12133 ---> 18735 +12134 ---> 18736 +12135 ---> 18737 +12136 ---> 18738 +12137 ---> 18739 +12138 ---> 18740 +12139 ---> 18741 +12140 ---> 18742 +12141 ---> 18743 +12142 ---> 18744 +12143 ---> 18745 +12144 ---> 18746 +12145 ---> 18747 +12146 ---> 18748 +12147 ---> 18749 +12148 ---> 18750 +12150 ---> 18751 +12154 ---> 18752 +12156 ---> 18753 +12160 ---> 18754 +12162 ---> 18755 +12167 ---> 18756 +12168 ---> 18757 +12169 ---> 18758 +12170 ---> 18759 +12171 ---> 18760 +12172 ---> 18761 +12173 ---> 18762 +12174 ---> 18763 +12175 ---> 18764 +12176 ---> 18765 +12177 ---> 18766 +12179 ---> 18767 +12180 ---> 18768 +12182 ---> 18769 +12184 ---> 18770 +12190 ---> 18771 +12192 ---> 18772 +12195 ---> 18773 +12196 ---> 18774 +12197 ---> 18775 +12198 ---> 18776 +12199 ---> 18777 +12203 ---> 18778 +12204 ---> 18779 +12205 ---> 18780 +12207 ---> 18781 +12209 ---> 18782 +12211 ---> 18783 +12212 ---> 18784 +12213 ---> 18785 +12214 ---> 18786 +12215 ---> 18787 +12217 ---> 18788 +12219 ---> 18789 +12221 ---> 18790 +12222 ---> 18791 +12223 ---> 18792 +12224 ---> 18793 +12228 ---> 18794 +12233 ---> 18795 +12234 ---> 18796 +12235 ---> 18797 +12236 ---> 18798 +12239 ---> 18799 +12242 ---> 18800 +12243 ---> 18801 +12245 ---> 18802 +12247 ---> 18803 +12251 ---> 18804 +12252 ---> 18805 +12254 ---> 18806 +12255 ---> 18807 +12257 ---> 18808 +12258 ---> 18809 +12259 ---> 18810 +12260 ---> 18811 +12270 ---> 18812 +12272 ---> 18813 +12273 ---> 18814 +12275 ---> 18815 +12276 ---> 18816 +12278 ---> 18817 +12281 ---> 18818 +12282 ---> 18819 +12283 ---> 18820 +12286 ---> 18821 +12288 ---> 18822 +12289 ---> 18823 +12290 ---> 18824 +12292 ---> 18825 +12294 ---> 18826 +12295 ---> 18827 +12296 ---> 18828 +12298 ---> 18829 +12302 ---> 18830 +12304 ---> 18831 +12307 ---> 18832 +12309 ---> 18833 +12313 ---> 18834 +12315 ---> 18835 +12316 ---> 18836 +12319 ---> 18837 +12320 ---> 18838 +12323 ---> 18839 +12325 ---> 18840 +12327 ---> 18841 +12329 ---> 18842 +12331 ---> 18843 +12336 ---> 802 +12338 ---> 18844 +12341 ---> 18845 +12349 ---> 18846 +12350 ---> 18847 +12352 ---> 18848 +12356 ---> 18849 +12362 ---> 18850 +12363 ---> 18851 +12364 ---> 18852 +12365 ---> 18853 +12366 ---> 18854 +12367 ---> 18855 +12368 ---> 18856 +12369 ---> 18857 +12372 ---> 18858 +12380 ---> 18859 +12381 ---> 18860 +12384 ---> 18861 +12386 ---> 18862 +12388 ---> 18863 +12396 ---> 18864 +12398 ---> 18865 +12399 ---> 18866 +12400 ---> 18867 +12401 ---> 18868 +12402 ---> 18869 +12403 ---> 18870 +12405 ---> 18871 +12408 ---> 18872 +12412 ---> 18873 +12421 ---> 18874 +12423 ---> 18875 +12425 ---> 18876 +12427 ---> 18877 +12431 ---> 18878 +12435 ---> 18879 +12441 ---> 18880 +12442 ---> 18881 +12445 ---> 18882 +12447 ---> 18883 +12449 ---> 18884 +12450 ---> 18885 +12452 ---> 18886 +12456 ---> 18887 +12459 ---> 18888 +12460 ---> 18889 +12461 ---> 18890 +12462 ---> 18891 +12463 ---> 18892 +12464 ---> 18893 +12465 ---> 18894 +12467 ---> 18895 +12469 ---> 18896 +12472 ---> 18897 +12477 ---> 18898 +12483 ---> 18899 +12492 ---> 18900 +12494 ---> 18901 +12496 ---> 18902 +12501 ---> 18903 +12503 ---> 18904 +12505 ---> 18905 +12506 ---> 18906 +12509 ---> 18907 +12510 ---> 18908 +12512 ---> 18909 +12513 ---> 18910 +12517 ---> 18911 +12518 ---> 18912 +12519 ---> 18913 +12525 ---> 18914 +12526 ---> 18915 +12529 ---> 18916 +12531 ---> 18917 +12534 ---> 18918 +12535 ---> 18919 +12536 ---> 18920 +12537 ---> 18921 +12538 ---> 18922 +12539 ---> 18923 +12542 ---> 18924 +12545 ---> 18925 +12546 ---> 18926 +12547 ---> 18927 +12549 ---> 18928 +12550 ---> 18929 +12556 ---> 18930 +12560 ---> 18931 +12565 ---> 18932 +12580 ---> 18933 +12581 ---> 18934 +12584 ---> 18935 +12590 ---> 18936 +12591 ---> 18937 +12592 ---> 18938 +12593 ---> 18939 +12601 ---> 18940 +12606 ---> 18941 +12608 ---> 18942 +12615 ---> 18943 +12618 ---> 18944 +12623 ---> 18945 +12625 ---> 18946 +12626 ---> 18947 +12627 ---> 18948 +12628 ---> 2092 +12629 ---> 18949 +12632 ---> 18950 +12633 ---> 18951 +12635 ---> 18952 +12637 ---> 18953 +12638 ---> 18954 +12639 ---> 18955 +12640 ---> 18956 +12641 ---> 18957 +12643 ---> 18958 +12644 ---> 18959 +12646 ---> 18960 +12652 ---> 18961 +12655 ---> 18962 +12659 ---> 18963 +12660 ---> 18964 +12661 ---> 18965 +12662 ---> 18966 +12669 ---> 18967 +12670 ---> 18968 +12672 ---> 18969 +12673 ---> 18970 +12674 ---> 18971 +12678 ---> 18972 +12681 ---> 18973 +12683 ---> 18974 +12685 ---> 18975 +12686 ---> 18976 +12692 ---> 18977 +12696 ---> 18978 +12702 ---> 18979 +12704 ---> 18980 +12706 ---> 18981 +12713 ---> 18982 +12715 ---> 18983 +12716 ---> 18984 +12722 ---> 18985 +12723 ---> 18986 +12724 ---> 18987 +12725 ---> 18988 +12726 ---> 18989 +12730 ---> 18990 +12731 ---> 18991 +12735 ---> 18992 +12737 ---> 18993 +12738 ---> 18994 +12740 ---> 18995 +12746 ---> 18996 +12747 ---> 18997 +12748 ---> 18998 +12751 ---> 18999 +12753 ---> 19000 +12755 ---> 19001 +12758 ---> 19002 +12759 ---> 19003 +12761 ---> 19004 +12764 ---> 19005 +12767 ---> 19006 +12772 ---> 19007 +12774 ---> 19008 +12778 ---> 19009 +12780 ---> 19010 +12788 ---> 19011 +12789 ---> 19012 +12793 ---> 19013 +12794 ---> 19014 +12795 ---> 19015 +12796 ---> 19016 +12797 ---> 19017 +12798 ---> 19018 +12799 ---> 19019 +12808 ---> 19020 +12810 ---> 19021 +12811 ---> 19022 +12812 ---> 19023 +12815 ---> 19024 +12816 ---> 19025 +12817 ---> 19026 +12818 ---> 19027 +12821 ---> 19028 +12828 ---> 19029 +12833 ---> 19030 +12834 ---> 19031 +12837 ---> 19032 +12838 ---> 19033 +12840 ---> 19034 +12850 ---> 19035 +12855 ---> 19036 +12858 ---> 19037 +12860 ---> 19038 +12861 ---> 19039 +12864 ---> 19040 +12868 ---> 19041 +12871 ---> 19042 +12878 ---> 19043 +12886 ---> 19044 +12887 ---> 19045 +12891 ---> 19046 +12892 ---> 19047 +12893 ---> 19048 +12894 ---> 19049 +12901 ---> 19050 +12902 ---> 19051 +12903 ---> 19052 +12904 ---> 19053 +12908 ---> 19054 +12912 ---> 19055 +12913 ---> 19056 +12915 ---> 19057 +12921 ---> 19058 +12926 ---> 19059 +12927 ---> 19060 +12932 ---> 19061 +12934 ---> 19062 +12937 ---> 19063 +12939 ---> 19064 +12940 ---> 19065 +12941 ---> 19066 +12942 ---> 19067 +12943 ---> 19068 +12944 ---> 19069 +12947 ---> 19070 +12948 ---> 19071 +12949 ---> 19072 +12950 ---> 19073 +12953 ---> 19074 +12954 ---> 19075 +12955 ---> 19076 +12956 ---> 19077 +12959 ---> 19078 +12962 ---> 19079 +12966 ---> 19080 +12969 ---> 19081 +12976 ---> 19082 +12979 ---> 19083 +12983 ---> 19084 +12987 ---> 19085 +12991 ---> 19086 +12993 ---> 19087 +12994 ---> 19088 +12998 ---> 19089 +13001 ---> 19090 +13003 ---> 19091 +13004 ---> 19092 +13005 ---> 19093 +13007 ---> 19094 +13008 ---> 19095 +13020 ---> 19096 +13025 ---> 19097 +13028 ---> 19098 +13032 ---> 19099 +13033 ---> 19100 +13034 ---> 19101 +13035 ---> 19102 +13036 ---> 19103 +13041 ---> 19104 +13047 ---> 19105 +13048 ---> 19106 +13050 ---> 19107 +13052 ---> 19108 +13054 ---> 19109 +13057 ---> 19110 +13062 ---> 19111 +13063 ---> 19112 +13064 ---> 19113 +13070 ---> 19114 +13071 ---> 19115 +13073 ---> 19116 +13077 ---> 19117 +13079 ---> 19118 +13085 ---> 19119 +13094 ---> 19120 +13098 ---> 19121 +13099 ---> 19122 +13100 ---> 19123 +13101 ---> 19124 +13102 ---> 19125 +13103 ---> 19126 +13104 ---> 19127 +13105 ---> 19128 +13106 ---> 19129 +13107 ---> 19130 +13108 ---> 19131 +13110 ---> 19132 +13114 ---> 19133 +13115 ---> 19134 +13116 ---> 19135 +13121 ---> 19136 +13124 ---> 19137 +13127 ---> 19138 +13130 ---> 19139 +13135 ---> 19140 +13137 ---> 19141 +13146 ---> 19142 +13154 ---> 19143 +13156 ---> 19144 +13159 ---> 19145 +13169 ---> 19146 +13170 ---> 19147 +13171 ---> 19148 +13172 ---> 19149 +13173 ---> 19150 +13175 ---> 19151 +13176 ---> 19152 +13177 ---> 19153 +13179 ---> 19154 +13187 ---> 19155 +13188 ---> 19156 +13190 ---> 19157 +13191 ---> 19158 +13201 ---> 19159 +13202 ---> 19160 +13207 ---> 1546 +13210 ---> 19161 +13213 ---> 19162 +13214 ---> 19163 +13215 ---> 19164 +13216 ---> 19165 +13218 ---> 19166 +13220 ---> 19167 +13221 ---> 19168 +13230 ---> 19169 +13236 ---> 19170 +13238 ---> 19171 +13241 ---> 19172 +13242 ---> 19173 +13243 ---> 19174 +13244 ---> 19175 +13245 ---> 19176 +13246 ---> 19177 +13247 ---> 19179 +13248 ---> 19180 +13249 ---> 19181 +13250 ---> 19182 +13251 ---> 19183 +13252 ---> 19184 +13253 ---> 19185 +13254 ---> 19186 +13255 ---> 19187 +13256 ---> 19188 +13257 ---> 19189 +13258 ---> 19190 +13259 ---> 19191 +13260 ---> 19192 +13261 ---> 19193 +13262 ---> 19194 +13263 ---> 19195 +13265 ---> 19196 +13267 ---> 19197 +13268 ---> 19198 +13269 ---> 19199 +13270 ---> 19200 +13280 ---> 19201 +13281 ---> 19202 +13283 ---> 19203 +13284 ---> 19204 +13286 ---> 19205 +13289 ---> 19206 +13291 ---> 19207 +13293 ---> 19208 +13294 ---> 19209 +13295 ---> 19210 +13296 ---> 19211 +13297 ---> 19212 +13298 ---> 19213 +13299 ---> 19214 +13300 ---> 19215 +13301 ---> 19216 +13302 ---> 19217 +13303 ---> 19218 +13304 ---> 19219 +13305 ---> 19220 +13308 ---> 19221 +13309 ---> 19222 +13310 ---> 19223 +13311 ---> 19224 +13322 ---> 19225 +13323 ---> 19226 +13329 ---> 19227 +13331 ---> 19228 +13332 ---> 19229 +13337 ---> 19230 +13338 ---> 19231 +13339 ---> 19232 +13340 ---> 19233 +13342 ---> 19234 +13343 ---> 19235 +13345 ---> 19236 +13346 ---> 19238 +13347 ---> 19239 +13348 ---> 19240 +13349 ---> 19241 +13351 ---> 19242 +13355 ---> 19243 +13356 ---> 19244 +13360 ---> 19245 +13361 ---> 19246 +13364 ---> 19247 +13365 ---> 19248 +13367 ---> 19249 +13368 ---> 19250 +13369 ---> 19251 +13372 ---> 19252 +13374 ---> 19253 +13375 ---> 19254 +13381 ---> 19255 +13383 ---> 19256 +13385 ---> 19257 +13388 ---> 19258 +13394 ---> 19259 +13395 ---> 19260 +13401 ---> 19261 +13402 ---> 19262 +13407 ---> 19263 +13409 ---> 19264 +13410 ---> 19265 +13416 ---> 19266 +13417 ---> 19267 +13418 ---> 19268 +13419 ---> 19269 +13421 ---> 19270 +13422 ---> 19271 +13423 ---> 19272 +13426 ---> 19273 +13427 ---> 19274 +13429 ---> 19275 +13439 ---> 19276 +13447 ---> 19277 +13448 ---> 19278 +13450 ---> 19279 +13452 ---> 19280 +13453 ---> 19281 +13454 ---> 19282 +13455 ---> 19283 +13456 ---> 19284 +13457 ---> 19285 +13458 ---> 19286 +13462 ---> 19287 +13464 ---> 19288 +13465 ---> 19289 +13469 ---> 19290 +13470 ---> 19291 +13471 ---> 19292 +13474 ---> 19293 +13478 ---> 19294 +13480 ---> 19295 +13481 ---> 19296 +13482 ---> 19297 +13483 ---> 19298 +13484 ---> 19299 +13486 ---> 19300 +13487 ---> 19301 +13488 ---> 19302 +13489 ---> 19303 +13490 ---> 19304 +13491 ---> 19305 +13493 ---> 19306 +13500 ---> 19307 +13501 ---> 19308 +13504 ---> 19309 +13505 ---> 19310 +13510 ---> 19311 +13516 ---> 19312 +13519 ---> 19313 +13520 ---> 19314 +13522 ---> 19315 +13523 ---> 19316 +13526 ---> 19317 +13532 ---> 19318 +13535 ---> 19319 +13537 ---> 19320 +13538 ---> 19321 +13539 ---> 19322 +13541 ---> 19323 +13544 ---> 19324 +13550 ---> 19325 +13551 ---> 19326 +13555 ---> 19327 +13556 ---> 19328 +13558 ---> 19329 +13559 ---> 19330 +13566 ---> 19331 +13568 ---> 19332 +13570 ---> 19333 +13571 ---> 19334 +13583 ---> 19335 +13584 ---> 19336 +13586 ---> 19337 +13588 ---> 19338 +13589 ---> 19339 +13592 ---> 19340 +13593 ---> 19341 +13598 ---> 19342 +13599 ---> 19343 +13601 ---> 19344 +13602 ---> 19345 +13604 ---> 19346 +13606 ---> 19347 +13607 ---> 19348 +13609 ---> 19349 +13610 ---> 19350 +13613 ---> 19351 +13618 ---> 19352 +13619 ---> 19353 +13622 ---> 19354 +13624 ---> 19355 +13626 ---> 19356 +13630 ---> 19357 +13633 ---> 19358 +13635 ---> 19359 +13636 ---> 19360 +13637 ---> 19361 +13639 ---> 19362 +13640 ---> 19363 +13647 ---> 19364 +13649 ---> 19365 +13660 ---> 19366 +13663 ---> 19367 +13670 ---> 19368 +13672 ---> 19369 +13675 ---> 19370 +13677 ---> 19371 +13680 ---> 19372 +13681 ---> 19373 +13683 ---> 19374 +13687 ---> 19375 +13688 ---> 19376 +13689 ---> 19377 +13691 ---> 19378 +13692 ---> 19379 +13694 ---> 19380 +13695 ---> 19381 +13696 ---> 19382 +13699 ---> 19383 +13700 ---> 19384 +13703 ---> 19385 +13705 ---> 19386 +13706 ---> 19387 +13708 ---> 19388 +13710 ---> 19389 +13717 ---> 19390 +13721 ---> 19391 +13727 ---> 19392 +13735 ---> 19393 +13738 ---> 19394 +13739 ---> 19395 +13741 ---> 19396 +13746 ---> 19397 +13748 ---> 19398 +13749 ---> 19399 +13752 ---> 19400 +13753 ---> 19401 +13757 ---> 19402 +13766 ---> 19403 +13768 ---> 19404 +13773 ---> 19405 +13774 ---> 19406 +13778 ---> 19407 +13783 ---> 19408 +13784 ---> 19409 +13794 ---> 19410 +13795 ---> 19411 +13799 ---> 19412 +13800 ---> 19413 +13804 ---> 19414 +13806 ---> 19415 +13807 ---> 19416 +13808 ---> 19417 +13809 ---> 19418 +13813 ---> 19419 +13814 ---> 19420 +13816 ---> 19421 +13822 ---> 19422 +13824 ---> 19423 +13827 ---> 19424 +13831 ---> 19425 +13832 ---> 19426 +13833 ---> 19427 +13834 ---> 19428 +13837 ---> 19429 +13840 ---> 19430 +13842 ---> 19431 +13849 ---> 19432 +13850 ---> 19433 +13856 ---> 19434 +13864 ---> 19435 +13868 ---> 19436 +13869 ---> 19437 +13871 ---> 19438 +13872 ---> 19439 +13881 ---> 19440 +13882 ---> 19441 +13884 ---> 19442 +13890 ---> 19443 +13892 ---> 19444 +13893 ---> 19445 +13894 ---> 19446 +13897 ---> 19447 +13899 ---> 19448 +13900 ---> 19449 +13901 ---> 19450 +13903 ---> 19451 +13906 ---> 19452 +13907 ---> 19453 +13909 ---> 19454 +13910 ---> 19455 +13911 ---> 19456 +13914 ---> 19457 +13915 ---> 19458 +13919 ---> 19459 +13922 ---> 19460 +13924 ---> 19461 +13926 ---> 19462 +13931 ---> 19463 +13934 ---> 19464 +13936 ---> 19465 +13937 ---> 19466 +13938 ---> 19467 +13939 ---> 19468 +13940 ---> 19469 +13946 ---> 19470 +13951 ---> 19471 +13960 ---> 19472 +13964 ---> 19473 +13966 ---> 19474 +13967 ---> 19475 +13970 ---> 19476 +13972 ---> 19477 +13977 ---> 19478 +13979 ---> 19479 +13994 ---> 19480 +14008 ---> 19481 +14012 ---> 19482 +14017 ---> 19483 +14021 ---> 19484 +14022 ---> 19485 +14028 ---> 19486 +14032 ---> 19487 +14033 ---> 19488 +14036 ---> 19489 +14037 ---> 19490 +14038 ---> 19491 +14041 ---> 862 +14046 ---> 19492 +14047 ---> 19493 +14048 ---> 19494 +14049 ---> 19495 +14050 ---> 19496 +14051 ---> 19497 +14053 ---> 19498 +14059 ---> 19499 +14064 ---> 19500 +14068 ---> 19501 +14070 ---> 19502 +14071 ---> 19503 +14077 ---> 19504 +14078 ---> 19505 +14085 ---> 19506 +14088 ---> 19507 +14089 ---> 19508 +14090 ---> 19509 +14093 ---> 19510 +14095 ---> 19511 +14101 ---> 19512 +14102 ---> 19513 +14103 ---> 19514 +14105 ---> 19515 +14106 ---> 19516 +14107 ---> 19517 +14108 ---> 19518 +14110 ---> 19519 +14117 ---> 19520 +14118 ---> 19521 +14119 ---> 19522 +14127 ---> 19523 +14131 ---> 19524 +14135 ---> 19525 +14137 ---> 19526 +14140 ---> 19527 +14144 ---> 19528 +14146 ---> 19529 +14147 ---> 19530 +14148 ---> 19531 +14151 ---> 19532 +14152 ---> 19533 +14155 ---> 19534 +14157 ---> 19535 +14159 ---> 19536 +14160 ---> 19537 +14162 ---> 19538 +14164 ---> 19539 +14165 ---> 19540 +14166 ---> 19541 +14169 ---> 19542 +14170 ---> 19543 +14173 ---> 19544 +14177 ---> 19545 +14178 ---> 19546 +14181 ---> 19547 +14182 ---> 19548 +14183 ---> 19549 +14189 ---> 19550 +14193 ---> 19551 +14197 ---> 19552 +14198 ---> 19553 +14200 ---> 19554 +14202 ---> 19555 +14203 ---> 19556 +14207 ---> 19557 +14209 ---> 19558 +14211 ---> 19559 +14212 ---> 19560 +14215 ---> 19561 +14219 ---> 19562 +14220 ---> 19563 +14228 ---> 19564 +14230 ---> 19565 +14234 ---> 19566 +14235 ---> 19567 +14237 ---> 19568 +14238 ---> 19569 +14242 ---> 19570 +14244 ---> 19571 +14252 ---> 19572 +14253 ---> 19573 +14255 ---> 19574 +14259 ---> 19575 +14260 ---> 19576 +14263 ---> 19577 +14273 ---> 19578 +14275 ---> 19579 +14283 ---> 19580 +14284 ---> 19581 +14286 ---> 19582 +14288 ---> 19583 +14291 ---> 19584 +14296 ---> 19585 +14298 ---> 19586 +14299 ---> 19587 +14300 ---> 19588 +14303 ---> 19589 +14305 ---> 19590 +14307 ---> 19591 +14308 ---> 19592 +14310 ---> 19593 +14311 ---> 19594 +14313 ---> 19595 +14319 ---> 19596 +14320 ---> 19597 +14321 ---> 19598 +14322 ---> 19599 +14323 ---> 19600 +14324 ---> 19601 +14325 ---> 19602 +14327 ---> 19603 +14329 ---> 19604 +14331 ---> 19605 +14332 ---> 19606 +14333 ---> 19607 +14334 ---> 19608 +14336 ---> 19609 +14337 ---> 19610 +14338 ---> 19611 +14340 ---> 19612 +14341 ---> 19614 +14344 ---> 19615 +14345 ---> 19616 +14349 ---> 19617 +14350 ---> 19618 +14351 ---> 19619 +14352 ---> 19620 +14354 ---> 19621 +14356 ---> 19622 +14359 ---> 19623 +14365 ---> 19624 +14368 ---> 19625 +14369 ---> 19626 +14374 ---> 19627 +14375 ---> 19628 +14376 ---> 19629 +14378 ---> 19630 +14382 ---> 19631 +14387 ---> 19632 +14390 ---> 19633 +14391 ---> 19634 +14398 ---> 19635 +14399 ---> 19636 +14403 ---> 19637 +14404 ---> 19638 +14406 ---> 19639 +14409 ---> 19640 +14410 ---> 19641 +14412 ---> 19642 +14415 ---> 19643 +14416 ---> 19644 +14417 ---> 19645 +14419 ---> 19646 +14423 ---> 19647 +14430 ---> 19648 +14432 ---> 19649 +14433 ---> 19650 +14437 ---> 19651 +14439 ---> 19652 +14442 ---> 19654 +14443 ---> 19655 +14445 ---> 19656 +14447 ---> 19657 +14454 ---> 19658 +14455 ---> 19659 +14456 ---> 19660 +14457 ---> 19661 +14466 ---> 19662 +14467 ---> 19663 +14468 ---> 19664 +14469 ---> 19665 +14473 ---> 19666 +14480 ---> 19667 +14484 ---> 19668 +14485 ---> 19669 +14486 ---> 19670 +14488 ---> 19671 +14492 ---> 19672 +14495 ---> 19673 +14496 ---> 19674 +14499 ---> 19675 +14501 ---> 19676 +14502 ---> 19677 +14503 ---> 19678 +14504 ---> 19679 +14505 ---> 19680 +14507 ---> 19681 +14510 ---> 19682 +14511 ---> 19683 +14512 ---> 19684 +14513 ---> 19685 +14518 ---> 19686 +14519 ---> 19687 +14520 ---> 19688 +14527 ---> 19689 +14528 ---> 19690 +14529 ---> 19691 +14530 ---> 19692 +14533 ---> 19693 +14536 ---> 19694 +14538 ---> 19695 +14540 ---> 19696 +14541 ---> 19697 +14542 ---> 19698 +14543 ---> 19699 +14553 ---> 19700 +14554 ---> 19701 +14555 ---> 19702 +14560 ---> 19703 +14561 ---> 19704 +14563 ---> 19705 +14565 ---> 19706 +14566 ---> 19707 +14567 ---> 19708 +14570 ---> 19709 +14571 ---> 19710 +14572 ---> 19711 +14573 ---> 19712 +14574 ---> 19713 +14576 ---> 19714 +14577 ---> 19715 +14580 ---> 19716 +14581 ---> 19717 +14582 ---> 19718 +14583 ---> 19719 +14584 ---> 19720 +14587 ---> 19721 +14588 ---> 19722 +14589 ---> 19723 +14590 ---> 19724 +14591 ---> 19725 +14592 ---> 19726 +14593 ---> 19727 +14594 ---> 19728 +14595 ---> 19729 +14600 ---> 19730 +14601 ---> 19731 +14606 ---> 19732 +14612 ---> 19733 +14614 ---> 19734 +14615 ---> 19735 +14620 ---> 19736 +14625 ---> 19737 +14627 ---> 19738 +14636 ---> 19739 +14638 ---> 19740 +14640 ---> 19741 +14651 ---> 1414 +14653 ---> 19742 +14669 ---> 19743 +14671 ---> 19744 +14673 ---> 19745 +14674 ---> 19746 +14680 ---> 19747 +14681 ---> 19748 +14682 ---> 19749 +14684 ---> 19750 +14690 ---> 19751 +14691 ---> 19752 +14693 ---> 1396 +14695 ---> 19753 +14696 ---> 19754 +14698 ---> 19755 +14700 ---> 19756 +14701 ---> 19757 +14702 ---> 19758 +14703 ---> 19759 +14705 ---> 19760 +14708 ---> 19761 +14715 ---> 19762 +14717 ---> 19763 +14721 ---> 19764 +14724 ---> 19765 +14725 ---> 19766 +14728 ---> 19767 +14729 ---> 19768 +14730 ---> 19769 +14735 ---> 19770 +14736 ---> 19771 +14740 ---> 19772 +14742 ---> 19773 +14745 ---> 19774 +14747 ---> 19775 +14748 ---> 19776 +14749 ---> 19777 +14750 ---> 19778 +14752 ---> 19779 +14754 ---> 19780 +14756 ---> 19781 +14757 ---> 19782 +14758 ---> 19783 +14760 ---> 19784 +14762 ---> 19785 +14767 ---> 19786 +14772 ---> 19787 +14775 ---> 19788 +14779 ---> 19789 +14780 ---> 19790 +14781 ---> 19791 +14790 ---> 19792 +14791 ---> 19793 +14797 ---> 19794 +14799 ---> 19795 +14802 ---> 19796 +14804 ---> 19797 +14814 ---> 19798 +14815 ---> 19799 +14818 ---> 19800 +14820 ---> 19801 +14824 ---> 19802 +14833 ---> 19803 +14837 ---> 19804 +14838 ---> 19805 +14839 ---> 19806 +14842 ---> 19807 +14846 ---> 19808 +14849 ---> 19809 +14850 ---> 19810 +14853 ---> 19811 +14855 ---> 19812 +14856 ---> 19813 +14865 ---> 19814 +14868 ---> 19815 +14869 ---> 19816 +14874 ---> 19817 +14875 ---> 19818 +14879 ---> 19819 +14885 ---> 19820 +14888 ---> 19821 +14891 ---> 19822 +14894 ---> 19823 +14896 ---> 19824 +14897 ---> 19825 +14900 ---> 19826 +14903 ---> 19827 +14904 ---> 19828 +14908 ---> 19829 +14911 ---> 19830 +14917 ---> 19831 +14918 ---> 19832 +14924 ---> 19833 +14934 ---> 19834 +14935 ---> 19835 +14940 ---> 19836 +14946 ---> 19837 +14950 ---> 19838 +14954 ---> 19839 +14961 ---> 19840 +14966 ---> 19841 +14967 ---> 19842 +14976 ---> 19843 +14978 ---> 19844 +14983 ---> 19845 +14984 ---> 19846 +14986 ---> 19847 +14987 ---> 19848 +14989 ---> 19849 +14990 ---> 19850 +14991 ---> 19851 +14992 ---> 19852 +14993 ---> 19853 +14994 ---> 19854 +14995 ---> 19855 +14998 ---> 19856 +15002 ---> 19857 +15011 ---> 19858 +15012 ---> 19859 +15017 ---> 19860 +15018 ---> 19861 +15022 ---> 19862 +15023 ---> 19863 +15027 ---> 19864 +15028 ---> 19865 +15031 ---> 19866 +15033 ---> 19867 +15040 ---> 19868 +15041 ---> 19869 +15045 ---> 19870 +15046 ---> 19871 +15047 ---> 19872 +15049 ---> 19873 +15051 ---> 19874 +15065 ---> 19875 +15066 ---> 19876 +15069 ---> 19877 +15075 ---> 19878 +15076 ---> 19879 +15083 ---> 19880 +15089 ---> 19881 +15092 ---> 19882 +15096 ---> 19883 +15098 ---> 19884 +15099 ---> 19885 +15101 ---> 19886 +15106 ---> 19887 +15109 ---> 19888 +15110 ---> 19889 +15111 ---> 19890 +15112 ---> 19891 +15114 ---> 19892 +15116 ---> 19893 +15117 ---> 19894 +15118 ---> 19895 +15120 ---> 19896 +15121 ---> 19897 +15122 ---> 19898 +15125 ---> 19899 +15126 ---> 19900 +15127 ---> 19901 +15131 ---> 19902 +15135 ---> 19903 +15136 ---> 19904 +15140 ---> 19905 +15143 ---> 19906 +15145 ---> 19907 +15148 ---> 19908 +15150 ---> 19909 +15151 ---> 19910 +15152 ---> 19911 +15154 ---> 19912 +15156 ---> 19913 +15157 ---> 19914 +15158 ---> 19915 +15160 ---> 19916 +15166 ---> 19917 +15167 ---> 19918 +15168 ---> 19919 +15173 ---> 19920 +15175 ---> 19921 +15176 ---> 19922 +15184 ---> 19923 +15185 ---> 19924 +15191 ---> 19925 +15194 ---> 19926 +15201 ---> 19927 +15202 ---> 19928 +15206 ---> 19929 +15208 ---> 19930 +15209 ---> 19931 +15215 ---> 19932 +15217 ---> 19933 +15219 ---> 19934 +15220 ---> 19935 +15224 ---> 19936 +15226 ---> 19937 +15227 ---> 19938 +15229 ---> 19939 +15234 ---> 19940 +15242 ---> 19941 +15243 ---> 19942 +15245 ---> 19943 +15252 ---> 19944 +15253 ---> 19945 +15254 ---> 19946 +15255 ---> 19947 +15259 ---> 19948 +15269 ---> 19949 +15274 ---> 19950 +15275 ---> 19951 +15277 ---> 19952 +15278 ---> 19953 +15279 ---> 19954 +15280 ---> 19955 +15284 ---> 19956 +15288 ---> 19957 +15289 ---> 19958 +15290 ---> 19959 +15298 ---> 19960 +15301 ---> 19961 +15303 ---> 19962 +15305 ---> 19963 +15309 ---> 19964 +15320 ---> 19965 +15322 ---> 19966 +15323 ---> 19967 +15328 ---> 19968 +15329 ---> 19969 +15330 ---> 19970 +15331 ---> 19971 +15332 ---> 19972 +15333 ---> 19973 +15337 ---> 19974 +15339 ---> 19975 +15348 ---> 19976 +15355 ---> 19977 +15356 ---> 19978 +15362 ---> 19979 +15374 ---> 19980 +15378 ---> 19981 +15380 ---> 19982 +15383 ---> 19983 +15387 ---> 19984 +15388 ---> 19985 +15390 ---> 19986 +15393 ---> 19987 +15395 ---> 19988 +15401 ---> 19989 +15403 ---> 19990 +15404 ---> 19991 +15407 ---> 19992 +15408 ---> 19993 +15410 ---> 19994 +15411 ---> 19995 +15413 ---> 19996 +15414 ---> 19997 +15419 ---> 19998 +15420 ---> 19999 +15421 ---> 20000 +15423 ---> 20001 +15427 ---> 20002 +15429 ---> 20003 +15430 ---> 20004 +15436 ---> 20005 +15443 ---> 20006 +15445 ---> 20007 +15453 ---> 20008 +15455 ---> 20010 +15457 ---> 20011 +15459 ---> 20012 +15460 ---> 20013 +15464 ---> 20014 +15467 ---> 20015 +15469 ---> 20016 +15471 ---> 20017 +15472 ---> 20018 +15473 ---> 20019 +15474 ---> 20020 +15475 ---> 20021 +15482 ---> 20022 +15486 ---> 20023 +15487 ---> 20024 +15490 ---> 20025 +15502 ---> 20026 +15503 ---> 20027 +15511 ---> 20028 +15513 ---> 20029 +15515 ---> 20030 +15516 ---> 20031 +15519 ---> 20032 +15521 ---> 20033 +15523 ---> 20034 +15525 ---> 20035 +15533 ---> 20036 +15542 ---> 20037 +15549 ---> 20038 +15550 ---> 20039 +15554 ---> 20040 +15555 ---> 20041 +15560 ---> 20042 +15566 ---> 20043 +15570 ---> 20044 +15573 ---> 20045 +15579 ---> 20046 +15581 ---> 20047 +15589 ---> 20048 +15591 ---> 20049 +15599 ---> 1547 +15609 ---> 20050 +15611 ---> 20051 +15612 ---> 20052 +15613 ---> 20053 +15615 ---> 20054 +15622 ---> 20055 +15623 ---> 20056 +15630 ---> 20057 +15633 ---> 20058 +15635 ---> 20059 +15640 ---> 20060 +15656 ---> 20061 +15660 ---> 20062 +15661 ---> 20063 +15663 ---> 20064 +15667 ---> 20065 +15673 ---> 20066 +15680 ---> 20067 +15682 ---> 20068 +15686 ---> 20069 +15687 ---> 20070 +15688 ---> 20071 +15689 ---> 20072 +15691 ---> 20073 +15693 ---> 20074 +15702 ---> 20075 +15703 ---> 20076 +15707 ---> 20077 +15708 ---> 20078 +15709 ---> 20079 +15713 ---> 20080 +15716 ---> 20081 +15717 ---> 20082 +15719 ---> 20083 +15731 ---> 20084 +15735 ---> 20085 +15736 ---> 20086 +15739 ---> 20087 +15740 ---> 20088 +15741 ---> 20089 +15744 ---> 20090 +15752 ---> 20091 +15758 ---> 20092 +15761 ---> 20093 +15763 ---> 20094 +15771 ---> 20095 +15773 ---> 20096 +15776 ---> 20097 +15785 ---> 20098 +15790 ---> 20099 +15793 ---> 20100 +15806 ---> 20101 +15808 ---> 20102 +15809 ---> 20103 +15810 ---> 20104 +15814 ---> 20105 +15817 ---> 20106 +15818 ---> 20107 +15823 ---> 20108 +15825 ---> 20109 +15826 ---> 20110 +15827 ---> 20111 +15829 ---> 20112 +15830 ---> 20113 +15831 ---> 20114 +15833 ---> 20115 +15837 ---> 20116 +15839 ---> 20117 +15842 ---> 20118 +15844 ---> 20119 +15845 ---> 20120 +15847 ---> 20121 +15849 ---> 20122 +15850 ---> 20123 +15852 ---> 20124 +15859 ---> 20125 +15865 ---> 20126 +15870 ---> 20127 +15871 ---> 20128 +15884 ---> 20129 +15891 ---> 20130 +15892 ---> 20131 +15895 ---> 20132 +15897 ---> 20133 +15902 ---> 20134 +15913 ---> 20135 +15914 ---> 20136 +15921 ---> 20137 +15926 ---> 20138 +15927 ---> 20139 +15930 ---> 20140 +15931 ---> 20141 +15936 ---> 963 +15937 ---> 20142 +15942 ---> 20143 +15949 ---> 20144 +15954 ---> 20145 +15955 ---> 20146 +15957 ---> 20147 +15960 ---> 20148 +15961 ---> 20149 +15966 ---> 20150 +15968 ---> 20151 +15972 ---> 20152 +15974 ---> 20153 +15981 ---> 20154 +15982 ---> 20155 +15984 ---> 20156 +15986 ---> 20157 +15989 ---> 20158 +15990 ---> 20159 +15991 ---> 20160 +16002 ---> 20161 +16004 ---> 20162 +16005 ---> 20163 +16006 ---> 20164 +16007 ---> 20165 +16010 ---> 20166 +16011 ---> 20167 +16013 ---> 20168 +16022 ---> 20169 +16024 ---> 20170 +16025 ---> 20171 +16028 ---> 20172 +16029 ---> 20173 +16033 ---> 20174 +16036 ---> 20175 +16038 ---> 20176 +16040 ---> 20177 +16041 ---> 20178 +16042 ---> 20179 +16043 ---> 20180 +16044 ---> 20181 +16046 ---> 20182 +16047 ---> 20183 +16050 ---> 20184 +16055 ---> 20185 +16060 ---> 20186 +16067 ---> 20187 +16068 ---> 20188 +16074 ---> 20189 +16076 ---> 20190 +16081 ---> 20191 +16082 ---> 20192 +16084 ---> 20193 +16086 ---> 20194 +16094 ---> 20195 +16097 ---> 20196 +16098 ---> 20197 +16099 ---> 20198 +16100 ---> 20199 +16101 ---> 20200 +16105 ---> 20201 +16107 ---> 20202 +16108 ---> 20203 +16109 ---> 20204 +16111 ---> 20205 +16116 ---> 20206 +16121 ---> 20207 +16123 ---> 20208 +16125 ---> 20209 +16126 ---> 20210 +16128 ---> 20211 +16129 ---> 20212 +16133 ---> 20213 +16138 ---> 20214 +16146 ---> 20215 +16147 ---> 20216 +16148 ---> 20217 +16152 ---> 20218 +16155 ---> 20219 +16156 ---> 20220 +16161 ---> 20221 +16162 ---> 20222 +16165 ---> 20223 +16172 ---> 20224 +16174 ---> 20225 +16175 ---> 20226 +16177 ---> 20227 +16178 ---> 20228 +16179 ---> 20229 +16180 ---> 20230 +16181 ---> 20231 +16184 ---> 20232 +16185 ---> 20233 +16187 ---> 20234 +16195 ---> 20235 +16200 ---> 20236 +16201 ---> 20237 +16202 ---> 20238 +16206 ---> 20239 +16209 ---> 20240 +16213 ---> 20241 +16217 ---> 12248 +16221 ---> 20242 +16223 ---> 20243 +16225 ---> 20244 +16227 ---> 20245 +16229 ---> 20246 +16235 ---> 20247 +16236 ---> 20248 +16238 ---> 20249 +16240 ---> 20250 +16242 ---> 20251 +16248 ---> 20252 +16254 ---> 20253 +16255 ---> 20254 +16256 ---> 20255 +16257 ---> 20256 +16258 ---> 20257 +16259 ---> 20258 +16260 ---> 20259 +16261 ---> 20260 +16263 ---> 20261 +16265 ---> 20262 +16270 ---> 20263 +16272 ---> 20264 +16274 ---> 20265 +16275 ---> 20266 +16279 ---> 20267 +16283 ---> 20269 +16287 ---> 20270 +16289 ---> 20271 +16290 ---> 20272 +16291 ---> 20273 +16293 ---> 20274 +16296 ---> 20275 +16298 ---> 20276 +16301 ---> 20277 +16305 ---> 20278 +16306 ---> 20279 +16308 ---> 20280 +16310 ---> 20281 +16315 ---> 20282 +16316 ---> 20283 +16322 ---> 20284 +16334 ---> 20285 +16335 ---> 20286 +16336 ---> 20288 +16337 ---> 20289 +16338 ---> 20290 +16340 ---> 20291 +16346 ---> 20292 +16347 ---> 20293 +16348 ---> 20294 +16352 ---> 20295 +16353 ---> 20296 +16354 ---> 20297 +16358 ---> 20298 +16359 ---> 20299 +16362 ---> 20300 +16363 ---> 20301 +16364 ---> 20302 +16371 ---> 20303 +16374 ---> 20304 +16375 ---> 1476 +16379 ---> 20305 +16383 ---> 20306 +16396 ---> 20307 +16399 ---> 20308 +16400 ---> 20309 +16401 ---> 20310 +16402 ---> 20311 +16403 ---> 20312 +16404 ---> 20313 +16405 ---> 20314 +16409 ---> 20315 +16415 ---> 20316 +16417 ---> 20317 +16419 ---> 20318 +16421 ---> 20319 +16422 ---> 20320 +16427 ---> 20321 +16428 ---> 20322 +16430 ---> 20323 +16432 ---> 20324 +16433 ---> 20325 +16439 ---> 20326 +16441 ---> 20327 +16448 ---> 20328 +16452 ---> 20329 +16458 ---> 20330 +16462 ---> 20331 +16463 ---> 20332 +16464 ---> 20333 +16467 ---> 20334 +16468 ---> 20335 +16469 ---> 20336 +16476 ---> 20337 +16479 ---> 20338 +16481 ---> 20339 +16482 ---> 20340 +16483 ---> 20341 +16485 ---> 20342 +16486 ---> 20343 +16488 ---> 20344 +16489 ---> 20345 +16490 ---> 20346 +16491 ---> 20347 +16492 ---> 20348 +16493 ---> 20349 +16498 ---> 20350 +16500 ---> 20351 +16508 ---> 20352 +16510 ---> 20353 +16511 ---> 20354 +16513 ---> 20355 +16516 ---> 20356 +16518 ---> 20357 +16520 ---> 20358 +16525 ---> 20359 +16526 ---> 20360 +16528 ---> 20361 +16529 ---> 20362 +16530 ---> 20363 +16531 ---> 20364 +16532 ---> 20365 +16533 ---> 20366 +16534 ---> 20367 +16539 ---> 20368 +16540 ---> 20369 +16542 ---> 20370 +16555 ---> 20371 +16558 ---> 20372 +16560 ---> 20373 +16563 ---> 20374 +16565 ---> 20375 +16566 ---> 20376 +16567 ---> 20377 +16571 ---> 20378 +16572 ---> 20379 +16584 ---> 20380 +16585 ---> 20381 +16586 ---> 20382 +16590 ---> 20383 +16593 ---> 20384 +16594 ---> 20385 +16596 ---> 20386 +16598 ---> 20387 +16599 ---> 20388 +16601 ---> 20389 +16602 ---> 20390 +16606 ---> 20391 +16610 ---> 20392 +16611 ---> 20393 +16613 ---> 20394 +16616 ---> 20395 +16619 ---> 20396 +16621 ---> 20397 +16622 ---> 20398 +16626 ---> 20399 +16629 ---> 20400 +16635 ---> 20401 +16636 ---> 20402 +16637 ---> 20403 +16638 ---> 20404 +16640 ---> 20405 +16643 ---> 20406 +16644 ---> 20407 +16645 ---> 20408 +16646 ---> 20409 +16647 ---> 20410 +16649 ---> 20411 +16650 ---> 20412 +16651 ---> 20413 +16653 ---> 20414 +16654 ---> 20415 +16655 ---> 20416 +16658 ---> 20417 +16660 ---> 20418 +16661 ---> 20419 +16662 ---> 20420 +16664 ---> 20421 +16665 ---> 20422 +16669 ---> 20423 +16670 ---> 20424 +16673 ---> 20425 +16674 ---> 20426 +16675 ---> 20427 +16680 ---> 20428 +16683 ---> 1415 +16685 ---> 20429 +16686 ---> 20430 +16687 ---> 20431 +16688 ---> 20432 +16689 ---> 20433 +16690 ---> 20434 +16691 ---> 20435 +16692 ---> 20436 +16693 ---> 20437 +16694 ---> 20438 +16695 ---> 20439 +16696 ---> 20440 +16697 ---> 20441 +16698 ---> 20442 +16699 ---> 20443 +16700 ---> 20444 +16701 ---> 20445 +16702 ---> 20446 +16703 ---> 20447 +16705 ---> 20448 +16708 ---> 20449 +16709 ---> 20450 +16713 ---> 20451 +16715 ---> 20452 +16716 ---> 20453 +16721 ---> 20454 +16724 ---> 20455 +16727 ---> 20456 +16730 ---> 20457 +16739 ---> 20458 +16741 ---> 20459 +16742 ---> 20460 +16743 ---> 20461 +16744 ---> 20462 +16745 ---> 20463 +16747 ---> 20464 +16748 ---> 20465 +16749 ---> 20466 +16750 ---> 20467 +16751 ---> 20468 +16752 ---> 20469 +16753 ---> 20470 +16754 ---> 20471 +16755 ---> 20472 +16757 ---> 20473 +16760 ---> 20474 +16761 ---> 20475 +16762 ---> 20476 +16764 ---> 20477 +16765 ---> 20478 +16766 ---> 20479 +16767 ---> 20480 +16768 ---> 20481 +16769 ---> 20482 +16770 ---> 20483 +16772 ---> 20484 +16778 ---> 20485 +16779 ---> 20486 +16780 ---> 20487 +16781 ---> 20488 +16782 ---> 20489 +16783 ---> 20490 +16784 ---> 20491 +16785 ---> 20492 +16786 ---> 20493 +16788 ---> 20494 +16789 ---> 20495 +16790 ---> 20496 +16795 ---> 20497 +16796 ---> 20498 +16798 ---> 20499 +16799 ---> 20500 +16804 ---> 20501 +16805 ---> 20502 +16813 ---> 20503 +16818 ---> 20504 +16823 ---> 20505 +16825 ---> 20506 +16829 ---> 20508 +16833 ---> 20509 +16835 ---> 20510 +16836 ---> 20511 +16839 ---> 20512 +16840 ---> 20513 +16841 ---> 20514 +16842 ---> 20515 +16843 ---> 20516 +16850 ---> 20517 +16856 ---> 20518 +16857 ---> 20519 +16859 ---> 20520 +16860 ---> 20521 +16864 ---> 20522 +16871 ---> 20523 +16872 ---> 20524 +16878 ---> 20525 +16879 ---> 20526 +16881 ---> 20527 +16886 ---> 20528 +16888 ---> 20529 +16890 ---> 20530 +16892 ---> 20531 +16896 ---> 20532 +16897 ---> 20533 +16900 ---> 20534 +16910 ---> 20535 +16912 ---> 20536 +16913 ---> 20537 +16914 ---> 20538 +16916 ---> 20539 +16918 ---> 20540 +16919 ---> 20541 +16923 ---> 20542 +16924 ---> 20543 +16925 ---> 20544 +16926 ---> 20545 +16928 ---> 20546 +16934 ---> 20547 +16940 ---> 20548 +16944 ---> 20549 +16945 ---> 1712 +16946 ---> 20550 +16947 ---> 20551 +16948 ---> 20552 +16949 ---> 20553 +16953 ---> 20554 +16956 ---> 20555 +16958 ---> 20556 +16960 ---> 20557 +16961 ---> 20558 +16962 ---> 20559 +16967 ---> 20560 +16968 ---> 20561 +16970 ---> 20562 +16972 ---> 20563 +16973 ---> 20564 +16974 ---> 20565 +16981 ---> 20566 +16985 ---> 20567 +16988 ---> 20568 +16991 ---> 20569 +16992 ---> 20570 +16993 ---> 20571 +16994 ---> 20572 +16995 ---> 20573 +16997 ---> 20574 +17001 ---> 20575 +17002 ---> 20576 +17008 ---> 20577 +17010 ---> 20578 +17014 ---> 20579 +17015 ---> 20580 +17018 ---> 20581 +17021 ---> 20582 +17024 ---> 20583 +17026 ---> 20584 +17027 ---> 20585 +17028 ---> 20586 +17030 ---> 20587 +17032 ---> 20588 +17034 ---> 20589 +17036 ---> 20590 +17037 ---> 20591 +17039 ---> 20592 +17043 ---> 20593 +17044 ---> 20594 +17045 ---> 20595 +17047 ---> 20596 +17048 ---> 20597 +17051 ---> 20598 +17052 ---> 20599 +17055 ---> 20600 +17056 ---> 20601 +17058 ---> 20602 +17067 ---> 20603 +17068 ---> 20604 +17071 ---> 20605 +17072 ---> 20606 +17075 ---> 20607 +17078 ---> 20608 +17080 ---> 20609 +17083 ---> 20610 +17086 ---> 20611 +17088 ---> 20612 +17089 ---> 20613 +17093 ---> 20614 +17094 ---> 20615 +17099 ---> 20616 +17103 ---> 20617 +17104 ---> 20618 +17106 ---> 20619 +17107 ---> 20620 +17108 ---> 20621 +17112 ---> 20622 +17116 ---> 20623 +17117 ---> 20624 +17118 ---> 20625 +17120 ---> 20626 +17123 ---> 20627 +17127 ---> 20628 +17128 ---> 20629 +17129 ---> 20630 +17130 ---> 20631 +17131 ---> 20632 +17133 ---> 20633 +17134 ---> 20634 +17135 ---> 20635 +17136 ---> 20636 +17138 ---> 20637 +17139 ---> 20638 +17144 ---> 20639 +17147 ---> 20640 +17149 ---> 20641 +17153 ---> 20642 +17154 ---> 20643 +17160 ---> 20644 +17162 ---> 20645 +17163 ---> 20646 +17164 ---> 20647 +17166 ---> 20648 +17174 ---> 20649 +17175 ---> 20650 +17177 ---> 20651 +17179 ---> 20652 +17180 ---> 20653 +17184 ---> 20654 +17187 ---> 20655 +17188 ---> 20656 +17190 ---> 20657 +17193 ---> 20658 +17194 ---> 20659 +17198 ---> 20660 +17199 ---> 20661 +17202 ---> 20662 +17209 ---> 1483 +17211 ---> 20663 +17213 ---> 20664 +17214 ---> 20665 +17216 ---> 20666 +17218 ---> 20667 +17220 ---> 20668 +17222 ---> 20669 +17225 ---> 20670 +17226 ---> 20671 +17227 ---> 20672 +17232 ---> 20673 +17233 ---> 20674 +17234 ---> 20675 +17235 ---> 20676 +17236 ---> 20677 +17242 ---> 20678 +17256 ---> 20679 +17260 ---> 20680 +17267 ---> 20681 +17272 ---> 20682 +17273 ---> 20683 +17275 ---> 20684 +17278 ---> 20685 +17281 ---> 20686 +17282 ---> 20687 +17283 ---> 20688 +17286 ---> 20689 +17292 ---> 20690 +17299 ---> 20691 +17300 ---> 20692 +17301 ---> 20693 +17302 ---> 20694 +17304 ---> 20695 +17305 ---> 20696 +17306 ---> 20697 +17308 ---> 20698 +17309 ---> 20699 +17316 ---> 20700 +17317 ---> 20701 +17318 ---> 20702 +17324 ---> 20703 +17325 ---> 20704 +17327 ---> 20705 +17328 ---> 20706 +17330 ---> 20707 +17335 ---> 20708 +17337 ---> 20709 +17339 ---> 20710 +17342 ---> 1548 +17345 ---> 20711 +17346 ---> 20712 +17349 ---> 20713 +17353 ---> 20714 +17356 ---> 20715 +17362 ---> 20716 +17365 ---> 20717 +17366 ---> 20718 +17368 ---> 20719 +17373 ---> 20720 +17376 ---> 20721 +17377 ---> 20722 +17378 ---> 20723 +17379 ---> 20724 +17382 ---> 20725 +17390 ---> 20726 +17391 ---> 20727 +17396 ---> 20728 +17401 ---> 20729 +17403 ---> 20730 +17405 ---> 20731 +17408 ---> 20732 +17410 ---> 20733 +17412 ---> 20734 +17413 ---> 20735 +17414 ---> 20736 +17420 ---> 20737 +17421 ---> 20738 +17422 ---> 20739 +17426 ---> 20740 +17427 ---> 20741 +17430 ---> 20742 +17433 ---> 20743 +17434 ---> 20744 +17437 ---> 20745 +17438 ---> 20746 +17439 ---> 20747 +17443 ---> 20748 +17447 ---> 20749 +17449 ---> 20750 +17450 ---> 20751 +17452 ---> 20752 +17453 ---> 20753 +17454 ---> 20754 +17458 ---> 20755 +17459 ---> 20756 +17462 ---> 20757 +17464 ---> 20758 +17468 ---> 20759 +17470 ---> 20760 +17478 ---> 20761 +17479 ---> 20762 +17480 ---> 20763 +17481 ---> 20764 +17482 ---> 20765 +17483 ---> 20766 +17486 ---> 20767 +17487 ---> 20768 +17490 ---> 20769 +17492 ---> 20770 +17494 ---> 20771 +17495 ---> 20772 +17496 ---> 20773 +17497 ---> 20774 +17499 ---> 20775 +17518 ---> 20776 +17522 ---> 20777 +17523 ---> 20778 +17524 ---> 20779 +17528 ---> 20780 +17533 ---> 20781 +17534 ---> 20782 +17536 ---> 20783 +17537 ---> 20784 +17538 ---> 20785 +17542 ---> 20786 +17545 ---> 20787 +17550 ---> 20788 +17555 ---> 20789 +17557 ---> 20790 +17558 ---> 20791 +17559 ---> 20792 +17564 ---> 20793 +17569 ---> 20794 +17575 ---> 20795 +17576 ---> 20796 +17579 ---> 20797 +17580 ---> 20798 +17581 ---> 20799 +17582 ---> 20800 +17583 ---> 20801 +17589 ---> 20802 +17591 ---> 20803 +17593 ---> 20804 +17601 ---> 20805 +17611 ---> 20806 +17614 ---> 20807 +17616 ---> 20808 +17619 ---> 20809 +17621 ---> 20810 +17627 ---> 20811 +17629 ---> 20812 +17631 ---> 20813 +17633 ---> 20814 +17636 ---> 20815 +17639 ---> 20816 +17643 ---> 20817 +17647 ---> 20818 +17659 ---> 20819 +17660 ---> 20820 +17661 ---> 20821 +17667 ---> 20822 +17668 ---> 20823 +17670 ---> 20824 +17675 ---> 20825 +17681 ---> 20826 +17688 ---> 20827 +17690 ---> 20828 +17691 ---> 20829 +17693 ---> 20830 +17696 ---> 20831 +17708 ---> 20832 +17710 ---> 20833 +17711 ---> 20834 +17713 ---> 20835 +17718 ---> 20836 +17721 ---> 20837 +17722 ---> 20838 +17723 ---> 20839 +17724 ---> 20840 +17725 ---> 20841 +17726 ---> 20842 +17727 ---> 20843 +17728 ---> 20844 +17730 ---> 20845 +17738 ---> 20846 +17741 ---> 20847 +17745 ---> 20848 +17746 ---> 20849 +17749 ---> 20850 +17752 ---> 20851 +17762 ---> 20852 +17763 ---> 20853 +17764 ---> 20854 +17773 ---> 20855 +17774 ---> 20856 +17789 ---> 20857 +17791 ---> 20858 +17793 ---> 20859 +17795 ---> 20860 +17797 ---> 20861 +17801 ---> 20862 +17802 ---> 20863 +17808 ---> 20864 +17809 ---> 20865 +17811 ---> 20866 +17812 ---> 20867 +17817 ---> 20868 +17819 ---> 20869 +17820 ---> 20870 +17833 ---> 20871 +17839 ---> 20872 +17842 ---> 20873 +17843 ---> 20874 +17844 ---> 20875 +17852 ---> 20876 +17856 ---> 20877 +17857 ---> 20878 +17858 ---> 20879 +17866 ---> 20880 +17870 ---> 20881 +17871 ---> 20882 +17872 ---> 20883 +17873 ---> 20884 +17878 ---> 20885 +17882 ---> 20886 +17892 ---> 20887 +17905 ---> 20888 +17910 ---> 20889 +17914 ---> 20890 +17916 ---> 20891 +17917 ---> 20892 +17918 ---> 20893 +17920 ---> 20894 +17921 ---> 20895 +17922 ---> 20896 +17923 ---> 20897 +17924 ---> 20898 +17925 ---> 20899 +17926 ---> 20900 +17927 ---> 20901 +17928 ---> 20902 +17929 ---> 20903 +17930 ---> 20904 +17932 ---> 20905 +17933 ---> 20906 +17934 ---> 20907 +17935 ---> 20908 +17943 ---> 20909 +17950 ---> 20910 +17955 ---> 20911 +17956 ---> 1482 +17957 ---> 20912 +17960 ---> 20913 +17961 ---> 20914 +17964 ---> 20915 +17966 ---> 20916 +17968 ---> 20917 +17976 ---> 20918 +17977 ---> 20919 +17978 ---> 20920 +17980 ---> 20921 +17981 ---> 20922 +17982 ---> 20923 +17983 ---> 20924 +17984 ---> 20925 +17985 ---> 20926 +17986 ---> 20927 +17987 ---> 20928 +17988 ---> 20929 +17989 ---> 20930 +17990 ---> 20931 +17992 ---> 20932 +17993 ---> 20933 +17994 ---> 20934 +17995 ---> 20935 +17996 ---> 20936 +18000 ---> 20937 +18002 ---> 20938 +18006 ---> 20939 +18009 ---> 20940 +18012 ---> 20941 +18013 ---> 20942 +18015 ---> 20943 +18016 ---> 20944 +18017 ---> 20945 +18019 ---> 20946 +18023 ---> 20947 +18029 ---> 20948 +18036 ---> 20949 +18048 ---> 20950 +18049 ---> 20951 +18050 ---> 20952 +18051 ---> 20953 +18052 ---> 20954 +18053 ---> 20955 +18054 ---> 20956 +18055 ---> 20957 +18056 ---> 20958 +18057 ---> 20959 +18058 ---> 20960 +18059 ---> 20961 +18060 ---> 20962 +18062 ---> 20963 +18063 ---> 20964 +18064 ---> 20965 +18065 ---> 20966 +18068 ---> 20967 +18069 ---> 20968 +18070 ---> 20969 +18071 ---> 20970 +18072 ---> 20971 +18073 ---> 20972 +18074 ---> 20973 +18075 ---> 20974 +18076 ---> 20975 +18077 ---> 20976 +18078 ---> 20977 +18079 ---> 20978 +18083 ---> 20979 +18087 ---> 20980 +18088 ---> 20981 +18090 ---> 20982 +18095 ---> 20983 +18098 ---> 20984 +18099 ---> 20986 +18103 ---> 20987 +18104 ---> 20988 +18106 ---> 20989 +18107 ---> 20990 +18112 ---> 20991 +18114 ---> 20992 +18116 ---> 20993 +18118 ---> 20994 +18121 ---> 20995 +18125 ---> 20996 +18128 ---> 20997 +18129 ---> 20998 +18130 ---> 20999 +18133 ---> 21000 +18139 ---> 21001 +18140 ---> 21002 +18141 ---> 21003 +18142 ---> 21004 +18143 ---> 21005 +18145 ---> 21006 +18146 ---> 21007 +18147 ---> 21008 +18148 ---> 21009 +18149 ---> 21010 +18150 ---> 21011 +18151 ---> 21012 +18152 ---> 21013 +18159 ---> 21014 +18160 ---> 21015 +18164 ---> 21016 +18168 ---> 21017 +18172 ---> 21018 +18173 ---> 21019 +18178 ---> 21020 +18187 ---> 21021 +18188 ---> 21022 +18190 ---> 21023 +18192 ---> 21024 +18193 ---> 21025 +18194 ---> 21026 +18195 ---> 21027 +18196 ---> 21028 +18197 ---> 21029 +18198 ---> 21030 +18199 ---> 21031 +18201 ---> 21032 +18202 ---> 21033 +18203 ---> 21034 +18204 ---> 21035 +18205 ---> 21036 +18207 ---> 21037 +18208 ---> 21038 +18210 ---> 21039 +18211 ---> 21040 +18212 ---> 21041 +18217 ---> 21042 +18219 ---> 21043 +18220 ---> 21044 +18225 ---> 21045 +18226 ---> 21046 +18237 ---> 21047 +18242 ---> 21048 +18245 ---> 21049 +18247 ---> 21050 +18248 ---> 21051 +18249 ---> 21052 +18253 ---> 21053 +18255 ---> 21054 +18257 ---> 21055 +18260 ---> 21056 +18261 ---> 21057 +18262 ---> 21058 +18263 ---> 21059 +18264 ---> 21060 +18265 ---> 21061 +18266 ---> 21062 +18268 ---> 21063 +18269 ---> 21064 +18270 ---> 21065 +18271 ---> 21066 +18272 ---> 21067 +18273 ---> 21068 +18274 ---> 21069 +18279 ---> 21070 +18283 ---> 21071 +18284 ---> 21073 +18290 ---> 21074 +18292 ---> 21075 +18293 ---> 21076 +18296 ---> 21077 +18302 ---> 21078 +18304 ---> 21079 +18305 ---> 21080 +18308 ---> 21081 +18310 ---> 21082 +18311 ---> 21083 +18312 ---> 21084 +18313 ---> 21085 +18314 ---> 21086 +18315 ---> 21087 +18316 ---> 21088 +18317 ---> 21089 +18318 ---> 21090 +18321 ---> 21091 +18324 ---> 21092 +18328 ---> 21093 +18334 ---> 21094 +18338 ---> 21095 +18347 ---> 21096 +18352 ---> 21097 +18354 ---> 21098 +18357 ---> 21099 +18360 ---> 21100 +18361 ---> 21101 +18369 ---> 21102 +18373 ---> 21103 +18376 ---> 21104 +18381 ---> 21105 +18387 ---> 21106 +18389 ---> 21107 +18390 ---> 21108 +18391 ---> 21110 +18392 ---> 21111 +18394 ---> 21112 +18400 ---> 21113 +18401 ---> 21114 +18405 ---> 21115 +18406 ---> 21116 +18408 ---> 21117 +18409 ---> 21118 +18416 ---> 21119 +18418 ---> 21120 +18420 ---> 21121 +18424 ---> 21122 +18429 ---> 21123 +18431 ---> 21124 +18432 ---> 21125 +18436 ---> 21126 +18437 ---> 21127 +18444 ---> 21128 +18445 ---> 21129 +18448 ---> 21130 +18449 ---> 21131 +18452 ---> 21132 +18454 ---> 21133 +18458 ---> 21134 +18459 ---> 21135 +18461 ---> 21136 +18462 ---> 21137 +18463 ---> 21138 +18464 ---> 21139 +18465 ---> 21140 +18469 ---> 21141 +18470 ---> 21142 +18471 ---> 21143 +18472 ---> 21144 +18473 ---> 21145 +18474 ---> 21146 +18475 ---> 21147 +18476 ---> 21148 +18477 ---> 21149 +18478 ---> 21150 +18479 ---> 21151 +18480 ---> 21152 +18481 ---> 21153 +18482 ---> 21154 +18483 ---> 21155 +18485 ---> 21156 +18486 ---> 21157 +18490 ---> 21158 +18493 ---> 21159 +18497 ---> 21160 +18506 ---> 21161 +18509 ---> 21162 +18512 ---> 21163 +18516 ---> 21164 +18518 ---> 21165 +18520 ---> 21166 +18521 ---> 21167 +18528 ---> 21168 +18530 ---> 21169 +18538 ---> 21170 +18539 ---> 21171 +18540 ---> 21172 +18542 ---> 21173 +18543 ---> 21174 +18544 ---> 21175 +18545 ---> 21176 +18546 ---> 21177 +18547 ---> 21178 +18548 ---> 21179 +18549 ---> 21181 +18550 ---> 21182 +18551 ---> 21183 +18552 ---> 21184 +18559 ---> 21185 +18560 ---> 21186 +18567 ---> 21187 +18568 ---> 1481 +18569 ---> 21188 +18572 ---> 21189 +18578 ---> 21190 +18580 ---> 21191 +18581 ---> 21192 +18584 ---> 21193 +18589 ---> 21194 +18590 ---> 21195 +18594 ---> 21196 +18595 ---> 21197 +18596 ---> 21198 +18597 ---> 21199 +18598 ---> 21200 +18599 ---> 21201 +18600 ---> 21202 +18601 ---> 21203 +18602 ---> 21204 +18603 ---> 21205 +18604 ---> 21206 +18606 ---> 21207 +18608 ---> 21208 +18614 ---> 21209 +18623 ---> 21210 +18626 ---> 21211 +18630 ---> 21212 +18632 ---> 21213 +18646 ---> 21214 +18649 ---> 21215 +18652 ---> 21216 +18653 ---> 21217 +18654 ---> 21218 +18655 ---> 21219 +18656 ---> 21220 +18657 ---> 21221 +18659 ---> 21222 +18660 ---> 21223 +18661 ---> 21224 +18664 ---> 21225 +18666 ---> 21226 +18668 ---> 21227 +18670 ---> 21228 +18671 ---> 21229 +18674 ---> 21230 +18676 ---> 21231 +18677 ---> 21232 +18680 ---> 21233 +18682 ---> 21234 +18683 ---> 21235 +18690 ---> 21236 +18693 ---> 21237 +18697 ---> 21238 +18704 ---> 21239 +18705 ---> 21240 +18706 ---> 21241 +18707 ---> 21242 +18708 ---> 21243 +18709 ---> 21244 +18710 ---> 21245 +18711 ---> 21246 +18712 ---> 21247 +18713 ---> 21248 +18715 ---> 21249 +18716 ---> 21250 +18717 ---> 21251 +18718 ---> 21252 +18719 ---> 21253 +18720 ---> 21254 +18721 ---> 21255 +18723 ---> 21256 +18724 ---> 21257 +18726 ---> 21258 +18733 ---> 21259 +18735 ---> 21260 +18736 ---> 21261 +18745 ---> 21262 +18747 ---> 21263 +18749 ---> 21264 +18750 ---> 21265 +18752 ---> 21266 +18753 ---> 21267 +18754 ---> 21268 +18755 ---> 21269 +18756 ---> 21270 +18759 ---> 21271 +18760 ---> 21272 +18762 ---> 21273 +18763 ---> 21274 +18765 ---> 21275 +18775 ---> 21276 +18776 ---> 21277 +18780 ---> 21278 +18782 ---> 21279 +18784 ---> 21280 +18786 ---> 21281 +18787 ---> 21282 +18788 ---> 21283 +18789 ---> 21284 +18790 ---> 21285 +18791 ---> 21286 +18794 ---> 21287 +18797 ---> 21288 +18798 ---> 21289 +18799 ---> 21290 +18800 ---> 21291 +18802 ---> 21292 +18803 ---> 21293 +18805 ---> 21294 +18806 ---> 21295 +18807 ---> 21296 +18808 ---> 21297 +18809 ---> 21298 +18810 ---> 21299 +18811 ---> 21300 +18812 ---> 21301 +18813 ---> 21302 +18814 ---> 21303 +18815 ---> 21304 +18816 ---> 21305 +18817 ---> 21306 +18818 ---> 21307 +18819 ---> 21308 +18820 ---> 21309 +18821 ---> 21310 +18822 ---> 21311 +18823 ---> 21312 +18825 ---> 21313 +18826 ---> 21314 +18827 ---> 21315 +18828 ---> 21316 +18829 ---> 21317 +18830 ---> 21318 +18831 ---> 21319 +18832 ---> 21320 +18834 ---> 21321 +18835 ---> 21322 +18836 ---> 21323 +18845 ---> 21324 +18846 ---> 21325 +18847 ---> 21326 +18848 ---> 21327 +18849 ---> 21328 +18850 ---> 21329 +18851 ---> 21330 +18853 ---> 21331 +18854 ---> 21332 +18858 ---> 21333 +18862 ---> 21334 +18863 ---> 21335 +18864 ---> 21336 +18869 ---> 21337 +18870 ---> 21338 +18873 ---> 21339 +18877 ---> 21340 +18882 ---> 21341 +18883 ---> 21342 +18885 ---> 21343 +18888 ---> 21344 +18890 ---> 21345 +18892 ---> 21346 +18893 ---> 21347 +18894 ---> 21348 +18896 ---> 21349 +18898 ---> 21350 +18899 ---> 21351 +18900 ---> 21352 +18902 ---> 21353 +18903 ---> 21354 +18905 ---> 21355 +18906 ---> 21356 +18907 ---> 21357 +18908 ---> 21358 +18909 ---> 21359 +18910 ---> 21360 +18918 ---> 21361 +18922 ---> 21362 +18924 ---> 21363 +18931 ---> 21364 +18932 ---> 21365 +18936 ---> 21366 +18938 ---> 21367 +18940 ---> 21368 +18942 ---> 21369 +18946 ---> 21370 +18949 ---> 21371 +18954 ---> 21372 +18964 ---> 21373 +18966 ---> 21374 +18969 ---> 21375 +18970 ---> 21376 +18971 ---> 21377 +18972 ---> 21378 +18973 ---> 21379 +18974 ---> 21380 +18975 ---> 21381 +18976 ---> 21382 +18978 ---> 21383 +18982 ---> 21384 +18984 ---> 21385 +18989 ---> 21386 +18993 ---> 21387 +18994 ---> 21388 +18997 ---> 21389 +19001 ---> 21390 +19003 ---> 21391 +19016 ---> 21392 +19023 ---> 21393 +19028 ---> 21394 +19031 ---> 21395 +19032 ---> 21396 +19033 ---> 21397 +19036 ---> 21398 +19037 ---> 21399 +19038 ---> 21400 +19039 ---> 21401 +19040 ---> 21402 +19041 ---> 21403 +19042 ---> 21404 +19044 ---> 21405 +19052 ---> 21406 +19056 ---> 21407 +19057 ---> 21408 +19058 ---> 21409 +19062 ---> 21410 +19067 ---> 21411 +19071 ---> 21412 +19076 ---> 21413 +19077 ---> 21414 +19079 ---> 21415 +19080 ---> 21416 +19081 ---> 21417 +19083 ---> 21418 +19086 ---> 21419 +19090 ---> 21420 +19091 ---> 21421 +19092 ---> 21422 +19093 ---> 21423 +19094 ---> 21424 +19095 ---> 21425 +19096 ---> 21426 +19098 ---> 21427 +19101 ---> 21428 +19104 ---> 21429 +19110 ---> 21430 +19115 ---> 21431 +19116 ---> 21432 +19119 ---> 21433 +19129 ---> 21434 +19139 ---> 21435 +19152 ---> 21436 +19154 ---> 21437 +19156 ---> 21438 +19162 ---> 21439 +19166 ---> 21440 +19167 ---> 21441 +19168 ---> 21442 +19175 ---> 21443 +19179 ---> 21444 +19180 ---> 21445 +19183 ---> 21446 +19185 ---> 21447 +19188 ---> 21448 +19191 ---> 21449 +19194 ---> 21450 +19198 ---> 21451 +19200 ---> 21452 +19202 ---> 21453 +19204 ---> 21454 +19210 ---> 21455 +19211 ---> 21456 +19212 ---> 21457 +19213 ---> 21458 +19218 ---> 21459 +19220 ---> 21460 +19221 ---> 21461 +19222 ---> 21462 +19223 ---> 21463 +19225 ---> 21464 +19226 ---> 21465 +19227 ---> 21466 +19230 ---> 21467 +19231 ---> 21468 +19235 ---> 21469 +19236 ---> 21470 +19238 ---> 21471 +19239 ---> 21472 +20751 ---> 22155 +20753 ---> 22156 +20755 ---> 22157 +20757 ---> 22158 +20764 ---> 22159 +20765 ---> 22160 +20766 ---> 22161 +20768 ---> 22162 +20769 ---> 22163 +20772 ---> 22164 +20773 ---> 22165 +20775 ---> 22166 +20776 ---> 22167 +20779 ---> 22168 +20780 ---> 22169 +20781 ---> 22170 +20782 ---> 22171 +20787 ---> 22172 +20788 ---> 22173 +20794 ---> 22174 +20795 ---> 22175 +20797 ---> 22176 +20799 ---> 22177 +20803 ---> 22178 +20804 ---> 22179 +20805 ---> 22180 +20808 ---> 22181 +20809 ---> 22182 +20810 ---> 22183 +20812 ---> 22184 +20814 ---> 22185 +20816 ---> 22186 +20817 ---> 22187 +20818 ---> 22188 +20825 ---> 22189 +20827 ---> 22190 +20832 ---> 22191 +20834 ---> 22192 +20835 ---> 22193 +20837 ---> 22194 +20840 ---> 22195 +20841 ---> 22196 +20845 ---> 22197 +20846 ---> 22198 +20849 ---> 22199 +20850 ---> 22200 +20851 ---> 22201 +20852 ---> 22202 +20853 ---> 22203 +20854 ---> 22204 +20855 ---> 22205 +20856 ---> 22206 +20857 ---> 22207 +20858 ---> 22208 +20859 ---> 22209 +20860 ---> 22210 +20861 ---> 22211 +20862 ---> 22212 +20865 ---> 22213 +20866 ---> 22214 +20869 ---> 22215 +20871 ---> 22216 +20874 ---> 22217 +20875 ---> 22218 +20876 ---> 22219 +20880 ---> 22220 +20884 ---> 22221 +20888 ---> 22222 +20892 ---> 22223 +20893 ---> 22225 +20897 ---> 22226 +20899 ---> 22227 +20902 ---> 22228 +20903 ---> 22229 +20910 ---> 22230 +20911 ---> 22231 +20916 ---> 22232 +20917 ---> 22233 +20918 ---> 22234 +20919 ---> 22235 +20920 ---> 22236 +20921 ---> 22237 +20922 ---> 22238 +20923 ---> 22239 +20924 ---> 22240 +20925 ---> 22241 +20926 ---> 22242 +20932 ---> 22243 +20940 ---> 22244 +20942 ---> 22245 +20944 ---> 22246 +20948 ---> 22247 +20951 ---> 22248 +20954 ---> 22249 +20955 ---> 22250 +20965 ---> 22251 +20966 ---> 22252 +20967 ---> 22253 +20969 ---> 22254 +20970 ---> 22255 +20972 ---> 22256 +20973 ---> 22257 +20974 ---> 22258 +20975 ---> 22259 +20976 ---> 22260 +20977 ---> 22261 +20978 ---> 22262 +20979 ---> 22263 +20980 ---> 22264 +20981 ---> 22265 +20982 ---> 22266 +20985 ---> 22267 +20990 ---> 22268 +20994 ---> 22269 +20997 ---> 22270 +20998 ---> 22271 +21000 ---> 22272 +21004 ---> 22273 +21008 ---> 22274 +21011 ---> 22275 +21017 ---> 22276 +21018 ---> 22277 +21022 ---> 22278 +21023 ---> 22279 +21024 ---> 22280 +21025 ---> 22281 +21026 ---> 22282 +21027 ---> 22283 +21030 ---> 22284 +21034 ---> 22285 +21035 ---> 22286 +21037 ---> 22287 +21038 ---> 22288 +21042 ---> 22289 +21045 ---> 22290 +21047 ---> 22291 +21052 ---> 22292 +21053 ---> 22293 +21055 ---> 22294 +21057 ---> 22295 +21060 ---> 22296 +21062 ---> 22297 +21066 ---> 22298 +21075 ---> 22299 +21076 ---> 22300 +21078 ---> 22301 +21079 ---> 22302 +21081 ---> 22303 +21088 ---> 22304 +21091 ---> 22305 +21092 ---> 22306 +21093 ---> 22307 +21095 ---> 22308 +21096 ---> 22309 +21097 ---> 22310 +21102 ---> 22311 +21103 ---> 22312 +21105 ---> 22313 +21106 ---> 22314 +21109 ---> 22315 +21111 ---> 22316 +21112 ---> 22317 +21116 ---> 22318 +21119 ---> 22319 +21122 ---> 22320 +21123 ---> 22321 +21127 ---> 22322 +21128 ---> 22323 +21129 ---> 22324 +21131 ---> 22325 +21135 ---> 22326 +21141 ---> 22327 +21143 ---> 22328 +21146 ---> 22329 +21147 ---> 22330 +21148 ---> 22331 +21151 ---> 22332 +21154 ---> 22333 +21156 ---> 22334 +21158 ---> 22335 +21160 ---> 22336 +21166 ---> 22337 +21168 ---> 22338 +21172 ---> 22339 +21181 ---> 22340 +21186 ---> 22341 +21187 ---> 22342 +21188 ---> 22343 +21190 ---> 22344 +21193 ---> 22345 +21195 ---> 22346 +21197 ---> 22347 +21198 ---> 22348 +21201 ---> 22349 +21202 ---> 1487 +21203 ---> 22350 +21204 ---> 22351 +21206 ---> 22352 +21208 ---> 22353 +21209 ---> 22354 +21210 ---> 22355 +21212 ---> 22356 +21213 ---> 22357 +21214 ---> 22358 +21215 ---> 22359 +21216 ---> 22360 +21217 ---> 22361 +21218 ---> 22362 +21219 ---> 22363 +21225 ---> 22364 +21226 ---> 22365 +21227 ---> 22366 +21231 ---> 22367 +21233 ---> 22368 +21237 ---> 22369 +21240 ---> 22370 +21248 ---> 22371 +21250 ---> 22372 +21252 ---> 22373 +21253 ---> 22374 +21258 ---> 22375 +21259 ---> 22376 +21260 ---> 22377 +21261 ---> 22378 +21267 ---> 22379 +21270 ---> 22380 +21271 ---> 22381 +21273 ---> 22382 +21274 ---> 22383 +21275 ---> 22384 +21276 ---> 22385 +21279 ---> 22386 +21281 ---> 22387 +21282 ---> 22389 +21285 ---> 22390 +21288 ---> 22391 +21292 ---> 22392 +21294 ---> 22393 +21296 ---> 22394 +21297 ---> 22395 +21299 ---> 22396 +21301 ---> 22397 +21302 ---> 22398 +21303 ---> 22399 +21304 ---> 22400 +21305 ---> 22401 +21306 ---> 22402 +21310 ---> 22403 +21314 ---> 22404 +21319 ---> 22405 +21323 ---> 22406 +21327 ---> 22407 +21330 ---> 22408 +21332 ---> 22409 +21335 ---> 22410 +21338 ---> 22411 +21343 ---> 22412 +21344 ---> 22413 +21345 ---> 22414 +21346 ---> 22415 +21347 ---> 22416 +21348 ---> 22417 +21350 ---> 22418 +21351 ---> 22419 +21353 ---> 22420 +21356 ---> 22421 +21358 ---> 22422 +21359 ---> 22423 +21360 ---> 22424 +21371 ---> 22425 +21377 ---> 22426 +21379 ---> 22427 +21380 ---> 22428 +21384 ---> 22429 +21386 ---> 22430 +21391 ---> 22431 +21392 ---> 22432 +21393 ---> 22433 +21395 ---> 22434 +21398 ---> 22435 +21401 ---> 22436 +21404 ---> 22437 +21406 ---> 22438 +21409 ---> 22439 +21410 ---> 22440 +21413 ---> 22441 +21414 ---> 22442 +21415 ---> 22443 +21416 ---> 22444 +21420 ---> 22445 +21421 ---> 22446 +21422 ---> 22447 +21424 ---> 22448 +21425 ---> 22449 +21426 ---> 22450 +21427 ---> 22451 +21429 ---> 22452 +21430 ---> 22453 +21431 ---> 22454 +21432 ---> 22455 +21433 ---> 22456 +21434 ---> 22457 +21435 ---> 22458 +21436 ---> 22459 +21437 ---> 22460 +21438 ---> 22461 +21439 ---> 22462 +21440 ---> 22463 +21441 ---> 22464 +21442 ---> 22465 +21443 ---> 22466 +21444 ---> 22467 +21445 ---> 22468 +21451 ---> 22469 +21452 ---> 22470 +21459 ---> 22471 +21472 ---> 22472 +21474 ---> 22473 +21481 ---> 22474 +21483 ---> 22475 +21489 ---> 22476 +21496 ---> 22477 +21503 ---> 22478 +21508 ---> 22479 +21509 ---> 22480 +21510 ---> 22481 +21515 ---> 22482 +21520 ---> 22483 +21525 ---> 22484 +21526 ---> 22485 +21530 ---> 22486 +21533 ---> 22487 +21534 ---> 22488 +21537 ---> 22489 +21539 ---> 22490 +21541 ---> 22491 +21542 ---> 22492 +21545 ---> 22493 +21547 ---> 22494 +21548 ---> 22495 +21549 ---> 22496 +21550 ---> 22497 +21553 ---> 22498 +21554 ---> 22499 +21555 ---> 22500 +21556 ---> 22501 +21557 ---> 22502 +21558 ---> 22503 +21559 ---> 22504 +21568 ---> 22505 +21570 ---> 22506 +21577 ---> 22507 +21585 ---> 22508 +21591 ---> 22509 +21597 ---> 22510 +21598 ---> 22511 +21602 ---> 22512 +21605 ---> 22513 +21609 ---> 22514 +21610 ---> 22515 +21612 ---> 22516 +21613 ---> 22517 +21614 ---> 22518 +21615 ---> 22519 +21622 ---> 22520 +21624 ---> 22521 +21626 ---> 22522 +21627 ---> 22523 +21628 ---> 22524 +21629 ---> 22525 +21640 ---> 22526 +21642 ---> 22527 +21643 ---> 22528 +21645 ---> 22529 +21649 ---> 22530 +21651 ---> 22531 +21655 ---> 22532 +21656 ---> 22533 +21657 ---> 22534 +21660 ---> 22535 +21661 ---> 22536 +21663 ---> 22537 +21664 ---> 22538 +21667 ---> 22539 +21676 ---> 22540 +21680 ---> 22541 +21682 ---> 22542 +21687 ---> 22543 +21689 ---> 22544 +21692 ---> 22545 +21693 ---> 22546 +21694 ---> 22547 +21695 ---> 22548 +21696 ---> 22549 +21698 ---> 22550 +21699 ---> 22551 +21701 ---> 22552 +21702 ---> 22553 +21703 ---> 22554 +21704 ---> 22555 +21706 ---> 22556 +21709 ---> 22557 +21714 ---> 22558 +21715 ---> 22559 +21716 ---> 22560 +21718 ---> 22561 +21720 ---> 22562 +21722 ---> 22563 +21724 ---> 22564 +21726 ---> 22565 +21727 ---> 22566 +21728 ---> 22567 +21729 ---> 22568 +21731 ---> 22569 +21738 ---> 22570 +21741 ---> 22571 +21744 ---> 22572 +21747 ---> 22573 +21753 ---> 22574 +21754 ---> 22575 +21757 ---> 22576 +21759 ---> 22577 +21761 ---> 22578 +21763 ---> 22579 +21766 ---> 22580 +21767 ---> 22581 +21775 ---> 22582 +21776 ---> 22583 +21777 ---> 22584 +21778 ---> 22585 +21781 ---> 22586 +21786 ---> 22587 +21788 ---> 22588 +21790 ---> 22589 +21791 ---> 22590 +21793 ---> 22591 +21796 ---> 22592 +21803 ---> 22593 +21804 ---> 22594 +21807 ---> 22595 +21809 ---> 22596 +21810 ---> 22597 +21811 ---> 22598 +21813 ---> 22599 +21815 ---> 22600 +21817 ---> 22601 +21818 ---> 22602 +21820 ---> 22603 +21821 ---> 22604 +21823 ---> 22605 +21824 ---> 22606 +21825 ---> 22607 +21829 ---> 22608 +21832 ---> 22609 +21833 ---> 22610 +21834 ---> 22611 +21835 ---> 22612 +21842 ---> 22613 +21845 ---> 22614 +21850 ---> 22615 +21851 ---> 22616 +21852 ---> 22617 +21853 ---> 22618 +21854 ---> 22619 +21855 ---> 22620 +21857 ---> 22621 +21865 ---> 22622 +21867 ---> 22623 +21870 ---> 22624 +21875 ---> 22625 +21876 ---> 22626 +21880 ---> 22627 +21881 ---> 22628 +21886 ---> 22629 +21890 ---> 22630 +21891 ---> 22631 +21892 ---> 22632 +21895 ---> 22633 +21898 ---> 22634 +21899 ---> 22635 +21902 ---> 22636 +21903 ---> 22637 +21904 ---> 22638 +21914 ---> 22639 +21917 ---> 22640 +21918 ---> 22641 +21920 ---> 22642 +21921 ---> 22643 +21922 ---> 22644 +21923 ---> 22645 +21924 ---> 22646 +21925 ---> 22647 +21926 ---> 22648 +21927 ---> 22649 +21929 ---> 22650 +21931 ---> 22651 +21932 ---> 22652 +21933 ---> 22653 +21934 ---> 22654 +21941 ---> 22655 +21942 ---> 22656 +21945 ---> 22657 +21946 ---> 22658 +21949 ---> 22659 +21950 ---> 22660 +21953 ---> 22661 +21954 ---> 22662 +21961 ---> 22663 +21963 ---> 22664 +21967 ---> 22665 +21971 ---> 22666 +21973 ---> 22667 +21974 ---> 22668 +21975 ---> 22669 +21976 ---> 22670 +21982 ---> 12430 +21983 ---> 22671 +21986 ---> 22672 +21991 ---> 22673 +21993 ---> 22674 +21995 ---> 22675 +21999 ---> 22676 +22011 ---> 22677 +22014 ---> 22678 +22016 ---> 22679 +22019 ---> 22680 +22021 ---> 22681 +22026 ---> 22682 +22030 ---> 22683 +22032 ---> 22684 +22038 ---> 22685 +22040 ---> 22686 +22042 ---> 22687 +22045 ---> 22688 +22048 ---> 22689 +22049 ---> 22690 +22050 ---> 22691 +22053 ---> 22692 +22054 ---> 22693 +22055 ---> 22694 +22056 ---> 22695 +22057 ---> 22696 +22063 ---> 22697 +22066 ---> 22698 +22068 ---> 22699 +22076 ---> 22700 +22077 ---> 22701 +22078 ---> 22702 +22079 ---> 22703 +22080 ---> 22704 +22081 ---> 22705 +22082 ---> 22706 +22083 ---> 22707 +22084 ---> 22708 +22085 ---> 22709 +22087 ---> 22710 +22088 ---> 22711 +22089 ---> 22712 +22090 ---> 22713 +22091 ---> 22714 +22092 ---> 22715 +22093 ---> 22716 +22094 ---> 22717 +22098 ---> 22718 +22099 ---> 22719 +22101 ---> 22720 +22103 ---> 22721 +22104 ---> 22722 +22110 ---> 22723 +22113 ---> 22724 +22128 ---> 22725 +22133 ---> 22726 +22134 ---> 22727 +22135 ---> 22728 +22137 ---> 22729 +22139 ---> 22730 +22141 ---> 22731 +22142 ---> 22732 +22145 ---> 22733 +22152 ---> 22734 +22158 ---> 22735 +22159 ---> 22736 +22161 ---> 22737 +22163 ---> 22738 +22164 ---> 22739 +22168 ---> 22740 +22171 ---> 22741 +22172 ---> 22742 +22174 ---> 22743 +22177 ---> 22744 +22184 ---> 22745 +22187 ---> 22746 +22191 ---> 22747 +22192 ---> 22748 +22195 ---> 22749 +22196 ---> 22750 +22203 ---> 22751 +22204 ---> 22752 +22205 ---> 22753 +22206 ---> 22754 +22208 ---> 22755 +22210 ---> 22756 +22211 ---> 22757 +22215 ---> 22758 +22222 ---> 22759 +22229 ---> 22760 +22233 ---> 22761 +22236 ---> 22762 +22244 ---> 22763 +22245 ---> 22764 +22251 ---> 22765 +22252 ---> 22766 +22253 ---> 22767 +22254 ---> 22768 +22256 ---> 22769 +22257 ---> 1404 +22264 ---> 22770 +22266 ---> 22771 +22268 ---> 22772 +22269 ---> 22773 +22271 ---> 22774 +22276 ---> 22775 +22280 ---> 22776 +22284 ---> 22777 +22292 ---> 22778 +22293 ---> 22779 +22294 ---> 22780 +22299 ---> 22781 +22300 ---> 22782 +22302 ---> 22783 +22309 ---> 22784 +22316 ---> 22785 +22318 ---> 22787 +22321 ---> 22788 +22324 ---> 22789 +22328 ---> 22790 +22331 ---> 22791 +22332 ---> 22792 +22335 ---> 22793 +22339 ---> 22794 +22343 ---> 22795 +22345 ---> 22796 +22347 ---> 22797 +22348 ---> 22798 +22350 ---> 22799 +22351 ---> 22800 +22353 ---> 22801 +22354 ---> 22802 +22355 ---> 22803 +22356 ---> 22804 +22358 ---> 22805 +22360 ---> 22806 +22362 ---> 22807 +22364 ---> 22808 +22365 ---> 22809 +22367 ---> 22810 +22369 ---> 22811 +22373 ---> 22813 +22375 ---> 22814 +22376 ---> 22815 +22377 ---> 22816 +22378 ---> 22817 +22379 ---> 22818 +22380 ---> 22819 +22381 ---> 22820 +22384 ---> 22821 +22385 ---> 22822 +22386 ---> 22823 +22387 ---> 22824 +22388 ---> 22825 +22389 ---> 22826 +22390 ---> 22827 +22391 ---> 22828 +22392 ---> 22829 +22394 ---> 22830 +22395 ---> 22831 +22396 ---> 22832 +22397 ---> 22833 +22398 ---> 22834 +22399 ---> 22835 +22401 ---> 22836 +22403 ---> 22837 +22404 ---> 22838 +22405 ---> 22839 +22406 ---> 22840 +22408 ---> 22841 +22409 ---> 22842 +22410 ---> 22843 +22411 ---> 22844 +22412 ---> 22845 +22415 ---> 22846 +22416 ---> 22847 +22417 ---> 22848 +22425 ---> 22849 +22427 ---> 22850 +22428 ---> 22851 +22429 ---> 22852 +22430 ---> 22853 +22431 ---> 22854 +22434 ---> 22855 +22437 ---> 22856 +22440 ---> 22857 +22443 ---> 22858 +22444 ---> 22859 +22452 ---> 22860 +22453 ---> 22861 +22458 ---> 22862 +22463 ---> 22863 +22464 ---> 22864 +22468 ---> 22865 +22469 ---> 22866 +22470 ---> 22868 +22472 ---> 22869 +22475 ---> 22870 +22479 ---> 22871 +22480 ---> 22872 +22482 ---> 22873 +22484 ---> 22874 +22485 ---> 22875 +22488 ---> 22876 +22492 ---> 22877 +22493 ---> 22878 +22496 ---> 22879 +22500 ---> 22880 +22502 ---> 22881 +22503 ---> 22882 +22506 ---> 22883 +22508 ---> 22884 +22509 ---> 22885 +22510 ---> 22886 +22515 ---> 22887 +22520 ---> 22888 +22527 ---> 22889 +22528 ---> 22890 +22534 ---> 22891 +22535 ---> 22892 +22536 ---> 22893 +22542 ---> 22894 +22543 ---> 22895 +22544 ---> 22896 +22545 ---> 22897 +22551 ---> 22898 +22555 ---> 22899 +22560 ---> 22900 +22564 ---> 22901 +22565 ---> 22902 +22569 ---> 22903 +22576 ---> 22904 +22577 ---> 22905 +22578 ---> 22906 +22582 ---> 22907 +22583 ---> 22908 +22586 ---> 22909 +22587 ---> 22910 +22589 ---> 22911 +22591 ---> 22912 +22593 ---> 22913 +22597 ---> 22914 +22598 ---> 22915 +22599 ---> 22916 +22601 ---> 22917 +22607 ---> 22918 +22608 ---> 22919 +22610 ---> 22920 +22611 ---> 22921 +22612 ---> 22922 +22613 ---> 22923 +22614 ---> 22924 +22615 ---> 22925 +22616 ---> 22926 +22620 ---> 22927 +22625 ---> 22928 +22626 ---> 22929 +22627 ---> 22930 +22629 ---> 22931 +22630 ---> 22932 +22631 ---> 22933 +22632 ---> 22934 +22634 ---> 22935 +22635 ---> 22936 +22637 ---> 22937 +22638 ---> 22938 +22640 ---> 22939 +22642 ---> 22940 +22644 ---> 22941 +22646 ---> 22942 +22647 ---> 22943 +22650 ---> 22944 +22655 ---> 22945 +22656 ---> 22946 +22658 ---> 22947 +22660 ---> 22948 +22661 ---> 22949 +22663 ---> 22950 +22670 ---> 22951 +22674 ---> 22952 +22677 ---> 22953 +22681 ---> 22954 +22688 ---> 22955 +22690 ---> 22956 +22691 ---> 22957 +22695 ---> 22958 +22697 ---> 22959 +22700 ---> 22960 +22705 ---> 22961 +22707 ---> 22962 +22711 ---> 22963 +22713 ---> 22964 +22719 ---> 22965 +22721 ---> 22966 +22723 ---> 22967 +22725 ---> 22968 +22735 ---> 22969 +22741 ---> 22970 +22744 ---> 22971 +22745 ---> 22972 +22746 ---> 22973 +22747 ---> 22974 +22755 ---> 22975 +22764 ---> 22976 +22765 ---> 22978 +22767 ---> 22979 +22771 ---> 22980 +22773 ---> 22981 +22775 ---> 22982 +22776 ---> 22983 +22777 ---> 22984 +22778 ---> 22985 +22779 ---> 22986 +22780 ---> 22987 +22786 ---> 22988 +22789 ---> 22989 +22790 ---> 22990 +22791 ---> 22992 +22796 ---> 22993 +22801 ---> 22994 +22803 ---> 22995 +22806 ---> 22996 +22807 ---> 22997 +22808 ---> 22998 +22809 ---> 22999 +22811 ---> 23000 +22812 ---> 23001 +22813 ---> 23002 +22814 ---> 23003 +22818 ---> 23004 +22819 ---> 23005 +22820 ---> 23006 +22826 ---> 23007 +22831 ---> 23008 +22837 ---> 23009 +22843 ---> 23010 +22844 ---> 23011 +22845 ---> 23012 +22847 ---> 23013 +22848 ---> 23014 +22849 ---> 23015 +22850 ---> 23016 +22851 ---> 23017 +22853 ---> 23018 +22854 ---> 23019 +22855 ---> 23020 +22857 ---> 23021 +22865 ---> 23022 +22866 ---> 23023 +22870 ---> 23024 +22871 ---> 23025 +22876 ---> 23026 +22877 ---> 23027 +22879 ---> 23028 +22880 ---> 23029 +22882 ---> 23030 +22885 ---> 23031 +22890 ---> 23032 +22891 ---> 23033 +22900 ---> 23034 +22901 ---> 23035 +22902 ---> 23036 +22903 ---> 23037 +22904 ---> 23038 +22909 ---> 23039 +22910 ---> 23040 +22911 ---> 23041 +22915 ---> 23042 +22917 ---> 23043 +22922 ---> 23044 +22923 ---> 23045 +22924 ---> 23046 +22925 ---> 23047 +22929 ---> 23048 +22931 ---> 23049 +22932 ---> 23050 +22933 ---> 23051 +22934 ---> 23052 +22935 ---> 23053 +22936 ---> 23054 +22937 ---> 23055 +22938 ---> 23056 +22940 ---> 23057 +22949 ---> 23058 +22952 ---> 23059 +22953 ---> 23060 +22956 ---> 23061 +22957 ---> 23062 +22959 ---> 23063 +22964 ---> 23064 +22965 ---> 23065 +22966 ---> 23066 +22968 ---> 23067 +22972 ---> 23068 +22974 ---> 23069 +22979 ---> 23070 +22986 ---> 23071 +22991 ---> 23072 +22992 ---> 23073 +22996 ---> 23074 +22997 ---> 23075 +23000 ---> 23076 +23001 ---> 23077 +23002 ---> 23078 +23003 ---> 23079 +23005 ---> 23080 +23006 ---> 23081 +23007 ---> 23082 +23009 ---> 23083 +23012 ---> 23084 +23014 ---> 23085 +23019 ---> 23086 +23020 ---> 23087 +23022 ---> 23088 +23023 ---> 23089 +23024 ---> 23090 +23027 ---> 23091 +23033 ---> 23092 +23037 ---> 23093 +23038 ---> 23094 +23039 ---> 23095 +23040 ---> 23096 +23051 ---> 23097 +23054 ---> 23098 +23056 ---> 23099 +23057 ---> 23100 +23063 ---> 23101 +23066 ---> 23102 +23068 ---> 23103 +23072 ---> 23104 +23073 ---> 23105 +23074 ---> 23106 +23077 ---> 23107 +23080 ---> 23108 +23085 ---> 23109 +23086 ---> 23110 +23095 ---> 23111 +23096 ---> 23112 +23097 ---> 23113 +23098 ---> 23114 +23099 ---> 23115 +23100 ---> 23116 +23102 ---> 23117 +23108 ---> 23118 +23116 ---> 23119 +23119 ---> 23120 +23121 ---> 23121 +23122 ---> 23122 +23123 ---> 23123 +23125 ---> 23124 +23127 ---> 23125 +23128 ---> 23126 +23129 ---> 23127 +23130 ---> 23128 +23131 ---> 23129 +23132 ---> 23130 +23134 ---> 23131 +23135 ---> 23132 +23136 ---> 23133 +23137 ---> 23134 +23138 ---> 23135 +23139 ---> 23136 +23140 ---> 23137 +23141 ---> 23138 +23142 ---> 23139 +23143 ---> 23140 +23144 ---> 23141 +23145 ---> 23142 +23146 ---> 23143 +23147 ---> 23144 +23148 ---> 23145 +23149 ---> 23146 +23150 ---> 23147 +23151 ---> 23148 +23152 ---> 23149 +23153 ---> 23150 +23154 ---> 23151 +23156 ---> 23152 +23159 ---> 23153 +23165 ---> 23154 +23166 ---> 23155 +23169 ---> 23156 +23177 ---> 23157 +23178 ---> 23158 +23193 ---> 23159 +23197 ---> 23160 +23201 ---> 23161 +23202 ---> 23162 +23204 ---> 23163 +23206 ---> 23164 +23207 ---> 23165 +23208 ---> 23166 +23209 ---> 23167 +23211 ---> 23168 +23213 ---> 23169 +23217 ---> 23170 +23220 ---> 23171 +23221 ---> 23172 +23227 ---> 23173 +23229 ---> 23174 +23230 ---> 23175 +23231 ---> 23176 +23233 ---> 23177 +23234 ---> 23178 +23240 ---> 23179 +23244 ---> 23180 +23245 ---> 23181 +23246 ---> 23182 +23250 ---> 23183 +23255 ---> 23184 +23260 ---> 23185 +23262 ---> 23186 +23264 ---> 23187 +23270 ---> 23188 +23273 ---> 23189 +23279 ---> 23190 +23280 ---> 23191 +23282 ---> 23192 +23283 ---> 23193 +23291 ---> 23194 +23294 ---> 23195 +23296 ---> 23196 +23297 ---> 23197 +23298 ---> 23198 +23299 ---> 23199 +23300 ---> 23200 +23304 ---> 23201 +23305 ---> 23202 +23306 ---> 23203 +23307 ---> 23204 +23308 ---> 23205 +23311 ---> 23206 +23312 ---> 23207 +23313 ---> 23208 +23317 ---> 23209 +23319 ---> 23210 +23320 ---> 23211 +23322 ---> 23212 +23327 ---> 23213 +23328 ---> 23214 +23330 ---> 23215 +23331 ---> 23216 +23332 ---> 23217 +23334 ---> 23218 +23336 ---> 23219 +23340 ---> 23220 +23341 ---> 23221 +23343 ---> 23222 +23344 ---> 23223 +23347 ---> 23224 +23351 ---> 23225 +23353 ---> 23226 +23354 ---> 23227 +23355 ---> 23228 +23358 ---> 23229 +23360 ---> 23230 +23362 ---> 23231 +23363 ---> 23232 +23364 ---> 23233 +23372 ---> 23234 +23373 ---> 23235 +23374 ---> 23236 +23375 ---> 23237 +23376 ---> 23238 +23377 ---> 23239 +23379 ---> 23240 +23381 ---> 23241 +23382 ---> 23242 +23383 ---> 23243 +23385 ---> 23244 +23386 ---> 23245 +23387 ---> 23246 +23388 ---> 23247 +23389 ---> 23248 +23390 ---> 23249 +23393 ---> 23250 +23394 ---> 23251 +23395 ---> 23252 +23398 ---> 23253 +23399 ---> 23254 +23401 ---> 23255 +23404 ---> 23256 +23405 ---> 23257 +23406 ---> 23258 +23407 ---> 23259 +23411 ---> 23260 +23415 ---> 23261 +23416 ---> 23262 +23419 ---> 23263 +23422 ---> 23264 +23423 ---> 23265 +23425 ---> 23266 +23426 ---> 23267 +23427 ---> 23268 +23428 ---> 23269 +23429 ---> 23270 +23430 ---> 23271 +23431 ---> 23272 +23432 ---> 23273 +23433 ---> 23274 +23434 ---> 23275 +23435 ---> 23276 +23436 ---> 23277 +23438 ---> 23278 +23439 ---> 23279 +23440 ---> 1551 +23441 ---> 23280 +23443 ---> 23281 +23444 ---> 23282 +23448 ---> 23283 +23449 ---> 23284 +23455 ---> 23285 +23456 ---> 23286 +23460 ---> 23287 +23461 ---> 23288 +23463 ---> 23289 +23464 ---> 23290 +23468 ---> 23291 +23469 ---> 23292 +23470 ---> 23293 +23471 ---> 23294 +23473 ---> 23295 +23476 ---> 23296 +23483 ---> 23297 +23484 ---> 23298 +23485 ---> 23299 +23487 ---> 23300 +23496 ---> 23301 +23498 ---> 23302 +23499 ---> 23303 +23500 ---> 23304 +23501 ---> 23305 +23502 ---> 23306 +23503 ---> 23307 +23504 ---> 23308 +23505 ---> 23309 +23506 ---> 23310 +23515 ---> 23311 +23516 ---> 23312 +23517 ---> 23313 +23518 ---> 23314 +23519 ---> 23315 +23520 ---> 23316 +23524 ---> 23317 +23533 ---> 23318 +23534 ---> 23319 +23535 ---> 23320 +23542 ---> 23321 +23544 ---> 23322 +23545 ---> 23323 +23546 ---> 23324 +23547 ---> 23325 +23548 ---> 23326 +23549 ---> 23327 +23551 ---> 23328 +23556 ---> 23329 +23560 ---> 23330 +23561 ---> 23331 +23568 ---> 23332 +23570 ---> 23333 +23573 ---> 23334 +23574 ---> 23335 +23575 ---> 23336 +23578 ---> 23337 +23579 ---> 23338 +23582 ---> 23339 +23583 ---> 23340 +23584 ---> 23341 +23585 ---> 23342 +23586 ---> 23343 +23587 ---> 23344 +23588 ---> 23345 +23590 ---> 23346 +23592 ---> 23347 +23595 ---> 23348 +23597 ---> 23349 +23598 ---> 23350 +23599 ---> 23351 +23600 ---> 23352 +23602 ---> 23353 +23604 ---> 23354 +23605 ---> 23355 +23607 ---> 23356 +23608 ---> 23357 +23609 ---> 23358 +23614 ---> 23359 +23616 ---> 23360 +23618 ---> 23361 +23626 ---> 23362 +23627 ---> 23363 +23628 ---> 23364 +23629 ---> 23365 +23630 ---> 23366 +23631 ---> 23367 +23639 ---> 23368 +23641 ---> 23369 +23642 ---> 23370 +23643 ---> 23371 +23645 ---> 23372 +23646 ---> 23373 +23647 ---> 23374 +23650 ---> 23375 +23654 ---> 23376 +23656 ---> 23377 +23657 ---> 23378 +23660 ---> 23379 +23661 ---> 23380 +23665 ---> 23381 +23667 ---> 23382 +23671 ---> 23383 +23672 ---> 23384 +23676 ---> 23385 +23677 ---> 23386 +23678 ---> 23387 +23679 ---> 23388 +23680 ---> 23389 +23681 ---> 23390 +23686 ---> 23391 +23688 ---> 23392 +23689 ---> 23393 +23690 ---> 23394 +23691 ---> 23395 +23699 ---> 23396 +23700 ---> 23397 +23702 ---> 23398 +23703 ---> 23399 +23704 ---> 23400 +23706 ---> 23401 +23707 ---> 23402 +23708 ---> 23403 +23710 ---> 23404 +23716 ---> 23405 +23717 ---> 23406 +23725 ---> 23407 +23726 ---> 23408 +23731 ---> 23409 +23733 ---> 23410 +23734 ---> 23411 +23737 ---> 23412 +23738 ---> 23413 +23739 ---> 23414 +23741 ---> 23415 +23742 ---> 23416 +23743 ---> 23417 +23745 ---> 23418 +23748 ---> 23419 +23749 ---> 23420 +23756 ---> 23421 +23759 ---> 23422 +23760 ---> 23423 +23762 ---> 23424 +23763 ---> 23425 +23764 ---> 23426 +23765 ---> 23427 +23766 ---> 23428 +23767 ---> 23429 +23768 ---> 23430 +23769 ---> 23431 +23770 ---> 23432 +23771 ---> 1477 +23774 ---> 23433 +23777 ---> 23434 +23778 ---> 23435 +23779 ---> 23436 +23780 ---> 23437 +23782 ---> 23438 +23783 ---> 23439 +23785 ---> 23440 +23788 ---> 23441 +23789 ---> 23442 +23790 ---> 23443 +23792 ---> 23444 +23795 ---> 23445 +23796 ---> 23446 +23799 ---> 23447 +23800 ---> 23448 +23804 ---> 23449 +23806 ---> 23450 +23807 ---> 23451 +23809 ---> 23452 +23810 ---> 23453 +23811 ---> 23454 +23812 ---> 23455 +23815 ---> 23456 +23822 ---> 23457 +23824 ---> 23458 +23825 ---> 23459 +23827 ---> 23460 +23828 ---> 23461 +23830 ---> 23462 +23833 ---> 23463 +23835 ---> 23464 +23837 ---> 23465 +23843 ---> 23466 +23844 ---> 23467 +23845 ---> 23468 +23846 ---> 23469 +23847 ---> 23470 +23848 ---> 23471 +23850 ---> 23472 +23852 ---> 23473 +23853 ---> 23474 +23854 ---> 23475 +23855 ---> 23476 +23856 ---> 23477 +23857 ---> 23478 +23859 ---> 23479 +23862 ---> 23480 +23863 ---> 23481 +23864 ---> 23482 +23870 ---> 23483 +23871 ---> 23484 +23873 ---> 23485 +23874 ---> 23486 +23875 ---> 23487 +23876 ---> 23488 +23877 ---> 23489 +23878 ---> 23490 +23879 ---> 23491 +23881 ---> 23492 +23883 ---> 23493 +23884 ---> 23494 +23886 ---> 23495 +23887 ---> 23496 +23889 ---> 23497 +23898 ---> 23498 +23899 ---> 23499 +23906 ---> 23500 +23907 ---> 23501 +23912 ---> 23502 +23913 ---> 23503 +23916 ---> 23504 +23917 ---> 23505 +23919 ---> 23506 +23922 ---> 23507 +23923 ---> 23508 +23925 ---> 23509 +23927 ---> 23510 +23928 ---> 23511 +23929 ---> 23512 +23937 ---> 23513 +23938 ---> 23514 +23943 ---> 23515 +23948 ---> 23516 +23952 ---> 23517 +23953 ---> 23518 +23954 ---> 23519 +23960 ---> 23520 +23968 ---> 23521 +23969 ---> 23522 +23970 ---> 23523 +23971 ---> 23524 +23972 ---> 23525 +23974 ---> 23526 +23981 ---> 23527 +23985 ---> 23528 +23988 ---> 23529 +23989 ---> 23530 +23990 ---> 23531 +23992 ---> 23532 +23994 ---> 23533 +23996 ---> 23534 +23997 ---> 23535 +23999 ---> 23536 +24000 ---> 23537 +24001 ---> 23538 +24002 ---> 23539 +24004 ---> 23540 +24008 ---> 23541 +24012 ---> 23542 +24013 ---> 23543 +24018 ---> 23544 +24022 ---> 23545 +24026 ---> 23546 +24028 ---> 23547 +24029 ---> 23548 +24031 ---> 23549 +24033 ---> 23550 +24036 ---> 23551 +24038 ---> 23552 +24039 ---> 23553 +24040 ---> 23554 +24041 ---> 23555 +24043 ---> 23556 +24046 ---> 23557 +24048 ---> 23558 +24049 ---> 23559 +24057 ---> 23560 +24062 ---> 23561 +24063 ---> 23562 +24064 ---> 23563 +24065 ---> 23564 +24066 ---> 23565 +24067 ---> 23566 +24068 ---> 23567 +24070 ---> 23568 +24072 ---> 23569 +24073 ---> 23570 +24074 ---> 23571 +24081 ---> 23572 +24083 ---> 23573 +24085 ---> 23574 +24089 ---> 23575 +24090 ---> 23576 +24092 ---> 23577 +24093 ---> 23578 +24095 ---> 23579 +24103 ---> 23580 +24104 ---> 23581 +24105 ---> 23582 +24108 ---> 23583 +24110 ---> 23584 +24112 ---> 23585 +24114 ---> 23586 +24115 ---> 23587 +24117 ---> 23588 +24118 ---> 23589 +24120 ---> 23590 +24124 ---> 23591 +24126 ---> 23592 +24133 ---> 23593 +24135 ---> 23594 +24136 ---> 23595 +24137 ---> 23596 +24138 ---> 23597 +24139 ---> 23598 +24142 ---> 23599 +24143 ---> 23600 +24144 ---> 23601 +24145 ---> 23602 +24148 ---> 23603 +24153 ---> 23604 +24156 ---> 23605 +24159 ---> 23606 +24160 ---> 23607 +24161 ---> 23608 +24162 ---> 23609 +24165 ---> 23610 +24167 ---> 23611 +24169 ---> 23612 +24174 ---> 23613 +24175 ---> 23614 +24179 ---> 23615 +24180 ---> 23616 +24182 ---> 23617 +24185 ---> 23618 +24186 ---> 23619 +24189 ---> 23620 +24190 ---> 23621 +24191 ---> 23622 +24192 ---> 23623 +24193 ---> 23624 +24196 ---> 23625 +24200 ---> 23626 +24205 ---> 23627 +24206 ---> 23628 +24209 ---> 23629 +24210 ---> 23630 +24211 ---> 23631 +24213 ---> 23632 +24217 ---> 23633 +24220 ---> 23634 +24225 ---> 23635 +24226 ---> 23636 +24227 ---> 23637 +24228 ---> 23638 +24229 ---> 23639 +24232 ---> 23640 +24233 ---> 23641 +24240 ---> 23642 +24242 ---> 23643 +24246 ---> 23644 +24249 ---> 23645 +24250 ---> 23646 +24251 ---> 23647 +24253 ---> 23648 +24254 ---> 23649 +24255 ---> 23650 +24256 ---> 23651 +24257 ---> 23652 +24259 ---> 23653 +24264 ---> 23654 +24265 ---> 23655 +24268 ---> 23656 +24271 ---> 23657 +24272 ---> 23658 +24273 ---> 23659 +24274 ---> 23660 +24275 ---> 23661 +24276 ---> 23662 +24277 ---> 23663 +24278 ---> 23664 +24280 ---> 23665 +24281 ---> 23666 +24282 ---> 23667 +24292 ---> 23668 +24293 ---> 23669 +24296 ---> 23670 +24298 ---> 23671 +24299 ---> 23672 +24303 ---> 23673 +24304 ---> 23674 +24308 ---> 23675 +24309 ---> 23676 +24312 ---> 23677 +24317 ---> 23678 +24318 ---> 23679 +24320 ---> 23680 +24327 ---> 23681 +24332 ---> 23682 +24333 ---> 23683 +24334 ---> 23684 +24336 ---> 23685 +24337 ---> 23686 +24339 ---> 23687 +24343 ---> 23688 +24346 ---> 23689 +24353 ---> 23690 +24354 ---> 23691 +24355 ---> 1488 +24356 ---> 23692 +24357 ---> 23693 +24358 ---> 23694 +24359 ---> 23695 +24360 ---> 23696 +24361 ---> 23697 +24363 ---> 23698 +24364 ---> 23699 +24365 ---> 23700 +24366 ---> 23701 +24368 ---> 23702 +24370 ---> 23703 +24371 ---> 23704 +24372 ---> 23705 +24373 ---> 23706 +24374 ---> 23707 +24375 ---> 23708 +24376 ---> 23709 +24377 ---> 23710 +24379 ---> 23711 +24380 ---> 23712 +24384 ---> 23713 +24386 ---> 23714 +24387 ---> 23715 +24390 ---> 23716 +24394 ---> 23717 +24395 ---> 23718 +24399 ---> 23719 +24402 ---> 23720 +24403 ---> 23721 +24404 ---> 23722 +24407 ---> 23723 +24408 ---> 23724 +24409 ---> 23725 +24410 ---> 23726 +24416 ---> 23727 +24417 ---> 23728 +24420 ---> 23729 +24421 ---> 23730 +24422 ---> 23731 +24424 ---> 23732 +24425 ---> 23733 +24426 ---> 23734 +24429 ---> 23735 +24430 ---> 23736 +24435 ---> 23737 +24439 ---> 23738 +24440 ---> 23739 +24441 ---> 23740 +24442 ---> 23741 +24443 ---> 23742 +24444 ---> 23743 +24445 ---> 23744 +24446 ---> 23745 +24447 ---> 23746 +24449 ---> 23747 +24452 ---> 23748 +24454 ---> 23749 +24457 ---> 23750 +24462 ---> 23751 +24466 ---> 23752 +24468 ---> 23753 +24472 ---> 23754 +24473 ---> 23755 +24475 ---> 23756 +24477 ---> 23757 +24478 ---> 23758 +24480 ---> 23759 +24481 ---> 23760 +24482 ---> 23761 +24483 ---> 23762 +24484 ---> 23763 +24485 ---> 23764 +24486 ---> 23765 +24487 ---> 23766 +24488 ---> 23767 +24495 ---> 23768 +24496 ---> 23769 +24499 ---> 23770 +24501 ---> 23771 +24502 ---> 23772 +24504 ---> 23773 +24505 ---> 23774 +24507 ---> 23775 +24508 ---> 23776 +24509 ---> 23777 +24510 ---> 23778 +24514 ---> 23779 +24516 ---> 23780 +24517 ---> 23781 +24522 ---> 23782 +24524 ---> 23783 +24525 ---> 23784 +24537 ---> 23785 +24538 ---> 23786 +24539 ---> 23787 +24540 ---> 23788 +24541 ---> 23789 +24542 ---> 23790 +24543 ---> 23791 +24547 ---> 23792 +24548 ---> 23793 +24550 ---> 23794 +24551 ---> 23795 +24552 ---> 23796 +24553 ---> 23797 +24554 ---> 23798 +24555 ---> 23799 +24557 ---> 23801 +24559 ---> 23802 +24562 ---> 23803 +24563 ---> 23804 +24564 ---> 23805 +24566 ---> 23806 +24567 ---> 23807 +24568 ---> 23808 +24571 ---> 23809 +24572 ---> 23810 +24574 ---> 23811 +24575 ---> 23812 +24577 ---> 23813 +24580 ---> 23814 +24582 ---> 23815 +24585 ---> 23816 +24587 ---> 23817 +24588 ---> 23818 +24591 ---> 23819 +24593 ---> 23820 +24594 ---> 23821 +24597 ---> 23822 +24598 ---> 23823 +24599 ---> 23824 +24600 ---> 23825 +24601 ---> 23826 +24602 ---> 23827 +24603 ---> 23828 +24604 ---> 23829 +24606 ---> 23830 +24607 ---> 23831 +24608 ---> 23832 +24610 ---> 23833 +24614 ---> 23834 +24617 ---> 23835 +24618 ---> 23836 +24627 ---> 23837 +24628 ---> 23838 +24630 ---> 23839 +24634 ---> 23840 +24635 ---> 23841 +24637 ---> 23842 +24638 ---> 23843 +24641 ---> 23844 +24646 ---> 23845 +24648 ---> 23846 +24650 ---> 23847 +24652 ---> 23848 +24653 ---> 23849 +24654 ---> 23850 +24657 ---> 23851 +24658 ---> 23852 +24660 ---> 23853 +24661 ---> 23854 +24662 ---> 23855 +24663 ---> 23856 +24665 ---> 23857 +24666 ---> 23858 +24667 ---> 23859 +24668 ---> 23860 +24669 ---> 23861 +24670 ---> 23862 +24672 ---> 23863 +24675 ---> 23864 +24677 ---> 23865 +24678 ---> 23866 +24679 ---> 23867 +24680 ---> 23868 +24681 ---> 23869 +24683 ---> 23870 +24685 ---> 23871 +24688 ---> 23872 +24690 ---> 23873 +24694 ---> 23874 +24698 ---> 23875 +24703 ---> 23876 +24704 ---> 23877 +24705 ---> 23878 +24707 ---> 23879 +24709 ---> 23880 +24712 ---> 23881 +24713 ---> 23882 +24715 ---> 23883 +24716 ---> 23884 +24718 ---> 23885 +24721 ---> 23886 +24722 ---> 23887 +24726 ---> 23888 +24728 ---> 23889 +24738 ---> 23890 +24739 ---> 23891 +24740 ---> 23892 +24741 ---> 23893 +24742 ---> 23894 +24746 ---> 23895 +24747 ---> 23896 +24748 ---> 23897 +24750 ---> 23898 +24753 ---> 23899 +24754 ---> 23900 +24755 ---> 23901 +24759 ---> 23902 +24761 ---> 23903 +24763 ---> 23904 +24766 ---> 23905 +24767 ---> 23906 +24768 ---> 23907 +24769 ---> 23908 +24770 ---> 23909 +24773 ---> 23910 +24774 ---> 23911 +24775 ---> 23912 +24776 ---> 23913 +24778 ---> 23914 +24786 ---> 23915 +24787 ---> 23916 +24788 ---> 23917 +24790 ---> 23918 +24794 ---> 23919 +24795 ---> 23920 +24796 ---> 23921 +24797 ---> 23922 +24802 ---> 23923 +24804 ---> 23924 +24805 ---> 23925 +24806 ---> 23926 +24807 ---> 23927 +24817 ---> 23928 +24818 ---> 23929 +24819 ---> 23930 +24821 ---> 23931 +24822 ---> 23932 +24823 ---> 23933 +24824 ---> 23934 +24825 ---> 23935 +24826 ---> 23936 +24829 ---> 23937 +24832 ---> 23938 +24835 ---> 23939 +24837 ---> 23940 +24839 ---> 23941 +24840 ---> 23942 +24842 ---> 23943 +24843 ---> 23944 +24847 ---> 23945 +24848 ---> 23946 +24850 ---> 23947 +24852 ---> 23948 +24853 ---> 23949 +24854 ---> 23950 +24856 ---> 23951 +24858 ---> 23952 +24860 ---> 23953 +24861 ---> 23954 +24862 ---> 23955 +24865 ---> 23956 +24866 ---> 23957 +24869 ---> 23958 +24871 ---> 23959 +24874 ---> 23960 +24875 ---> 23961 +24877 ---> 23962 +24880 ---> 23963 +24886 ---> 23964 +24891 ---> 23965 +24892 ---> 23966 +24894 ---> 23967 +24895 ---> 1489 +24897 ---> 23968 +24900 ---> 23969 +24901 ---> 23970 +24902 ---> 23971 +24903 ---> 23972 +24907 ---> 23973 +24909 ---> 23974 +24910 ---> 23975 +24912 ---> 23976 +24913 ---> 23977 +24914 ---> 23978 +24915 ---> 23979 +24916 ---> 23980 +24918 ---> 23981 +24919 ---> 23982 +24920 ---> 23983 +24928 ---> 23984 +24931 ---> 23985 +24938 ---> 23986 +24940 ---> 23987 +24941 ---> 23988 +24942 ---> 23989 +24943 ---> 23990 +24946 ---> 23991 +24947 ---> 23992 +24948 ---> 23993 +24949 ---> 23994 +24950 ---> 23995 +24951 ---> 23996 +24952 ---> 23997 +24953 ---> 23998 +24954 ---> 23999 +24960 ---> 24000 +24961 ---> 24001 +24963 ---> 24002 +24968 ---> 24003 +24969 ---> 24004 +24970 ---> 24005 +24971 ---> 24006 +24973 ---> 24007 +24974 ---> 24008 +24977 ---> 24009 +24978 ---> 24010 +24981 ---> 24011 +24985 ---> 24012 +24986 ---> 24013 +24987 ---> 24014 +24990 ---> 24015 +24993 ---> 24016 +24994 ---> 24017 +24998 ---> 24018 +25002 ---> 24019 +25005 ---> 24020 +25008 ---> 24021 +25011 ---> 24022 +25012 ---> 24023 +25015 ---> 24024 +25016 ---> 24025 +25018 ---> 24026 +25019 ---> 24027 +25020 ---> 24028 +25021 ---> 24029 +25022 ---> 24030 +25023 ---> 24031 +25024 ---> 24032 +25025 ---> 24033 +25026 ---> 24034 +25027 ---> 24035 +25029 ---> 24036 +25033 ---> 24037 +25034 ---> 24038 +25036 ---> 801 +25037 ---> 24039 +25039 ---> 24040 +25040 ---> 24041 +25043 ---> 24042 +25046 ---> 24043 +25050 ---> 24044 +25053 ---> 24045 +25056 ---> 24046 +25058 ---> 24047 +25060 ---> 24048 +25062 ---> 24049 +25063 ---> 24050 +25064 ---> 24051 +25066 ---> 24052 +25067 ---> 24053 +25069 ---> 24054 +25070 ---> 24055 +25072 ---> 24056 +25077 ---> 24057 +25079 ---> 24058 +25080 ---> 24059 +25081 ---> 24060 +25082 ---> 24061 +25083 ---> 24062 +25084 ---> 24063 +25085 ---> 24064 +25088 ---> 24065 +25089 ---> 24066 +25093 ---> 24067 +25094 ---> 24068 +25099 ---> 24069 +25102 ---> 24070 +25105 ---> 24071 +25107 ---> 24072 +25110 ---> 24073 +25111 ---> 24074 +25114 ---> 24075 +25115 ---> 24076 +25116 ---> 24078 +25117 ---> 24079 +25121 ---> 24080 +25122 ---> 24081 +25123 ---> 24082 +25127 ---> 24083 +25128 ---> 24084 +25129 ---> 24085 +25133 ---> 24086 +25135 ---> 24087 +25145 ---> 24088 +25148 ---> 24089 +25149 ---> 24090 +25150 ---> 24091 +25153 ---> 24092 +25154 ---> 24093 +25156 ---> 24094 +25157 ---> 24095 +25159 ---> 24096 +25161 ---> 24097 +25162 ---> 24098 +25163 ---> 24099 +25168 ---> 24100 +25171 ---> 24102 +25172 ---> 24103 +25176 ---> 24104 +25177 ---> 24105 +25180 ---> 24106 +25182 ---> 24107 +25184 ---> 24108 +25188 ---> 24109 +25189 ---> 24110 +25190 ---> 24111 +25193 ---> 24112 +25194 ---> 24113 +25201 ---> 24114 +25205 ---> 24115 +25206 ---> 24116 +25210 ---> 24117 +25212 ---> 24118 +25213 ---> 24119 +25220 ---> 24120 +25222 ---> 24121 +25223 ---> 24122 +25224 ---> 24123 +25225 ---> 24124 +25228 ---> 24125 +25229 ---> 24126 +25230 ---> 24127 +25232 ---> 24128 +25234 ---> 24129 +25236 ---> 24130 +25240 ---> 24131 +25242 ---> 24132 +25245 ---> 24133 +25248 ---> 24134 +25249 ---> 24135 +25251 ---> 24136 +25252 ---> 24137 +25253 ---> 24138 +25254 ---> 24139 +25255 ---> 24140 +25258 ---> 24141 +25259 ---> 24142 +25260 ---> 24143 +25263 ---> 24144 +25264 ---> 24145 +25267 ---> 24146 +25268 ---> 24147 +25269 ---> 24148 +25273 ---> 24149 +25287 ---> 24150 +25289 ---> 24151 +25290 ---> 1478 +25291 ---> 24152 +25293 ---> 24153 +25294 ---> 24154 +25295 ---> 907 +25298 ---> 24155 +25299 ---> 24156 +25301 ---> 24157 +25302 ---> 24158 +25303 ---> 24159 +25306 ---> 24160 +25310 ---> 24161 +25311 ---> 24162 +25313 ---> 24163 +25320 ---> 24164 +25328 ---> 24165 +25330 ---> 24166 +25333 ---> 24167 +25334 ---> 24168 +25335 ---> 24169 +25336 ---> 24170 +25337 ---> 24171 +25338 ---> 24172 +25340 ---> 24173 +25344 ---> 24174 +25346 ---> 24175 +25349 ---> 24176 +25354 ---> 24177 +25355 ---> 24178 +25359 ---> 24179 +25363 ---> 24180 +25364 ---> 24181 +25367 ---> 24182 +25369 ---> 24183 +25371 ---> 24184 +25372 ---> 24185 +25373 ---> 24186 +25374 ---> 24187 +25375 ---> 24188 +25376 ---> 24189 +25378 ---> 24190 +25379 ---> 24191 +25380 ---> 24192 +25381 ---> 24193 +25382 ---> 24194 +25383 ---> 24195 +25384 ---> 799 +25385 ---> 24196 +25386 ---> 24197 +25387 ---> 24198 +25393 ---> 24199 +25396 ---> 24200 +25400 ---> 24201 +25403 ---> 24202 +25404 ---> 24203 +25405 ---> 24204 +25408 ---> 24205 +25409 ---> 24206 +25412 ---> 24207 +25413 ---> 24208 +25415 ---> 24209 +25419 ---> 24210 +25425 ---> 24211 +25427 ---> 24212 +25428 ---> 24213 +25429 ---> 24214 +25432 ---> 24215 +25434 ---> 24216 +25439 ---> 24217 +25440 ---> 24218 +25441 ---> 24219 +25442 ---> 24220 +25443 ---> 24221 +25449 ---> 24222 +25450 ---> 24223 +25452 ---> 24224 +25453 ---> 24225 +25456 ---> 24226 +25459 ---> 24227 +25461 ---> 24228 +25463 ---> 24229 +25467 ---> 24230 +25469 ---> 24231 +25470 ---> 24232 +25477 ---> 24233 +25480 ---> 24234 +25483 ---> 24235 +25489 ---> 24236 +25495 ---> 24237 +25496 ---> 24238 +25497 ---> 24239 +25498 ---> 24240 +25499 ---> 24241 +25500 ---> 24242 +25503 ---> 24243 +25505 ---> 24244 +25506 ---> 24245 +25507 ---> 24246 +25512 ---> 24247 +25513 ---> 24248 +25515 ---> 24249 +25516 ---> 24250 +25517 ---> 24251 +25519 ---> 24252 +25520 ---> 24253 +25521 ---> 24254 +25525 ---> 24255 +25526 ---> 24256 +25527 ---> 24257 +25529 ---> 24258 +25530 ---> 24259 +25531 ---> 24260 +25533 ---> 24261 +25535 ---> 24262 +25536 ---> 24263 +25539 ---> 24264 +25541 ---> 24265 +25548 ---> 24266 +25550 ---> 24267 +25554 ---> 24268 +25555 ---> 24269 +25561 ---> 24270 +25569 ---> 24271 +25570 ---> 24272 +25572 ---> 24273 +25574 ---> 919 +25575 ---> 24274 +25580 ---> 24275 +25581 ---> 24276 +25582 ---> 24277 +25585 ---> 24278 +25588 ---> 24279 +25591 ---> 24280 +25595 ---> 24281 +25596 ---> 24282 +25597 ---> 24283 +25598 ---> 24284 +25599 ---> 24285 +25600 ---> 24286 +25601 ---> 24287 +25602 ---> 24288 +25603 ---> 24289 +25605 ---> 24290 +25607 ---> 24291 +25608 ---> 24292 +25609 ---> 24293 +25610 ---> 24294 +25613 ---> 24295 +25614 ---> 24296 +25615 ---> 24297 +25616 ---> 24298 +25617 ---> 24299 +25619 ---> 24300 +25620 ---> 24301 +25629 ---> 24302 +25631 ---> 24303 +25632 ---> 24304 +25633 ---> 24305 +25634 ---> 24306 +25635 ---> 24307 +25636 ---> 24308 +25638 ---> 24309 +25639 ---> 24310 +25640 ---> 24311 +25647 ---> 24312 +25648 ---> 24313 +25650 ---> 24314 +25651 ---> 24315 +25652 ---> 24316 +25653 ---> 24317 +25654 ---> 24318 +25655 ---> 24319 +25657 ---> 24320 +25659 ---> 24321 +25660 ---> 24322 +25661 ---> 24323 +25662 ---> 24324 +25663 ---> 24325 +25664 ---> 24326 +25665 ---> 24327 +25666 ---> 24328 +25669 ---> 24329 +25671 ---> 24330 +25672 ---> 24331 +25673 ---> 24332 +25674 ---> 24333 +25675 ---> 24334 +25676 ---> 24335 +25677 ---> 24336 +25682 ---> 24337 +25684 ---> 24338 +25690 ---> 24339 +25699 ---> 24340 +25701 ---> 24341 +25702 ---> 936 +25704 ---> 24342 +25705 ---> 24343 +25706 ---> 24344 +25707 ---> 24345 +25712 ---> 24346 +25717 ---> 24347 +25718 ---> 24348 +25719 ---> 24349 +25720 ---> 24350 +25721 ---> 24351 +25722 ---> 24352 +25723 ---> 24353 +25725 ---> 24354 +25726 ---> 24355 +25727 ---> 24356 +25729 ---> 24357 +25730 ---> 24358 +25731 ---> 1490 +25732 ---> 24359 +25733 ---> 24360 +25734 ---> 24361 +25739 ---> 24362 +25741 ---> 24363 +25742 ---> 24364 +25745 ---> 24365 +25746 ---> 24366 +27386 ---> 25157 +27390 ---> 25158 +27391 ---> 25159 +27392 ---> 25160 +27393 ---> 25161 +27396 ---> 25162 +27400 ---> 25163 +27401 ---> 25164 +27402 ---> 25165 +27403 ---> 25166 +27405 ---> 25167 +27406 ---> 25168 +27409 ---> 25169 +27412 ---> 25170 +27416 ---> 25171 +27417 ---> 25172 +27418 ---> 25173 +27422 ---> 25174 +27426 ---> 25175 +27431 ---> 25176 +27433 ---> 25177 +27434 ---> 25178 +27435 ---> 25179 +27440 ---> 25180 +27442 ---> 25181 +27445 ---> 25182 +27446 ---> 25183 +27447 ---> 25184 +27448 ---> 25185 +27450 ---> 25186 +27451 ---> 25187 +27453 ---> 2364 +27456 ---> 25188 +27458 ---> 25189 +27459 ---> 25190 +27460 ---> 25191 +27462 ---> 25192 +27464 ---> 25193 +27465 ---> 25194 +27466 ---> 25195 +27467 ---> 25196 +27468 ---> 25197 +27469 ---> 25198 +27471 ---> 25199 +27477 ---> 25200 +27481 ---> 25201 +27482 ---> 25202 +27483 ---> 25203 +27484 ---> 25204 +27485 ---> 25205 +27486 ---> 25206 +27487 ---> 25207 +27488 ---> 25208 +27492 ---> 25209 +27495 ---> 25210 +27496 ---> 25211 +27498 ---> 25212 +27500 ---> 25213 +27503 ---> 25214 +27504 ---> 25215 +27505 ---> 25216 +27506 ---> 25217 +27508 ---> 25218 +27510 ---> 25219 +27512 ---> 25220 +27513 ---> 25221 +27516 ---> 25222 +27517 ---> 25223 +27518 ---> 25224 +27519 ---> 25225 +27520 ---> 25226 +27521 ---> 25227 +27526 ---> 25228 +27527 ---> 25229 +27528 ---> 25230 +27529 ---> 25231 +27534 ---> 25232 +27537 ---> 25233 +27542 ---> 25234 +27543 ---> 25235 +27544 ---> 25236 +27546 ---> 25237 +27547 ---> 25238 +27548 ---> 25239 +27549 ---> 25240 +27550 ---> 25241 +27552 ---> 25242 +27554 ---> 25243 +27560 ---> 25244 +27561 ---> 25245 +27564 ---> 25246 +27565 ---> 25247 +27566 ---> 25248 +27571 ---> 25249 +27574 ---> 25250 +27577 ---> 25251 +27578 ---> 25252 +27580 ---> 25253 +27587 ---> 25254 +27588 ---> 25255 +27590 ---> 25256 +27592 ---> 25257 +27593 ---> 25258 +27594 ---> 25259 +27597 ---> 25260 +27603 ---> 25261 +27604 ---> 25262 +27605 ---> 25263 +27606 ---> 25264 +27607 ---> 25265 +27610 ---> 25266 +27611 ---> 25267 +27612 ---> 25268 +27613 ---> 25269 +27618 ---> 25270 +27619 ---> 25271 +27625 ---> 25272 +27626 ---> 25273 +27629 ---> 25274 +27636 ---> 25275 +27638 ---> 25276 +27639 ---> 25277 +27641 ---> 25278 +27642 ---> 25279 +27643 ---> 863 +27646 ---> 25280 +27647 ---> 25281 +27648 ---> 25282 +27649 ---> 25283 +27652 ---> 25284 +27653 ---> 25285 +27655 ---> 25286 +27659 ---> 25287 +27660 ---> 25288 +27662 ---> 25289 +27664 ---> 25290 +27672 ---> 25291 +27674 ---> 25292 +27675 ---> 25293 +27677 ---> 25294 +27679 ---> 25295 +27680 ---> 25296 +27682 ---> 25297 +27684 ---> 25298 +27685 ---> 25299 +27686 ---> 25300 +27688 ---> 25301 +27689 ---> 25302 +27702 ---> 25303 +27705 ---> 25304 +27707 ---> 25305 +27712 ---> 25306 +27714 ---> 25307 +27716 ---> 25308 +27717 ---> 25309 +27718 ---> 25310 +27719 ---> 25311 +27721 ---> 25312 +27723 ---> 25313 +27724 ---> 25314 +27730 ---> 25315 +27731 ---> 25316 +27732 ---> 25317 +27740 ---> 25318 +27741 ---> 25319 +27745 ---> 25320 +27746 ---> 25321 +27747 ---> 25322 +27750 ---> 25323 +27754 ---> 25324 +27761 ---> 25325 +27764 ---> 25326 +27765 ---> 25327 +27768 ---> 25328 +27769 ---> 25329 +27770 ---> 25330 +27771 ---> 25331 +27773 ---> 25332 +27774 ---> 25333 +27776 ---> 25334 +27778 ---> 25335 +27779 ---> 25336 +27783 ---> 25337 +27784 ---> 25338 +27786 ---> 25339 +27792 ---> 25340 +27800 ---> 25341 +27802 ---> 25342 +27808 ---> 25343 +27811 ---> 25344 +27812 ---> 25345 +27813 ---> 25346 +27814 ---> 25347 +27816 ---> 25348 +27817 ---> 25349 +27818 ---> 25350 +27820 ---> 25351 +27823 ---> 25352 +27824 ---> 25353 +27834 ---> 25354 +27835 ---> 25355 +27840 ---> 25356 +27841 ---> 25357 +27845 ---> 25358 +27846 ---> 1491 +27847 ---> 25359 +27848 ---> 25360 +27849 ---> 25361 +27854 ---> 25362 +27855 ---> 25363 +27861 ---> 25364 +27868 ---> 25365 +27870 ---> 25366 +27871 ---> 25367 +27872 ---> 25368 +27875 ---> 25369 +27876 ---> 25370 +27877 ---> 25371 +27878 ---> 25372 +27880 ---> 25373 +27884 ---> 25374 +27885 ---> 25375 +27887 ---> 25376 +27889 ---> 25377 +27891 ---> 25378 +27892 ---> 25379 +27893 ---> 25380 +27896 ---> 25381 +27901 ---> 25382 +27904 ---> 25383 +27906 ---> 25384 +27907 ---> 25385 +27908 ---> 25387 +27909 ---> 25388 +27911 ---> 25389 +27912 ---> 25390 +27922 ---> 25391 +27929 ---> 25392 +27933 ---> 25393 +27935 ---> 25394 +27936 ---> 25395 +27938 ---> 25396 +27942 ---> 25397 +27946 ---> 25398 +27947 ---> 25399 +27948 ---> 25400 +27949 ---> 25401 +27951 ---> 25402 +27952 ---> 25403 +27953 ---> 25404 +27961 ---> 25405 +27962 ---> 25406 +27963 ---> 25407 +27964 ---> 25408 +27965 ---> 25409 +27966 ---> 25410 +27965 ---> 25409 +27966 ---> 25410 +27969 ---> 25411 +27970 ---> 25412 +27971 ---> 25413 +27972 ---> 25414 +27973 ---> 25415 +27974 ---> 25416 +27976 ---> 25417 +27977 ---> 25418 +27978 ---> 25419 +27979 ---> 1492 +27980 ---> 25420 +27981 ---> 25421 +27982 ---> 25422 +27983 ---> 1393 +27985 ---> 25423 +27990 ---> 25424 +27992 ---> 25425 +27995 ---> 25426 +27996 ---> 25427 +28001 ---> 25428 +28002 ---> 25429 +28007 ---> 25430 +28009 ---> 25431 +28010 ---> 25432 +28012 ---> 25433 +28013 ---> 25434 +28015 ---> 25435 +28020 ---> 25436 +28021 ---> 25437 +28024 ---> 25438 +28025 ---> 25439 +28027 ---> 25440 +28030 ---> 25441 +28033 ---> 25442 +28035 ---> 25443 +28040 ---> 25444 +28043 ---> 25445 +28044 ---> 25446 +28045 ---> 25447 +28046 ---> 25448 +28049 ---> 25449 +28050 ---> 25450 +28051 ---> 25451 +28052 ---> 25452 +28053 ---> 25453 +28055 ---> 25454 +28056 ---> 25455 +28058 ---> 25456 +28060 ---> 25457 +28061 ---> 25458 +28062 ---> 25459 +28063 ---> 25460 +28064 ---> 25461 +28065 ---> 25462 +28066 ---> 25463 +28067 ---> 25464 +28069 ---> 25465 +28082 ---> 25466 +28083 ---> 25467 +28085 ---> 25468 +28087 ---> 25469 +28091 ---> 25470 +28093 ---> 25471 +28096 ---> 25472 +28097 ---> 25473 +28099 ---> 25474 +28100 ---> 25475 +28100 ---> 25475 +28107 ---> 25476 +28113 ---> 25477 +28116 ---> 25478 +28118 ---> 25479 +28119 ---> 25480 +28122 ---> 25481 +28123 ---> 25482 +28131 ---> 864 +28132 ---> 25483 +28133 ---> 25484 +28135 ---> 25485 +28136 ---> 25486 +28137 ---> 25487 +28138 ---> 25488 +28139 ---> 25489 +28140 ---> 25490 +28145 ---> 25491 +28149 ---> 25492 +28152 ---> 25493 +28156 ---> 25494 +28157 ---> 25495 +28159 ---> 25496 +28169 ---> 25497 +28170 ---> 25498 +28172 ---> 25499 +28178 ---> 25500 +28180 ---> 25501 +28182 ---> 25502 +28188 ---> 25503 +28189 ---> 25504 +28190 ---> 25505 +28191 ---> 25506 +28192 ---> 25507 +28195 ---> 25508 +28198 ---> 25509 +28199 ---> 25510 +28200 ---> 25511 +28201 ---> 25512 +28202 ---> 25513 +28203 ---> 25514 +28204 ---> 25515 +28205 ---> 25516 +28206 ---> 25517 +28207 ---> 25518 +28208 ---> 25519 +28209 ---> 25520 +28219 ---> 25521 +28221 ---> 25522 +28223 ---> 25523 +28227 ---> 25524 +28230 ---> 25525 +28236 ---> 25526 +28238 ---> 25527 +28240 ---> 25528 +28241 ---> 25529 +28246 ---> 25530 +28247 ---> 25531 +28249 ---> 25532 +28251 ---> 25533 +28252 ---> 25534 +28255 ---> 25535 +28256 ---> 25536 +28257 ---> 25537 +28258 ---> 25538 +28265 ---> 25539 +28267 ---> 25540 +28270 ---> 25541 +28271 ---> 25542 +28274 ---> 25543 +28275 ---> 25544 +28281 ---> 25545 +28282 ---> 25546 +28283 ---> 25547 +28285 ---> 25548 +28299 ---> 25549 +28301 ---> 25550 +28302 ---> 25551 +28303 ---> 25552 +28304 ---> 25553 +28305 ---> 25554 +28306 ---> 25555 +28309 ---> 25556 +28310 ---> 25557 +28311 ---> 25558 +28314 ---> 25559 +28319 ---> 25560 +28321 ---> 25561 +28326 ---> 25562 +28328 ---> 25563 +28333 ---> 25564 +28335 ---> 25565 +28336 ---> 25566 +28337 ---> 25567 +28338 ---> 25568 +28341 ---> 25569 +28342 ---> 25570 +28343 ---> 25571 +28344 ---> 25572 +28352 ---> 25573 +28353 ---> 25574 +28354 ---> 25575 +28355 ---> 25576 +28356 ---> 25577 +28358 ---> 25578 +28359 ---> 25579 +28360 ---> 25580 +28363 ---> 25581 +28365 ---> 25582 +28366 ---> 25583 +28370 ---> 25584 +28371 ---> 25585 +28378 ---> 25586 +28379 ---> 25587 +28382 ---> 25588 +28390 ---> 25589 +28392 ---> 25590 +28393 ---> 25591 +28398 ---> 25592 +28400 ---> 25593 +28402 ---> 25594 +28403 ---> 25595 +28406 ---> 25596 +28409 ---> 25597 +28410 ---> 25598 +28411 ---> 25599 +28414 ---> 25600 +28416 ---> 25601 +28418 ---> 25602 +28419 ---> 25603 +28420 ---> 25604 +28423 ---> 25605 +28424 ---> 25606 +28430 ---> 25607 +28433 ---> 25608 +28435 ---> 25609 +28436 ---> 25610 +28437 ---> 25611 +28438 ---> 25612 +28445 ---> 25613 +28447 ---> 25614 +28448 ---> 25615 +28449 ---> 25616 +28450 ---> 25617 +28452 ---> 25618 +28453 ---> 25619 +28454 ---> 25620 +28456 ---> 25621 +28457 ---> 25622 +28466 ---> 25623 +28468 ---> 25624 +28470 ---> 25625 +28473 ---> 25626 +28479 ---> 25627 +28482 ---> 25628 +28485 ---> 25629 +28486 ---> 25630 +28488 ---> 25631 +28491 ---> 25632 +28492 ---> 25633 +28496 ---> 25634 +28497 ---> 25635 +28499 ---> 25636 +28501 ---> 25637 +28502 ---> 25638 +28504 ---> 25639 +28508 ---> 25640 +28509 ---> 25641 +28511 ---> 25642 +28521 ---> 25643 +28522 ---> 25644 +28523 ---> 25645 +28530 ---> 25646 +28537 ---> 25647 +28538 ---> 25648 +28539 ---> 25649 +28542 ---> 25650 +28543 ---> 25651 +28544 ---> 25652 +28545 ---> 25653 +28546 ---> 25654 +28548 ---> 25655 +28549 ---> 25656 +28551 ---> 25657 +28553 ---> 25658 +28554 ---> 25659 +28556 ---> 25660 +28557 ---> 25661 +28558 ---> 25662 +28559 ---> 25663 +28566 ---> 25664 +28574 ---> 25665 +28580 ---> 25666 +28584 ---> 25667 +28585 ---> 25668 +28590 ---> 25669 +28591 ---> 25670 +28594 ---> 25671 +28597 ---> 25672 +28602 ---> 25673 +28603 ---> 25674 +28605 ---> 25675 +28606 ---> 25676 +28609 ---> 25677 +28611 ---> 25678 +28612 ---> 25679 +28614 ---> 25680 +28620 ---> 25681 +28625 ---> 25682 +28630 ---> 25683 +28631 ---> 25684 +28641 ---> 25685 +28642 ---> 25686 +28648 ---> 25688 +28651 ---> 25689 +28652 ---> 25690 +28655 ---> 25691 +28657 ---> 25692 +28658 ---> 25693 +28662 ---> 25694 +28667 ---> 25695 +28668 ---> 25696 +28680 ---> 25697 +28682 ---> 25698 +28683 ---> 25699 +28686 ---> 25700 +28689 ---> 25701 +28693 ---> 25702 +28694 ---> 25703 +28695 ---> 25704 +28696 ---> 25705 +28697 ---> 25706 +28700 ---> 25707 +28703 ---> 25708 +28707 ---> 25709 +28708 ---> 25710 +28709 ---> 25711 +28711 ---> 25712 +28713 ---> 25713 +28714 ---> 25714 +28716 ---> 25715 +28719 ---> 25716 +28721 ---> 25717 +28722 ---> 25718 +28724 ---> 25719 +28727 ---> 25720 +28729 ---> 25721 +28733 ---> 25722 +28743 ---> 25723 +28746 ---> 25724 +28747 ---> 25725 +28749 ---> 25726 +28750 ---> 25727 +28751 ---> 25728 +28752 ---> 25729 +28755 ---> 25730 +28756 ---> 25731 +28757 ---> 25732 +28758 ---> 25733 +28759 ---> 25734 +28761 ---> 25736 +28763 ---> 25737 +28764 ---> 25738 +28769 ---> 25739 +28772 ---> 25740 +28773 ---> 25741 +28774 ---> 25742 +28775 ---> 25743 +28777 ---> 25744 +28780 ---> 25745 +28781 ---> 25746 +28782 ---> 25747 +28784 ---> 25748 +28787 ---> 25749 +28790 ---> 25750 +28791 ---> 25751 +28793 ---> 25752 +28796 ---> 25753 +28798 ---> 25754 +28799 ---> 25755 +28801 ---> 25756 +28802 ---> 25757 +28803 ---> 25758 +28804 ---> 25759 +28805 ---> 25760 +28807 ---> 25761 +28808 ---> 25762 +28810 ---> 25763 +28813 ---> 25764 +28816 ---> 25765 +28819 ---> 25766 +28825 ---> 25767 +28830 ---> 25768 +28831 ---> 25769 +28833 ---> 25770 +28834 ---> 25771 +28841 ---> 25772 +28846 ---> 25773 +28847 ---> 25774 +28848 ---> 25775 +28850 ---> 25776 +28853 ---> 25777 +28856 ---> 25778 +28858 ---> 25779 +28860 ---> 25780 +28861 ---> 25781 +28863 ---> 25782 +28864 ---> 25783 +28868 ---> 25784 +28870 ---> 25785 +28878 ---> 25786 +28879 ---> 25787 +28881 ---> 25788 +28882 ---> 25789 +28884 ---> 25790 +28886 ---> 25791 +28890 ---> 25792 +28892 ---> 25793 +28897 ---> 25794 +28898 ---> 25795 +28899 ---> 25796 +28901 ---> 25797 +28903 ---> 25798 +28909 ---> 25799 +28911 ---> 25800 +28912 ---> 25801 +28913 ---> 25802 +28914 ---> 25803 +28915 ---> 25804 +28917 ---> 25805 +28920 ---> 25806 +28921 ---> 25807 +28922 ---> 25808 +28923 ---> 25809 +28924 ---> 25810 +28925 ---> 25811 +28929 ---> 25812 +28930 ---> 25813 +28932 ---> 25814 +28933 ---> 25815 +28934 ---> 927 +28935 ---> 25816 +28938 ---> 25817 +28941 ---> 25818 +28944 ---> 25819 +28948 ---> 25820 +28950 ---> 25821 +28951 ---> 25822 +28953 ---> 25823 +28954 ---> 25824 +28959 ---> 25825 +28960 ---> 25826 +28961 ---> 25827 +28963 ---> 25828 +28968 ---> 25829 +28969 ---> 25830 +28974 ---> 25831 +28978 ---> 25832 +28979 ---> 25833 +28984 ---> 25834 +28985 ---> 25835 +28986 ---> 25836 +29001 ---> 25837 +29005 ---> 25838 +29007 ---> 25839 +29011 ---> 25840 +29014 ---> 25841 +29015 ---> 25842 +29016 ---> 25843 +29017 ---> 25844 +29018 ---> 25845 +29019 ---> 25846 +29021 ---> 25847 +29022 ---> 25848 +29024 ---> 25849 +29026 ---> 25850 +29027 ---> 25851 +29028 ---> 25852 +29029 ---> 25853 +29032 ---> 25854 +29034 ---> 25855 +29035 ---> 25856 +29036 ---> 25857 +29037 ---> 25858 +29040 ---> 25859 +29045 ---> 25860 +29047 ---> 25861 +29048 ---> 25862 +29049 ---> 25863 +29052 ---> 25864 +29055 ---> 25865 +29056 ---> 25866 +29057 ---> 25867 +29059 ---> 25868 +29060 ---> 25869 +29061 ---> 25870 +29063 ---> 25871 +29064 ---> 25872 +29065 ---> 25873 +29066 ---> 25874 +29067 ---> 25875 +29068 ---> 25876 +29069 ---> 25877 +29073 ---> 25878 +29074 ---> 25879 +29075 ---> 25880 +29080 ---> 25881 +29084 ---> 25882 +29085 ---> 25883 +29086 ---> 25884 +29087 ---> 25885 +29089 ---> 25886 +29090 ---> 25887 +29094 ---> 25888 +29095 ---> 25889 +29101 ---> 25890 +29102 ---> 25891 +29108 ---> 25892 +29110 ---> 25893 +29113 ---> 25894 +29116 ---> 25895 +29118 ---> 25896 +29119 ---> 25897 +29120 ---> 25898 +29122 ---> 25899 +29123 ---> 25900 +29124 ---> 25901 +29125 ---> 25902 +29126 ---> 25903 +29127 ---> 25904 +29129 ---> 25905 +29134 ---> 25906 +29140 ---> 25907 +29141 ---> 25908 +29143 ---> 25909 +29144 ---> 25910 +29149 ---> 25911 +29150 ---> 25912 +29156 ---> 25913 +29157 ---> 25914 +29158 ---> 25915 +29161 ---> 25916 +29162 ---> 25917 +29163 ---> 25918 +29164 ---> 25919 +29166 ---> 25920 +29169 ---> 25921 +29170 ---> 25922 +29172 ---> 25923 +29173 ---> 25924 +29174 ---> 25925 +29175 ---> 25926 +29176 ---> 25927 +29180 ---> 25928 +29187 ---> 25929 +29188 ---> 25930 +29190 ---> 25931 +29191 ---> 25932 +29192 ---> 25933 +29193 ---> 25934 +29196 ---> 25935 +29207 ---> 25936 +29210 ---> 25937 +29211 ---> 25938 +29212 ---> 25939 +29218 ---> 998 +29220 ---> 25940 +29221 ---> 25941 +29223 ---> 25942 +29224 ---> 25943 +29226 ---> 25944 +29232 ---> 25945 +29235 ---> 25946 +29236 ---> 25947 +29239 ---> 25948 +29242 ---> 25949 +29243 ---> 25950 +29244 ---> 25951 +29245 ---> 25952 +29247 ---> 25953 +29248 ---> 25954 +29249 ---> 25955 +29250 ---> 25956 +29253 ---> 25957 +29254 ---> 25958 +29258 ---> 25959 +29260 ---> 25960 +29264 ---> 25961 +29265 ---> 25962 +29266 ---> 25963 +29269 ---> 25964 +29270 ---> 25965 +29271 ---> 25966 +29273 ---> 25967 +29274 ---> 25968 +29275 ---> 25969 +29276 ---> 25970 +29277 ---> 25971 +29278 ---> 25972 +29279 ---> 25973 +29285 ---> 25974 +29288 ---> 25975 +29290 ---> 25976 +29292 ---> 25977 +29293 ---> 25978 +29294 ---> 25979 +29298 ---> 25980 +29301 ---> 25981 +29308 ---> 25982 +29310 ---> 25983 +29313 ---> 25984 +29314 ---> 25985 +29318 ---> 25986 +29320 ---> 25987 +29322 ---> 25988 +29323 ---> 25989 +29325 ---> 25990 +29327 ---> 25991 +29329 ---> 25992 +29330 ---> 25993 +29331 ---> 25994 +29335 ---> 25995 +29340 ---> 25996 +29341 ---> 25997 +29342 ---> 25998 +29343 ---> 25999 +29345 ---> 26000 +29346 ---> 26001 +29349 ---> 26002 +29354 ---> 26003 +29360 ---> 26004 +29362 ---> 26005 +29364 ---> 26006 +29365 ---> 26007 +29368 ---> 26008 +29369 ---> 26009 +29370 ---> 26010 +29371 ---> 26011 +29373 ---> 26012 +29375 ---> 26013 +29376 ---> 26014 +29377 ---> 26015 +29379 ---> 26016 +29380 ---> 26017 +29381 ---> 26018 +29382 ---> 26019 +29383 ---> 26020 +29384 ---> 26021 +29386 ---> 26022 +29390 ---> 26023 +29391 ---> 26024 +29395 ---> 26025 +29396 ---> 26026 +29397 ---> 26027 +29399 ---> 26028 +29400 ---> 26029 +29403 ---> 26030 +29404 ---> 26031 +29405 ---> 26032 +29406 ---> 26033 +29410 ---> 26034 +29412 ---> 26035 +29414 ---> 26036 +29417 ---> 26037 +29421 ---> 26038 +29425 ---> 26039 +29426 ---> 26040 +29427 ---> 26041 +29430 ---> 26042 +29431 ---> 26043 +29437 ---> 26044 +29448 ---> 26045 +29449 ---> 26046 +29450 ---> 26047 +29452 ---> 26048 +29453 ---> 26049 +29454 ---> 26050 +29458 ---> 26051 +29459 ---> 26052 +29461 ---> 26053 +29462 ---> 26054 +29463 ---> 26055 +29472 ---> 26056 +29474 ---> 26057 +29476 ---> 26058 +29477 ---> 26059 +29478 ---> 26060 +29479 ---> 26061 +29481 ---> 26062 +29482 ---> 26063 +29483 ---> 26064 +29487 ---> 26065 +29488 ---> 26066 +29490 ---> 26067 +29494 ---> 26068 +29495 ---> 26069 +29498 ---> 26070 +29499 ---> 26071 +29500 ---> 26072 +29503 ---> 26073 +29504 ---> 26074 +29505 ---> 26075 +29506 ---> 26076 +29507 ---> 26077 +29510 ---> 26078 +29517 ---> 26079 +29523 ---> 26080 +29524 ---> 26081 +29525 ---> 26082 +29526 ---> 26083 +29531 ---> 26084 +29534 ---> 26085 +29535 ---> 26086 +29537 ---> 26087 +29538 ---> 26088 +29540 ---> 26089 +29541 ---> 26090 +29542 ---> 26091 +29544 ---> 26092 +29546 ---> 26093 +29547 ---> 26094 +29549 ---> 31594 +29551 ---> 26095 +29554 ---> 26096 +29555 ---> 26097 +29557 ---> 26098 +29558 ---> 26099 +29560 ---> 26100 +29562 ---> 26101 +29563 ---> 26102 +29564 ---> 26103 +29566 ---> 26104 +29567 ---> 26105 +29568 ---> 26106 +29569 ---> 26107 +29570 ---> 26108 +29574 ---> 26109 +29575 ---> 26110 +29577 ---> 26111 +29578 ---> 26112 +29580 ---> 26113 +29581 ---> 26114 +29582 ---> 26115 +29583 ---> 26116 +29585 ---> 26117 +29589 ---> 26118 +29590 ---> 26119 +29593 ---> 26120 +29595 ---> 26121 +29596 ---> 26122 +29597 ---> 26123 +29598 ---> 26124 +29600 ---> 26125 +29607 ---> 26126 +29608 ---> 26127 +29609 ---> 26128 +29610 ---> 26129 +29613 ---> 26130 +29622 ---> 26131 +29623 ---> 26132 +29629 ---> 26133 +29634 ---> 26134 +29637 ---> 26135 +29644 ---> 26136 +29645 ---> 26137 +29648 ---> 26138 +29649 ---> 26139 +29650 ---> 26140 +29651 ---> 26141 +29652 ---> 26142 +29653 ---> 26143 +29654 ---> 26144 +29656 ---> 26145 +29659 ---> 26146 +29660 ---> 26147 +29661 ---> 26148 +29664 ---> 26149 +29668 ---> 26150 +29669 ---> 26151 +29674 ---> 26152 +29679 ---> 26153 +29680 ---> 26154 +29683 ---> 26155 +29685 ---> 26156 +29686 ---> 26157 +29687 ---> 26158 +29688 ---> 26159 +29689 ---> 26160 +29691 ---> 26161 +29694 ---> 26162 +29696 ---> 26163 +29698 ---> 26164 +29699 ---> 26165 +29700 ---> 26166 +29703 ---> 26167 +29704 ---> 26168 +29706 ---> 26169 +29707 ---> 26170 +29708 ---> 26171 +29710 ---> 26172 +29711 ---> 26173 +29712 ---> 26174 +29714 ---> 26175 +29715 ---> 26176 +29716 ---> 26177 +29717 ---> 26178 +29718 ---> 26179 +29722 ---> 26180 +29723 ---> 26181 +29725 ---> 26182 +29728 ---> 26183 +29730 ---> 26184 +29735 ---> 26185 +29736 ---> 26186 +29737 ---> 26187 +29740 ---> 26188 +29742 ---> 26189 +29744 ---> 26190 +29745 ---> 26191 +29746 ---> 26192 +29747 ---> 26193 +29748 ---> 26194 +29752 ---> 26195 +29753 ---> 26196 +29754 ---> 26197 +29755 ---> 26198 +29756 ---> 26199 +29757 ---> 26200 +29759 ---> 26201 +29760 ---> 26202 +29761 ---> 26203 +29762 ---> 26204 +29764 ---> 26205 +29768 ---> 26206 +29770 ---> 26207 +29771 ---> 26208 +29772 ---> 26209 +29773 ---> 26210 +29776 ---> 26211 +29778 ---> 26212 +29779 ---> 26213 +29780 ---> 26214 +29781 ---> 26215 +29782 ---> 26216 +29783 ---> 26217 +29784 ---> 26218 +29785 ---> 26219 +29788 ---> 26220 +29791 ---> 26221 +29796 ---> 26222 +29799 ---> 26223 +29802 ---> 26224 +29804 ---> 26225 +29806 ---> 26226 +29807 ---> 26227 +29808 ---> 26228 +29811 ---> 26229 +29812 ---> 26230 +29815 ---> 26231 +29817 ---> 26232 +29820 ---> 26233 +29821 ---> 26234 +29823 ---> 26235 +29824 ---> 26236 +29825 ---> 26237 +29827 ---> 26238 +29828 ---> 26239 +29834 ---> 26240 +29841 ---> 26241 +29842 ---> 26242 +29844 ---> 26243 +29847 ---> 26244 +29848 ---> 26245 +29854 ---> 26246 +29858 ---> 26247 +29861 ---> 26248 +29862 ---> 1479 +29863 ---> 26249 +29865 ---> 26250 +29866 ---> 26251 +29868 ---> 26252 +29869 ---> 26253 +29870 ---> 26254 +29871 ---> 26255 +29872 ---> 26256 +29873 ---> 26257 +29874 ---> 26258 +29878 ---> 26259 +29881 ---> 26260 +29886 ---> 26261 +29887 ---> 26262 +29888 ---> 26263 +29890 ---> 26264 +29891 ---> 26265 +29892 ---> 26266 +29894 ---> 26267 +29898 ---> 26268 +29899 ---> 26269 +29900 ---> 26270 +29902 ---> 26271 +29905 ---> 26272 +29906 ---> 26273 +29907 ---> 26274 +29909 ---> 26275 +29910 ---> 26276 +29911 ---> 26277 +29912 ---> 26278 +29913 ---> 26279 +29914 ---> 26280 +29915 ---> 26281 +29916 ---> 26282 +29917 ---> 798 +29920 ---> 26283 +29921 ---> 26284 +29927 ---> 26285 +29929 ---> 26286 +29932 ---> 26287 +29934 ---> 26288 +29937 ---> 26289 +29938 ---> 26290 +29939 ---> 26291 +29940 ---> 26292 +29941 ---> 26293 +29942 ---> 26294 +29945 ---> 26295 +29946 ---> 26296 +29947 ---> 26297 +29951 ---> 1493 +29952 ---> 26298 +29953 ---> 26299 +29956 ---> 26300 +29957 ---> 26301 +29958 ---> 26302 +29959 ---> 26303 +29960 ---> 26304 +29962 ---> 26305 +29966 ---> 26306 +29969 ---> 26307 +29972 ---> 26308 +29974 ---> 26309 +29975 ---> 26310 +29976 ---> 26311 +29977 ---> 26312 +29978 ---> 26313 +29979 ---> 26314 +29980 ---> 26315 +29981 ---> 26316 +29982 ---> 26317 +29983 ---> 26318 +29984 ---> 26319 +29985 ---> 26320 +29990 ---> 26321 +29994 ---> 26322 +29996 ---> 26323 +29997 ---> 26324 +29999 ---> 26325 +30003 ---> 26326 +30004 ---> 26327 +30006 ---> 26328 +30009 ---> 26329 +30010 ---> 26330 +30011 ---> 26331 +30013 ---> 26332 +30016 ---> 26333 +30017 ---> 26334 +30018 ---> 26335 +30023 ---> 26336 +30028 ---> 26337 +30029 ---> 26338 +30030 ---> 26339 +30032 ---> 26340 +30038 ---> 26341 +30039 ---> 26342 +30040 ---> 26343 +30043 ---> 26344 +30044 ---> 26345 +30047 ---> 26346 +30048 ---> 26347 +30049 ---> 26348 +30050 ---> 26349 +30051 ---> 26350 +30052 ---> 26351 +30054 ---> 26352 +30056 ---> 26353 +30057 ---> 26354 +30059 ---> 26355 +30060 ---> 26356 +30061 ---> 26357 +30063 ---> 26358 +30068 ---> 26359 +30073 ---> 26360 +30074 ---> 26361 +30084 ---> 26362 +30086 ---> 26363 +30087 ---> 26364 +30091 ---> 26365 +30093 ---> 26366 +30094 ---> 26367 +30095 ---> 26368 +30096 ---> 26369 +30106 ---> 26370 +30109 ---> 26371 +30111 ---> 26372 +30113 ---> 26373 +30114 ---> 26374 +30120 ---> 26375 +30121 ---> 26376 +30123 ---> 26377 +30126 ---> 26378 +30127 ---> 26379 +30131 ---> 26380 +30133 ---> 26381 +30139 ---> 26382 +30140 ---> 26383 +30141 ---> 26384 +30143 ---> 26385 +30144 ---> 26386 +30146 ---> 26387 +30147 ---> 26388 +30148 ---> 26389 +30150 ---> 26390 +30156 ---> 26391 +30158 ---> 26392 +30162 ---> 26393 +30163 ---> 26394 +30164 ---> 26395 +30165 ---> 26396 +30166 ---> 26397 +30168 ---> 26398 +30169 ---> 26399 +30170 ---> 26400 +30171 ---> 26401 +30173 ---> 26402 +30174 ---> 26403 +30175 ---> 26404 +30177 ---> 26405 +30180 ---> 26406 +30181 ---> 26407 +30183 ---> 26408 +30184 ---> 26409 +30185 ---> 26410 +30187 ---> 26411 +30188 ---> 26412 +30190 ---> 26413 +30191 ---> 26414 +30193 ---> 26415 +30195 ---> 930 +30197 ---> 26416 +30199 ---> 26417 +30203 ---> 26418 +30207 ---> 26419 +30208 ---> 26420 +30209 ---> 26421 +30210 ---> 26422 +30211 ---> 26423 +30213 ---> 26424 +30214 ---> 26425 +30219 ---> 26426 +30222 ---> 26427 +30223 ---> 26428 +30230 ---> 26429 +30231 ---> 26430 +30234 ---> 26431 +30236 ---> 26432 +30246 ---> 26433 +30247 ---> 26434 +30249 ---> 26435 +30252 ---> 26436 +30253 ---> 26437 +30255 ---> 26438 +30257 ---> 26439 +30261 ---> 26440 +30262 ---> 26441 +30263 ---> 26442 +30264 ---> 26443 +30266 ---> 26444 +30267 ---> 26445 +30275 ---> 26446 +30276 ---> 26447 +30283 ---> 26448 +30284 ---> 26449 +30287 ---> 26450 +30311 ---> 26451 +30313 ---> 26452 +30314 ---> 26453 +30315 ---> 26454 +30317 ---> 26455 +30319 ---> 26456 +30320 ---> 26457 +30321 ---> 26458 +30323 ---> 26459 +30326 ---> 26460 +30327 ---> 26461 +30330 ---> 26462 +30331 ---> 26463 +30332 ---> 26464 +30333 ---> 26465 +30334 ---> 26466 +30335 ---> 26467 +30336 ---> 26468 +30337 ---> 26469 +30340 ---> 26470 +30341 ---> 26471 +30343 ---> 26472 +30345 ---> 26473 +30348 ---> 26474 +30349 ---> 26475 +30350 ---> 26476 +30351 ---> 26477 +30352 ---> 26478 +30353 ---> 26479 +30354 ---> 26480 +30355 ---> 26481 +30356 ---> 26482 +30357 ---> 26483 +30359 ---> 26484 +30360 ---> 26485 +30363 ---> 26486 +30368 ---> 26487 +30369 ---> 26488 +30373 ---> 957 +30375 ---> 26489 +30380 ---> 26490 +30382 ---> 26491 +30383 ---> 26492 +30385 ---> 26493 +30388 ---> 26494 +30389 ---> 26495 +30391 ---> 26496 +30393 ---> 26497 +30399 ---> 26498 +30403 ---> 26499 +30406 ---> 26500 +30413 ---> 26501 +30414 ---> 26502 +30415 ---> 26503 +30416 ---> 26504 +30417 ---> 26505 +30418 ---> 26506 +30419 ---> 26507 +30420 ---> 26508 +30422 ---> 26509 +30423 ---> 26510 +30424 ---> 1552 +30426 ---> 26511 +30435 ---> 26512 +30436 ---> 26513 +30443 ---> 26514 +30444 ---> 26515 +30445 ---> 26516 +30449 ---> 26517 +30453 ---> 26518 +30454 ---> 26519 +30455 ---> 26520 +30456 ---> 26521 +30458 ---> 26522 +30461 ---> 26523 +30466 ---> 26524 +30471 ---> 26525 +30473 ---> 26526 +30475 ---> 26527 +30477 ---> 26528 +30479 ---> 26529 +30482 ---> 26530 +30483 ---> 26531 +30484 ---> 26532 +30486 ---> 26533 +30492 ---> 26534 +30500 ---> 26535 +30502 ---> 26536 +30503 ---> 933 +30504 ---> 26537 +30505 ---> 26538 +30506 ---> 26539 +30507 ---> 26540 +30513 ---> 26541 +30517 ---> 26542 +30518 ---> 26543 +30523 ---> 26544 +30527 ---> 26545 +30538 ---> 26546 +30540 ---> 26547 +30542 ---> 26548 +30543 ---> 26549 +30544 ---> 26550 +30545 ---> 26551 +30546 ---> 26552 +30547 ---> 26553 +30552 ---> 26554 +30558 ---> 26555 +30559 ---> 26556 +30561 ---> 26557 +30573 ---> 26558 +30575 ---> 26559 +30576 ---> 26560 +30577 ---> 26561 +30578 ---> 26562 +30580 ---> 26563 +30581 ---> 26564 +30582 ---> 26565 +30584 ---> 26566 +30586 ---> 26567 +30587 ---> 26568 +30589 ---> 26569 +30592 ---> 26570 +30593 ---> 26571 +30594 ---> 26572 +30595 ---> 26573 +30596 ---> 26574 +30597 ---> 26575 +30599 ---> 26576 +30600 ---> 26577 +30601 ---> 26578 +30602 ---> 26579 +30604 ---> 26580 +30605 ---> 26581 +30606 ---> 26582 +30608 ---> 26583 +30610 ---> 26584 +30611 ---> 26585 +30612 ---> 26586 +30613 ---> 26587 +30616 ---> 26588 +30618 ---> 26589 +30623 ---> 26590 +30624 ---> 26591 +30626 ---> 26592 +30627 ---> 26593 +30629 ---> 26594 +30631 ---> 26595 +30635 ---> 26596 +30637 ---> 26597 +30638 ---> 26598 +30641 ---> 26599 +30642 ---> 26600 +30643 ---> 26601 +30644 ---> 26602 +30645 ---> 26603 +30648 ---> 26604 +30649 ---> 26605 +30650 ---> 26606 +30651 ---> 26607 +30652 ---> 26608 +30653 ---> 1504 +30654 ---> 26609 +30655 ---> 26610 +30657 ---> 26611 +30658 ---> 26612 +30659 ---> 26613 +30665 ---> 26614 +30666 ---> 26615 +30668 ---> 26616 +30669 ---> 26617 +30670 ---> 26618 +30671 ---> 26619 +30677 ---> 26620 +30678 ---> 26621 +30679 ---> 26622 +30681 ---> 26623 +30683 ---> 26624 +30685 ---> 26625 +30686 ---> 26626 +30687 ---> 26627 +30689 ---> 26628 +30691 ---> 26629 +30693 ---> 26630 +30696 ---> 26631 +30697 ---> 26632 +30698 ---> 26633 +30701 ---> 2162 +30706 ---> 26634 +30708 ---> 26635 +30709 ---> 26636 +30711 ---> 26637 +30713 ---> 26638 +30714 ---> 26639 +30718 ---> 26640 +30720 ---> 26641 +30723 ---> 26642 +30728 ---> 26643 +30729 ---> 26644 +30730 ---> 26645 +30732 ---> 26646 +30733 ---> 26647 +30734 ---> 26648 +30738 ---> 26649 +30742 ---> 26650 +30746 ---> 26651 +30747 ---> 26652 +30748 ---> 26653 +30749 ---> 26654 +30750 ---> 26655 +30752 ---> 26656 +30753 ---> 26657 +30754 ---> 26658 +30755 ---> 26659 +30756 ---> 26660 +30758 ---> 26661 +30760 ---> 26662 +30771 ---> 26663 +30772 ---> 26664 +30774 ---> 26665 +30775 ---> 26666 +30776 ---> 26667 +30777 ---> 26668 +30779 ---> 26669 +30780 ---> 26670 +30781 ---> 26671 +30783 ---> 26672 +30784 ---> 26673 +30787 ---> 26674 +30790 ---> 26675 +30791 ---> 26676 +30792 ---> 26677 +30793 ---> 26678 +30795 ---> 26679 +30799 ---> 26680 +30801 ---> 26681 +30802 ---> 26682 +30804 ---> 26683 +30805 ---> 26684 +30810 ---> 26685 +30811 ---> 26686 +30812 ---> 26687 +30816 ---> 26688 +30819 ---> 26689 +30820 ---> 26690 +30821 ---> 26691 +30822 ---> 26692 +30823 ---> 26693 +30826 ---> 26694 +30828 ---> 26695 +30829 ---> 26696 +30830 ---> 26697 +30834 ---> 26698 +30842 ---> 26699 +30843 ---> 26700 +30845 ---> 26701 +30846 ---> 26702 +30847 ---> 26703 +30848 ---> 26704 +30849 ---> 26705 +30852 ---> 26706 +30855 ---> 26707 +30858 ---> 26708 +30859 ---> 26709 +30861 ---> 26710 +30862 ---> 26711 +30864 ---> 26712 +30865 ---> 26713 +30866 ---> 26714 +30867 ---> 26715 +30873 ---> 26716 +30876 ---> 26717 +30877 ---> 26718 +30878 ---> 26719 +30879 ---> 26720 +30887 ---> 26721 +30891 ---> 26722 +30892 ---> 26723 +30893 ---> 26724 +30894 ---> 26725 +30899 ---> 26726 +30904 ---> 26727 +30905 ---> 26728 +30906 ---> 26729 +30909 ---> 26730 +30910 ---> 26731 +30913 ---> 26732 +30914 ---> 26733 +30915 ---> 26734 +30916 ---> 26735 +30924 ---> 26736 +30925 ---> 26737 +30926 ---> 26738 +30927 ---> 26739 +30930 ---> 26740 +30933 ---> 26741 +30934 ---> 26742 +30936 ---> 26743 +30938 ---> 26744 +30939 ---> 26745 +30940 ---> 26746 +30941 ---> 26747 +30942 ---> 26748 +30945 ---> 26749 +30946 ---> 26750 +30948 ---> 26751 +30951 ---> 26752 +30952 ---> 26753 +30953 ---> 26754 +30955 ---> 26755 +30958 ---> 26756 +30959 ---> 26757 +30960 ---> 26758 +30961 ---> 26759 +30962 ---> 26760 +30963 ---> 26761 +30964 ---> 26762 +30968 ---> 26763 +30971 ---> 26764 +30974 ---> 26765 +30978 ---> 26766 +30979 ---> 26767 +30983 ---> 26768 +30984 ---> 26769 +30985 ---> 26770 +30986 ---> 26771 +30987 ---> 26772 +30988 ---> 26773 +30989 ---> 26774 +30990 ---> 26775 +30991 ---> 26776 +30992 ---> 26777 +30993 ---> 26778 +30994 ---> 26779 +31002 ---> 26780 +31003 ---> 26781 +31005 ---> 26782 +31006 ---> 26783 +31007 ---> 26784 +31011 ---> 26785 +31012 ---> 26786 +31014 ---> 26787 +31015 ---> 26788 +31017 ---> 26789 +31018 ---> 26790 +31019 ---> 26791 +31020 ---> 26792 +31022 ---> 26793 +31024 ---> 26794 +31026 ---> 26795 +31028 ---> 26796 +31030 ---> 26797 +31032 ---> 26798 +31034 ---> 26799 +31036 ---> 26800 +31037 ---> 26801 +31038 ---> 26802 +31041 ---> 26803 +31042 ---> 26804 +31047 ---> 26805 +31049 ---> 26806 +31050 ---> 26807 +31051 ---> 26808 +31052 ---> 26809 +31053 ---> 26810 +31056 ---> 26811 +31061 ---> 26812 +31064 ---> 26813 +31066 ---> 26814 +31068 ---> 26815 +31069 ---> 26816 +31073 ---> 26817 +31074 ---> 26818 +31076 ---> 26819 +31077 ---> 26820 +31078 ---> 26821 +31079 ---> 26822 +31081 ---> 26823 +31082 ---> 26824 +31087 ---> 26825 +31088 ---> 26826 +31090 ---> 26827 +31091 ---> 26828 +31093 ---> 26829 +31094 ---> 26830 +31095 ---> 26831 +31098 ---> 26832 +31099 ---> 26833 +31101 ---> 26835 +31102 ---> 26836 +31103 ---> 26837 +31104 ---> 26838 +31105 ---> 26839 +31107 ---> 26840 +31112 ---> 26841 +31116 ---> 26842 +31117 ---> 26843 +31119 ---> 26844 +31120 ---> 925 +31121 ---> 26845 +31122 ---> 26846 +31124 ---> 26847 +31126 ---> 26848 +31135 ---> 26849 +31138 ---> 26850 +31143 ---> 26851 +31144 ---> 26852 +31145 ---> 26853 +31146 ---> 26854 +31147 ---> 26855 +31154 ---> 26856 +31155 ---> 26857 +31156 ---> 26858 +31159 ---> 26859 +31172 ---> 26860 +31173 ---> 26861 +31176 ---> 26862 +31177 ---> 26863 +31178 ---> 26864 +31180 ---> 26865 +31181 ---> 26866 +31182 ---> 26867 +31186 ---> 26868 +31190 ---> 26869 +31191 ---> 26870 +31193 ---> 26871 +31195 ---> 26872 +31200 ---> 26873 +31201 ---> 26874 +31203 ---> 26875 +31206 ---> 923 +31207 ---> 26876 +31208 ---> 26877 +31213 ---> 26878 +31214 ---> 26879 +31217 ---> 26880 +31220 ---> 26881 +31221 ---> 26882 +31224 ---> 26883 +31226 ---> 26884 +31227 ---> 26885 +31233 ---> 26886 +31237 ---> 26887 +31238 ---> 26888 +31239 ---> 26889 +31241 ---> 26890 +31242 ---> 26891 +31246 ---> 26892 +31247 ---> 26893 +31248 ---> 26894 +31249 ---> 26895 +31253 ---> 26896 +31255 ---> 26897 +31257 ---> 26898 +31258 ---> 26899 +31259 ---> 26900 +31262 ---> 26901 +31263 ---> 26902 +31264 ---> 26903 +31265 ---> 26904 +31270 ---> 26905 +31271 ---> 26906 +31274 ---> 26907 +31275 ---> 26908 +31276 ---> 26909 +31277 ---> 26910 +31278 ---> 26911 +31279 ---> 26912 +31281 ---> 26913 +31282 ---> 26914 +31288 ---> 26915 +31291 ---> 26916 +31294 ---> 26917 +31295 ---> 26918 +31296 ---> 26919 +31297 ---> 26920 +31298 ---> 26921 +31299 ---> 1587 +31300 ---> 26922 +31301 ---> 26923 +31302 ---> 26924 +31304 ---> 26925 +31305 ---> 26926 +31306 ---> 26927 +31307 ---> 26928 +31308 ---> 1590 +31309 ---> 1505 +31310 ---> 26929 +31312 ---> 26930 +31313 ---> 26931 +31315 ---> 26932 +31316 ---> 26933 +31319 ---> 26934 +31321 ---> 26935 +31322 ---> 26936 +31323 ---> 26937 +31326 ---> 26938 +31328 ---> 26939 +31330 ---> 26940 +31335 ---> 26941 +31336 ---> 26942 +31338 ---> 26943 +31340 ---> 26944 +31348 ---> 26945 +31349 ---> 26946 +31350 ---> 26947 +31351 ---> 26948 +31352 ---> 26949 +31353 ---> 26950 +31354 ---> 26951 +31357 ---> 26952 +31358 ---> 26953 +31359 ---> 26954 +31362 ---> 26955 +31363 ---> 26956 +31368 ---> 26957 +31369 ---> 26958 +31370 ---> 26959 +31371 ---> 26960 +31376 ---> 26962 +31377 ---> 26963 +31379 ---> 26964 +31380 ---> 26965 +31381 ---> 26966 +31383 ---> 26967 +31388 ---> 26968 +31390 ---> 26969 +31391 ---> 26970 +31393 ---> 26971 +31394 ---> 26972 +31395 ---> 26973 +31401 ---> 26974 +31403 ---> 26975 +31405 ---> 26976 +31407 ---> 26977 +31410 ---> 26978 +31412 ---> 26979 +31413 ---> 26981 +31414 ---> 26982 +31415 ---> 26983 +31416 ---> 26984 +31417 ---> 26985 +31418 ---> 26986 +31419 ---> 26987 +31420 ---> 26988 +31422 ---> 26989 +31423 ---> 26990 +31424 ---> 26991 +31425 ---> 956 +31426 ---> 26992 +31427 ---> 26993 +31428 ---> 26994 +31429 ---> 26995 +31433 ---> 26996 +31435 ---> 26997 +31441 ---> 26998 +31443 ---> 26999 +31445 ---> 27000 +31447 ---> 27001 +31448 ---> 27002 +31449 ---> 27003 +31453 ---> 27004 +31456 ---> 27005 +31459 ---> 27006 +31460 ---> 27007 +31463 ---> 27008 +31468 ---> 27009 +31469 ---> 27010 +31471 ---> 27011 +31475 ---> 27012 +31476 ---> 27013 +31477 ---> 27014 +31480 ---> 27015 +31482 ---> 27016 +31483 ---> 27017 +31484 ---> 27018 +31485 ---> 27019 +31487 ---> 27020 +31488 ---> 27021 +31489 ---> 27022 +31492 ---> 27023 +31493 ---> 27024 +31496 ---> 27025 +31499 ---> 27026 +31503 ---> 27027 +31504 ---> 27028 +31505 ---> 27029 +31507 ---> 27030 +31511 ---> 27031 +31514 ---> 27032 +31516 ---> 27033 +31517 ---> 27034 +31519 ---> 27035 +31520 ---> 27036 +31524 ---> 27037 +31525 ---> 27038 +31526 ---> 27039 +31531 ---> 27040 +31532 ---> 27041 +31534 ---> 27042 +31536 ---> 27043 +31542 ---> 27044 +31544 ---> 27045 +31547 ---> 27046 +31557 ---> 27047 +31559 ---> 27048 +31560 ---> 27049 +31561 ---> 27050 +31562 ---> 27051 +31563 ---> 27052 +31570 ---> 27053 +31575 ---> 27054 +31576 ---> 27055 +31583 ---> 27056 +31586 ---> 27057 +31587 ---> 27058 +31595 ---> 27059 +31596 ---> 27060 +31597 ---> 27061 +31598 ---> 27062 +31599 ---> 27063 +31605 ---> 27064 +31606 ---> 27065 +31608 ---> 27066 +31609 ---> 27067 +31610 ---> 27068 +31611 ---> 27069 +31612 ---> 27070 +31614 ---> 27071 +31617 ---> 27072 +31619 ---> 27073 +31622 ---> 27074 +31623 ---> 27075 +31625 ---> 27076 +31626 ---> 27077 +31628 ---> 27078 +31633 ---> 27079 +31634 ---> 27080 +31635 ---> 27081 +31638 ---> 27082 +31639 ---> 27083 +31640 ---> 27084 +31643 ---> 27085 +31645 ---> 27086 +31646 ---> 27087 +31647 ---> 27088 +31648 ---> 27089 +31650 ---> 27090 +31651 ---> 27091 +31652 ---> 27092 +31655 ---> 27093 +31658 ---> 27094 +31659 ---> 27095 +31662 ---> 27096 +31664 ---> 27097 +31665 ---> 27098 +31671 ---> 27099 +31672 ---> 27100 +31673 ---> 27101 +31674 ---> 27102 +31675 ---> 27103 +31676 ---> 27104 +31677 ---> 27105 +31687 ---> 27106 +31690 ---> 27107 +31692 ---> 27108 +31695 ---> 27109 +31696 ---> 27110 +31699 ---> 27111 +31704 ---> 27112 +31709 ---> 27113 +31712 ---> 27114 +31713 ---> 27115 +31717 ---> 27116 +31718 ---> 27117 +31720 ---> 1406 +31721 ---> 1411 +31722 ---> 27118 +31723 ---> 27119 +31724 ---> 27120 +31726 ---> 27121 +31728 ---> 27122 +31731 ---> 27123 +31732 ---> 27124 +31733 ---> 27125 +31734 ---> 27126 +31735 ---> 27127 +31740 ---> 27128 +31743 ---> 27129 +31746 ---> 27130 +31748 ---> 27131 +31749 ---> 27132 +31751 ---> 1506 +31757 ---> 27133 +31760 ---> 27134 +31761 ---> 27135 +31762 ---> 27136 +31764 ---> 27137 +31766 ---> 27138 +31769 ---> 27139 +31772 ---> 27140 +31776 ---> 27141 +31777 ---> 27142 +31784 ---> 27143 +31785 ---> 27144 +31786 ---> 27145 +31787 ---> 27146 +31792 ---> 27147 +31793 ---> 27148 +31795 ---> 27149 +31796 ---> 27150 +31797 ---> 27151 +31798 ---> 27152 +31799 ---> 27153 +31802 ---> 27154 +31803 ---> 27155 +31804 ---> 27156 +31805 ---> 27157 +31807 ---> 27158 +31808 ---> 27159 +31809 ---> 27160 +31812 ---> 27161 +31813 ---> 27162 +31814 ---> 27163 +31820 ---> 27164 +31823 ---> 27165 +31825 ---> 27166 +31833 ---> 27167 +31834 ---> 27168 +31836 ---> 27169 +31837 ---> 27170 +31840 ---> 27171 +31841 ---> 27172 +31842 ---> 27173 +31847 ---> 27174 +31851 ---> 27175 +31858 ---> 27176 +31859 ---> 27177 +31860 ---> 27178 +31862 ---> 27179 +31863 ---> 27180 +31866 ---> 27181 +31867 ---> 27182 +31868 ---> 27183 +31870 ---> 27184 +31872 ---> 27185 +31873 ---> 27186 +31874 ---> 27187 +31875 ---> 27188 +31877 ---> 27189 +31878 ---> 27190 +31879 ---> 27191 +31880 ---> 27192 +31881 ---> 27193 +31882 ---> 27194 +31884 ---> 27195 +31886 ---> 27196 +31889 ---> 27197 +31893 ---> 27198 +31894 ---> 27199 +31895 ---> 27200 +31898 ---> 27201 +31899 ---> 27202 +31900 ---> 27203 +31901 ---> 27204 +31902 ---> 27205 +31903 ---> 27206 +31906 ---> 27207 +31907 ---> 27208 +31908 ---> 27209 +31909 ---> 27210 +31910 ---> 27211 +31911 ---> 27212 +31912 ---> 27213 +31913 ---> 27214 +31914 ---> 27215 +31915 ---> 27216 +31917 ---> 27217 +31918 ---> 27218 +31924 ---> 27219 +31925 ---> 27220 +31927 ---> 27221 +31928 ---> 27222 +31929 ---> 27223 +31931 ---> 27224 +31933 ---> 27225 +31934 ---> 924 +31935 ---> 27226 +31939 ---> 27227 +31941 ---> 27228 +31942 ---> 27229 +31943 ---> 27230 +31949 ---> 27231 +31951 ---> 27232 +31953 ---> 27233 +31954 ---> 27234 +31956 ---> 27235 +31962 ---> 27236 +31965 ---> 27237 +31968 ---> 27238 +31969 ---> 27239 +31970 ---> 27240 +31971 ---> 27241 +31972 ---> 27242 +31973 ---> 27243 +31977 ---> 27244 +31978 ---> 27245 +31979 ---> 27246 +31983 ---> 27247 +31984 ---> 27248 +31985 ---> 27249 +31987 ---> 27250 +31990 ---> 27251 +31995 ---> 27252 +31996 ---> 27253 +31997 ---> 27254 +31999 ---> 27255 +32000 ---> 27256 +32003 ---> 27257 +32004 ---> 27258 +32005 ---> 27259 +32007 ---> 27260 +32008 ---> 27261 +32009 ---> 27262 +32010 ---> 27263 +32011 ---> 27264 +32012 ---> 27265 +32013 ---> 27266 +32015 ---> 27267 +32017 ---> 27268 +32018 ---> 27269 +32019 ---> 27270 +32021 ---> 27271 +32024 ---> 27272 +32025 ---> 27273 +32027 ---> 27274 +32029 ---> 27275 +32036 ---> 27276 +32037 ---> 27277 +32038 ---> 27278 +32051 ---> 27279 +32053 ---> 27280 +32054 ---> 27281 +32055 ---> 27282 +32057 ---> 27283 +32062 ---> 27284 +32063 ---> 27285 +32064 ---> 27286 +32065 ---> 27287 +32067 ---> 27288 +32068 ---> 27289 +32070 ---> 27290 +32073 ---> 27291 +32075 ---> 27292 +32076 ---> 27293 +32077 ---> 27294 +32078 ---> 27295 +32079 ---> 27296 +32080 ---> 27297 +32081 ---> 27298 +32082 ---> 27299 +32083 ---> 27300 +32084 ---> 27301 +32086 ---> 27302 +32088 ---> 27303 +32089 ---> 27304 +32090 ---> 27305 +32092 ---> 27306 +32095 ---> 931 +32098 ---> 27307 +32099 ---> 27308 +32100 ---> 27310 +32101 ---> 27311 +32103 ---> 27312 +32105 ---> 27313 +32110 ---> 27314 +32114 ---> 27315 +32115 ---> 27316 +32117 ---> 27317 +32118 ---> 27318 +32119 ---> 27319 +32126 ---> 27320 +32130 ---> 27321 +32134 ---> 27322 +32135 ---> 27323 +32136 ---> 27324 +32139 ---> 27325 +32142 ---> 27326 +32143 ---> 27327 +32144 ---> 27328 +32145 ---> 27329 +32147 ---> 27330 +32152 ---> 27331 +32155 ---> 27332 +32157 ---> 27333 +32158 ---> 27334 +32159 ---> 27335 +32162 ---> 27336 +32163 ---> 27337 +32164 ---> 27338 +32167 ---> 27339 +32171 ---> 27340 +32174 ---> 27341 +32175 ---> 27342 +32178 ---> 27343 +32180 ---> 27344 +32184 ---> 27345 +32185 ---> 27346 +32187 ---> 27347 +32188 ---> 27348 +32197 ---> 27349 +32198 ---> 27350 +32199 ---> 27351 +32201 ---> 27352 +32204 ---> 27353 +32206 ---> 27354 +32207 ---> 27355 +32208 ---> 27356 +32215 ---> 27357 +32217 ---> 27358 +32218 ---> 27359 +32219 ---> 27360 +32221 ---> 27361 +32224 ---> 27362 +32225 ---> 27363 +32227 ---> 27364 +32228 ---> 27365 +32231 ---> 27366 +32232 ---> 27367 +32233 ---> 27368 +32234 ---> 27369 +32235 ---> 27370 +32236 ---> 27371 +32237 ---> 27372 +32238 ---> 27373 +32239 ---> 27374 +32246 ---> 27375 +32250 ---> 27376 +32251 ---> 27377 +32253 ---> 27378 +32255 ---> 27379 +32256 ---> 27380 +32262 ---> 27381 +32269 ---> 27382 +32270 ---> 27383 +32271 ---> 27384 +32272 ---> 27385 +32273 ---> 27386 +32276 ---> 27387 +32277 ---> 27388 +32278 ---> 27389 +32279 ---> 27390 +32280 ---> 27391 +32282 ---> 27392 +32285 ---> 27393 +32287 ---> 27394 +32291 ---> 27395 +32295 ---> 27396 +32296 ---> 27397 +32300 ---> 27398 +32301 ---> 27399 +32303 ---> 27400 +32305 ---> 27401 +32307 ---> 27403 +32308 ---> 27404 +32309 ---> 27405 +32310 ---> 27406 +32312 ---> 27407 +32313 ---> 27408 +32316 ---> 27409 +32319 ---> 27410 +32321 ---> 27411 +32323 ---> 27412 +32325 ---> 27413 +32327 ---> 27414 +32328 ---> 27415 +32330 ---> 27416 +32331 ---> 27417 +32334 ---> 27418 +32335 ---> 27419 +32336 ---> 27420 +32337 ---> 27421 +32340 ---> 27422 +32343 ---> 27423 +32345 ---> 27424 +32346 ---> 27425 +32347 ---> 27426 +32348 ---> 27427 +32349 ---> 27428 +32354 ---> 27429 +32355 ---> 27430 +32357 ---> 27431 +32364 ---> 27432 +32365 ---> 27433 +32367 ---> 27434 +32371 ---> 27435 +32375 ---> 994 +32376 ---> 27436 +32378 ---> 27437 +32382 ---> 27438 +32385 ---> 27439 +32386 ---> 27440 +32387 ---> 27441 +32391 ---> 27442 +32396 ---> 27443 +32397 ---> 27444 +32400 ---> 27445 +32406 ---> 27446 +32408 ---> 27447 +32409 ---> 27448 +32412 ---> 27449 +32413 ---> 27450 +32414 ---> 27451 +32415 ---> 27452 +32417 ---> 27453 +32420 ---> 27454 +32421 ---> 27455 +32423 ---> 27456 +32425 ---> 27457 +32426 ---> 27458 +32427 ---> 27459 +32428 ---> 27460 +32430 ---> 27461 +32438 ---> 27462 +32442 ---> 27463 +32445 ---> 27464 +32448 ---> 27465 +32449 ---> 27466 +32450 ---> 27467 +32452 ---> 27468 +32454 ---> 27469 +32457 ---> 27470 +32461 ---> 27471 +32464 ---> 27472 +32465 ---> 27473 +32467 ---> 27474 +32473 ---> 27475 +32474 ---> 27476 +32475 ---> 27477 +32476 ---> 27478 +32478 ---> 27479 +32479 ---> 27480 +32480 ---> 27481 +32481 ---> 27482 +32485 ---> 27483 +32493 ---> 27484 +32494 ---> 27485 +32497 ---> 27486 +32501 ---> 27487 +32502 ---> 27488 +32503 ---> 27489 +32507 ---> 27490 +32510 ---> 27491 +32511 ---> 27492 +32514 ---> 27493 +32515 ---> 27494 +32516 ---> 27495 +32519 ---> 27496 +32520 ---> 27497 +32521 ---> 27498 +32523 ---> 27499 +32526 ---> 27500 +32528 ---> 27501 +32529 ---> 27502 +32534 ---> 27503 +32536 ---> 27504 +32539 ---> 27505 +32544 ---> 27506 +32547 ---> 27507 +32550 ---> 27508 +32551 ---> 27509 +32552 ---> 27510 +32553 ---> 27511 +32554 ---> 27512 +32560 ---> 27513 +32561 ---> 27514 +32563 ---> 27515 +32569 ---> 27516 +32570 ---> 27517 +32575 ---> 27518 +32576 ---> 27519 +32582 ---> 937 +32583 ---> 27520 +32587 ---> 27521 +32588 ---> 27522 +32589 ---> 27523 +32593 ---> 27524 +32594 ---> 27525 +32595 ---> 27526 +32598 ---> 27527 +32600 ---> 27528 +32602 ---> 27529 +32603 ---> 27530 +32606 ---> 27531 +32608 ---> 27532 +32610 ---> 27533 +32611 ---> 27534 +32612 ---> 27535 +32615 ---> 916 +32616 ---> 27536 +32619 ---> 27537 +32624 ---> 27538 +32628 ---> 27539 +32630 ---> 27541 +32631 ---> 27542 +32635 ---> 27543 +32636 ---> 27544 +32638 ---> 27545 +32639 ---> 27546 +32640 ---> 27547 +32641 ---> 27548 +32642 ---> 27549 +32643 ---> 27550 +32644 ---> 27551 +32645 ---> 27552 +32647 ---> 27553 +32650 ---> 27554 +32656 ---> 27555 +32657 ---> 27556 +32658 ---> 27557 +32664 ---> 27558 +32665 ---> 27559 +32672 ---> 27560 +32674 ---> 27561 +32678 ---> 27562 +32679 ---> 27563 +32681 ---> 27564 +32684 ---> 27565 +32685 ---> 27566 +32686 ---> 27567 +32687 ---> 27568 +32688 ---> 27569 +32689 ---> 27570 +32691 ---> 27571 +32694 ---> 27572 +32695 ---> 27573 +32699 ---> 27574 +32703 ---> 27575 +32706 ---> 27576 +32707 ---> 27577 +32708 ---> 27578 +32710 ---> 27579 +32711 ---> 27580 +32713 ---> 27581 +32716 ---> 27582 +32718 ---> 27583 +32721 ---> 27584 +32727 ---> 27585 +32728 ---> 27586 +32730 ---> 27587 +32733 ---> 27588 +32735 ---> 27589 +32736 ---> 27590 +32739 ---> 27591 +32740 ---> 27592 +32742 ---> 27593 +32745 ---> 27594 +32748 ---> 12181 +32749 ---> 27595 +32750 ---> 27596 +32751 ---> 27597 +32753 ---> 27598 +32756 ---> 27599 +32757 ---> 27600 +32758 ---> 27601 +32760 ---> 27602 +32762 ---> 27603 +32763 ---> 27604 +32764 ---> 27605 +32765 ---> 27606 +32767 ---> 27607 +32768 ---> 27608 +32769 ---> 27609 +32770 ---> 27610 +32771 ---> 27611 +32773 ---> 27612 +32774 ---> 27613 +32775 ---> 27614 +32780 ---> 27615 +32781 ---> 27616 +32782 ---> 27617 +32785 ---> 27618 +32787 ---> 27619 +32788 ---> 27620 +32790 ---> 935 +32796 ---> 27621 +32797 ---> 27622 +32800 ---> 27623 +32801 ---> 27624 +32802 ---> 27625 +32805 ---> 27626 +32806 ---> 27627 +32807 ---> 27628 +32808 ---> 27629 +32809 ---> 1507 +32812 ---> 27630 +32813 ---> 27631 +32815 ---> 27632 +32817 ---> 27633 +32819 ---> 27634 +32822 ---> 27635 +32825 ---> 27636 +32826 ---> 27637 +32827 ---> 27638 +32829 ---> 27639 +32831 ---> 27640 +32832 ---> 27641 +32834 ---> 27642 +32837 ---> 27643 +32839 ---> 27644 +32847 ---> 27645 +32849 ---> 27646 +32850 ---> 27647 +32857 ---> 27648 +32861 ---> 27649 +32862 ---> 27650 +32863 ---> 27651 +32864 ---> 27652 +32865 ---> 27653 +32866 ---> 27654 +32868 ---> 27655 +32870 ---> 27656 +32874 ---> 27657 +32875 ---> 27658 +32876 ---> 27659 +32877 ---> 27660 +32878 ---> 27661 +32879 ---> 27662 +32882 ---> 27663 +32883 ---> 27664 +32885 ---> 27665 +32888 ---> 27666 +32889 ---> 27667 +32894 ---> 27668 +32897 ---> 27669 +32898 ---> 27670 +32902 ---> 27671 +32905 ---> 27672 +32907 ---> 27673 +32909 ---> 27674 +32910 ---> 27675 +32913 ---> 27676 +32914 ---> 27677 +32915 ---> 27678 +32918 ---> 27679 +32924 ---> 27680 +32926 ---> 27681 +32928 ---> 27682 +32931 ---> 27683 +32932 ---> 27684 +32933 ---> 27685 +32935 ---> 27686 +32939 ---> 27687 +32941 ---> 27688 +32942 ---> 27689 +32943 ---> 27690 +32944 ---> 27691 +32946 ---> 27692 +32948 ---> 27693 +32950 ---> 27694 +32951 ---> 27695 +32955 ---> 27696 +32959 ---> 27697 +32960 ---> 27698 +32961 ---> 27699 +32970 ---> 27700 +32971 ---> 27701 +32974 ---> 27702 +32976 ---> 27703 +32977 ---> 27704 +32978 ---> 27705 +32979 ---> 27706 +32980 ---> 27707 +32982 ---> 27708 +32983 ---> 27709 +32984 ---> 27710 +32985 ---> 27711 +32986 ---> 27712 +32987 ---> 27713 +32988 ---> 27714 +32990 ---> 27715 +32999 ---> 27716 +33001 ---> 27717 +33002 ---> 27718 +33004 ---> 27719 +33005 ---> 27720 +33006 ---> 27721 +33007 ---> 27722 +33008 ---> 27723 +33009 ---> 27724 +33010 ---> 27725 +33013 ---> 27726 +33016 ---> 27727 +33018 ---> 27728 +33026 ---> 27729 +33029 ---> 27730 +33030 ---> 27731 +33033 ---> 27732 +33034 ---> 27733 +33037 ---> 27734 +33038 ---> 27735 +33042 ---> 27736 +33043 ---> 27737 +33047 ---> 27738 +33049 ---> 27739 +33053 ---> 27740 +33058 ---> 27741 +33060 ---> 27742 +33064 ---> 27743 +33069 ---> 27744 +33071 ---> 27745 +33074 ---> 27746 +33081 ---> 27747 +33084 ---> 27748 +33087 ---> 27749 +33088 ---> 27750 +33089 ---> 27751 +33091 ---> 27752 +33094 ---> 27753 +33096 ---> 27754 +33098 ---> 27755 +33106 ---> 27756 +33107 ---> 27757 +33109 ---> 1500 +33110 ---> 27758 +33111 ---> 27759 +33112 ---> 27760 +33115 ---> 27761 +33117 ---> 27762 +33120 ---> 27763 +33122 ---> 27764 +33123 ---> 27765 +33126 ---> 27766 +33127 ---> 27767 +33129 ---> 27768 +33130 ---> 27769 +33131 ---> 27770 +33141 ---> 27771 +33144 ---> 27772 +33146 ---> 27773 +33148 ---> 27774 +33149 ---> 27775 +33150 ---> 27776 +33151 ---> 27777 +33154 ---> 27778 +33157 ---> 27779 +33158 ---> 27780 +33159 ---> 27781 +33160 ---> 27782 +33161 ---> 27783 +33162 ---> 27784 +33163 ---> 27785 +33164 ---> 27786 +33165 ---> 27787 +33168 ---> 27788 +33169 ---> 27789 +33170 ---> 27790 +33172 ---> 27791 +33179 ---> 27792 +33182 ---> 27793 +33183 ---> 27794 +33188 ---> 27795 +33199 ---> 27796 +33202 ---> 27797 +33211 ---> 27798 +33213 ---> 27799 +33214 ---> 27800 +33219 ---> 27801 +33222 ---> 27802 +33228 ---> 27803 +33231 ---> 27804 +33232 ---> 27805 +33233 ---> 27806 +33234 ---> 27807 +33236 ---> 27808 +33237 ---> 27809 +33238 ---> 27810 +33239 ---> 27811 +33240 ---> 27812 +33241 ---> 27813 +33242 ---> 27814 +33243 ---> 27815 +33246 ---> 27816 +33249 ---> 27817 +33250 ---> 27818 +33251 ---> 27819 +33252 ---> 27820 +33257 ---> 27821 +33264 ---> 27822 +33266 ---> 27823 +33269 ---> 27824 +33270 ---> 27825 +33273 ---> 27826 +33275 ---> 27827 +33276 ---> 27828 +33277 ---> 27829 +33278 ---> 27830 +33279 ---> 27831 +33284 ---> 27832 +33285 ---> 27833 +33291 ---> 27834 +33292 ---> 27835 +33293 ---> 27836 +33294 ---> 27837 +33295 ---> 27838 +33296 ---> 27839 +33298 ---> 27840 +33299 ---> 27841 +33303 ---> 27842 +33304 ---> 27843 +33305 ---> 27844 +33311 ---> 27845 +33313 ---> 27846 +33315 ---> 27847 +33317 ---> 1417 +33319 ---> 27848 +33320 ---> 27849 +33321 ---> 27850 +33322 ---> 27851 +33323 ---> 27852 +33328 ---> 27853 +33329 ---> 27854 +33331 ---> 27855 +33332 ---> 27856 +33336 ---> 27857 +33338 ---> 27858 +33339 ---> 27859 +33342 ---> 27860 +33346 ---> 27861 +33347 ---> 27862 +33350 ---> 27863 +33360 ---> 27864 +33363 ---> 27865 +33364 ---> 27866 +33365 ---> 27867 +33368 ---> 27868 +33372 ---> 27869 +33373 ---> 27870 +33374 ---> 27871 +33375 ---> 27872 +33376 ---> 27873 +33380 ---> 27874 +33389 ---> 27875 +33390 ---> 27876 +33392 ---> 27877 +33396 ---> 27878 +33398 ---> 27879 +33399 ---> 27880 +33401 ---> 27881 +33403 ---> 27882 +33406 ---> 27883 +33407 ---> 27884 +33408 ---> 27885 +33409 ---> 27886 +33419 ---> 27887 +33430 ---> 27888 +33431 ---> 27889 +33434 ---> 27890 +33437 ---> 27891 +33440 ---> 27892 +33441 ---> 27893 +33442 ---> 27894 +33448 ---> 27895 +33453 ---> 27896 +33454 ---> 27897 +33456 ---> 27898 +33457 ---> 27899 +33458 ---> 1561 +33459 ---> 27900 +33461 ---> 27901 +33464 ---> 968 +33465 ---> 27902 +33470 ---> 27903 +33480 ---> 27904 +33482 ---> 27905 +33483 ---> 27906 +33485 ---> 27907 +33486 ---> 27908 +33487 ---> 27909 +33488 ---> 27910 +33490 ---> 27911 +33492 ---> 27912 +33500 ---> 27913 +33501 ---> 27914 +33502 ---> 27915 +33506 ---> 27916 +33507 ---> 27917 +33508 ---> 27918 +33509 ---> 27919 +33511 ---> 27920 +33513 ---> 27921 +33514 ---> 27922 +33518 ---> 27923 +33523 ---> 27924 +33524 ---> 27925 +33526 ---> 27926 +33528 ---> 27927 +33530 ---> 27928 +33534 ---> 27929 +33535 ---> 27930 +33538 ---> 27931 +33540 ---> 27932 +33541 ---> 27933 +33542 ---> 27934 +33543 ---> 27935 +33546 ---> 27936 +33550 ---> 27937 +33552 ---> 27938 +33553 ---> 27939 +33557 ---> 1061 +33558 ---> 27940 +33560 ---> 27941 +33561 ---> 27942 +33563 ---> 27943 +33566 ---> 954 +33572 ---> 27944 +33573 ---> 27945 +33574 ---> 27946 +33577 ---> 27947 +33582 ---> 27948 +33584 ---> 27949 +33585 ---> 27950 +33587 ---> 27951 +33590 ---> 27952 +33594 ---> 27953 +33595 ---> 27954 +33596 ---> 27955 +33601 ---> 27956 +33602 ---> 27957 +33603 ---> 27958 +33604 ---> 27959 +33609 ---> 27960 +33612 ---> 27961 +33613 ---> 27962 +33614 ---> 27963 +33615 ---> 27964 +33616 ---> 12190 +33618 ---> 27965 +33620 ---> 27966 +33622 ---> 27967 +33623 ---> 27968 +33625 ---> 27969 +33627 ---> 27970 +33628 ---> 27971 +33629 ---> 27972 +33631 ---> 27973 +33638 ---> 27974 +33643 ---> 27975 +33644 ---> 27976 +33648 ---> 27977 +33651 ---> 27978 +33653 ---> 27979 +33655 ---> 27980 +33663 ---> 27981 +33666 ---> 27982 +33671 ---> 27983 +33673 ---> 27984 +33674 ---> 27985 +33676 ---> 27986 +33677 ---> 27987 +33682 ---> 27988 +33683 ---> 27989 +33684 ---> 27990 +33686 ---> 27991 +33689 ---> 27992 +33691 ---> 27993 +33692 ---> 27994 +33693 ---> 917 +33696 ---> 27995 +33699 ---> 27996 +33701 ---> 27997 +33702 ---> 27998 +33703 ---> 27999 +33704 ---> 28000 +33706 ---> 28001 +33710 ---> 28002 +33711 ---> 28003 +33712 ---> 28004 +33714 ---> 28005 +33715 ---> 28006 +33716 ---> 28007 +33717 ---> 28008 +33719 ---> 28009 +33720 ---> 28010 +33724 ---> 28011 +33727 ---> 28012 +33728 ---> 28013 +33729 ---> 28014 +33731 ---> 28015 +33732 ---> 28016 +33733 ---> 28017 +33735 ---> 28018 +33736 ---> 28019 +33740 ---> 28020 +33742 ---> 28021 +33743 ---> 28022 +33744 ---> 28023 +33745 ---> 28024 +33746 ---> 28025 +33750 ---> 28026 +33753 ---> 28027 +33761 ---> 28028 +33762 ---> 28029 +33765 ---> 28030 +33767 ---> 28031 +33768 ---> 28032 +33769 ---> 28033 +33770 ---> 28034 +33774 ---> 28035 +33776 ---> 28036 +33786 ---> 28037 +33789 ---> 28038 +33791 ---> 28039 +33794 ---> 28040 +33795 ---> 28041 +33797 ---> 28042 +33798 ---> 28043 +33799 ---> 28044 +33800 ---> 28045 +33806 ---> 28046 +33807 ---> 28047 +33809 ---> 28048 +33813 ---> 28049 +33822 ---> 28050 +33823 ---> 28051 +33828 ---> 28052 +33829 ---> 28053 +33830 ---> 28054 +33831 ---> 28055 +33832 ---> 28056 +33833 ---> 28057 +33834 ---> 28058 +33836 ---> 28059 +33837 ---> 28060 +33838 ---> 28061 +33839 ---> 28062 +33841 ---> 28063 +33844 ---> 28064 +33845 ---> 28065 +33846 ---> 28066 +33847 ---> 28067 +33848 ---> 28068 +33849 ---> 28069 +33850 ---> 28070 +33853 ---> 28071 +33855 ---> 28072 +33857 ---> 28073 +33858 ---> 28074 +33859 ---> 28075 +33861 ---> 28076 +33862 ---> 28077 +33866 ---> 28078 +33870 ---> 28079 +33872 ---> 28080 +33873 ---> 28081 +33874 ---> 28082 +33875 ---> 28083 +33877 ---> 28084 +33879 ---> 28085 +33880 ---> 28086 +33882 ---> 28087 +33883 ---> 28088 +33884 ---> 28089 +33885 ---> 28090 +33886 ---> 28091 +33887 ---> 28092 +33888 ---> 28093 +33889 ---> 28094 +33890 ---> 28095 +33891 ---> 28096 +33893 ---> 28097 +33894 ---> 28098 +33895 ---> 28099 +33896 ---> 28100 +33897 ---> 28101 +33898 ---> 28102 +33902 ---> 28103 +33904 ---> 28104 +33909 ---> 28105 +33910 ---> 28106 +33919 ---> 28107 +33922 ---> 28108 +33927 ---> 28109 +33931 ---> 28110 +33934 ---> 28111 +33937 ---> 28112 +33938 ---> 28113 +33940 ---> 28114 +33941 ---> 28115 +33942 ---> 28116 +33943 ---> 28117 +33944 ---> 28118 +33945 ---> 28119 +33946 ---> 28120 +33949 ---> 28121 +33950 ---> 28122 +33951 ---> 28123 +33953 ---> 28124 +33957 ---> 28125 +33958 ---> 964 +33959 ---> 28126 +33961 ---> 28127 +33964 ---> 28128 +33965 ---> 28129 +33966 ---> 28130 +33967 ---> 28131 +33968 ---> 28132 +33972 ---> 28133 +33976 ---> 28134 +33978 ---> 28135 +33981 ---> 948 +33982 ---> 28136 +33983 ---> 28137 +33984 ---> 28138 +33985 ---> 28139 +33986 ---> 28140 +33987 ---> 28141 +33991 ---> 28142 +33993 ---> 28143 +33994 ---> 28144 +33996 ---> 28145 +33997 ---> 28146 +33998 ---> 28147 +33999 ---> 28148 +34000 ---> 28149 +34002 ---> 28150 +34004 ---> 28151 +34005 ---> 28152 +34007 ---> 1557 +34008 ---> 28153 +34011 ---> 28154 +34012 ---> 28155 +34014 ---> 28156 +34015 ---> 28157 +34017 ---> 28158 +34018 ---> 28159 +34019 ---> 28160 +34022 ---> 28161 +34024 ---> 28162 +34025 ---> 28163 +34026 ---> 28164 +34027 ---> 28165 +34028 ---> 28166 +34029 ---> 28167 +34030 ---> 28168 +34031 ---> 28169 +34032 ---> 28170 +34033 ---> 28171 +34034 ---> 28172 +34036 ---> 28173 +34037 ---> 28174 +34038 ---> 28175 +34039 ---> 28176 +34042 ---> 28177 +34045 ---> 28178 +34046 ---> 28179 +34050 ---> 28180 +34051 ---> 28181 +34052 ---> 28182 +34055 ---> 28183 +34059 ---> 28184 +34060 ---> 28185 +34061 ---> 28186 +34063 ---> 922 +34064 ---> 28187 +34065 ---> 28188 +34066 ---> 28189 +34067 ---> 28190 +34068 ---> 28191 +34070 ---> 28192 +34071 ---> 28193 +34073 ---> 28194 +34074 ---> 28195 +34075 ---> 28196 +34076 ---> 28197 +34077 ---> 28198 +34079 ---> 28199 +34080 ---> 28200 +34081 ---> 28201 +34083 ---> 28202 +34093 ---> 28203 +34094 ---> 28204 +34095 ---> 28205 +34096 ---> 28206 +34097 ---> 28207 +34098 ---> 28208 +34099 ---> 28209 +34100 ---> 28210 +34101 ---> 28211 +34102 ---> 28212 +34103 ---> 28213 +34106 ---> 28214 +34108 ---> 28215 +34109 ---> 28216 +34113 ---> 1421 +34115 ---> 28217 +34118 ---> 28218 +34120 ---> 28219 +34122 ---> 28220 +34124 ---> 28221 +34125 ---> 28222 +34126 ---> 28223 +34127 ---> 28224 +34130 ---> 11684 +34136 ---> 28225 +34139 ---> 28226 +34141 ---> 28227 +34142 ---> 28228 +34143 ---> 28229 +34144 ---> 28230 +34146 ---> 28231 +34149 ---> 28232 +34151 ---> 28233 +34156 ---> 28234 +34157 ---> 28235 +34160 ---> 28236 +34161 ---> 28237 +34164 ---> 28238 +34166 ---> 28239 +34173 ---> 28240 +34176 ---> 28241 +34177 ---> 28242 +34178 ---> 28243 +34179 ---> 28244 +34180 ---> 28245 +34182 ---> 28246 +34183 ---> 28247 +34190 ---> 28248 +34192 ---> 28249 +34193 ---> 28250 +34200 ---> 28251 +34202 ---> 28252 +34204 ---> 28253 +34205 ---> 28254 +34206 ---> 28255 +34210 ---> 28256 +34211 ---> 28257 +34219 ---> 28258 +34220 ---> 28259 +34221 ---> 926 +34223 ---> 28260 +34225 ---> 28261 +34227 ---> 28262 +34228 ---> 28263 +34233 ---> 1946 +34236 ---> 11912 +34237 ---> 28264 +34239 ---> 28265 +34240 ---> 28266 +34242 ---> 28267 +34243 ---> 28268 +34244 ---> 28269 +34248 ---> 28270 +34251 ---> 28271 +34252 ---> 28272 +34253 ---> 28273 +34254 ---> 28274 +34255 ---> 28275 +34256 ---> 28276 +34257 ---> 28277 +34258 ---> 28278 +34259 ---> 28279 +34263 ---> 28280 +34264 ---> 28281 +34265 ---> 28282 +34266 ---> 28283 +34270 ---> 28284 +34273 ---> 28285 +34276 ---> 28286 +34277 ---> 28287 +34278 ---> 28288 +34281 ---> 28289 +34283 ---> 28290 +34287 ---> 28291 +34290 ---> 28292 +34293 ---> 28293 +34294 ---> 28294 +34295 ---> 28295 +34297 ---> 28296 +34299 ---> 28297 +34302 ---> 28298 +34308 ---> 28299 +34309 ---> 28300 +34310 ---> 28301 +34314 ---> 28302 +34316 ---> 28303 +34318 ---> 28304 +34320 ---> 28305 +34325 ---> 28306 +34326 ---> 28307 +34327 ---> 28308 +34329 ---> 28309 +34330 ---> 28310 +34334 ---> 28311 +34338 ---> 945 +34340 ---> 28312 +34343 ---> 28313 +34349 ---> 28314 +34350 ---> 28315 +34355 ---> 28316 +34358 ---> 28317 +34359 ---> 28318 +34361 ---> 28319 +34363 ---> 28320 +34364 ---> 28321 +34366 ---> 28322 +34368 ---> 28323 +34369 ---> 28324 +34372 ---> 28325 +34376 ---> 28326 +34377 ---> 28327 +34392 ---> 28328 +34395 ---> 28329 +34397 ---> 28330 +34398 ---> 28331 +34400 ---> 28332 +34407 ---> 28333 +34413 ---> 28334 +34414 ---> 28335 +34417 ---> 28336 +34419 ---> 28337 +34422 ---> 28338 +34423 ---> 28339 +34424 ---> 28340 +34426 ---> 28341 +34427 ---> 28342 +34428 ---> 28343 +34430 ---> 28344 +34434 ---> 28345 +34437 ---> 28346 +34444 ---> 28347 +34447 ---> 28348 +34452 ---> 28349 +34454 ---> 28350 +34455 ---> 28351 +34459 ---> 28352 +34460 ---> 1583 +34461 ---> 28353 +34462 ---> 28354 +34463 ---> 28355 +34465 ---> 28356 +34466 ---> 28357 +34472 ---> 28358 +34473 ---> 28359 +34478 ---> 28360 +34479 ---> 28361 +34486 ---> 28362 +34487 ---> 28363 +34488 ---> 28364 +34489 ---> 28365 +34490 ---> 28366 +34492 ---> 28367 +34493 ---> 28368 +34498 ---> 28369 +34499 ---> 28370 +34501 ---> 28371 +34502 ---> 28372 +34503 ---> 28373 +34505 ---> 28374 +34506 ---> 28375 +34509 ---> 28376 +34510 ---> 28377 +34511 ---> 28378 +34512 ---> 28379 +34513 ---> 28380 +34514 ---> 28381 +34515 ---> 28382 +34516 ---> 28383 +34517 ---> 28384 +34518 ---> 28385 +34519 ---> 28386 +34520 ---> 28387 +34521 ---> 28388 +34522 ---> 28389 +34523 ---> 28390 +34524 ---> 28391 +34525 ---> 28392 +34526 ---> 28393 +34527 ---> 28394 +34530 ---> 28395 +34534 ---> 28396 +34535 ---> 28397 +34536 ---> 28398 +34537 ---> 3407 +34540 ---> 28399 +34542 ---> 28400 +34543 ---> 28401 +34544 ---> 28402 +34547 ---> 28403 +34550 ---> 28404 +34551 ---> 28405 +34555 ---> 28406 +34562 ---> 28407 +34568 ---> 28408 +34570 ---> 28409 +34572 ---> 28410 +34574 ---> 28411 +34576 ---> 28412 +34577 ---> 28413 +34578 ---> 28414 +34579 ---> 28415 +34580 ---> 28416 +34582 ---> 28417 +34584 ---> 28418 +34586 ---> 28419 +34588 ---> 28420 +34590 ---> 28421 +34591 ---> 28422 +34592 ---> 28423 +34599 ---> 28424 +34600 ---> 28425 +34602 ---> 28426 +34605 ---> 28427 +34606 ---> 28428 +34608 ---> 28429 +34613 ---> 28430 +34615 ---> 28431 +34616 ---> 28432 +34618 ---> 28433 +34619 ---> 28434 +34620 ---> 28435 +34623 ---> 28436 +34625 ---> 28437 +34628 ---> 28438 +34631 ---> 28439 +34632 ---> 28440 +34633 ---> 28441 +34635 ---> 28442 +34638 ---> 28443 +34640 ---> 28444 +34648 ---> 28445 +34659 ---> 28446 +34662 ---> 28447 +34663 ---> 28448 +34666 ---> 28449 +34670 ---> 28450 +34671 ---> 28451 +34672 ---> 28452 +34675 ---> 28453 +34676 ---> 28454 +34681 ---> 28455 +34683 ---> 28456 +34687 ---> 28457 +34689 ---> 28458 +34690 ---> 28459 +34697 ---> 28460 +34699 ---> 28461 +34706 ---> 28462 +34717 ---> 28463 +34718 ---> 28464 +34719 ---> 28465 +34721 ---> 28466 +34722 ---> 28467 +34723 ---> 28468 +34728 ---> 28469 +34730 ---> 28470 +34731 ---> 28471 +34739 ---> 28472 +34740 ---> 28473 +34744 ---> 28474 +34745 ---> 28475 +34746 ---> 28476 +34750 ---> 28477 +34752 ---> 953 +34754 ---> 28478 +34761 ---> 28479 +34765 ---> 28480 +34766 ---> 28481 +34768 ---> 28482 +34770 ---> 28483 +34771 ---> 28484 +34773 ---> 28485 +34775 ---> 28486 +34777 ---> 28487 +34778 ---> 28488 +34779 ---> 28489 +34781 ---> 28490 +34791 ---> 28491 +34793 ---> 28492 +34794 ---> 28493 +34799 ---> 28494 +34800 ---> 28495 +34801 ---> 28496 +34803 ---> 28497 +34804 ---> 28498 +34807 ---> 28499 +34808 ---> 28500 +34809 ---> 28501 +34810 ---> 28502 +34816 ---> 28503 +34822 ---> 28504 +34823 ---> 28505 +34824 ---> 1428 +34825 ---> 28506 +34826 ---> 28507 +34828 ---> 28508 +34830 ---> 28509 +34831 ---> 28510 +34833 ---> 28511 +34835 ---> 28512 +34837 ---> 28513 +34839 ---> 28514 +34840 ---> 28515 +34841 ---> 28516 +34845 ---> 28517 +34847 ---> 28518 +34849 ---> 28519 +34851 ---> 28520 +34852 ---> 28521 +34853 ---> 28522 +34855 ---> 28523 +34857 ---> 28524 +34863 ---> 28525 +34864 ---> 28526 +34867 ---> 28527 +34868 ---> 912 +34875 ---> 28528 +34876 ---> 28529 +34877 ---> 28530 +34878 ---> 28531 +34879 ---> 28532 +34881 ---> 28533 +34882 ---> 28534 +34885 ---> 28535 +34886 ---> 960 +34887 ---> 28536 +34892 ---> 28537 +34894 ---> 28538 +34895 ---> 28539 +34897 ---> 28540 +34899 ---> 28541 +34902 ---> 28542 +34904 ---> 28543 +34905 ---> 2359 +34906 ---> 28544 +34909 ---> 28545 +34910 ---> 28546 +34912 ---> 28547 +34918 ---> 28548 +34919 ---> 28549 +34920 ---> 28550 +34921 ---> 28551 +34922 ---> 28552 +34924 ---> 28553 +34925 ---> 28554 +34926 ---> 28555 +34927 ---> 28556 +34929 ---> 28557 +34932 ---> 1416 +34933 ---> 28558 +34935 ---> 28559 +34937 ---> 28560 +34938 ---> 28561 +34941 ---> 28562 +34942 ---> 28563 +34949 ---> 28564 +34953 ---> 28565 +34955 ---> 28566 +34957 ---> 961 +34958 ---> 28567 +34959 ---> 28568 +34963 ---> 28569 +34966 ---> 28570 +34969 ---> 28571 +34970 ---> 28572 +34972 ---> 28573 +34974 ---> 28574 +34976 ---> 28575 +34980 ---> 28576 +34982 ---> 28577 +34983 ---> 28578 +34984 ---> 28579 +34988 ---> 28580 +34989 ---> 28581 +34990 ---> 28582 +34991 ---> 28583 +34992 ---> 28584 +34993 ---> 28585 +34995 ---> 28586 +34996 ---> 28587 +34997 ---> 28588 +35001 ---> 28589 +35002 ---> 28590 +35006 ---> 28591 +35007 ---> 28592 +35009 ---> 28593 +35010 ---> 28594 +35011 ---> 28595 +35012 ---> 28596 +35021 ---> 28597 +35022 ---> 28598 +35026 ---> 28599 +35027 ---> 28600 +35030 ---> 28601 +35032 ---> 28602 +35034 ---> 28603 +35035 ---> 28604 +35037 ---> 28605 +35040 ---> 28606 +35041 ---> 28607 +35050 ---> 28608 +35053 ---> 28609 +35054 ---> 28610 +35063 ---> 28611 +35066 ---> 28612 +35068 ---> 28613 +35072 ---> 28614 +35073 ---> 28615 +35074 ---> 28616 +35075 ---> 918 +35084 ---> 28617 +35086 ---> 28618 +35088 ---> 28619 +35090 ---> 28620 +35095 ---> 28621 +35096 ---> 28622 +35099 ---> 28623 +35103 ---> 28624 +35111 ---> 28625 +35114 ---> 28626 +35117 ---> 28627 +35120 ---> 28628 +35121 ---> 28629 +35127 ---> 28630 +35128 ---> 1408 +35129 ---> 28631 +35130 ---> 28632 +35135 ---> 28633 +35137 ---> 28634 +35138 ---> 28635 +35143 ---> 28636 +35145 ---> 28637 +35146 ---> 28638 +35147 ---> 28639 +35151 ---> 28640 +35152 ---> 28641 +35153 ---> 28642 +35156 ---> 28643 +35157 ---> 942 +35159 ---> 28644 +35160 ---> 28645 +35163 ---> 28646 +35164 ---> 28647 +35165 ---> 28648 +35167 ---> 28649 +35169 ---> 28650 +35173 ---> 28651 +35176 ---> 28652 +35178 ---> 28653 +35180 ---> 28654 +35181 ---> 28655 +35182 ---> 28656 +35189 ---> 28657 +35191 ---> 28658 +35195 ---> 1582 +35203 ---> 1409 +35204 ---> 1410 +35205 ---> 28659 +35219 ---> 28660 +35220 ---> 28661 +35222 ---> 28662 +35224 ---> 28663 +35229 ---> 28664 +35230 ---> 28665 +35231 ---> 28666 +35233 ---> 28667 +35239 ---> 28668 +35244 ---> 28669 +35252 ---> 28670 +35254 ---> 28671 +35257 ---> 28672 +35263 ---> 28673 +35265 ---> 28674 +35266 ---> 28675 +35268 ---> 28676 +35283 ---> 28677 +35288 ---> 28678 +35290 ---> 28679 +35294 ---> 28680 +35302 ---> 28681 +35303 ---> 28682 +35307 ---> 28683 +35309 ---> 28684 +35313 ---> 28685 +35319 ---> 28686 +35328 ---> 28687 +35329 ---> 28688 +35330 ---> 28689 +35332 ---> 28690 +35333 ---> 28691 +35336 ---> 28692 +35341 ---> 28693 +35342 ---> 28694 +35343 ---> 28695 +35350 ---> 28696 +35351 ---> 28697 +35352 ---> 28698 +35358 ---> 28699 +35360 ---> 28700 +35361 ---> 28701 +35368 ---> 28702 +35369 ---> 28703 +35370 ---> 28704 +35371 ---> 28705 +35375 ---> 28706 +35376 ---> 28707 +35380 ---> 28708 +35381 ---> 28709 +35382 ---> 28710 +35384 ---> 28711 +35385 ---> 28712 +35386 ---> 1563 +35387 ---> 1576 +35388 ---> 28713 +35390 ---> 28714 +35391 ---> 28715 +35392 ---> 28716 +35393 ---> 28717 +35396 ---> 28718 +35400 ---> 28719 +35403 ---> 28720 +35404 ---> 28721 +35409 ---> 28722 +35410 ---> 28723 +35414 ---> 28724 +35419 ---> 28725 +35420 ---> 28726 +35421 ---> 28727 +35422 ---> 28728 +35424 ---> 28729 +35425 ---> 28730 +35434 ---> 28731 +35435 ---> 28732 +35437 ---> 28733 +35441 ---> 28734 +35443 ---> 28735 +35445 ---> 28736 +35447 ---> 28737 +35449 ---> 28738 +35451 ---> 28739 +35454 ---> 28740 +35456 ---> 28741 +35466 ---> 28742 +35470 ---> 28743 +35478 ---> 28744 +35479 ---> 28745 +35480 ---> 28746 +35483 ---> 28747 +35487 ---> 28748 +35490 ---> 28749 +35491 ---> 28750 +35493 ---> 28751 +35495 ---> 28752 +35498 ---> 28753 +35499 ---> 28754 +35500 ---> 28755 +35504 ---> 28756 +35505 ---> 28757 +35508 ---> 28758 +35513 ---> 28759 +35514 ---> 28760 +35515 ---> 28761 +35519 ---> 944 +35520 ---> 28762 +35521 ---> 28763 +35527 ---> 28764 +35528 ---> 28765 +35530 ---> 28767 +35535 ---> 28768 +35536 ---> 28769 +35537 ---> 28770 +35538 ---> 28771 +35539 ---> 28772 +35544 ---> 28773 +35547 ---> 28774 +35550 ---> 28775 +35552 ---> 28776 +35555 ---> 28777 +35556 ---> 28778 +35558 ---> 28779 +35559 ---> 28780 +35560 ---> 28781 +35561 ---> 28782 +35562 ---> 28783 +35563 ---> 28784 +35564 ---> 28785 +35566 ---> 28786 +35569 ---> 28787 +35573 ---> 28788 +35580 ---> 28789 +35582 ---> 28790 +35583 ---> 28791 +35585 ---> 28792 +35591 ---> 28793 +35592 ---> 28794 +35594 ---> 28795 +35599 ---> 28796 +35601 ---> 28797 +35608 ---> 28798 +35610 ---> 28799 +35611 ---> 28800 +35613 ---> 28801 +35614 ---> 28802 +35616 ---> 28803 +35617 ---> 28804 +35618 ---> 28805 +35619 ---> 28806 +35620 ---> 28807 +35622 ---> 28808 +35629 ---> 28809 +35630 ---> 28810 +35635 ---> 28811 +35638 ---> 28812 +35640 ---> 28813 +35642 ---> 28814 +35643 ---> 28815 +35644 ---> 28816 +35646 ---> 28817 +35647 ---> 28818 +35648 ---> 28820 +35649 ---> 28821 +35651 ---> 28822 +35652 ---> 28823 +35653 ---> 28824 +35654 ---> 28825 +35656 ---> 28826 +35661 ---> 28827 +35662 ---> 28828 +35663 ---> 28829 +35664 ---> 28830 +35665 ---> 28831 +35666 ---> 28832 +35668 ---> 28833 +35669 ---> 28834 +35676 ---> 28835 +35679 ---> 28836 +35681 ---> 28837 +35685 ---> 28838 +35691 ---> 1394 +35693 ---> 28839 +35694 ---> 28840 +35697 ---> 28841 +35698 ---> 28842 +35700 ---> 28843 +35702 ---> 28844 +35703 ---> 28845 +35707 ---> 28846 +35708 ---> 28847 +35710 ---> 28848 +35716 ---> 28849 +35717 ---> 962 +35719 ---> 28850 +35722 ---> 28851 +35724 ---> 28852 +35727 ---> 28853 +35730 ---> 28854 +35732 ---> 28855 +35738 ---> 28856 +35742 ---> 28857 +35743 ---> 28858 +35744 ---> 28859 +35746 ---> 28860 +35748 ---> 28861 +35751 ---> 28862 +35753 ---> 28863 +35755 ---> 28864 +35758 ---> 28865 +35761 ---> 28866 +35765 ---> 28867 +35768 ---> 28868 +35769 ---> 28869 +35771 ---> 28870 +35774 ---> 28871 +35780 ---> 28872 +35782 ---> 28873 +35783 ---> 28874 +35784 ---> 28876 +35785 ---> 28877 +35791 ---> 2365 +35792 ---> 28878 +35793 ---> 28879 +35797 ---> 28880 +35799 ---> 28881 +35806 ---> 28882 +35807 ---> 28883 +35808 ---> 28884 +35814 ---> 28885 +35815 ---> 28886 +35818 ---> 28887 +35821 ---> 28888 +35824 ---> 28889 +35830 ---> 28890 +35838 ---> 28891 +35839 ---> 28892 +35841 ---> 28893 +35843 ---> 28894 +35845 ---> 28895 +35847 ---> 28896 +35855 ---> 28897 +35857 ---> 28898 +35861 ---> 938 +35862 ---> 28899 +35864 ---> 28900 +35866 ---> 28901 +35869 ---> 28902 +35873 ---> 28903 +35877 ---> 28904 +35878 ---> 28905 +35881 ---> 28906 +35886 ---> 28907 +35888 ---> 28908 +35889 ---> 28909 +35890 ---> 28910 +35892 ---> 28911 +35893 ---> 28912 +35895 ---> 28913 +35897 ---> 28914 +35898 ---> 28915 +35902 ---> 28916 +35907 ---> 28917 +35909 ---> 28918 +35924 ---> 28919 +35928 ---> 28920 +35929 ---> 28921 +35933 ---> 28922 +35935 ---> 28923 +35938 ---> 28924 +35940 ---> 28925 +35941 ---> 28926 +35942 ---> 28927 +35943 ---> 28928 +35950 ---> 28929 +35951 ---> 28930 +35953 ---> 28931 +35956 ---> 28932 +35961 ---> 28933 +35962 ---> 28934 +35963 ---> 28935 +35965 ---> 28936 +35967 ---> 28937 +35969 ---> 28938 +35972 ---> 28939 +35973 ---> 28940 +35974 ---> 28941 +35976 ---> 28942 +35977 ---> 28943 +35981 ---> 28944 +35986 ---> 28945 +35987 ---> 28946 +35988 ---> 28947 +35993 ---> 28948 +35998 ---> 28949 +36001 ---> 28950 +36003 ---> 28951 +36005 ---> 28952 +36010 ---> 28953 +36011 ---> 28954 +36013 ---> 28955 +36014 ---> 28956 +36016 ---> 28957 +36023 ---> 28958 +36024 ---> 28959 +36025 ---> 28960 +36026 ---> 28961 +36028 ---> 28962 +36029 ---> 28963 +36030 ---> 28964 +36034 ---> 28965 +36036 ---> 28966 +36039 ---> 28967 +36040 ---> 28968 +36041 ---> 28969 +36046 ---> 28970 +36050 ---> 28971 +36053 ---> 28972 +36057 ---> 28973 +36058 ---> 28974 +36062 ---> 28975 +36063 ---> 28976 +36066 ---> 28977 +36068 ---> 28978 +36069 ---> 28979 +36070 ---> 28980 +36072 ---> 28981 +36074 ---> 28982 +36075 ---> 28983 +36076 ---> 28984 +36077 ---> 28985 +36078 ---> 28986 +36079 ---> 28987 +36080 ---> 28988 +36083 ---> 28989 +36086 ---> 28990 +36087 ---> 28991 +36088 ---> 28992 +36095 ---> 28993 +36101 ---> 28994 +36102 ---> 28995 +36109 ---> 28996 +36113 ---> 950 +36118 ---> 28997 +36119 ---> 28998 +36124 ---> 28999 +36125 ---> 29000 +36129 ---> 29001 +36132 ---> 29002 +36133 ---> 29003 +36135 ---> 29004 +36140 ---> 29005 +36141 ---> 29006 +36147 ---> 29007 +36148 ---> 29008 +36149 ---> 29009 +36151 ---> 29010 +36152 ---> 29011 +36153 ---> 29012 +36154 ---> 29013 +36155 ---> 29014 +36156 ---> 29015 +36157 ---> 29016 +36163 ---> 29017 +36166 ---> 29018 +36167 ---> 29019 +36168 ---> 29020 +36169 ---> 29021 +36173 ---> 29022 +36174 ---> 29023 +36175 ---> 800 +36176 ---> 29024 +36178 ---> 29025 +36182 ---> 29026 +36185 ---> 12368 +36186 ---> 29027 +36187 ---> 29028 +36188 ---> 29029 +36189 ---> 29030 +36190 ---> 29031 +36193 ---> 29032 +36195 ---> 29033 +36197 ---> 29034 +36198 ---> 1530 +36202 ---> 29035 +36217 ---> 1553 +36219 ---> 29036 +36220 ---> 29037 +36221 ---> 29038 +36222 ---> 29039 +36226 ---> 29040 +36235 ---> 29041 +36236 ---> 29042 +36237 ---> 29043 +36238 ---> 29044 +36240 ---> 29045 +36243 ---> 29046 +36244 ---> 29047 +36247 ---> 29048 +36248 ---> 29049 +36249 ---> 29050 +36250 ---> 29051 +36251 ---> 29052 +36318 ---> 29053 +36324 ---> 29054 +36330 ---> 29055 +36331 ---> 29056 +36334 ---> 29057 +36335 ---> 29058 +36338 ---> 29059 +36339 ---> 29060 +36343 ---> 29061 +36348 ---> 1549 +36349 ---> 29062 +36351 ---> 29063 +36355 ---> 29064 +36359 ---> 29065 +36360 ---> 29066 +36364 ---> 29067 +36366 ---> 29068 +36368 ---> 29069 +36370 ---> 29070 +36374 ---> 12343 +36379 ---> 952 +36382 ---> 29071 +36384 ---> 29072 +36386 ---> 29073 +36388 ---> 29074 +36391 ---> 29075 +36393 ---> 29076 +36394 ---> 29077 +36395 ---> 29078 +36396 ---> 29079 +36397 ---> 29080 +36401 ---> 29081 +36403 ---> 29082 +36404 ---> 29083 +36405 ---> 29084 +36406 ---> 29085 +36407 ---> 29086 +36408 ---> 29087 +36411 ---> 947 +36412 ---> 29088 +36413 ---> 29089 +36414 ---> 29090 +36415 ---> 29091 +36416 ---> 29092 +36417 ---> 29093 +36422 ---> 29094 +36423 ---> 29095 +36424 ---> 29096 +36425 ---> 29097 +36426 ---> 29098 +36427 ---> 29099 +36428 ---> 29100 +36430 ---> 29101 +36433 ---> 29102 +36438 ---> 914 +36439 ---> 29103 +36446 ---> 29104 +36448 ---> 29105 +36449 ---> 1442 +36451 ---> 29106 +36452 ---> 29107 +36453 ---> 29108 +36454 ---> 29109 +36459 ---> 29110 +36460 ---> 29111 +36461 ---> 29112 +36462 ---> 29113 +36463 ---> 29114 +36467 ---> 29115 +36473 ---> 12374 +36474 ---> 29116 +36475 ---> 29117 +36476 ---> 29118 +36483 ---> 29119 +36484 ---> 29120 +36488 ---> 29121 +36491 ---> 29122 +36494 ---> 29123 +36495 ---> 29124 +36498 ---> 29125 +36499 ---> 29126 +36505 ---> 876 +36508 ---> 29127 +36509 ---> 29128 +36510 ---> 29129 +36511 ---> 29130 +36514 ---> 29131 +36515 ---> 29132 +36517 ---> 29133 +36519 ---> 29134 +36520 ---> 12390 +36521 ---> 29135 +36524 ---> 29136 +36525 ---> 29137 +36526 ---> 29138 +36529 ---> 29139 +36530 ---> 29140 +36531 ---> 29141 +36532 ---> 29142 +36538 ---> 29143 +36542 ---> 29144 +36543 ---> 1392 +36545 ---> 29145 +36547 ---> 29146 +36553 ---> 29147 +36554 ---> 29148 +36555 ---> 29149 +36556 ---> 12409 +36561 ---> 29150 +36562 ---> 29151 +36563 ---> 29152 +36567 ---> 29153 +36568 ---> 29154 +36570 ---> 29155 +36577 ---> 29156 +36579 ---> 29157 +36582 ---> 29158 +36586 ---> 1718 +36591 ---> 29159 +36592 ---> 29160 +36593 ---> 12422 +36594 ---> 29161 +36598 ---> 29162 +36605 ---> 29163 +36606 ---> 29164 +36607 ---> 29165 +36609 ---> 29166 +36610 ---> 29167 +36611 ---> 29168 +36613 ---> 996 +36617 ---> 29169 +36618 ---> 29170 +36622 ---> 29171 +36623 ---> 627 +36625 ---> 29172 +36628 ---> 29173 +36629 ---> 29174 +36630 ---> 29175 +36631 ---> 29176 +36639 ---> 29177 +36640 ---> 1562 +36641 ---> 29178 +36642 ---> 29179 +36643 ---> 29180 +36647 ---> 29181 +36649 ---> 29182 +36650 ---> 29183 +36651 ---> 29184 +36652 ---> 29185 +36659 ---> 29186 +36665 ---> 29187 +36666 ---> 29188 +36675 ---> 29189 +36677 ---> 29190 +36679 ---> 29191 +36680 ---> 29192 +36682 ---> 29193 +36683 ---> 29194 +36686 ---> 29195 +36687 ---> 29196 +36688 ---> 29197 +36691 ---> 29198 +36692 ---> 29199 +36704 ---> 29200 +36705 ---> 29201 +36706 ---> 1554 +36707 ---> 29202 +36709 ---> 29203 +36713 ---> 29204 +36714 ---> 29205 +36715 ---> 29206 +36716 ---> 29207 +36717 ---> 29208 +36719 ---> 29209 +36720 ---> 29210 +36722 ---> 29211 +36723 ---> 29212 +36724 ---> 29213 +36730 ---> 29214 +36732 ---> 29215 +36733 ---> 29216 +36737 ---> 29217 +36741 ---> 29218 +36743 ---> 29219 +36744 ---> 29220 +36746 ---> 29221 +36749 ---> 29222 +36754 ---> 29223 +36758 ---> 29224 +36761 ---> 29225 +36768 ---> 29226 +36771 ---> 29227 +36778 ---> 29228 +36779 ---> 29229 +36781 ---> 29230 +36782 ---> 29231 +36783 ---> 29232 +36789 ---> 29233 +36790 ---> 29234 +36792 ---> 29235 +36793 ---> 29236 +36794 ---> 29237 +36798 ---> 29238 +36800 ---> 29239 +36802 ---> 29240 +36804 ---> 29241 +36809 ---> 29242 +36817 ---> 29243 +36818 ---> 29244 +36819 ---> 29245 +36820 ---> 29246 +36821 ---> 29247 +36824 ---> 29248 +36835 ---> 29249 +36836 ---> 29250 +36841 ---> 29251 +36842 ---> 29252 +36846 ---> 29253 +36849 ---> 29254 +36855 ---> 29255 +36858 ---> 29256 +36860 ---> 29257 +36861 ---> 29258 +36870 ---> 29259 +36871 ---> 29260 +36872 ---> 29261 +36874 ---> 29262 +36881 ---> 29263 +36882 ---> 29264 +36885 ---> 29265 +36887 ---> 29266 +36889 ---> 29267 +36892 ---> 29268 +36893 ---> 29269 +36896 ---> 29270 +36897 ---> 29271 +36899 ---> 29272 +36900 ---> 12497 +36901 ---> 29273 +36902 ---> 29274 +36910 ---> 29275 +36914 ---> 29276 +36916 ---> 29277 +36918 ---> 29278 +36925 ---> 29279 +36929 ---> 29280 +36931 ---> 29281 +36932 ---> 29282 +36939 ---> 29283 +36941 ---> 29284 +36942 ---> 29285 +36947 ---> 29286 +36948 ---> 29287 +36949 ---> 29288 +36952 ---> 29289 +36953 ---> 29290 +36954 ---> 29291 +36955 ---> 29292 +36958 ---> 29293 +36963 ---> 29294 +36966 ---> 29295 +36967 ---> 29296 +36969 ---> 29297 +36973 ---> 29298 +36974 ---> 29299 +36977 ---> 29300 +36979 ---> 29301 +36980 ---> 29302 +36982 ---> 1643 +36983 ---> 29303 +36986 ---> 29304 +36987 ---> 29305 +36991 ---> 29306 +36992 ---> 29307 +36999 ---> 29308 +37000 ---> 29309 +37006 ---> 29310 +37008 ---> 29311 +37012 ---> 29312 +37015 ---> 29313 +37016 ---> 29314 +37019 ---> 29315 +37025 ---> 29316 +37026 ---> 29317 +37030 ---> 29318 +37031 ---> 29319 +37034 ---> 29320 +37035 ---> 29321 +37036 ---> 29322 +37037 ---> 29323 +37040 ---> 1558 +37041 ---> 29324 +37042 ---> 29325 +37043 ---> 29326 +37044 ---> 29327 +37046 ---> 29328 +37053 ---> 29329 +37054 ---> 29330 +37055 ---> 29331 +37056 ---> 29332 +37060 ---> 29333 +37063 ---> 29334 +37066 ---> 29335 +37072 ---> 29336 +37077 ---> 29337 +37078 ---> 29338 +37082 ---> 29339 +37083 ---> 29340 +37084 ---> 29341 +37091 ---> 29342 +37095 ---> 29343 +37098 ---> 29344 +37100 ---> 29345 +37104 ---> 29346 +37111 ---> 29347 +37112 ---> 29348 +37114 ---> 29349 +37118 ---> 921 +37119 ---> 29350 +37120 ---> 29351 +37122 ---> 865 +37126 ---> 29352 +37127 ---> 29353 +37133 ---> 29354 +37134 ---> 29355 +37135 ---> 29356 +37147 ---> 29357 +37149 ---> 29358 +37154 ---> 29359 +37156 ---> 29360 +37161 ---> 12587 +37166 ---> 29361 +37169 ---> 29362 +37170 ---> 29363 +37171 ---> 29364 +37173 ---> 29365 +37174 ---> 29366 +37175 ---> 29367 +37177 ---> 29368 +37183 ---> 29369 +37185 ---> 29370 +37187 ---> 29371 +37188 ---> 29372 +37190 ---> 29373 +37192 ---> 29374 +37198 ---> 29375 +37199 ---> 29376 +37203 ---> 29377 +37204 ---> 29378 +37205 ---> 29379 +37207 ---> 29380 +37209 ---> 29381 +37210 ---> 29382 +37211 ---> 29383 +37212 ---> 29384 +37214 ---> 29385 +37215 ---> 29386 +37220 ---> 29387 +37221 ---> 29388 +37224 ---> 29389 +37226 ---> 29390 +37227 ---> 29391 +37228 ---> 29392 +37230 ---> 29393 +37231 ---> 29394 +37232 ---> 29395 +37239 ---> 29396 +37240 ---> 29397 +37245 ---> 29398 +37246 ---> 29399 +37249 ---> 29400 +37250 ---> 29401 +37255 ---> 29402 +37258 ---> 29403 +37260 ---> 29404 +37261 ---> 29405 +37262 ---> 29406 +37272 ---> 29407 +37276 ---> 29408 +37282 ---> 29409 +37293 ---> 29410 +37295 ---> 29411 +37304 ---> 2411 +37305 ---> 29412 +37313 ---> 29413 +37317 ---> 29414 +37321 ---> 29415 +37322 ---> 29416 +37325 ---> 29417 +37335 ---> 29418 +37336 ---> 29419 +37341 ---> 29420 +37343 ---> 29421 +37348 ---> 29422 +37351 ---> 29423 +37352 ---> 29424 +37353 ---> 29425 +37354 ---> 29426 +37357 ---> 29427 +37362 ---> 29428 +37364 ---> 29429 +37365 ---> 29430 +37366 ---> 29431 +37370 ---> 29432 +37372 ---> 29433 +37378 ---> 29434 +37380 ---> 29435 +37381 ---> 29436 +37385 ---> 29437 +37386 ---> 29438 +37389 ---> 29439 +37394 ---> 29440 +37396 ---> 29441 +37397 ---> 29442 +37399 ---> 29443 +37400 ---> 1422 +37402 ---> 29444 +37404 ---> 29445 +37411 ---> 29446 +37412 ---> 29568 +37415 ---> 29447 +37422 ---> 29448 +37423 ---> 29449 +37425 ---> 29450 +37429 ---> 29451 +37430 ---> 29452 +37431 ---> 29453 +37432 ---> 29454 +37434 ---> 29455 +37435 ---> 29456 +37444 ---> 29457 +37445 ---> 29458 +37446 ---> 29459 +37447 ---> 29460 +37452 ---> 29461 +37453 ---> 29462 +37455 ---> 29463 +37457 ---> 29464 +37467 ---> 29465 +37471 ---> 29466 +37483 ---> 29467 +37485 ---> 29468 +37488 ---> 29469 +37493 ---> 29470 +37496 ---> 29471 +37500 ---> 29472 +37502 ---> 29473 +37503 ---> 29474 +37504 ---> 29475 +37506 ---> 29476 +37510 ---> 29477 +37511 ---> 29478 +37515 ---> 29479 +37516 ---> 29480 +37517 ---> 29481 +37520 ---> 29482 +37522 ---> 29483 +37524 ---> 29484 +37526 ---> 29485 +37527 ---> 29486 +37528 ---> 29487 +37534 ---> 29488 +37536 ---> 29489 +37537 ---> 29490 +37538 ---> 29491 +37545 ---> 29492 +37552 ---> 29493 +37557 ---> 29494 +37558 ---> 29495 +37559 ---> 29496 +37561 ---> 29497 +37562 ---> 29498 +37563 ---> 29499 +37564 ---> 29500 +37565 ---> 29501 +37566 ---> 29502 +37567 ---> 29503 +37569 ---> 29504 +37573 ---> 29505 +37577 ---> 29506 +37579 ---> 29507 +37580 ---> 29508 +37582 ---> 29509 +37587 ---> 29510 +37588 ---> 29511 +37589 ---> 29512 +37590 ---> 29513 +37594 ---> 29514 +37595 ---> 29515 +37597 ---> 29516 +37598 ---> 29517 +37599 ---> 29518 +37602 ---> 29519 +37606 ---> 29520 +37607 ---> 29521 +37608 ---> 29522 +37609 ---> 29523 +37610 ---> 29524 +37612 ---> 29525 +37613 ---> 29526 +37614 ---> 29527 +37615 ---> 29528 +37617 ---> 29529 +37618 ---> 29530 +37620 ---> 29531 +37621 ---> 29532 +37622 ---> 29533 +37623 ---> 29534 +37624 ---> 29535 +37625 ---> 29536 +37626 ---> 29537 +37627 ---> 29538 +37628 ---> 29539 +37629 ---> 29540 +37630 ---> 29541 +37633 ---> 29542 +37634 ---> 29543 +37639 ---> 29544 +37642 ---> 29545 +37643 ---> 29546 +37644 ---> 29547 +37645 ---> 29548 +37646 ---> 29549 +37649 ---> 29550 +37650 ---> 29551 +37651 ---> 29552 +37653 ---> 29553 +37662 ---> 29554 +37664 ---> 29555 +37665 ---> 29556 +37666 ---> 29557 +37671 ---> 29558 +37672 ---> 29559 +37673 ---> 29560 +37674 ---> 29561 +37679 ---> 29562 +37680 ---> 29563 +37689 ---> 29564 +37691 ---> 29565 +37692 ---> 29566 +37694 ---> 29567 +37695 ---> 29568 +37701 ---> 29569 +37702 ---> 29570 +37707 ---> 29571 +37708 ---> 29572 +37709 ---> 29573 +37711 ---> 29574 +37720 ---> 29575 +37722 ---> 29576 +37725 ---> 29577 +37726 ---> 29578 +37727 ---> 29579 +37729 ---> 29580 +37735 ---> 29581 +37738 ---> 29582 +37739 ---> 29583 +37740 ---> 29584 +37742 ---> 29585 +37743 ---> 29586 +37747 ---> 29587 +37748 ---> 29588 +37749 ---> 29589 +37751 ---> 29590 +37752 ---> 29591 +37753 ---> 29592 +37755 ---> 29593 +37764 ---> 29594 +37765 ---> 29595 +37768 ---> 29596 +37770 ---> 29597 +37775 ---> 490 +37776 ---> 29598 +37780 ---> 29599 +37786 ---> 29600 +37787 ---> 29601 +37794 ---> 29602 +37795 ---> 29603 +37796 ---> 29604 +37801 ---> 29605 +37802 ---> 29606 +37803 ---> 29607 +37806 ---> 29608 +37807 ---> 29609 +37808 ---> 29610 +37815 ---> 29611 +37816 ---> 29612 +37817 ---> 29613 +37822 ---> 29614 +37823 ---> 29615 +37824 ---> 29616 +37826 ---> 29617 +37828 ---> 29618 +37830 ---> 29619 +37839 ---> 29620 +37841 ---> 29621 +37842 ---> 29622 +37843 ---> 29623 +37844 ---> 29624 +37846 ---> 29625 +37849 ---> 29626 +37861 ---> 29627 +37865 ---> 29628 +37868 ---> 29629 +37870 ---> 29630 +37873 ---> 29631 +37880 ---> 29632 +37882 ---> 29633 +37884 ---> 29634 +37885 ---> 29635 +37886 ---> 29636 +37892 ---> 29637 +37893 ---> 29638 +37896 ---> 29639 +37897 ---> 29640 +37898 ---> 29641 +37899 ---> 29642 +37903 ---> 29643 +37904 ---> 29644 +37907 ---> 29645 +37908 ---> 29646 +37915 ---> 29647 +37916 ---> 29648 +37918 ---> 29649 +37922 ---> 29650 +37923 ---> 29651 +37924 ---> 29652 +37927 ---> 29653 +37929 ---> 29654 +37930 ---> 1555 +37931 ---> 29655 +37935 ---> 29656 +37936 ---> 29657 +37940 ---> 29658 +37942 ---> 29659 +37943 ---> 29660 +37946 ---> 29661 +37948 ---> 29662 +37949 ---> 29663 +37955 ---> 29664 +37956 ---> 29665 +37957 ---> 29666 +37958 ---> 29667 +37959 ---> 29668 +37962 ---> 29669 +37965 ---> 29670 +37966 ---> 29671 +37967 ---> 29672 +37968 ---> 29673 +37969 ---> 29674 +37970 ---> 29675 +37971 ---> 29676 +37978 ---> 29677 +37982 ---> 29678 +37983 ---> 29679 +37984 ---> 29680 +37985 ---> 29681 +37989 ---> 1429 +37992 ---> 29682 +37994 ---> 29683 +37997 ---> 29684 +37998 ---> 29685 +38000 ---> 29686 +38001 ---> 29687 +38002 ---> 29688 +38006 ---> 29689 +38007 ---> 29690 +38008 ---> 29691 +38011 ---> 29692 +38014 ---> 29693 +38015 ---> 29694 +38022 ---> 29695 +38027 ---> 29696 +38028 ---> 29697 +38031 ---> 29698 +38033 ---> 29699 +38034 ---> 29700 +38035 ---> 29701 +38043 ---> 29702 +38046 ---> 29703 +38047 ---> 29704 +38049 ---> 29705 +38050 ---> 29706 +38052 ---> 29707 +38053 ---> 29708 +38059 ---> 29709 +38064 ---> 29710 +38065 ---> 29711 +38066 ---> 29712 +38071 ---> 29713 +38073 ---> 29714 +38074 ---> 29715 +38075 ---> 29716 +38078 ---> 29717 +38080 ---> 29718 +38082 ---> 29719 +38084 ---> 29720 +38085 ---> 29721 +38086 ---> 29722 +38087 ---> 29723 +38092 ---> 29724 +38093 ---> 29725 +38094 ---> 29726 +38105 ---> 29727 +38109 ---> 29728 +38110 ---> 29729 +38114 ---> 29730 +38117 ---> 12801 +38122 ---> 29731 +38130 ---> 29732 +38131 ---> 29733 +38132 ---> 29734 +38141 ---> 29735 +38143 ---> 29736 +38144 ---> 29737 +38148 ---> 29738 +38149 ---> 29739 +38154 ---> 29740 +38156 ---> 29741 +38157 ---> 29742 +38163 ---> 29743 +38164 ---> 29744 +38165 ---> 29745 +38168 ---> 29746 +38169 ---> 29747 +38173 ---> 29748 +38174 ---> 29749 +38176 ---> 29750 +38177 ---> 29751 +38178 ---> 29752 +38180 ---> 29753 +38181 ---> 29754 +38184 ---> 29755 +38188 ---> 29756 +38191 ---> 29757 +38192 ---> 29758 +38194 ---> 29759 +38195 ---> 29760 +38197 ---> 29761 +38198 ---> 29762 +38199 ---> 29763 +38206 ---> 29764 +38208 ---> 29765 +38212 ---> 29766 +38215 ---> 29767 +38216 ---> 29768 +38219 ---> 29769 +38221 ---> 29770 +38227 ---> 29771 +38229 ---> 29772 +38230 ---> 29773 +38238 ---> 29774 +38241 ---> 29775 +38242 ---> 29776 +38243 ---> 29777 +38245 ---> 29778 +38247 ---> 29779 +38248 ---> 29780 +38249 ---> 29781 +38252 ---> 29782 +38253 ---> 29783 +38259 ---> 29784 +38260 ---> 29785 +38263 ---> 29787 +38267 ---> 29788 +38268 ---> 29789 +38276 ---> 29790 +38277 ---> 29791 +38278 ---> 29792 +38279 ---> 29793 +38285 ---> 29794 +38289 ---> 29795 +38292 ---> 29796 +38293 ---> 29797 +38294 ---> 29798 +38295 ---> 29799 +38297 ---> 29800 +38301 ---> 29801 +38302 ---> 29802 +38303 ---> 29803 +38311 ---> 29804 +38315 ---> 29805 +38316 ---> 29806 +38329 ---> 29807 +38332 ---> 29808 +38334 ---> 29809 +38342 ---> 29810 +38346 ---> 29811 +38348 ---> 29812 +38349 ---> 29813 +38353 ---> 29814 +38354 ---> 1564 +38355 ---> 29815 +38359 ---> 29816 +38361 ---> 29817 +38362 ---> 29818 +38363 ---> 29819 +38364 ---> 29820 +38370 ---> 29821 +38372 ---> 29822 +38374 ---> 29823 +38385 ---> 29824 +38387 ---> 29825 +38391 ---> 29826 +38392 ---> 29827 +38394 ---> 29828 +38395 ---> 29829 +38399 ---> 29830 +38400 ---> 29831 +38402 ---> 29832 +38407 ---> 29833 +38408 ---> 29834 +38412 ---> 29835 +38414 ---> 29836 +38415 ---> 995 +38416 ---> 29837 +38418 ---> 29838 +38421 ---> 29839 +38422 ---> 29840 +38425 ---> 29841 +38426 ---> 29842 +38435 ---> 29843 +38436 ---> 29844 +38437 ---> 29845 +38440 ---> 29846 +38441 ---> 29847 +38442 ---> 29848 +38443 ---> 29849 +38444 ---> 29850 +38445 ---> 29851 +38455 ---> 29852 +38457 ---> 29853 +38460 ---> 29854 +38467 ---> 29855 +38472 ---> 1423 +38480 ---> 12872 +38481 ---> 29856 +38483 ---> 29857 +38485 ---> 29858 +38486 ---> 29859 +38490 ---> 29860 +38492 ---> 29861 +38494 ---> 29862 +38495 ---> 29863 +38497 ---> 29864 +38498 ---> 29865 +38500 ---> 29866 +38507 ---> 29867 +38508 ---> 29868 +38510 ---> 29869 +38521 ---> 29870 +38522 ---> 29871 +38523 ---> 1570 +38526 ---> 29872 +38528 ---> 29873 +38533 ---> 29874 +38534 ---> 29875 +38535 ---> 29876 +38536 ---> 29877 +38540 ---> 29878 +38543 ---> 29879 +38545 ---> 29880 +38546 ---> 29881 +38547 ---> 29882 +38548 ---> 29883 +38550 ---> 29884 +38552 ---> 29885 +38553 ---> 29886 +38555 ---> 29887 +38557 ---> 29888 +38558 ---> 29889 +38559 ---> 1511 +38563 ---> 29890 +38564 ---> 29891 +38565 ---> 29893 +38568 ---> 29894 +38569 ---> 29895 +38570 ---> 29896 +38571 ---> 29897 +38575 ---> 29898 +38576 ---> 29899 +38579 ---> 29900 +38580 ---> 29901 +38581 ---> 29902 +38582 ---> 29903 +38583 ---> 29904 +38585 ---> 29905 +38586 ---> 29906 +38587 ---> 29907 +38588 ---> 29908 +38589 ---> 29909 +38590 ---> 29910 +38591 ---> 29911 +38592 ---> 29912 +38594 ---> 29913 +38595 ---> 29914 +38596 ---> 29915 +38602 ---> 29916 +38606 ---> 29917 +38608 ---> 29918 +38609 ---> 29919 +38612 ---> 29920 +38615 ---> 29921 +38616 ---> 29922 +38618 ---> 29923 +38620 ---> 29924 +38624 ---> 29925 +38626 ---> 29926 +38630 ---> 29927 +38632 ---> 29928 +38633 ---> 29929 +38634 ---> 29930 +38640 ---> 29931 +38641 ---> 29932 +38643 ---> 29933 +38646 ---> 29935 +38647 ---> 29936 +38650 ---> 29937 +38652 ---> 29938 +38658 ---> 29939 +38659 ---> 29940 +38661 ---> 29941 +38663 ---> 29942 +38666 ---> 29943 +38667 ---> 29944 +38668 ---> 29945 +38669 ---> 29946 +38670 ---> 29947 +38671 ---> 29948 +38673 ---> 29949 +38675 ---> 12924 +38677 ---> 29950 +38682 ---> 29951 +38684 ---> 29952 +38688 ---> 29953 +38689 ---> 29954 +38695 ---> 29955 +38708 ---> 29956 +38710 ---> 29957 +38711 ---> 29958 +38712 ---> 29959 +38713 ---> 29960 +38714 ---> 29961 +38715 ---> 29962 +38716 ---> 29963 +38717 ---> 29964 +38726 ---> 29965 +38729 ---> 29966 +38734 ---> 29967 +38735 ---> 29968 +38737 ---> 29969 +38738 ---> 29970 +38745 ---> 29971 +38748 ---> 29972 +38750 ---> 29973 +38751 ---> 29974 +38758 ---> 29975 +38759 ---> 1501 +38760 ---> 29976 +38761 ---> 29977 +38762 ---> 29978 +38763 ---> 29979 +38765 ---> 29980 +38767 ---> 29981 +38768 ---> 29982 +38769 ---> 29983 +38770 ---> 29984 +38785 ---> 29985 +38788 ---> 29986 +38791 ---> 29987 +38798 ---> 29988 +38799 ---> 29989 +38801 ---> 29990 +38802 ---> 29991 +38803 ---> 29992 +38806 ---> 29993 +38814 ---> 29994 +38815 ---> 29995 +38818 ---> 29996 +38820 ---> 29997 +38821 ---> 29998 +38822 ---> 29999 +38824 ---> 30000 +38825 ---> 30001 +38827 ---> 30002 +38833 ---> 30003 +38834 ---> 30004 +38835 ---> 30005 +38836 ---> 30006 +38837 ---> 30007 +38840 ---> 30008 +38841 ---> 30009 +38843 ---> 30010 +38846 ---> 30011 +38848 ---> 30012 +38849 ---> 30013 +38851 ---> 30014 +38852 ---> 30015 +38853 ---> 30016 +38858 ---> 30017 +38859 ---> 30018 +38861 ---> 30019 +38862 ---> 30020 +38863 ---> 30021 +38871 ---> 30022 +38872 ---> 30023 +38875 ---> 30024 +38878 ---> 779 +38882 ---> 30025 +38886 ---> 30026 +38888 ---> 30027 +38891 ---> 30028 +38894 ---> 30029 +38895 ---> 30030 +38896 ---> 30031 +38898 ---> 30032 +38900 ---> 30033 +38901 ---> 30034 +38903 ---> 30035 +38904 ---> 30036 +38907 ---> 30037 +38911 ---> 30038 +38913 ---> 30039 +38914 ---> 30040 +38915 ---> 30041 +38916 ---> 30042 +38917 ---> 30043 +38919 ---> 30044 +38920 ---> 30045 +38922 ---> 30046 +38927 ---> 30047 +38931 ---> 30048 +38939 ---> 30049 +38941 ---> 30050 +38944 ---> 30051 +38948 ---> 30052 +38951 ---> 30053 +38958 ---> 30054 +38960 ---> 30055 +38966 ---> 30056 +38968 ---> 30057 +38974 ---> 30058 +38979 ---> 30059 +38984 ---> 30060 +38985 ---> 30061 +38986 ---> 30062 +38987 ---> 30063 +38988 ---> 30064 +38989 ---> 30065 +38990 ---> 30066 +38992 ---> 30067 +38997 ---> 30068 +38998 ---> 30069 +38999 ---> 30070 +39004 ---> 30071 +39005 ---> 30072 +39006 ---> 30073 +39007 ---> 30074 +39009 ---> 30075 +39010 ---> 30076 +39013 ---> 30077 +39014 ---> 30078 +39016 ---> 30079 +39018 ---> 30080 +39023 ---> 30081 +39024 ---> 30082 +39031 ---> 30083 +39037 ---> 30084 +39041 ---> 30085 +39044 ---> 30086 +39046 ---> 30087 +39048 ---> 30088 +39049 ---> 1591 +39053 ---> 30089 +39057 ---> 30090 +39058 ---> 13009 +39059 ---> 30091 +39060 ---> 30092 +39063 ---> 30093 +39065 ---> 30094 +39067 ---> 30095 +39068 ---> 30096 +39069 ---> 30097 +39075 ---> 30098 +39081 ---> 30099 +39082 ---> 30100 +39084 ---> 30101 +39086 ---> 30102 +39089 ---> 30103 +39093 ---> 30104 +39104 ---> 30106 +39105 ---> 1395 +39106 ---> 30107 +39108 ---> 30108 +39114 ---> 30109 +39118 ---> 30110 +39119 ---> 13025 +39121 ---> 30111 +39129 ---> 30112 +39130 ---> 30113 +39133 ---> 30114 +39136 ---> 30115 +39139 ---> 30116 +39140 ---> 30117 +39143 ---> 1581 +39144 ---> 30118 +39148 ---> 30119 +39152 ---> 30120 +39153 ---> 949 +39155 ---> 30122 +39156 ---> 30123 +39159 ---> 30124 +39161 ---> 1502 +39162 ---> 1503 +39163 ---> 1494 +39164 ---> 30125 +39165 ---> 1496 +39166 ---> 1497 +39167 ---> 1498 +39168 ---> 30126 +39169 ---> 30127 +39170 ---> 30128 +39171 ---> 30129 +39172 ---> 30130 +39175 ---> 30131 +39177 ---> 30132 +39178 ---> 30133 +39181 ---> 30134 +39185 ---> 30135 +39190 ---> 30136 +39192 ---> 30137 +39198 ---> 30138 +39199 ---> 30139 +39201 ---> 30140 +39204 ---> 30141 +39207 ---> 30142 +39208 ---> 30143 +39211 ---> 30144 +39214 ---> 30145 +39216 ---> 30146 +39218 ---> 30147 +39221 ---> 30148 +39223 ---> 30149 +39224 ---> 30150 +39225 ---> 30151 +39226 ---> 30152 +39227 ---> 30153 +39229 ---> 30154 +39230 ---> 30155 +39231 ---> 30156 +39232 ---> 30157 +39233 ---> 30158 +39234 ---> 30159 +39237 ---> 30160 +39239 ---> 30161 +39240 ---> 1577 +39241 ---> 30162 +39245 ---> 30163 +39246 ---> 30164 +39247 ---> 30165 +39248 ---> 30166 +39256 ---> 30167 +39257 ---> 30168 +39258 ---> 30169 +39259 ---> 30170 +39260 ---> 30171 +39265 ---> 30173 +39266 ---> 30174 +39268 ---> 30175 +39269 ---> 30176 +39271 ---> 30177 +39274 ---> 30178 +39276 ---> 30179 +39277 ---> 30180 +39278 ---> 30181 +39288 ---> 30182 +39289 ---> 30183 +39290 ---> 30184 +39293 ---> 30185 +39294 ---> 30186 +39295 ---> 30187 +39296 ---> 30188 +39298 ---> 1499 +39304 ---> 30189 +39307 ---> 30190 +39308 ---> 30191 +39310 ---> 30192 +39313 ---> 30193 +39314 ---> 30194 +39316 ---> 30195 +39317 ---> 30196 +39320 ---> 30197 +39322 ---> 30198 +39324 ---> 30199 +39325 ---> 30200 +39326 ---> 30201 +39334 ---> 13051 +39336 ---> 30202 +39337 ---> 30203 +39339 ---> 30204 +39345 ---> 30205 +39348 ---> 30206 +39354 ---> 30207 +39355 ---> 30208 +39360 ---> 30209 +39362 ---> 30210 +39363 ---> 30211 +39364 ---> 30212 +39366 ---> 30213 +39370 ---> 30214 +39372 ---> 30215 +39373 ---> 30216 +39374 ---> 30217 +39377 ---> 30218 +39378 ---> 30219 +39380 ---> 30220 +39381 ---> 30221 +39382 ---> 30222 +39385 ---> 30223 +39386 ---> 30224 +39389 ---> 30225 +39393 ---> 30226 +39394 ---> 30227 +39397 ---> 30228 +39401 ---> 30229 +39404 ---> 30230 +39405 ---> 30231 +39408 ---> 30232 +39410 ---> 30233 +39413 ---> 30234 +39416 ---> 30235 +39420 ---> 30236 +39422 ---> 30237 +39427 ---> 30238 +39431 ---> 30239 +39433 ---> 30240 +39434 ---> 30241 +39435 ---> 30242 +39439 ---> 30243 +39441 ---> 2017 +39445 ---> 30244 +39451 ---> 30245 +39457 ---> 30246 +39458 ---> 30247 +39459 ---> 30248 +39460 ---> 30249 +39461 ---> 30250 +39464 ---> 30251 +39466 ---> 30252 +39467 ---> 30253 +39470 ---> 30254 +39473 ---> 30255 +39475 ---> 30256 +39476 ---> 30257 +39477 ---> 30258 +39478 ---> 30259 +39483 ---> 30260 +39484 ---> 13080 +39486 ---> 30261 +39489 ---> 997 +39492 ---> 30262 +39497 ---> 30263 +39500 ---> 30264 +39502 ---> 30265 +39505 ---> 30266 +39509 ---> 30267 +39511 ---> 30268 +39512 ---> 30269 +39514 ---> 30270 +39515 ---> 30271 +39518 ---> 30272 +39519 ---> 30273 +39523 ---> 30274 +39525 ---> 30275 +39527 ---> 30276 +39529 ---> 30277 +39533 ---> 30278 +39534 ---> 30279 +39536 ---> 30280 +39537 ---> 30281 +39538 ---> 13091 +39539 ---> 13092 +39542 ---> 30282 +39544 ---> 30283 +39545 ---> 1580 +39552 ---> 30284 +39554 ---> 30285 +39555 ---> 30286 +39564 ---> 782 +39565 ---> 30287 +39566 ---> 30288 +39569 ---> 30289 +39570 ---> 30290 +39575 ---> 13101 +39580 ---> 30291 +39581 ---> 30292 +39582 ---> 30293 +39583 ---> 30294 +39586 ---> 30295 +39592 ---> 30296 +39593 ---> 30297 +39595 ---> 30298 +39601 ---> 30299 +39602 ---> 30300 +39603 ---> 30301 +39611 ---> 30302 +39614 ---> 30303 +39615 ---> 30304 +39616 ---> 30305 +39617 ---> 920 +39618 ---> 30306 +39621 ---> 30307 +39622 ---> 30308 +39623 ---> 30309 +39624 ---> 30310 +39626 ---> 30311 +39627 ---> 30312 +39628 ---> 30313 +39629 ---> 30314 +39630 ---> 30315 +39631 ---> 30316 +39634 ---> 30317 +39639 ---> 30318 +39640 ---> 30319 +39641 ---> 30320 +39642 ---> 30321 +39645 ---> 30322 +39648 ---> 30323 +39649 ---> 30324 +39650 ---> 30325 +39652 ---> 30326 +39654 ---> 30327 +39655 ---> 30328 +39656 ---> 30329 +39657 ---> 30330 +39658 ---> 30331 +39659 ---> 30332 +39663 ---> 30333 +39666 ---> 30334 +39670 ---> 30335 +39672 ---> 30336 +39673 ---> 30337 +39675 ---> 30338 +39676 ---> 30339 +39677 ---> 30340 +39679 ---> 30341 +39683 ---> 1508 +39689 ---> 30342 +39691 ---> 30343 +39694 ---> 30344 +39697 ---> 30345 +39701 ---> 30346 +39702 ---> 30347 +39711 ---> 1484 +39712 ---> 30348 +39713 ---> 30349 +39715 ---> 30350 +39716 ---> 30351 +39717 ---> 30352 +39718 ---> 30353 +39721 ---> 30354 +39723 ---> 30355 +39729 ---> 30356 +39732 ---> 30357 +39733 ---> 30358 +39735 ---> 30359 +39736 ---> 30360 +39741 ---> 30361 +39746 ---> 30362 +39749 ---> 30363 +39755 ---> 30364 +39756 ---> 30365 +39760 ---> 30366 +39761 ---> 30367 +39762 ---> 30368 +39763 ---> 13154 +39767 ---> 30369 +39768 ---> 30370 +39769 ---> 30371 +39770 ---> 30372 +39776 ---> 30373 +39780 ---> 30374 +39787 ---> 30375 +39791 ---> 30376 +39792 ---> 30377 +39793 ---> 30378 +39794 ---> 30379 +39797 ---> 30380 +39798 ---> 30381 +39799 ---> 30382 +39800 ---> 30383 +39801 ---> 30384 +39802 ---> 30385 +39803 ---> 30386 +39807 ---> 30387 +39808 ---> 30388 +39809 ---> 30389 +39810 ---> 30390 +39814 ---> 30391 +39816 ---> 30392 +39819 ---> 30393 +39823 ---> 30394 +39824 ---> 30395 +39826 ---> 30396 +39828 ---> 30397 +39831 ---> 30398 +39832 ---> 30399 +39835 ---> 30400 +39837 ---> 30401 +39839 ---> 30402 +39840 ---> 30403 +39841 ---> 30404 +39843 ---> 30405 +39844 ---> 13168 +39845 ---> 30406 +39851 ---> 30407 +39852 ---> 30408 +39854 ---> 30409 +39856 ---> 30410 +39859 ---> 30411 +39862 ---> 30412 +39873 ---> 30413 +39876 ---> 30414 +39881 ---> 30415 +39883 ---> 30416 +39886 ---> 30417 +39887 ---> 30418 +39888 ---> 30419 +39890 ---> 30420 +39891 ---> 30421 +39892 ---> 30422 +39897 ---> 30423 +39898 ---> 30424 +39903 ---> 30425 +39904 ---> 30426 +39905 ---> 30427 +39906 ---> 30428 +39908 ---> 30429 +39909 ---> 30430 +39911 ---> 30431 +39914 ---> 30432 +39918 ---> 30433 +39919 ---> 30434 +39920 ---> 30435 +39922 ---> 30436 +39923 ---> 1556 +39924 ---> 30437 +39925 ---> 30438 +39927 ---> 30439 +39929 ---> 30440 +39930 ---> 30441 +39931 ---> 30442 +39934 ---> 30443 +39935 ---> 30444 +39939 ---> 30445 +39944 ---> 30446 +39946 ---> 30447 +39948 ---> 30448 +39949 ---> 30449 +39951 ---> 30450 +39952 ---> 30451 +39953 ---> 30452 +39955 ---> 30453 +39957 ---> 30454 +39959 ---> 30455 +39961 ---> 30456 +39962 ---> 30457 +39964 ---> 30458 +39966 ---> 30459 +39967 ---> 30460 +39970 ---> 30461 +39974 ---> 30462 +39975 ---> 30463 +39977 ---> 30464 +39980 ---> 30465 +39982 ---> 30466 +39983 ---> 30467 +39987 ---> 30468 +39988 ---> 30469 +39989 ---> 30470 +39994 ---> 30471 +39998 ---> 30472 +39999 ---> 30473 +40000 ---> 30474 +40004 ---> 30475 +40009 ---> 30476 +40011 ---> 30477 +40012 ---> 30478 +40013 ---> 30479 +40014 ---> 30480 +40015 ---> 30481 +40016 ---> 30482 +40017 ---> 30483 +40018 ---> 30484 +40022 ---> 30485 +40026 ---> 30486 +40027 ---> 30487 +40029 ---> 943 +40030 ---> 30488 +40031 ---> 30489 +40032 ---> 30490 +40034 ---> 30491 +40037 ---> 30492 +40039 ---> 30493 +40041 ---> 30494 +40044 ---> 30495 +40045 ---> 30496 +40046 ---> 30497 +40048 ---> 30498 +40050 ---> 30499 +40051 ---> 30500 +40052 ---> 30501 +40053 ---> 30502 +40054 ---> 30503 +40060 ---> 30504 +40062 ---> 30505 +40067 ---> 30506 +40068 ---> 30507 +40069 ---> 30508 +40073 ---> 30509 +40074 ---> 30510 +40081 ---> 30511 +40084 ---> 30512 +40087 ---> 30513 +40094 ---> 30514 +40095 ---> 30515 +40097 ---> 30516 +40100 ---> 30517 +40101 ---> 30518 +40102 ---> 30519 +40110 ---> 30520 +40115 ---> 30521 +40116 ---> 30522 +40118 ---> 30523 +40120 ---> 30524 +40130 ---> 30525 +40133 ---> 30526 +40134 ---> 30527 +40137 ---> 30528 +40145 ---> 30529 +40150 ---> 30530 +40152 ---> 30531 +40156 ---> 30532 +40161 ---> 30533 +40162 ---> 30534 +40166 ---> 30535 +40167 ---> 30536 +40168 ---> 30537 +40169 ---> 30538 +40170 ---> 30539 +40172 ---> 30540 +40173 ---> 30541 +40175 ---> 30542 +40182 ---> 30543 +40185 ---> 30544 +40186 ---> 30545 +40187 ---> 30546 +40188 ---> 30547 +40192 ---> 30548 +40193 ---> 30549 +40194 ---> 30550 +40195 ---> 30551 +40196 ---> 30552 +40201 ---> 30553 +40204 ---> 30554 +40207 ---> 30555 +40208 ---> 30556 +40209 ---> 30557 +40213 ---> 30558 +40216 ---> 30559 +40217 ---> 30560 +40218 ---> 30561 +40219 ---> 30562 +40220 ---> 30563 +40221 ---> 30564 +40222 ---> 1567 +40224 ---> 30565 +40226 ---> 30566 +40229 ---> 30567 +40231 ---> 30568 +40233 ---> 30569 +40234 ---> 30570 +40237 ---> 30571 +40241 ---> 30572 +40245 ---> 30573 +40250 ---> 30574 +40252 ---> 30575 +40256 ---> 30576 +40260 ---> 30577 +40262 ---> 30578 +40263 ---> 30579 +40266 ---> 1418 +40267 ---> 30580 +40269 ---> 30581 +40272 ---> 13252 +40273 ---> 30582 +40282 ---> 30583 +40286 ---> 30584 +40296 ---> 30585 +40297 ---> 30586 +40300 ---> 30587 +40301 ---> 30588 +40302 ---> 30589 +40304 ---> 30590 +40305 ---> 30591 +40306 ---> 30592 +40312 ---> 30593 +40315 ---> 30594 +40330 ---> 30595 +40333 ---> 30596 +40347 ---> 30597 +40348 ---> 30598 +40350 ---> 1405 +40351 ---> 30599 +40353 ---> 13260 +40367 ---> 30600 +40368 ---> 30601 +40370 ---> 30602 +40373 ---> 30603 +40374 ---> 30604 +40376 ---> 30605 +40378 ---> 30606 +40384 ---> 30607 +40385 ---> 30608 +40389 ---> 30609 +40390 ---> 30610 +40391 ---> 30611 +40393 ---> 30612 +40396 ---> 30613 +40398 ---> 30614 +40399 ---> 30615 +40400 ---> 30616 +40403 ---> 30617 +40404 ---> 30618 +40405 ---> 30619 +40406 ---> 30620 +40409 ---> 30621 +40410 ---> 30622 +40412 ---> 30623 +40416 ---> 30624 +40417 ---> 30625 +40421 ---> 30626 +40428 ---> 30627 +40434 ---> 30628 +40437 ---> 30629 +40444 ---> 30630 +40445 ---> 30631 +40447 ---> 30632 +40449 ---> 30633 +40450 ---> 30634 +40451 ---> 30635 +40452 ---> 30636 +40455 ---> 30637 +40456 ---> 30638 +40459 ---> 30639 +40461 ---> 30640 +40471 ---> 30641 +40472 ---> 13289 +40473 ---> 30642 +40474 ---> 30643 +40475 ---> 30644 +40476 ---> 30645 +40479 ---> 30646 +40480 ---> 30647 +40482 ---> 1572 +40484 ---> 30648 +40485 ---> 30649 +40489 ---> 30650 +40491 ---> 30651 +40496 ---> 30652 +40497 ---> 30653 +40498 ---> 30654 +40499 ---> 30655 +40500 ---> 30656 +40502 ---> 30657 +40503 ---> 30658 +40504 ---> 30659 +40506 ---> 30660 +40508 ---> 30661 +40513 ---> 30662 +40514 ---> 1509 +40523 ---> 30663 +40531 ---> 30664 +40532 ---> 30665 +40533 ---> 30666 +40538 ---> 30667 +40539 ---> 30668 +40544 ---> 30669 +40557 ---> 30670 +40558 ---> 30671 +40560 ---> 30672 +40561 ---> 30673 +40562 ---> 13316 +40565 ---> 30674 +40566 ---> 30675 +40571 ---> 30676 +40575 ---> 30677 +40576 ---> 30678 +40578 ---> 30679 +40586 ---> 30680 +40587 ---> 30681 +40588 ---> 30682 +40593 ---> 30683 +40594 ---> 30684 +40596 ---> 30685 +40597 ---> 30686 +40600 ---> 30687 +40602 ---> 30688 +40603 ---> 1573 +40604 ---> 1510 +40606 ---> 30689 +40607 ---> 30690 +40608 ---> 30691 +40609 ---> 30692 +40610 ---> 30693 +40612 ---> 30694 +40615 ---> 30695 +40618 ---> 30696 +40620 ---> 30697 +40621 ---> 30698 +40623 ---> 2339 +40625 ---> 30699 +40626 ---> 30700 +40632 ---> 30701 +40636 ---> 30702 +40641 ---> 30703 +40642 ---> 30704 +40645 ---> 30705 +40646 ---> 30706 +40648 ---> 30707 +40649 ---> 30708 +40656 ---> 30709 +40657 ---> 30710 +40659 ---> 30711 +40660 ---> 30712 +40663 ---> 1586 +40664 ---> 30713 +40666 ---> 30714 +40672 ---> 30715 +40674 ---> 30716 +40675 ---> 30717 +40676 ---> 30718 +40679 ---> 30719 +40683 ---> 30720 +40686 ---> 30721 +40690 ---> 30722 +40693 ---> 30723 +40697 ---> 30724 +40698 ---> 30725 +40700 ---> 30726 +40702 ---> 30727 +40704 ---> 30728 +40706 ---> 30729 +40707 ---> 30730 +40710 ---> 30731 +40711 ---> 30732 +40712 ---> 30733 +40721 ---> 13344 +40722 ---> 30734 +40725 ---> 30735 +40730 ---> 1390 +40731 ---> 30736 +40734 ---> 30737 +40736 ---> 30738 +40737 ---> 30739 +40739 ---> 30740 +40740 ---> 30741 +40744 ---> 30742 +40745 ---> 30743 +40750 ---> 30744 +40751 ---> 30745 +40753 ---> 30872 +40755 ---> 30746 +40756 ---> 30747 +40759 ---> 30748 +40765 ---> 30749 +40770 ---> 30750 +40771 ---> 30751 +40773 ---> 30752 +40776 ---> 30753 +40779 ---> 30754 +40795 ---> 30755 +40798 ---> 30756 +40799 ---> 30757 +40803 ---> 30758 +40805 ---> 30759 +40809 ---> 30760 +40811 ---> 30761 +40812 ---> 30762 +40813 ---> 30763 +40814 ---> 30764 +40826 ---> 30765 +40827 ---> 30766 +40830 ---> 30767 +40834 ---> 30768 +40842 ---> 30769 +40843 ---> 30770 +40845 ---> 30771 +40846 ---> 30772 +40848 ---> 30773 +40850 ---> 30774 +40853 ---> 30775 +40857 ---> 30776 +40865 ---> 30777 +40870 ---> 30778 +40871 ---> 30779 +40877 ---> 30780 +40878 ---> 30781 +40881 ---> 30782 +40885 ---> 30783 +40888 ---> 30784 +40890 ---> 30785 +40892 ---> 30786 +40893 ---> 30787 +40897 ---> 30788 +40898 ---> 30789 +40899 ---> 30790 +40904 ---> 30791 +40905 ---> 30792 +40909 ---> 30793 +40920 ---> 30794 +40922 ---> 30795 +40925 ---> 30796 +40933 ---> 30797 +40934 ---> 30798 +40936 ---> 30799 +40941 ---> 30800 +40947 ---> 30801 +40948 ---> 30802 +40949 ---> 30803 +40952 ---> 30804 +40953 ---> 30805 +40955 ---> 30806 +40962 ---> 30807 +40964 ---> 30808 +40966 ---> 30809 +40967 ---> 30810 +40968 ---> 30811 +40973 ---> 30812 +40978 ---> 30813 +40979 ---> 30814 +40981 ---> 30815 +40982 ---> 30816 +40988 ---> 30817 +40993 ---> 30818 +40995 ---> 30819 +41002 ---> 30820 +41005 ---> 30821 +41009 ---> 30822 +41015 ---> 1571 +41019 ---> 30823 +41026 ---> 30824 +41027 ---> 30825 +41029 ---> 30826 +41031 ---> 30827 +41032 ---> 30828 +41033 ---> 30829 +41034 ---> 30830 +41037 ---> 30831 +41038 ---> 30832 +41039 ---> 30833 +41043 ---> 3761 +41044 ---> 30834 +41047 ---> 30835 +41049 ---> 30836 +41050 ---> 30837 +41057 ---> 30838 +41059 ---> 30839 +41060 ---> 30840 +41064 ---> 30841 +41068 ---> 30842 +41070 ---> 30843 +41072 ---> 30844 +41077 ---> 30845 +41080 ---> 30846 +41085 ---> 30847 +41086 ---> 13416 +41091 ---> 30848 +41093 ---> 30849 +41094 ---> 1382 +41095 ---> 30850 +41096 ---> 30851 +41097 ---> 30852 +41100 ---> 30853 +41102 ---> 30854 +41105 ---> 30855 +41107 ---> 30856 +41108 ---> 30857 +41112 ---> 30858 +41113 ---> 30859 +41115 ---> 30860 +41116 ---> 30861 +41117 ---> 30862 +41125 ---> 30863 +41127 ---> 30864 +41129 ---> 30865 +41130 ---> 30866 +41131 ---> 30867 +41132 ---> 30868 +41133 ---> 30869 +41139 ---> 30870 +41140 ---> 30871 +41141 ---> 30872 +41144 ---> 30873 +41145 ---> 30874 +41148 ---> 30875 +41150 ---> 30876 +41151 ---> 30877 +41152 ---> 30878 +41156 ---> 30879 +41158 ---> 30880 +41159 ---> 30881 +41166 ---> 30882 +41167 ---> 30883 +41168 ---> 30884 +41171 ---> 30885 +41172 ---> 30886 +41174 ---> 30887 +41175 ---> 30888 +41176 ---> 30889 +41179 ---> 30890 +41181 ---> 30891 +41182 ---> 30892 +41183 ---> 30893 +41186 ---> 30894 +41189 ---> 30895 +41192 ---> 30896 +41194 ---> 30897 +41196 ---> 30898 +41198 ---> 30899 +41199 ---> 30900 +41200 ---> 30901 +41201 ---> 30902 +41203 ---> 30903 +41204 ---> 30904 +41205 ---> 30905 +41206 ---> 30906 +41207 ---> 30907 +41208 ---> 1589 +41209 ---> 1588 +41212 ---> 1592 +41213 ---> 30908 +41214 ---> 30909 +41215 ---> 30910 +41219 ---> 30911 +41220 ---> 1413 +41221 ---> 1578 +41223 ---> 30912 +41225 ---> 30913 +41226 ---> 30914 +41228 ---> 30915 +41234 ---> 30916 +41240 ---> 30917 +41242 ---> 30918 +41243 ---> 13447 +41244 ---> 30919 +41247 ---> 30920 +41248 ---> 30921 +41253 ---> 30922 +41254 ---> 30923 +41256 ---> 30924 +41257 ---> 30925 +41258 ---> 30926 +41260 ---> 30927 +41262 ---> 30928 +41264 ---> 30929 +41266 ---> 30930 +41267 ---> 13463 +41268 ---> 30931 +41275 ---> 30932 +41276 ---> 13471 +41278 ---> 30933 +41281 ---> 30934 +41282 ---> 1574 +41283 ---> 30935 +41284 ---> 30936 +41286 ---> 1388 +41287 ---> 30937 +41288 ---> 30938 +41290 ---> 30939 +41291 ---> 30940 +41292 ---> 30941 +41296 ---> 30942 +41297 ---> 13474 +41298 ---> 30943 +41299 ---> 30944 +41304 ---> 30945 +41305 ---> 30946 +41307 ---> 30947 +41308 ---> 30948 +41309 ---> 1197 +41310 ---> 30949 +41313 ---> 30950 +41315 ---> 30951 +41319 ---> 30952 +41320 ---> 30953 +41321 ---> 30954 +41324 ---> 30955 +41325 ---> 30956 +41326 ---> 30957 +41329 ---> 30958 +41332 ---> 30959 +41333 ---> 30960 +41334 ---> 30961 +41335 ---> 30962 +41337 ---> 30963 +41338 ---> 30964 +41339 ---> 30965 +41344 ---> 30966 +41345 ---> 30967 +41346 ---> 30968 +41347 ---> 30969 +41348 ---> 1565 +41349 ---> 30970 +41351 ---> 30971 +41356 ---> 30972 +41357 ---> 2356 +41358 ---> 1569 +41359 ---> 30973 +41361 ---> 30974 +41362 ---> 30975 +41366 ---> 30976 +41368 ---> 30977 +41369 ---> 30978 +41371 ---> 30979 +41374 ---> 30980 +41378 ---> 30981 +41379 ---> 30982 +41380 ---> 30983 +41381 ---> 30984 +41382 ---> 30985 +41383 ---> 30986 +41384 ---> 30987 +41385 ---> 30988 +41388 ---> 30989 +41390 ---> 30990 +41391 ---> 30991 +41393 ---> 30992 +41396 ---> 30993 +41398 ---> 1568 +41399 ---> 30994 +41401 ---> 1559 +41402 ---> 30995 +41403 ---> 30996 +41404 ---> 30997 +41405 ---> 30998 +41406 ---> 30999 +41408 ---> 31000 +41409 ---> 31001 +41410 ---> 31002 +41412 ---> 31003 +41420 ---> 31004 +41421 ---> 31005 +41422 ---> 3783 +41423 ---> 31006 +41425 ---> 31007 +41426 ---> 31008 +41427 ---> 31009 +41428 ---> 31010 +41429 ---> 31011 +41430 ---> 31012 +41431 ---> 31013 +41432 ---> 31014 +41433 ---> 31015 +41434 ---> 31016 +41435 ---> 31017 +41436 ---> 31018 +41437 ---> 31019 +41438 ---> 31020 +41439 ---> 31021 +41440 ---> 31022 +41441 ---> 31023 +41442 ---> 31024 +41443 ---> 31025 +41444 ---> 31026 +41445 ---> 31027 +41456 ---> 1566 +41458 ---> 31028 +41459 ---> 31029 +41460 ---> 31030 +41465 ---> 31031 +41466 ---> 31032 +41468 ---> 31033 +41472 ---> 31034 +41474 ---> 31035 +41475 ---> 31036 +41481 ---> 31037 +41485 ---> 1579 +41487 ---> 31038 +41488 ---> 31039 +41489 ---> 31040 +41491 ---> 31041 +41497 ---> 31042 +41498 ---> 31043 +41500 ---> 31044 +41501 ---> 31045 +41503 ---> 31046 +41505 ---> 31047 +41507 ---> 31048 +41508 ---> 31049 +41509 ---> 31050 +41510 ---> 31051 +41512 ---> 31052 +41515 ---> 31053 +41516 ---> 31054 +41517 ---> 31055 +41518 ---> 31056 +41519 ---> 31057 +41520 ---> 31058 +41525 ---> 31059 +41526 ---> 31060 +41527 ---> 31061 +41528 ---> 31062 +41529 ---> 31063 +41530 ---> 31064 +41532 ---> 31065 +41534 ---> 31066 +41536 ---> 31067 +41537 ---> 31068 +41539 ---> 31069 +41541 ---> 1420 +41544 ---> 31070 +41545 ---> 31071 +41546 ---> 31072 +41551 ---> 31073 +41558 ---> 31074 +41560 ---> 31075 +41563 ---> 31076 +41570 ---> 31077 +41573 ---> 31078 +41574 ---> 31079 +41575 ---> 31080 +41578 ---> 31081 +41582 ---> 31082 +41583 ---> 31083 +41586 ---> 31084 +41587 ---> 1425 +41588 ---> 31085 +41590 ---> 1575 +41591 ---> 31086 +41592 ---> 31087 +41595 ---> 31088 +41598 ---> 31089 +41599 ---> 31090 +41602 ---> 31091 +41608 ---> 13544 +41610 ---> 31092 +41611 ---> 31093 +41612 ---> 31094 +41614 ---> 31095 +41618 ---> 31096 +41619 ---> 13563 +41621 ---> 988 +41622 ---> 31097 +41628 ---> 31098 +41629 ---> 31099 +41630 ---> 31100 +41633 ---> 31101 +41635 ---> 31102 +41638 ---> 31103 +41642 ---> 31104 +41644 ---> 31105 +41645 ---> 31106 +41646 ---> 31107 +41649 ---> 31108 +41650 ---> 31109 +41652 ---> 31110 +41654 ---> 941 +41655 ---> 31111 +41657 ---> 31112 +41658 ---> 31113 +41662 ---> 31114 +41663 ---> 826 +41664 ---> 31115 +41667 ---> 31116 +41668 ---> 31117 +41669 ---> 31118 +41672 ---> 13552 +41673 ---> 31119 +41675 ---> 31120 +41676 ---> 31121 +41677 ---> 31122 +41679 ---> 31123 +41680 ---> 31124 +41685 ---> 31125 +41687 ---> 31126 +41695 ---> 31127 +41697 ---> 31128 +41698 ---> 31129 +41699 ---> 31130 +41700 ---> 31131 +41701 ---> 31132 +41702 ---> 31133 +41704 ---> 31134 +41706 ---> 31135 +41709 ---> 31136 +41710 ---> 31137 +41711 ---> 31138 +41713 ---> 31139 +41714 ---> 31140 +41719 ---> 31141 +41720 ---> 31142 +41722 ---> 31143 +41727 ---> 31144 +41728 ---> 31145 +41729 ---> 31146 +41732 ---> 31147 +41733 ---> 31148 +41734 ---> 31149 +41738 ---> 31150 +41739 ---> 31151 +41740 ---> 31152 +41743 ---> 31153 +41747 ---> 31154 +41748 ---> 31155 +41751 ---> 31156 +41755 ---> 31157 +41756 ---> 31158 +41757 ---> 31159 +41758 ---> 31160 +41762 ---> 31161 +41769 ---> 31162 +41770 ---> 31163 +41773 ---> 31164 +41775 ---> 31165 +41778 ---> 861 +41779 ---> 31166 +41780 ---> 31167 +41781 ---> 31168 +41782 ---> 31169 +41783 ---> 31170 +41784 ---> 31171 +41785 ---> 31172 +41786 ---> 928 +41787 ---> 1584 +41790 ---> 31173 +41792 ---> 31174 +41811 ---> 31175 +41813 ---> 31176 +41814 ---> 31177 +41815 ---> 31178 +41816 ---> 31179 +41817 ---> 31180 +41818 ---> 31181 +41819 ---> 31182 +41821 ---> 31183 +41822 ---> 31184 +41823 ---> 31185 +41825 ---> 31186 +41826 ---> 31187 +41828 ---> 31188 +41830 ---> 31189 +41836 ---> 31190 +41837 ---> 31191 +41839 ---> 31192 +41840 ---> 31193 +41841 ---> 31194 +41846 ---> 31195 +41847 ---> 31196 +41849 ---> 31197 +41852 ---> 31198 +41853 ---> 31199 +41857 ---> 31200 +41859 ---> 13603 +41860 ---> 31201 +41862 ---> 31202 +41863 ---> 31203 +41864 ---> 31204 +41875 ---> 31205 +41879 ---> 31206 +41881 ---> 31207 +41883 ---> 31208 +41884 ---> 31209 +41886 ---> 31210 +41887 ---> 31211 +41895 ---> 31212 +41897 ---> 31213 +41898 ---> 31214 +41899 ---> 31215 +41900 ---> 31216 +41901 ---> 31217 +41902 ---> 31218 +41905 ---> 13610 +41907 ---> 31219 +41911 ---> 31220 +41913 ---> 31221 +41915 ---> 31222 +41916 ---> 31223 +41917 ---> 31224 +41921 ---> 31225 +41922 ---> 31226 +41923 ---> 31227 +41928 ---> 31228 +41929 ---> 31229 +41930 ---> 31230 +41931 ---> 31231 +41932 ---> 31232 +41934 ---> 31233 +41935 ---> 2353 +41936 ---> 31234 +41938 ---> 31235 +41939 ---> 31236 +41946 ---> 31237 +41950 ---> 31238 +41952 ---> 31239 +41953 ---> 1475 +41954 ---> 31240 +41955 ---> 31241 +41959 ---> 31242 +41961 ---> 31243 +41965 ---> 31244 +41968 ---> 31245 +41969 ---> 31246 +41972 ---> 31247 +41973 ---> 31248 +41974 ---> 31249 +41978 ---> 31250 +41979 ---> 31251 +41981 ---> 31252 +41983 ---> 31253 +41986 ---> 31254 +41996 ---> 31255 +41999 ---> 31256 +42001 ---> 31257 +42003 ---> 31258 +42004 ---> 939 +42012 ---> 13625 +42013 ---> 13625 +42024 ---> 31259 +42028 ---> 31260 +42029 ---> 31261 +42032 ---> 31262 +42034 ---> 31263 +42037 ---> 31264 +42040 ---> 31265 +42043 ---> 31266 +42044 ---> 31267 +42047 ---> 31268 +42048 ---> 31269 +42049 ---> 31270 +42051 ---> 13629 +42052 ---> 31271 +42054 ---> 31272 +42055 ---> 31273 +42056 ---> 31274 +42058 ---> 31275 +42060 ---> 2352 +42061 ---> 31276 +42062 ---> 31277 +42065 ---> 31278 +42067 ---> 31279 +42074 ---> 31280 +42077 ---> 31281 +42078 ---> 31282 +42079 ---> 31283 +42083 ---> 31284 +42084 ---> 31285 +42085 ---> 31286 +42086 ---> 31287 +42087 ---> 13793 +42091 ---> 31288 +42092 ---> 31289 +42093 ---> 31290 +42096 ---> 31291 +42101 ---> 31292 +42105 ---> 31293 +42106 ---> 31294 +42107 ---> 31295 +42108 ---> 31296 +42109 ---> 31297 +42111 ---> 31298 +42112 ---> 31299 +42113 ---> 31300 +42114 ---> 31301 +42120 ---> 31302 +42123 ---> 31303 +42130 ---> 1560 +42131 ---> 31304 +42133 ---> 31305 +42136 ---> 31306 +42138 ---> 31307 +42141 ---> 31308 +42143 ---> 31309 +42145 ---> 31310 +42147 ---> 31311 +42149 ---> 31312 +42153 ---> 31313 +42154 ---> 31314 +42155 ---> 31315 +42160 ---> 31316 +42161 ---> 31317 +42164 ---> 31318 +42167 ---> 31319 +42168 ---> 31320 +42170 ---> 31321 +42172 ---> 31322 +42173 ---> 31323 +42176 ---> 31324 +42178 ---> 31325 +42179 ---> 31326 +42180 ---> 31327 +42181 ---> 31328 +42185 ---> 31329 +42191 ---> 31330 +42192 ---> 31331 +42193 ---> 1002 +42194 ---> 31332 +42196 ---> 31333 +42197 ---> 31334 +42199 ---> 31335 +42200 ---> 1585 +42201 ---> 31336 +42205 ---> 31337 +42207 ---> 31338 +42208 ---> 31339 +42211 ---> 31340 +42212 ---> 31341 +42216 ---> 866 +42217 ---> 31342 +42218 ---> 31343 +42219 ---> 31344 +42220 ---> 31345 +42221 ---> 31346 +42231 ---> 2350 +42234 ---> 31347 +42236 ---> 31348 +42237 ---> 31349 +42238 ---> 31350 +42245 ---> 31351 +42246 ---> 31352 +42250 ---> 31353 +42251 ---> 31354 +42252 ---> 31355 +42253 ---> 31356 +42255 ---> 31357 +42264 ---> 31358 +42269 ---> 31359 +42272 ---> 1424 +42275 ---> 31360 +42276 ---> 13701 +42280 ---> 31361 +42283 ---> 31362 +42285 ---> 31363 +42287 ---> 31364 +42292 ---> 31365 +42293 ---> 31366 +42294 ---> 31367 +42299 ---> 31368 +42301 ---> 31369 +42303 ---> 31370 +42304 ---> 31371 +42305 ---> 31372 +42307 ---> 31373 +42309 ---> 31374 +42310 ---> 31375 +42315 ---> 31376 +42318 ---> 31377 +42319 ---> 31378 +42321 ---> 31379 +42323 ---> 31380 +42334 ---> 31381 +42339 ---> 31382 +42341 ---> 1419 +42344 ---> 31383 +42345 ---> 31384 +42347 ---> 31385 +42348 ---> 31386 +42349 ---> 31387 +42350 ---> 31388 +42352 ---> 31389 +42357 ---> 13723 +42366 ---> 31390 +42368 ---> 31391 +42369 ---> 31392 +42371 ---> 31393 +42372 ---> 2406 +42374 ---> 31394 +42375 ---> 31395 +42378 ---> 31396 +42379 ---> 31397 +42380 ---> 31398 +42383 ---> 31399 +42384 ---> 31400 +42386 ---> 31401 +42389 ---> 13740 +42393 ---> 31402 +42396 ---> 31403 +42399 ---> 31404 +42401 ---> 31405 +42402 ---> 31406 +42406 ---> 31407 +42410 ---> 31408 +42413 ---> 31409 +42416 ---> 31410 +42419 ---> 31411 +42421 ---> 31412 +42422 ---> 31413 +42423 ---> 31414 +42424 ---> 31415 +42429 ---> 31416 +42431 ---> 31417 +42435 ---> 31418 +42436 ---> 31419 +42437 ---> 31420 +42438 ---> 31421 +42441 ---> 31422 +42445 ---> 31423 +42446 ---> 31424 +42447 ---> 31425 +42448 ---> 31426 +42449 ---> 31427 +42450 ---> 31428 +42455 ---> 31429 +42459 ---> 31430 +42460 ---> 31431 +42461 ---> 31432 +42466 ---> 31433 +42469 ---> 31434 +42470 ---> 31435 +42471 ---> 31436 +42473 ---> 31437 +42474 ---> 31438 +42476 ---> 31439 +42477 ---> 31440 +42478 ---> 31441 +42479 ---> 31442 +42481 ---> 31443 +42483 ---> 31444 +42487 ---> 31445 +42492 ---> 31446 +42494 ---> 31447 +42495 ---> 31448 +42498 ---> 31449 +42499 ---> 31450 +42500 ---> 31451 +42503 ---> 31452 +42504 ---> 31453 +42505 ---> 31454 +42507 ---> 31455 +42510 ---> 31456 +42515 ---> 31457 +42520 ---> 31458 +42523 ---> 31459 +42524 ---> 31460 +42525 ---> 31461 +42528 ---> 31462 +42530 ---> 31463 +42533 ---> 31464 +42535 ---> 31465 +42539 ---> 31466 +42541 ---> 31467 +42543 ---> 31468 +42544 ---> 31469 +42545 ---> 31470 +42550 ---> 31471 +42552 ---> 31472 +42553 ---> 31473 +42555 ---> 31474 +42556 ---> 31475 +42558 ---> 31476 +42559 ---> 31477 +42562 ---> 31478 +42564 ---> 31479 +42570 ---> 31480 +42571 ---> 31481 +42572 ---> 31482 +42576 ---> 31483 +42578 ---> 31484 +42579 ---> 31485 +42581 ---> 31486 +42582 ---> 31487 +42583 ---> 31488 +42584 ---> 31489 +42585 ---> 31490 +42586 ---> 31491 +42589 ---> 31492 +42590 ---> 31493 +42591 ---> 31494 +42592 ---> 31495 +42595 ---> 31496 +42596 ---> 31497 +42598 ---> 31498 +42599 ---> 31499 +42600 ---> 31500 +42602 ---> 31501 +42607 ---> 31502 +42608 ---> 31503 +42609 ---> 31504 +42612 ---> 31505 +42616 ---> 31506 +42620 ---> 31507 +42621 ---> 31508 +42622 ---> 31509 +42623 ---> 31510 +42625 ---> 31511 +42626 ---> 31512 +42627 ---> 31513 +42628 ---> 31514 +42629 ---> 31515 +42630 ---> 31516 +42631 ---> 31517 +42633 ---> 31518 +42634 ---> 31519 +42635 ---> 31520 +42636 ---> 31521 +42637 ---> 31522 +42638 ---> 31523 +42643 ---> 31524 +42645 ---> 31525 +42646 ---> 31526 +42647 ---> 31527 +42648 ---> 31528 +42649 ---> 31529 +42650 ---> 31530 +42651 ---> 31531 +42652 ---> 31532 +42655 ---> 31533 +42659 ---> 31534 +42660 ---> 31535 +42661 ---> 31536 +42662 ---> 31537 +42665 ---> 31538 +42668 ---> 31539 +42669 ---> 31540 +42670 ---> 31541 +42672 ---> 31542 +42674 ---> 31543 +42675 ---> 31544 +42676 ---> 31545 +42677 ---> 31546 +42678 ---> 498 +42680 ---> 31547 +42683 ---> 227 +42684 ---> 31548 +42686 ---> 31549 +42687 ---> 31550 +42688 ---> 31551 +42692 ---> 31552 +42693 ---> 31553 +42695 ---> 31554 +42696 ---> 31555 +42697 ---> 31556 +42699 ---> 31557 +42700 ---> 31558 +42701 ---> 31559 +42702 ---> 31560 +42704 ---> 31561 +42705 ---> 31562 +42707 ---> 31563 +42708 ---> 31564 +42709 ---> 31565 +42710 ---> 735 +42711 ---> 31566 +42712 ---> 31567 +42716 ---> 31568 +42717 ---> 31569 +42718 ---> 31570 +42719 ---> 31571 +42720 ---> 31572 +42729 ---> 31573 +42730 ---> 325 +42733 ---> 31574 +42734 ---> 733 +42736 ---> 31575 +42737 ---> 31576 +42738 ---> 31577 +42739 ---> 399 +42740 ---> 372 +42742 ---> 371 +42746 ---> 31578 +42748 ---> 31579 +42749 ---> 31580 +42750 ---> 31581 +42751 ---> 31582 +42752 ---> 31583 +42755 ---> 31584 +42756 ---> 577 +42759 ---> 2403 +42761 ---> 732 +42763 ---> 730 +42764 ---> 731 +42765 ---> 1383 +42766 ---> 31585 +42767 ---> 31586 +42769 ---> 804 +42770 ---> 31587 +42771 ---> 772 +42773 ---> 805 +42774 ---> 867 +42775 ---> 31588 +42777 ---> 31589 +42778 ---> 31590 +42779 ---> 31591 +42780 ---> 31592 +42781 ---> 31593 +42782 ---> 31594 +42783 ---> 31595 +42785 ---> 1040 +42786 ---> 1039 +42787 ---> 31596 +42788 ---> 1132 +42789 ---> 1139 +42790 ---> 31597 +42791 ---> 1174 +42792 ---> 31598 +42793 ---> 1341 +42794 ---> 1239 +42795 ---> 31599 +42797 ---> 1366 +42798 ---> 1340 +42802 ---> 31600 +42804 ---> 1384 +42806 ---> 31601 +42808 ---> 31602 +42811 ---> 31603 +42812 ---> 31604 +42813 ---> 1689 +42814 ---> 31605 +42815 ---> 31606 +42816 ---> 31607 +42817 ---> 1733 +42819 ---> 31608 +42825 ---> 31609 +42826 ---> 1766 +42833 ---> 1812 +42836 ---> 1925 +42839 ---> 2117 +42840 ---> 2155 +42841 ---> 2174 +42842 ---> 2241 +42844 ---> 31610 +42846 ---> 31611 diff --git a/docs/pr-guide.md b/docs/pr-guide.md index 6ed95afcc9288f..f55e4e5f1b6b89 100644 --- a/docs/pr-guide.md +++ b/docs/pr-guide.md @@ -25,20 +25,62 @@ Anyone with write access can merge a pull request manually or by setting the [au * The PR has been approved by at least one reviewer and any other objections are addressed. * You can request another review from the original reviewer. * The PR successfully builds and passes all tests in the Continuous Integration (CI) system. - * You can trigger a rebuild by adding a comment like `/azp run ` or manually re-run only the failing lanes in Azure DevOps tab. - * Reach out to the infrastructure team for assistance on [Teams channel](https://teams.microsoft.com/l/channel/19%3ab27b36ecd10a46398da76b02f0411de7%40thread.skype/Infrastructure?groupId=014ca51d-be57-47fa-9628-a15efcc3c376&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47) (for corpnet users) or on [Gitter](https://gitter.im/dotnet/community) in other cases. + * Depending on your change, you may need to re-run validation. See [rerunning validation](#rerunning-validation) below. Please always **squash** the pull request unless there are special circumstances. Do so, even if the PR contains only one commit. It creates a simpler history than a Merge Commit. "Special circumstances" are rare, and typically mean that there are a series of cleanly separated changes that will be too hard to understand if squashed together, or for some reason we want to preserve the ability to bisect them. -## Unrelated failure - -In case CI indicates failures which are **highly unlikely** to be caused by changes in the PR, the following actions should be taken: - -* An existing issue in the repository should be searched for. Usually the test method's or the test assembly's name (in case of a crash) are good parameters. -* If there's an existing issue, a comment should be placed that includes a) the link to the build, b) the affected configuration (ie `netcoreapp-Windows_NT-Release-x64-Windows.81.Amd64.Open`) and c) the Error message and Stack trace. This is necessary as retention policies are in place that recycle _old_ builds. In case the issue is already closed, it should be reopened and labels should be updated to reflect the current failure state. -* If there's no existing issue, an issue should be created with the same information outlined above. -* In a follow-up Pull Request, the failing test(s) should be disabled with the corresponding issue number, e.g. `[ActiveIssue(x)]`, and the tracking issue should be labeled as `disabled-test`. -* A comment should be placed in the original Pull Request that links to the created or updated issues. +## Rerunning Validation + +Validation may fail for several reasons: + +### Option 1: You have a defect in your PR + +* Simply push the fix to your PR branch, and validation will start over. + +### Option 2: There is a flaky test that is not related to your PR + +* Your assumption should be that a failed test indicates a problem in your PR. (If we don't operate this way, chaos ensues.) If the test fails when run again, it is almost surely a failure caused by your PR. However, there are occasions where unrelated failures occur. Here's some ways to know: + * Perhaps you see the same failure in CI results for unrelated active PR's. + * It's a known issue listed in our [big tracking issue](https://github.com/dotnet/runtime/issues/702) or tagged `blocking-clean-ci` [(query here)](https://github.com/dotnet/runtime/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Ablocking-clean-ci+) + * Its otherwise beyond any reasonable doubt that your code changes could not have caused this. + * If the tests pass on rerun, that may suggest it's not related. +* In this situation, you want to re-run but not necessarily rebase on master. + * To rerun just the failed leg(s): + * Click on any leg. Navigate through the Azure DevOps UI, find the "..." button and choose "Retry failed legs" + * Or, on the GitHub Checks tab choose "re-run failed checks". This will not rebase your change. + * To rerun all validation: + * Add a comment `/azp run runtime` + * Or, click on "re-run all checks" in the GitHub Checks tab + * Or, simply close and reopen the PR. +* If you have established that it is an unrelated failure, please ensure we have an active issue for it. See the [unrelated failure](#unrelated-failure) section below. +* Whoever merges the PR should be satisfied that the failure is unrelated, is not introduced by the change, and that we are appropriately tracking it. + +### Option 3: The state of the master branch HEAD is bad. + +* This is the very rare case where there was a build break in master, and you got unlucky. Hopefully the break has been fixed, and you want CI to rebase your change and rerun validation. +* To rebase and rerun all validation: + * Add a comment `/azp run runtime` + * Or, click on "re-run all checks" in the GitHub Checks tab + * Or, simply close and reopen the PR. + +### Additional information: + * You can list the available pipelines by adding a comment like `/azp list` or get the available commands by adding a comment like `azp help`. + * Reach out to the infrastructure team for assistance on [Teams channel](https://teams.microsoft.com/l/channel/19%3ab27b36ecd10a46398da76b02f0411de7%40thread.skype/Infrastructure?groupId=014ca51d-be57-47fa-9628-a15efcc3c376&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47) (for corpnet users) or on [Gitter](https://gitter.im/dotnet/community) in other cases. + +## What to do if you determine the failure is unrelated + +If you have determined the failure is definitely not caused by changes in your PR, please do this: + +* Search for an [existing issue](https://github.com/dotnet/runtime/issues). Usually the test method name or (if a crash/hang) the test assembly name are good search parameters. + * If there's an existing issue, add a comment with + * a) the link to the build + * b) the affected configuration (ie `netcoreapp-Windows_NT-Release-x64-Windows.81.Amd64.Open`) + * c) all console output including the error message and stack trace from the Azure DevOps tab (This is necessary as retention policies are in place that recycle old builds.) + * d) if there's a dump file (see Attachments tab in Azure DevOps) include that + * If the issue is already closed, reopen it and update the labels to reflect the current failure state. + * If there's no existing issue, create an issue with the same information listed above. + * Update the original pull request with a comment linking to the new or existing issue. +* In a follow-up Pull Request, disable the failing test(s) with the corresponding issue link, e.g. `[ActiveIssue(x)]`, and update the tracking issue with the label `disabled-test`. There are plenty of possible bugs, e.g. race conditions, where a failure might highlight a real problem and it won't manifest again on a retry. Therefore these steps should be followed for every iteration of the PR build, e.g. before retrying/rebuilding. diff --git a/docs/project/api-review-process.md b/docs/project/api-review-process.md index da3abcfa51eab0..8cafa7f5988ab2 100644 --- a/docs/project/api-review-process.md +++ b/docs/project/api-review-process.md @@ -4,7 +4,7 @@ ## Which APIs should be reviewed? -The rule of thumb is that we (**corefx**) review every API that is being added to the `System.*` namespaces. In some cases, we also review APIs that are added to other namespaces, such as `Microsoft.*`. We mostly do this for high impact APIs, such as Roslyn, and when both the owner of the technology and we feel there is win-win for both sides if we review the APIs. However, we can't scale to review all APIs being added to .NET. +The rule of thumb is that we (**dotnet/runtime**) review every API that is being added to the `System.*` namespaces. In some cases, we also review APIs that are added to other namespaces, such as `Microsoft.*`. We mostly do this for high impact APIs, such as Roslyn, and when both the owner of the technology and we feel there is win-win for both sides if we review the APIs. However, we can't scale to review all APIs being added to .NET. ## Process @@ -25,7 +25,7 @@ APIs and some code samples that show how it should be used. If changes are neces 4. **Owner makes decision**. When the owner believes enough information is available to make a decision, they will update the issue accordingly: - * **Mark for review**. If the owner believes the proposal is actionable, they will label the issue with `api-ready-for-review`. Here is [a good example](https://github.com/dotnet/corefx/issues/4547) of as strong API proposal. + * **Mark for review**. If the owner believes the proposal is actionable, they will label the issue with `api-ready-for-review`. [Here is a good example](https://github.com/dotnet/corefx/issues/4547) of as strong API proposal. * **Close as not actionable**. In case the issue didn't get enough traction to be distilled into a concrete proposal, the owner will close the issue. * **Close as won't fix as proposed**. Sometimes, the issue that is raised is a good one but the owner thinks the concrete proposal is not the right way to tackle the problem. In most cases, the owner will try to steer the discussion in a direction that results in a design that we believe is appropriate. However, for some proposals the problem is at the heart of the design which can't easily be changed without starting a new proposal. In those cases, the owner will close the issue and explain the issue the design has. * **Close as won't fix**. Similarly, if proposal is taking the product in a direction we simply don't want to go, the issue might also get closed. In that case, the problem isn't the proposed design but in the issue itself. @@ -40,9 +40,9 @@ APIs and some code samples that show how it should be used. If changes are neces ## Pull requests -Pull requests against **corefx** shouldn't be submitted before getting approval. Also, we don't want to get work in progress (WIP). The reason being that we want to reduce the number pending PRs so that we can focus on the work the community expects we take action on. +Pull requests against **dotnet/runtime** shouldn't be submitted before getting approval. Also, we don't want to get work in progress (WIP). The reason being that we want to reduce the number pending PRs so that we can focus on the work the community expects we take action on. -If you want to collaborate with other people on the design, feel free to perform the work in a branch in your own fork. If you want to track your TODOs in the description of a PR, you can always submit a PR against your own fork. Also, feel free to advertise your PR by linking it from the issue you filed against **corefx** in the first step above. +If you want to collaborate with other people on the design, feel free to perform the work in a branch in your own fork. If you want to track your TODOs in the description of a PR, you can always submit a PR against your own fork. Also, feel free to advertise your PR by linking it from the issue you filed against **dotnet/runtime** in the first step above. ## API Design Guidelines diff --git a/docs/project/glossary.md b/docs/project/glossary.md index 0e562b180c4592..c1232faac39f85 100644 --- a/docs/project/glossary.md +++ b/docs/project/glossary.md @@ -34,7 +34,7 @@ terminology. | ProjectN | Codename for the first version of [.NET Native for UWP](https://msdn.microsoft.com/en-us/vstudio/dotnetnative.aspx). | | R2R | Ready-to-Run. A flavor of native images - command line switch of [crossgen](../workflow/building/coreclr/crossgen.md). | | Redhawk | Codename for experimental minimal managed code runtime that evolved into [CoreRT](https://github.com/dotnet/corert/). | -| SOS | [Son of Strike](http://blogs.msdn.com/b/jasonz/archive/2003/10/21/53581.aspx). The debugging extension for DbgEng based debuggers. Uses the DAC as an abstraction layer for its operation. | +| SOS | [Son of Strike](https://docs.microsoft.com/en-us/archive/blogs/jasonz/sos-debugging-of-the-clr-part-1). The debugging extension for DbgEng based debuggers. Uses the DAC as an abstraction layer for its operation. | | SuperPMI | JIT component test framework (super fast JIT testing - it mocks/replays EE in EE-JIT interface) - see [SuperPMI details](https://github.com/dotnet/coreclr/blob/master/src/ToolBox/superpmi/readme.txt). | | SVR | The CLR used to be built as two variants, with one called "mscorsvr.dll", to mean the "server" version. In particular, it contained the server GC implementation, which was intended for multi-threaded apps capable of taking advantage of multiple processors. In the .NET Framework 2 release, the two variants were merged into "mscorwks.dll". The WKS version was the default, however the SVR version remained available. | | TPA | Trusted Platform Assemblies used to be a special set of assemblies that comprised the platform assemblies, when it was originally designed. As of today, it is simply the set of assemblies known to constitute the application. | @@ -345,7 +345,7 @@ and enabling support for running WPF on .NET Core (Windows Only). and the logs will have the URL. -[introducing-net-core]: http://blogs.msdn.com/b/dotnet/archive/2014/12/04/introducing-net-core.aspx +[introducing-net-core]: https://devblogs.microsoft.com/dotnet/introducing-net-core/ [core-build-status]: https://github.com/dotnet/coreclr#build-status [corefx]: http://github.com/dotnet/corefx [referencesource]: https://github.com/microsoft/referencesource diff --git a/docs/project/performance-guidelines.md b/docs/project/performance-guidelines.md index a8d4124bda3054..d2cee51456f804 100644 --- a/docs/project/performance-guidelines.md +++ b/docs/project/performance-guidelines.md @@ -55,7 +55,7 @@ PerfView is available at the [PerfView repo](https://github.com/microsoft/perfvi 2. After building the runtime you will need to generate a core root that contains all of the binaries we just built along with the required dependencies. This can be done with the command `tests\runtest.cmd Release x64 GenerateLayoutOnly`, with the same caveat that x86 should be used if that is the platform that you are testing. -3. Now we need to actually run the performance tests. You can do that with the following command that should be run from the root of your repo `python tests\scripts\run-xunit-perf.py -arch x64 -configuration Release -testBinLoc bin\tests\Windows_NT.x64.Release\Jit\Performance\CodeQuality`. This will run all of the tests in the JIT CodeQuality directory as the script will walk all sub-directories and look for tests to run. If you want to just run a single test, pass the path of the single test that you want to run. +3. Now we need to actually run the performance tests. The performance tests live in the [dotnet/performance](https://github.com/dotnet/performance) repo. Instructions for running them are [here](https://github.com/dotnet/performance/blob/master/docs/benchmarking-workflow-dotnet-runtime.md). 4. Navigate to the `sandbox` directory in the root of your repo. Inside that directory you will find a bunch of files that follow the name Perf-*.md. These will contain the results, formatted as Markdown files, for each test that was run. diff --git a/docs/workflow/building/libraries/README.md b/docs/workflow/building/libraries/README.md index 5c03b40a262905..cd3e04e30e92db 100644 --- a/docs/workflow/building/libraries/README.md +++ b/docs/workflow/building/libraries/README.md @@ -24,7 +24,7 @@ cd tests :: Then inner loop build / test :: (If using Visual Studio, you might run tests inside it instead) -pushd ..\src & dotnet msbuild & popd & dotnet msbuild /t:buildandtest +pushd ..\src & dotnet build & popd & dotnet build /t:buildandtest ``` The instructions for Linux and macOS are essentially the same: @@ -46,7 +46,7 @@ cd src/libraries/System.Text.RegularExpressions cd tests # Then inner loop build / test: -pushd ../src & dotnet msbuild & popd & dotnet msbuild /t:buildandtest +pushd ../src & dotnet build & popd & dotnet build /t:buildandtest ``` The steps above may be all you need to know to make a change. Want more details about what this means? Read on. @@ -77,7 +77,7 @@ The libraries build has two logical components, the native build which produces The build configurations are generally defaulted based on where you are building (i.e. which OS or which architecture) but we have a few shortcuts for the individual properties that can be passed to the build scripts: -- `-framework|-f` identifies the target framework for the build. It defaults to latest `netcoreapp` but possible values include `netcoreapp` (Which will map to latest netcoreapp) or `net472`. (msbuild property `TargetGroup`) +- `-framework|-f` identifies the target framework for the build. Possible values include `netcoreapp5.0` (currently the latest .NET Core version) or `net472`. (msbuild property `TargetFramework`) - `-os` identifies the OS for the build. It defaults to the OS you are running on but possible values include `Windows_NT`, `Unix`, `Linux`, or `OSX`. (msbuild property `OSGroup`) - `-configuration|-c Debug|Release` controls the optimization level the compilers use for the build. It defaults to `Debug`. (msbuild property `ConfigurationGroup`) - `-arch` identifies the architecture for the build. It defaults to `x64` but possible values include `x64`, `x86`, `arm`, or `arm64`. (msbuild property `ArchGroup`) @@ -101,8 +101,8 @@ By default build only builds the product libraries and none of the tests. If you - Building for different target frameworks (restore and build are implicit again as no action is passed in) ```bash -./build.sh -subsetCategory libraries -framework netcoreapp -./build.sh -subsetCategory libraries -framework netfx +./build.sh -subsetCategory libraries -framework netcoreapp5.0 +./build.sh -subsetCategory libraries -framework net472 ``` - Build only managed components and skip the native build @@ -154,40 +154,34 @@ Similar to building the entire repo with `build.cmd` or `build.sh` in the root y - All the options listed above like framework and configuration are also supported (note they must be after the directory) ```bash - ./build.sh -subsetCategory libraries System.Collections -f netfx -c Release + ./build.sh -subsetCategory libraries System.Collections -f net472 -c Release ``` -As an alternative, once you are iterating on specific libraries, you can either use `dotnet msbuild` (not `dotnet build` -- that will run a restore as well) or `msbuild`, depending on which is in your path. As `dotnet msbuild` works on both Unix and Windows we will use it throughout this guide. +As `dotnet build` works on both Unix and Windows and calls the restore target implicitly, we will use it throughout this guide. Under the src directory is a set of directories, each of which represents a particular assembly in CoreFX. See Library Project Guidelines section under [project-guidelines](../../../coding-guidelines/project-guidelines.md) for more details about the structure. For example the src\libraries\System.Diagnostics.DiagnosticSource directory holds the source code for the System.Diagnostics.DiagnosticSource.dll assembly. -You can build the DLL for System.Diagnostics.DiagnosticSource.dll by going to the `src\libraries\System.Diagnostics.DiagnosticsSource\src` directory and typing `dotnet msbuild`. The DLL ends up in `artifacts\bin\AnyOS.AnyCPU.Debug\System.Diagnostics.DiagnosticSource` as well as `artifacts\bin\runtime\[BuildConfiguration]`. +You can build the DLL for System.Diagnostics.DiagnosticSource.dll by going to the `src\libraries\System.Diagnostics.DiagnosticsSource\src` directory and typing `dotnet build`. The DLL ends up in `artifacts\bin\AnyOS.AnyCPU.Debug\System.Diagnostics.DiagnosticSource` as well as `artifacts\bin\runtime\[BuildConfiguration]`. You can build the tests for System.Diagnostics.DiagnosticSource.dll by going to -`src\libraries\System.Diagnostics.DiagnosticSource\tests` and typing `dotnet msbuild`. +`src\libraries\System.Diagnostics.DiagnosticSource\tests` and typing `dotnet build`. -Some libraries might also have a ref and/or a pkg directory and you can build them in a similar way by typing `dotnet msbuild` in that directory. +Some libraries might also have a ref and/or a pkg directory and you can build them in a similar way by typing `dotnet build` in that directory. For libraries that have multiple build configurations the configurations will be listed in the `` property group, commonly found in a configurations.props file next to the csproj. When building the csproj for a configuration the most compatible one in the list will be chosen and set for the build. For more information about `BuildConfigurations` see [project-guidelines](../../../coding-guidelines/project-guidelines.md). **Examples** -- Build project for Linux for netcoreapp +- Build project for Linux for .NET Core ``` -dotnet msbuild System.Net.NetworkInformation.csproj /p:OSGroup=Linux +dotnet build System.Net.NetworkInformation.csproj /p:OSGroup=Linux ``` - Build release version of library ``` -dotnet msbuild System.Net.NetworkInformation.csproj /p:ConfigurationGroup=Release -``` - -To build for all supported configurations you can use the `BuildAll` and `RebuildAll` targets: - -``` -dotnet msbuild System.Net.NetworkInformation.csproj /t:RebuildAll +dotnet build -c Release System.Net.NetworkInformation.csproj ``` ### Building all for other OSes @@ -200,11 +194,11 @@ Note that you cannot generally build native components for another OS but you ca ### Building in Release or Debug By default, building from the root or within a project will build the libraries in Debug mode. -One can build in Debug or Release mode from the root by doing `./build.sh -subsetCategory libraries -c Release` or `./build.sh -subsetCategory libraries -c Debug` or when building a project by specifying `/p:ConfigurationGroup=[Debug|Release]` after the `dotnet msbuild` command. +One can build in Debug or Release mode from the root by doing `./build.sh -subsetCategory libraries -c Release` or `./build.sh -subsetCategory libraries -c Debug` or when building a project by specifying `-c Debug/Release` after the `dotnet build` command. ### Building other Architectures -One can build 32- or 64-bit binaries or for any architecture by specifying in the root `./build.sh -subsetCategory libraries -arch [value]` or in a project `/p:ArchGroup=[value]` after the `dotnet msbuild` command. +One can build 32- or 64-bit binaries or for any architecture by specifying in the root `./build.sh -subsetCategory libraries -arch [value]` or in a project `/p:ArchGroup=[value]` after the `dotnet build` command. ## Working in Visual Studio diff --git a/docs/workflow/building/mono/README.md b/docs/workflow/building/mono/README.md index 8890e63e36aa45..c751144bd28ec5 100644 --- a/docs/workflow/building/mono/README.md +++ b/docs/workflow/building/mono/README.md @@ -1,21 +1,42 @@ # Building Mono -To build just Mono runtime, use the `--subsetCategory` flag to the `build.sh` (or `build.cmd`) at the repo root: +To build the Mono runtime, you must first do a complete runtime build (coreclr, libraries, and then mono). At the repo root, simply execute: ```bash -./build.sh --subsetCategory mono +./build.sh ``` or on Windows, ```bat -build.cmd --subsetCategory mono +build.cmd ``` +Note that the debug configuration is the default option. It generates a 'debug' output and that includes asserts, fewer code optimizations, and is easier for debugging. If you want to make performance measurements, or just want tests to execute more quickly, you can also build the 'release' version which does not have these checks by adding the flag `-configuration release` (or `-c release`). + + +Once you've built the whole runtime and assuming you want to work with just mono, we have provided `$/mono.sh` that only builds mono and is short hand for: -By default, build generates a 'debug' build output, that includes asserts, less code optimizations and is easier for debugging. If you want to make performance measurements, or just want tests to execute more quickly, you can also build the 'release' version which does not have these checks by adding the flag `-configuration Release` (or `-c Release`) and `/p:__BuildType=Release`, for example ```bash -./build.sh --subsetCategory mono -configuration Release /p:__BuildType=Release +./build.sh --subsetCategory mono +``` +or on Windows, +```bat +build.cmd --subsetCategory mono ``` +When the build completes, product binaries will be dropped in the `artifacts\bin\mono\..` folder. -Product binaries will be dropped in `artifacts\bin\mono\..` folder. +### Useful Build Arguments +Here are a list of build arguments that may be of use. These apply to both `build.sh` and `mono.sh`: + +For both `build.sh` and `mono.sh` + +`/p:MonoEnableLlvm=true` - Builds mono w/ LLVM + +For `build.sh` + +`/p:DisableCrossgen=true` - Skips building the installer if you don't need it (builds faster) + +The build has a number of options that you can learn about using build -?. + +## Packages To generate nuget packages: @@ -34,11 +55,11 @@ The following packages will be created under `artifacts\packages\ - `transport.Microsoft.NETCore.Runtime.Mono.-dev..1.nupkg` - `transport.runtime..Microsoft.NETCore.Runtime.Mono.-dev..1.nupkg` +## Important Notes + Test binaries are not yet available for mono. The build places logs in `artifacts\log` and these are useful when the build fails. The build places all of its output in the `artifacts\obj\mono` directory, so if you remove that directory you can force a full rebuild. - -The build has a number of options that you can learn about using `build -?`. \ No newline at end of file diff --git a/docs/workflow/debugging/crash-dumps.md b/docs/workflow/debugging/crash-dumps.md deleted file mode 100644 index 990cb6b924d37a..00000000000000 --- a/docs/workflow/debugging/crash-dumps.md +++ /dev/null @@ -1,16 +0,0 @@ -Crash dumps can be useful for analyzing and debugging intermittent or hard-to-reproduce bugs. In all of our CI test runs and official build test runs, we use a utility called "Dumpling" to collect and archive crash dumps that are created during test execution. These crash dumps are archived on the [Dumpling web portal](https://dumpling.azurewebsites.net/), which has download links, as well as auxiliary triage information gathered during crash dump collection. - -When a crash is encountered in a test run (and crash dump collection is enabled), the following information will be printed to the log: - -``` - Process is terminating due to StackOverflowException. - processing dump file C:\Users\DOTNET~1\AppData\Local\Temp\CoreRunCrashDumps\dotnet.exe.13228.dmp - creating dumpling dump 37ad6dce8b9d7f29def35b1ae1c9a3d4e3fc03bf - uploading artifact 37ad6dce8b9d7f29def35b1ae1c9a3d4e3fc03bf dotnet.exe.13228.dmp -``` - -The crash dump can then be located via this unique identifier from the Dumpling portal. In the example above, the identifier is "37ad6dce8b9d7f29def35b1ae1c9a3d4e3fc03bf". - -Note that, while Dumpling archives the crash dumps for a long time, the Jenkins CI logs (containing the test info and the crash dump identifier) are not persisted for more than a few days. - -Debugging crash dumps is a fairly involved process. Windows crash dumps are well-supported using existing and documented tools like Visual Studio, WinDBG, and SOS. The instructions for Unix platforms are complicated, and are documented [here](../debugging/coreclr/debugging.md#debugging-core-dumps-with-lldb). diff --git a/docs/workflow/debugging/libraries/unix-instructions.md b/docs/workflow/debugging/libraries/unix-instructions.md index d33a8c023a4e63..8fdf86334dfab2 100644 --- a/docs/workflow/debugging/libraries/unix-instructions.md +++ b/docs/workflow/debugging/libraries/unix-instructions.md @@ -23,23 +23,10 @@ error: no such file It is also possible to debug .NET Core crash dumps using lldb and SOS. In order to do this, you need all of the following: -- You will find the dump url to download the crash dump file in the test logs, something similar to: -
-2017-10-10 21:17:48,020: INFO: proc(54): run_and_log_output: Output: dumplingid:  eefcb1cc36977ccf86f457ee28a33a7b4cc24e13
-2017-10-10 21:17:48,020: INFO: proc(54): run_and_log_output: Output: https://dumpling.azurewebsites.net/api/dumplings/archived/eefcb1cc36977ccf86f457ee28a33a7b4cc24e13
-
-- The crash dump file. We have a service called "Dumpling" which collects, uploads, and archives crash dump files during all of our CI jobs and official builds. -- On Linux, there is an utility called `createdump` (see [doc](../../../design/coreclr/botr/xplat-minidump-generation.md "doc")) that can be setup to generate core dumps when a managed app throws an unhandled exception or faults. -- Matching coreclr/corefx runtime bits from the crash. To get these, you should either: - - Download the matching Jenkins archive onto your repro machine. - - Check out the coreclr and corefx repositories at the appropriate commit and re-build the necessary portions. -- lldb version 3.9. The SOS plugin (i.e. libsosplugin.so) provided is now built for lldb 3.9. In order to install lldb 3.9 just run the following commands: -``` -~$ echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.9 main" | sudo tee /etc/apt/sources.list.d/llvm.list -~$ wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - -~$ sudo apt-get update -~$ sudo apt-get install lldb-3.9 -``` +- The crash dump file. +- On Linux, there is an utility called `createdump` (see [doc](../../../design/coreclr/botr/xplat-minidump-generation.md "doc")) that can be setup to generate core dumps when a managed app throws an unhandled exception or faults.' + +There are instructions for installing lldb and SOS [here](https://github.com/dotnet/diagnostics/blob/master/documentation/sos.md). Once you have everything listed above, you are ready to start debugging. You need to specify an extra parameter to lldb in order for it to correctly resolve the symbols for libcoreclr.so. Use a command like this: diff --git a/docs/workflow/testing/coreclr/windows-test-instructions.md b/docs/workflow/testing/coreclr/windows-test-instructions.md index ee5f94796f6d29..c1a423acdccd1d 100644 --- a/docs/workflow/testing/coreclr/windows-test-instructions.md +++ b/docs/workflow/testing/coreclr/windows-test-instructions.md @@ -51,7 +51,7 @@ Note: `build-test.cmd` or `build.cmd skipnative` needs to be run at least once ### Running Tests -`src\coreclr\runtest.cmd /?` - will list supported parameters. +`src\coreclr\tests\runtest.cmd /?` - will list supported parameters. For example to run all of the tests using your checked build: diff --git a/docs/workflow/testing/libraries/filtering-tests.md b/docs/workflow/testing/libraries/filtering-tests.md index f7348a0281df5d..3b7d911d97fe3b 100644 --- a/docs/workflow/testing/libraries/filtering-tests.md +++ b/docs/workflow/testing/libraries/filtering-tests.md @@ -44,22 +44,22 @@ This attribute returns the 'failing' category, which is disabled by default. **Disable for all platforms and all target frameworks:** ```cs -[ActiveIssue(int issue)] [ActiveIssue(string issue)] ``` **Disable for specific platform:** ```cs -[ActiveIssue(int issue, TestPlatforms platforms)] [ActiveIssue(string issue, TestPlatforms platforms)] ``` +**Disable for specific runtime:** +```cs +[ActiveIssue(string issue, TestRuntimes runtimes)] +``` **Disable for specific target frameworks:** ```cs -[ActiveIssue(int issue, TargetFrameworkMonikers frameworks)] [ActiveIssue(string issue, TargetFrameworkMonikers frameworks)] ``` **Disable for specific test platforms and target frameworks:** ```cs -[ActiveIssue(int issue, TestPlatforms platforms, TargetFrameworkMonikers frameworks)] [ActiveIssue(string issue, TestPlatforms platforms, TargetFrameworkMonikers frameworks)] ``` Use this attribute over test methods to skip failing tests only on the specific platforms and the specific target frameworks. @@ -142,7 +142,7 @@ public class TestClass } ``` -**Note that all of the attributes above must include an issue number/link and/or have a comment next to them briefly justifying the reason. ActiveIssueAttribute and SkipOnTargetFrameworkAttribute should use their constructor parameters to do this** +**Note that all of the attributes above must include an issue link and/or have a comment next to them briefly justifying the reason. ActiveIssueAttribute and SkipOnTargetFrameworkAttribute should use their constructor parameters to do this** _**A few common examples with the above attributes:**_ diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index f634d217d31875..894f44cc484b6e 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -1,7 +1,18 @@ # Running Tests using Mono Runtime ## Running Runtime Tests -The runtime tests will be available at a later date. +We currently only support running tests against coreclr. There are additional mono runtime tests in mono/mono, but they +have not been moved over yet. Simply run the following command: + +``` +dotnet msbuild /t:RunCoreClrTests $(REPO_ROOT)/src/mono/mono.proj +``` + +If you want to run individual tests, execute this command: + +``` +dotnet msbuild /t:RunCoreClrTest /p:CoreClrTest="" $(REPO_ROOT)/src/mono/mono.proj +``` ## Running Library Tests Running library tests against Mono is straightforward regardless of configuration. Simply run the following commands: @@ -23,3 +34,21 @@ build.cmd /p:RuntimeFlavor=mono ``` dotnet msbuild /t:BuildAndTest /p:RuntimeFlavor=mono ``` + +# Patching Local dotnet (.dotnet-mono) +Another way to test mono out is by 'patching' a local dotnet with our runtime bits. This is a good way to write simple +test programs and get a glimpse of how mono will work with the dotnet tooling. + +To generate a local .dotnet-mono, execute this command: + +``` +dotnet msbuild /t:PatchLocalMonoDotnet $(REPO_ROOT)/src/mono/mono.proj +``` + +You can then, for example, run our HelloWorld sample via: + +``` +dotnet build -c Release $(REPO_ROOT)/src/mono/netcore/sample/HelloWorld +MONO_ENV_OPTIONS="" COMPlus_DebugWriteToStdErr=1 \ +$(REPO_ROOT)/.dotnet-mono/dotnet $(REPO_ROOT)/src/mono/netcore/sample/HelloWorld/bin/HelloWorld.dll +``` \ No newline at end of file diff --git a/eng/Analyzers.props b/eng/Analyzers.props index e2163a76e3a96f..534d38a5546ca3 100644 --- a/eng/Analyzers.props +++ b/eng/Analyzers.props @@ -4,7 +4,7 @@ - - + + diff --git a/eng/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset index 646deabaf86736..e4525c4a7d0c94 100644 --- a/eng/CodeAnalysis.ruleset +++ b/eng/CodeAnalysis.ruleset @@ -50,7 +50,6 @@ - diff --git a/eng/LicenseHeader.txt b/eng/LicenseHeader.txt index 5c2f593e663071..94ec97db2fac35 100644 --- a/eng/LicenseHeader.txt +++ b/eng/LicenseHeader.txt @@ -2,6 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 68cefeed6be998..66c2e3d1ba1ee9 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,106 +1,66 @@ - - https://github.com/dotnet/runtime - 665983a01f9c604bc3f704f469acb8a08c619d8a - - - https://github.com/dotnet/runtime - 665983a01f9c604bc3f704f469acb8a08c619d8a - - - https://github.com/dotnet/runtime - 665983a01f9c604bc3f704f469acb8a08c619d8a - - - https://github.com/dotnet/corefx - cf64918877d98577363bb40d5eafac52beb80a79 - - - https://github.com/dotnet/coreclr - 2c4fb3250989f014550882f5d165cdc36ebdbd08 - - - https://github.com/dotnet/coreclr - 2c4fb3250989f014550882f5d165cdc36ebdbd08 - - - https://github.com/dotnet/corefx - 5cee7c97d602f294e27c582d4dab81ec388f1d7b - - - https://github.com/dotnet/corefx - 5cee7c97d602f294e27c582d4dab81ec388f1d7b - https://github.com/dotnet/standard cfe95a23647c7de1fe1a349343115bd7720d6949 - - https://github.com/mono/linker - cbdda5a2a6fbf01f74581aa956ef2e7b03b96977 - - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 - + https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 - - - https://github.com/dotnet/arcade - b65df96ccb820fd5f7ea226aeba310485f395130 + bd2a2b09716ddb54cb1e40f087beaaeeef859118 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -158,5 +118,65 @@ https://github.com/dotnet/runtime-assets 572e952eae1d4fc6e83300031c5f7c401014ff34 + + https://github.com/dotnet/llvm-project + adeaa08e7bbc9aba5d67cb16c2b348be12deb000 + + + https://github.com/dotnet/llvm-project + adeaa08e7bbc9aba5d67cb16c2b348be12deb000 + + + https://github.com/dotnet/llvm-project + adeaa08e7bbc9aba5d67cb16c2b348be12deb000 + + + https://github.com/dotnet/llvm-project + adeaa08e7bbc9aba5d67cb16c2b348be12deb000 + + + https://github.com/dotnet/llvm-project + adeaa08e7bbc9aba5d67cb16c2b348be12deb000 + + + https://github.com/dotnet/llvm-project + adeaa08e7bbc9aba5d67cb16c2b348be12deb000 + + + https://github.com/dotnet/runtime + 665983a01f9c604bc3f704f469acb8a08c619d8a + + + https://github.com/dotnet/runtime + 665983a01f9c604bc3f704f469acb8a08c619d8a + + + https://github.com/dotnet/runtime + 665983a01f9c604bc3f704f469acb8a08c619d8a + + + https://github.com/dotnet/corefx + cf64918877d98577363bb40d5eafac52beb80a79 + + + https://github.com/dotnet/coreclr + 2c4fb3250989f014550882f5d165cdc36ebdbd08 + + + https://github.com/dotnet/runtime + e793fcc19797f407a1b7e98d5f81b04e25a551c3 + + + https://github.com/dotnet/corefx + 5cee7c97d602f294e27c582d4dab81ec388f1d7b + + + https://github.com/dotnet/corefx + 5cee7c97d602f294e27c582d4dab81ec388f1d7b + + + https://github.com/mono/linker + 72551f41d5925198262c1f3c2d06dfecd2596a4e + diff --git a/eng/Versions.props b/eng/Versions.props index 854eb2523d8415..4a749666efcc6e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -6,8 +6,8 @@ 5 0 0 - alpha - 1 + preview + 2 $(MajorVersion).$(MinorVersion).0.0 @@ -16,6 +16,8 @@ release true + + 3.5.0-beta2-20074-05 true false @@ -57,16 +59,16 @@ - 5.0.0-beta.20105.2 - 5.0.0-beta.20105.2 - 5.0.0-beta.20105.2 - 5.0.0-beta.20105.2 - 5.0.0-beta.20105.2 - 5.0.0-beta.20105.2 - 2.5.1-beta.20105.2 - 5.0.0-beta.20105.2 - 5.0.0-beta.20105.2 - 5.0.0-beta.20105.2 + 5.0.0-beta.20117.3 + 5.0.0-beta.20117.3 + 5.0.0-beta.20117.3 + 5.0.0-beta.20117.3 + 5.0.0-beta.20117.3 + 5.0.0-beta.20117.3 + 2.5.1-beta.20117.3 + 5.0.0-beta.20117.3 + 5.0.0-beta.20117.3 + 5.0.0-beta.20117.3 5.0.0-alpha.1.20080.9 5.0.0-alpha.1.20080.9 @@ -120,9 +122,16 @@ 2.1.26 4.12.0 - 3.0.0-preview9-190909-1 + 3.1.0-preview-20200129.1 - 0.1.6-prerelease.19567.1 + 0.1.6-prerelease.20117.1 + + 6.0.1-alpha.1.20078.4 + 6.0.1-alpha.1.20078.4 + 6.0.1-alpha.1.20078.4 + 6.0.1-alpha.1.20078.4 + 6.0.1-alpha.1.20078.4 + 6.0.1-alpha.1.20078.4 diff --git a/eng/build.ps1 b/eng/build.ps1 index 81c417a34e72d7..cf9297f833999a 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -14,21 +14,24 @@ Param( [string]$arch, [string]$subsetCategory, [string]$subset, - [string]$runtimeConfiguration, - [string]$librariesConfiguration, + [ValidateSet("Debug","Release","Checked")][string]$runtimeConfiguration, + [ValidateSet("Debug","Release")][string]$librariesConfiguration, [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties ) function Get-Help() { Write-Host "Common settings:" - Write-Host " -subset Build a subset, print available subsets with -subset help" - Write-Host " -subsetCategory Build a subsetCategory, print available subsetCategories with -subset help" - Write-Host " -os Build operating system: Windows_NT or Unix" - Write-Host " -arch Build platform: x86, x64, arm or arm64" - Write-Host " -configuration Build configuration: Debug or Release (short: -c)" - Write-Host " -verbosity MSBuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" - Write-Host " -binaryLog Output binary log (short: -bl)" - Write-Host " -help Print help and exit (short: -h)" + Write-Host " -subset Build a subset, print available subsets with -subset help" + Write-Host " -subsetCategory Build a subsetCategory, print available subsetCategories with -subset help" + Write-Host " -vs Open the solution with VS for Test Explorer support. Path or solution name (ie -vs Microsoft.CSharp)" + Write-Host " -os Build operating system: Windows_NT or Unix" + Write-Host " -arch Build platform: x86, x64, arm or arm64" + Write-Host " -configuration Build configuration: Debug, Release or [CoreCLR]Checked (short: -c)" + Write-Host " -runtimeConfiguration Runtime build configuration: Debug, Release or [CoreCLR]Checked" + Write-Host " -librariesConfiguration Libraries build configuration: Debug or Release" + Write-Host " -verbosity MSBuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" + Write-Host " -binaryLog Output binary log (short: -bl)" + Write-Host " -help Print help and exit (short: -h)" Write-Host "" Write-Host "Actions (defaults to -restore -build):" @@ -44,7 +47,6 @@ function Get-Help() { Write-Host "" Write-Host "Libraries settings:" - Write-Host " -vs Open the solution with VS for Test Explorer support. Path or solution name (ie -vs Microsoft.CSharp)" Write-Host " -framework Build framework: netcoreapp5.0 or net472 (short: -f)" Write-Host " -coverage Collect code coverage when testing" Write-Host " -testscope Scope tests, allowed values: innerloop, outerloop, all" diff --git a/eng/build.sh b/eng/build.sh index 4da7816215aba3..22577c6332ba75 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -21,8 +21,10 @@ usage() echo " --subsetCategory Build a subsetCategory, print available subsetCategories with -subset help" echo " --os Build operating system: Windows_NT or Unix" echo " --arch Build platform: x86, x64, arm or arm64" - echo " --configuration Build configuration: Debug or Release (short: -c)" - echo " --verbosity MSBuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" + echo " --configuration Build configuration: Debug, Release or [CoreCLR]Checked (short: -c)" + echo " --runtimeConfiguration Runtime build configuration: Debug, Release or [CoreCLR]Checked" + echo " --librariesConfiguration Libraries build configuration: Debug or Release" + echo " --verbosity MSBuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" echo " --binaryLog Output binary log (short: -bl)" echo " --cross Optional argument to signify cross compilation" echo " --help Print help and exit (short: -h)" @@ -41,7 +43,7 @@ usage() echo "" echo "Libraries settings:" - echo " --framework Build framework: netcoreapp or net472 (short: -f)" + echo " --framework Build framework: netcoreapp5.0 or net472 (short: -f)" echo " --coverage Collect code coverage when testing" echo " --testscope Test scope, allowed values: innerloop, outerloop, all" echo " --allconfigurations Build packages for all build configurations" diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index 0eea7d1df3e413..556da2e1355f7f 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -71,7 +71,17 @@ endif() if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$") add_compile_options(-mthumb) - add_compile_options(-mfpu=vfpv3) + if (NOT DEFINED CLR_ARM_FPU_TYPE) + set (CLR_ARM_FPU_TYPE vfpv3) + endif (NOT DEFINED CLR_ARM_FPU_TYPE) + + add_compile_options (-mfpu=${CLR_ARM_FPU_TYPE}) + if (NOT DEFINED CLR_ARM_FPU_CAPABILITY) + set (CLR_ARM_FPU_CAPABILITY 0x7) + endif (NOT DEFINED CLR_ARM_FPU_CAPABILITY) + + add_definitions (-DCLR_ARM_FPU_CAPABILITY=${CLR_ARM_FPU_CAPABILITY}) + if(TARGET_ARCH_NAME STREQUAL "armel") add_compile_options(-mfloat-abi=softfp) if(DEFINED TIZEN_TOOLCHAIN) diff --git a/eng/common/performance/performance-setup.ps1 b/eng/common/performance/performance-setup.ps1 index a6916d25f00b08..e3376699294509 100644 --- a/eng/common/performance/performance-setup.ps1 +++ b/eng/common/performance/performance-setup.ps1 @@ -2,7 +2,7 @@ Param( [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, [string] $CoreRootDirectory, [string] $BaselineCoreRootDirectory, - [string] $Architecture=$env:archType, + [string] $Architecture="x64", [string] $Framework="netcoreapp5.0", [string] $CompilationMode="Tiered", [string] $Repository=$env:BUILD_REPOSITORY_NAME, @@ -50,7 +50,7 @@ if ($Internal) { } # FIX ME: This is a workaround until we get this from the actual pipeline -$CommonSetupArguments="--channel master --queue $Queue --build-number $BuildNumber --build-configs $Configurations" +$CommonSetupArguments="--channel master --queue $Queue --build-number $BuildNumber --build-configs $Configurations --architecture $Architecture" $SetupArguments = "--repository https://github.com/$Repository --branch $Branch --get-perf-hash --commit-sha $CommitSha $CommonSetupArguments" if ($RunFromPerformanceRepo) { diff --git a/eng/common/performance/performance-setup.sh b/eng/common/performance/performance-setup.sh index ba8bfc13dd768f..94a04e0fe5519e 100755 --- a/eng/common/performance/performance-setup.sh +++ b/eng/common/performance/performance-setup.sh @@ -3,7 +3,7 @@ source_directory=$BUILD_SOURCESDIRECTORY core_root_directory= baseline_core_root_directory= -architecture=$archType +architecture=x64 framework=netcoreapp5.0 compilation_mode=tiered repository=$BUILD_REPOSITORY_NAME @@ -164,7 +164,7 @@ if [[ "$internal" == true ]]; then fi fi -common_setup_arguments="--channel master --queue $queue --build-number $build_number --build-configs $configurations" +common_setup_arguments="--channel master --queue $queue --build-number $build_number --build-configs $configurations --architecture $architecture" setup_arguments="--repository https://github.com/$repository --branch $branch --get-perf-hash --commit-sha $commit_sha $common_setup_arguments" if [[ "$run_from_perf_repo" = true ]]; then diff --git a/eng/common/post-build/darc-gather-drop.ps1 b/eng/common/post-build/darc-gather-drop.ps1 deleted file mode 100644 index 81ff2a437769be..00000000000000 --- a/eng/common/post-build/darc-gather-drop.ps1 +++ /dev/null @@ -1,44 +0,0 @@ -param( - [Parameter(Mandatory=$true)][int] $BarBuildId, # ID of the build which assets should be downloaded - [Parameter(Mandatory=$true)][string] $DropLocation, # Where the assets should be downloaded to - [Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, # Token used to access Maestro API - [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', # Maestro API URL - [Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16' # Version of Maestro API to use -) - -try { - . $PSScriptRoot\post-build-utils.ps1 - - Write-Host 'Installing DARC ...' - - . $PSScriptRoot\..\darc-init.ps1 - $exitCode = $LASTEXITCODE - - if ($exitCode -ne 0) { - Write-PipelineTelemetryError -Category "Darc" -Message "Something failed while running 'darc-init.ps1'. Check for errors above. Exiting now..." - ExitWithExitCode $exitCode - } - - # For now, only use a dry run. - # Ideally we would change darc to enable a quick request that - # would check whether the file exists that you can download it, - # and that it won't conflict with other files. - # https://github.com/dotnet/arcade/issues/3674 - # Right now we can't remove continue-on-error because we ocassionally will have - # dependencies that have no associated builds (e.g. an old dependency). - # We need to add an option to baseline specific dependencies away, or add them manually - # to the BAR. - darc gather-drop --non-shipping ` - --dry-run ` - --continue-on-error ` - --id $BarBuildId ` - --output-dir $DropLocation ` - --bar-uri $MaestroApiEndpoint ` - --password $MaestroApiAccessToken ` - --latest-location -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category "Darc" -Message $_ - ExitWithExitCode 1 -} diff --git a/eng/common/post-build/nuget-validation.ps1 b/eng/common/post-build/nuget-validation.ps1 index 3d6129d72b0710..dab3534ab53893 100644 --- a/eng/common/post-build/nuget-validation.ps1 +++ b/eng/common/post-build/nuget-validation.ps1 @@ -9,7 +9,7 @@ param( try { . $PSScriptRoot\post-build-utils.ps1 - $url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/jver-verify/src/VerifyMicrosoftPackage/verify.ps1' + $url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1' New-Item -ItemType 'directory' -Path ${ToolDestinationPath} -Force diff --git a/eng/common/templates/post-build/channels/generic-internal-channel.yml b/eng/common/templates/post-build/channels/generic-internal-channel.yml index 29d8d46ee21842..380122901d0da8 100644 --- a/eng/common/templates/post-build/channels/generic-internal-channel.yml +++ b/eng/common/templates/post-build/channels/generic-internal-channel.yml @@ -46,7 +46,7 @@ stages: buildId: $(AzDOBuildId) downloadType: 'specific' itemPattern: | - PDBArtifacts/** + PdbArtifacts/** BlobArtifacts/** downloadPath: '$(Build.ArtifactStagingDirectory)' diff --git a/eng/common/templates/post-build/channels/generic-public-channel.yml b/eng/common/templates/post-build/channels/generic-public-channel.yml index 883e033c80236b..ae8c6349d49b9f 100644 --- a/eng/common/templates/post-build/channels/generic-public-channel.yml +++ b/eng/common/templates/post-build/channels/generic-public-channel.yml @@ -46,7 +46,7 @@ stages: buildId: $(AzDOBuildId) downloadType: 'specific' itemPattern: | - PDBArtifacts/** + PdbArtifacts/** BlobArtifacts/** downloadPath: '$(Build.ArtifactStagingDirectory)' diff --git a/eng/common/templates/post-build/darc-gather-drop.yml b/eng/common/templates/post-build/darc-gather-drop.yml deleted file mode 100644 index 3268ccaa551397..00000000000000 --- a/eng/common/templates/post-build/darc-gather-drop.yml +++ /dev/null @@ -1,23 +0,0 @@ -parameters: - ChannelId: 0 - -jobs: -- job: gatherDrop - displayName: Gather Drop - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.ChannelId }})) - variables: - - name: BARBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - pool: - vmImage: 'windows-2019' - steps: - - task: PowerShell@2 - displayName: Darc gather-drop - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/darc-gather-drop.ps1 - arguments: -BarBuildId $(BARBuildId) - -DropLocation $(Agent.BuildDirectory)/Temp/Drop/ - -MaestroApiAccessToken $(MaestroApiAccessToken) - -MaestroApiEndPoint $(MaestroApiEndPoint) - -MaestroApiVersion $(MaestroApiVersion) diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 70cb65f50b48b2..eff0d9ac7983d1 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -170,6 +170,32 @@ stages: shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json' +- template: \eng\common\templates\post-build\channels\generic-public-channel.yml + parameters: + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + dependsOn: ${{ parameters.publishDependsOn }} + publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} + symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} + stageName: 'Net5_Preview1_Publish' + channelName: '.NET 5 Preview 1' + channelId: 737 + transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' + shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' + symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json' + +- template: \eng\common\templates\post-build\channels\generic-public-channel.yml + parameters: + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + dependsOn: ${{ parameters.publishDependsOn }} + publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} + symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} + stageName: 'Net5_Preview2_Publish' + channelName: '.NET 5 Preview 2' + channelId: 738 + transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' + shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' + symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json' + - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index d3a432878e2167..a45302b377f2bc 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -155,12 +155,12 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { # The following code block is protecting against concurrent access so that this function can # be called in parallel. if ($createSdkLocationFile) { - do { + do { $sdkCacheFileTemp = Join-Path $ToolsetDir $([System.IO.Path]::GetRandomFileName()) - } + } until (!(Test-Path $sdkCacheFileTemp)) Set-Content -Path $sdkCacheFileTemp -Value $dotnetRoot - + try { Rename-Item -Force -Path $sdkCacheFileTemp 'sdk.txt' } catch { @@ -188,7 +188,33 @@ function GetDotNetInstallScript([string] $dotnetRoot) { if (!(Test-Path $installScript)) { Create-Directory $dotnetRoot $ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit - Invoke-WebRequest "https://dot.net/$dotnetInstallScriptVersion/dotnet-install.ps1" -OutFile $installScript + + $maxRetries = 5 + $retries = 1 + + $uri = "https://dot.net/$dotnetInstallScriptVersion/dotnet-install.ps1" + + while($true) { + try { + Write-Host "GET $uri" + Invoke-WebRequest $uri -OutFile $installScript + break + } + catch { + Write-Host "Failed to download '$uri'" + Write-Error $_.Exception.Message -ErrorAction Continue + } + + if (++$retries -le $maxRetries) { + $delayInSeconds = [math]::Pow(2, $retries) - 1 # Exponential backoff + Write-Host "Retrying. Waiting for $delayInSeconds seconds before next attempt ($retries of $maxRetries)." + Start-Sleep -Seconds $delayInSeconds + } + else { + throw "Unable to download file in $maxRetries attempts." + } + + } } return $installScript @@ -198,12 +224,12 @@ function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $arc InstallDotNet $dotnetRoot $version $architecture } -function InstallDotNet([string] $dotnetRoot, - [string] $version, - [string] $architecture = '', - [string] $runtime = '', - [bool] $skipNonVersionedFiles = $false, - [string] $runtimeSourceFeed = '', +function InstallDotNet([string] $dotnetRoot, + [string] $version, + [string] $architecture = '', + [string] $runtime = '', + [bool] $skipNonVersionedFiles = $false, + [string] $runtimeSourceFeed = '', [string] $runtimeSourceFeedKey = '') { $installScript = GetDotNetInstallScript $dotnetRoot @@ -298,7 +324,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = $vsMajorVersion = $vsMinVersion.Major $xcopyMSBuildVersion = "$vsMajorVersion.$($vsMinVersion.Minor).0-alpha" } - + $vsInstallDir = $null if ($xcopyMSBuildVersion.Trim() -ine "none") { $vsInstallDir = InitializeXCopyMSBuild $xcopyMSBuildVersion $install @@ -373,7 +399,12 @@ function LocateVisualStudio([object]$vsRequirements = $null){ if (!(Test-Path $vsWhereExe)) { Create-Directory $vsWhereDir Write-Host 'Downloading vswhere' - Invoke-WebRequest "https://github.com/Microsoft/vswhere/releases/download/$vswhereVersion/vswhere.exe" -OutFile $vswhereExe + try { + Invoke-WebRequest "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/vswhere/$vswhereVersion/vswhere.exe" -OutFile $vswhereExe + } + catch { + Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_ + } } if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs } diff --git a/eng/common/tools.sh b/eng/common/tools.sh index e071af4ee494e9..664ac1055bd0c0 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -41,7 +41,7 @@ fi # Configures warning treatment in msbuild. warn_as_error=${warn_as_error:-true} -# True to attempt using .NET Core already that meets requirements specified in global.json +# True to attempt using .NET Core already that meets requirements specified in global.json # installed on the machine instead of downloading one. use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} @@ -172,7 +172,7 @@ function InstallDotNetSdk { function InstallDotNet { local root=$1 local version=$2 - + GetDotNetInstallScript "$root" local install_script=$_GetDotNetInstallScript @@ -218,6 +218,28 @@ function InstallDotNet { } } +function with_retries { + local maxRetries=5 + local retries=1 + echo "Trying to run '$@' for maximum of $maxRetries attempts." + while [[ $((retries++)) -le $maxRetries ]]; do + "$@" + + if [[ $? == 0 ]]; then + echo "Ran '$@' successfully." + return 0 + fi + + timeout=$((2**$retries-1)) + echo "Failed to execute '$@'. Waiting $timeout seconds before next attempt ($retries out of $maxRetries)." 1>&2 + sleep $timeout + done + + echo "Failed to execute '$@' for $maxRetries times." 1>&2 + + return 1 +} + function GetDotNetInstallScript { local root=$1 local install_script="$root/dotnet-install.sh" @@ -230,13 +252,13 @@ function GetDotNetInstallScript { # Use curl if available, otherwise use wget if command -v curl > /dev/null; then - curl "$install_script_url" -sSL --retry 10 --create-dirs -o "$install_script" || { + with_retries curl "$install_script_url" -sSL --retry 10 --create-dirs -o "$install_script" || { local exit_code=$? Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to acquire dotnet install script (exit code '$exit_code')." ExitWithExitCode $exit_code } - else - wget -q -O "$install_script" "$install_script_url" || { + else + with_retries wget -v -O "$install_script" "$install_script_url" || { local exit_code=$? Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to acquire dotnet install script (exit code '$exit_code')." ExitWithExitCode $exit_code @@ -251,11 +273,11 @@ function InitializeBuildTool { if [[ -n "${_InitializeBuildTool:-}" ]]; then return fi - + InitializeDotNetCli $restore # return values - _InitializeBuildTool="$_InitializeDotNetCli/dotnet" + _InitializeBuildTool="$_InitializeDotNetCli/dotnet" _InitializeBuildToolCommand="msbuild" _InitializeBuildToolFramework="netcoreapp2.1" } @@ -319,7 +341,7 @@ function InitializeToolset { if [[ "$binary_log" == true ]]; then bl="/bl:$log_dir/ToolsetRestore.binlog" fi - + echo '' > "$proj" MSBuild-Core "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file" diff --git a/eng/illink.targets b/eng/illink.targets index 59960f31aa19a7..ae2de5625865b8 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -10,7 +10,7 @@ $([MSBuild]::NormalizeDirectory('$(PkgILLink_Tasks)', 'tools')) - $(ILLinkTasksDir)netcoreapp2.0/ILLink.Tasks.dll + $(ILLinkTasksDir)netcoreapp3.0/ILLink.Tasks.dll $(ILLinkTasksDir)$(NetFrameworkCurrent)/ILLink.Tasks.dll $(IntermediateOutputPath)$(TargetName)$(TargetExt) $(IntermediateOutputPath)$(TargetName).pdb @@ -83,6 +83,8 @@ $(ILLinkArgs) --skip-unresolved true $(ILLinkArgs) --disable-opt unusedinterfaces + + $(ILLinkArgs) --disable-opt ipconstprop $(ILLinkArgs) --keep-dep-attributes true diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index ed3362c0a31c8c..8707e3b6d70420 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -27,7 +27,7 @@ isMSBuildOnNETCoreSupported() return fi - if [[ ( "$__HostOS" == "Linux" ) && ( "$__HostArch" == "x64" || "$__HostArch" == "arm" || "$__HostArch" == "arm64" ) ]]; then + if [[ ( "$__HostOS" == "Linux" ) && ( "$__HostArch" == "x64" || "$__HostArch" == "arm" || "$__HostArch" == "armel" || "$__HostArch" == "arm64" ) ]]; then __IsMSBuildOnNETCoreSupported=1 elif [[ ( "$__HostOS" == "OSX" || "$__HostOS" == "FreeBSD" ) && "$__HostArch" == "x64" ]]; then __IsMSBuildOnNETCoreSupported=1 @@ -213,8 +213,13 @@ case "$CPUName" in ;; armv7l) - __BuildArch=arm - __HostArch=arm + if (NAME=""; . /etc/os-release; test "$NAME" = "Tizen"); then + __BuildArch=armel + __HostArch=armel + else + __BuildArch=arm + __HostArch=arm + fi ;; i686) diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake index c1b627f5f9dd74..29f4f85436ba88 100644 --- a/eng/native/configureplatform.cmake +++ b/eng/native/configureplatform.cmake @@ -137,7 +137,7 @@ if(CLR_CMAKE_HOST_UNIX_ARM) set(CLR_CMAKE_HOST_ARCH_ARM 1) set(CLR_CMAKE_HOST_ARCH "arm") - if(CLR_CMAKE_HOST_HOST_ARMV7L) + if(CLR_CMAKE_HOST_UNIX_ARMV7L) set(CLR_CMAKE_HOST_ARCH_ARMV7L 1) endif() elseif(CLR_CMAKE_HOST_UNIX_ARM64) @@ -169,6 +169,12 @@ endif() # if target arch is not specified then host & target are same if(NOT DEFINED CLR_CMAKE_TARGET_ARCH OR CLR_CMAKE_TARGET_ARCH STREQUAL "" ) set(CLR_CMAKE_TARGET_ARCH ${CLR_CMAKE_HOST_ARCH}) + + # This is required for "arm" targets (CMAKE_SYSTEM_PROCESSOR "armv7l"), + # for which this flag otherwise won't be set up below + if (CLR_CMAKE_HOST_ARCH_ARMV7L) + set(CLR_CMAKE_TARGET_ARCH_ARMV7L 1) + endif() endif() # Set target architecture variables @@ -182,6 +188,7 @@ if (CLR_CMAKE_TARGET_ARCH STREQUAL x64) set(CLR_CMAKE_TARGET_ARCH_ARM 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL armel) set(CLR_CMAKE_TARGET_ARCH_ARM 1) + set(CLR_CMAKE_TARGET_ARCH_ARMV7L 1) set(ARM_SOFTFP 1) else() clr_unknown_arch() diff --git a/eng/native/gen-buildsys.sh b/eng/native/gen-buildsys.sh index ae2e0eb2d0bd5c..4e39d16e8243b4 100755 --- a/eng/native/gen-buildsys.sh +++ b/eng/native/gen-buildsys.sh @@ -25,98 +25,15 @@ fi tryrun_dir="$2" build_arch="$4" compiler="$5" -cxxCompiler="$compiler++" majorVersion="$6" minorVersion="$7" -if [[ "$compiler" == "gcc" ]]; then cxxCompiler="g++"; fi - -check_version_exists() { - desired_version=-1 - - # Set up the environment to be used for building with the desired compiler. - if command -v "$compiler-$1.$2" > /dev/null; then - desired_version="-$1.$2" - elif command -v "$compier$1$2" > /dev/null; then - desired_version="$1$2" - elif command -v "$compiler-$1$2" > /dev/null; then - desired_version="-$1$2" - fi - - echo "$desired_version" -} - -if [[ -z "$CLR_CC" ]]; then - - # Set default versions - if [[ -z "$majorVersion" ]]; then - # note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero. - if [[ "$compiler" == "clang" ]]; then versions=( 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) - elif [[ "$compiler" == "gcc" ]]; then versions=( 9 8 7 6 5 4.9 ); fi - - for version in "${versions[@]}"; do - parts=(${version//./ }) - desired_version="$(check_version_exists "${parts[0]}" "${parts[1]}")" - if [[ "$desired_version" != "-1" ]]; then majorVersion="${parts[0]}"; break; fi - done - - if [[ -z "$majorVersion" ]]; then - if command -v "$compiler" > /dev/null; then - if [[ "$(uname)" != "Darwin" ]]; then - echo "WARN: Specific version of $compiler not found, falling back to use the one in PATH." - fi - CC="$(command -v "$compiler")" - CXX="$(command -v "$cxxCompiler")" - else - echo "ERROR: No usable version of $compiler found." - exit 1 - fi - else - if [[ "$compiler" == "clang" && "$majorVersion" -lt 5 ]]; then - if [[ "$build_arch" == "arm" || "$build_arch" == "armel" ]]; then - if command -v "$compiler" > /dev/null; then - echo "WARN: Found clang version $majorVersion which is not supported on arm/armel architectures, falling back to use clang from PATH." - CC="$(command -v "$compiler")" - CXX="$(command -v "$cxxCompiler")" - else - echo "ERROR: Found clang version $majorVersion which is not supported on arm/armel architectures, and there is no clang in PATH." - exit 1 - fi - fi - fi - fi - else - desired_version="$(check_version_exists "$majorVersion" "$minorVersion")" - if [[ "$desired_version" == "-1" ]]; then - echo "ERROR: Could not find specific version of $compiler: $majorVersion $minorVersion." - exit 1 - fi - fi - - if [[ -z "$CC" ]]; then - CC="$(command -v "$compiler$desired_version")" - CXX="$(command -v "$cxxCompiler$desired_version")" - if [[ -z "$CXX" ]]; then CXX="$(command -v "$cxxCompiler")"; fi - fi -else - if [[ ! -f "$CLR_CC" ]]; then - echo "ERROR: CLR_CC is set but path '$CLR_CC' does not exist" - exit 1 - fi - CC="$CLR_CC" - CXX="$CLR_CXX" -fi - -if [[ -z "$CC" ]]; then - echo "ERROR: Unable to find $compiler." - exit 1 -fi +source "$scriptroot/init-compiler.sh" "$build_arch" "$compiler" "$majorVersion" "$minorVersion" CCC_CC="$CC" CCC_CXX="$CXX" -SCAN_BUILD_COMMAND="$(command -v "scan-build$desired_version")" -export CC CCC_CC CXX CCC_CXX SCAN_BUILD_COMMAND +export CCC_CC CCC_CXX buildtype=DEBUG code_coverage=OFF diff --git a/eng/native/init-compiler.sh b/eng/native/init-compiler.sh new file mode 100755 index 00000000000000..ff0f69c6a00457 --- /dev/null +++ b/eng/native/init-compiler.sh @@ -0,0 +1,111 @@ +#!/usr/bin/env bash +# +# This file detects the C/C++ compiler and exports it to the CC/CXX environment variables +# + +if [[ "$#" -lt 2 ]]; then + echo "Usage..." + echo "detect-compiler.sh " + echo "Specify the target architecture." + echo "Specify the name of compiler (clang or gcc)." + echo "Specify the major version of compiler." + echo "Specify the minor version of compiler." + exit 1 +fi + +build_arch="$1" +compiler="$2" +cxxCompiler="$compiler++" +majorVersion="$3" +minorVersion="$4" + +# clear the existing CC and CXX from environment +CC= +CXX= + +if [[ "$compiler" == "gcc" ]]; then cxxCompiler="g++"; fi + +check_version_exists() { + desired_version=-1 + + # Set up the environment to be used for building with the desired compiler. + if command -v "$compiler-$1.$2" > /dev/null; then + desired_version="-$1.$2" + elif command -v "$compiler$1$2" > /dev/null; then + desired_version="$1$2" + elif command -v "$compiler-$1$2" > /dev/null; then + desired_version="-$1$2" + fi + + echo "$desired_version" +} + +if [[ -z "$CLR_CC" ]]; then + + # Set default versions + if [[ -z "$majorVersion" ]]; then + # note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero. + if [[ "$compiler" == "clang" ]]; then versions=( 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) + elif [[ "$compiler" == "gcc" ]]; then versions=( 9 8 7 6 5 4.9 ); fi + + for version in "${versions[@]}"; do + parts=(${version//./ }) + desired_version="$(check_version_exists "${parts[0]}" "${parts[1]}")" + if [[ "$desired_version" != "-1" ]]; then majorVersion="${parts[0]}"; break; fi + done + + if [[ -z "$majorVersion" ]]; then + if command -v "$compiler" > /dev/null; then + if [[ "$(uname)" != "Darwin" ]]; then + echo "WARN: Specific version of $compiler not found, falling back to use the one in PATH." + fi + CC="$(command -v "$compiler")" + CXX="$(command -v "$cxxCompiler")" + else + echo "ERROR: No usable version of $compiler found." + exit 1 + fi + else + if [[ "$compiler" == "clang" && "$majorVersion" -lt 5 ]]; then + if [[ "$build_arch" == "arm" || "$build_arch" == "armel" ]]; then + if command -v "$compiler" > /dev/null; then + echo "WARN: Found clang version $majorVersion which is not supported on arm/armel architectures, falling back to use clang from PATH." + CC="$(command -v "$compiler")" + CXX="$(command -v "$cxxCompiler")" + else + echo "ERROR: Found clang version $majorVersion which is not supported on arm/armel architectures, and there is no clang in PATH." + exit 1 + fi + fi + fi + fi + else + desired_version="$(check_version_exists "$majorVersion" "$minorVersion")" + if [[ "$desired_version" == "-1" ]]; then + echo "ERROR: Could not find specific version of $compiler: $majorVersion $minorVersion." + exit 1 + fi + fi + + if [[ -z "$CC" ]]; then + CC="$(command -v "$compiler$desired_version")" + CXX="$(command -v "$cxxCompiler$desired_version")" + if [[ -z "$CXX" ]]; then CXX="$(command -v "$cxxCompiler")"; fi + fi +else + if [[ ! -f "$CLR_CC" ]]; then + echo "ERROR: CLR_CC is set but path '$CLR_CC' does not exist" + exit 1 + fi + CC="$CLR_CC" + CXX="$CLR_CXX" +fi + +if [[ -z "$CC" ]]; then + echo "ERROR: Unable to find $compiler." + exit 1 +fi + +SCAN_BUILD_COMMAND="$(command -v "scan-build$desired_version")" + +export CC CXX SCAN_BUILD_COMMAND diff --git a/eng/outerBuild.targets b/eng/outerBuild.targets new file mode 100644 index 00000000000000..dd546d6bd6f6bc --- /dev/null +++ b/eng/outerBuild.targets @@ -0,0 +1,8 @@ + + + + + + diff --git a/eng/packaging.props b/eng/packaging.props index a7eb2fa7b041a5..23725665e24102 100644 --- a/eng/packaging.props +++ b/eng/packaging.props @@ -12,7 +12,7 @@ x64 - $(NuGetPackageRoot)$(MicrosoftPrivateIntellisensePackage)/$(MicrosoftPrivateIntellisenseVersion)/xmldocs/netcoreapp + $(NuGetPackageRoot)$(MicrosoftPrivateIntellisensePackage)/$(MicrosoftPrivateIntellisenseVersion)/IntellisenseFiles/netcoreapp diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index 89f8f929f033f6..b6c357f4563b08 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -19,10 +19,18 @@ jobs: pool: ${{ parameters.pool }} container: ${{ parameters.container }} timeoutInMinutes: ${{ parameters.timeoutInMinutes }} - variables: ${{ parameters.variables }} workspace: clean: all + variables: + - ${{ each variable in parameters.variables }}: + - ${{insert}}: ${{ variable }} + - name: noWarnAsErrorArg + value: '' + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - name: noWarnAsErrorArg + value: -warnAsError:0 + steps: - ${{ if eq(parameters.osGroup, 'OSX') }}: - script: | @@ -37,7 +45,7 @@ jobs: - template: /eng/pipelines/common/clone-checkout-bundle-step.yml # Build - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} ${{ parameters.buildArgs }} + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(noWarnAsErrorArg) ${{ parameters.buildArgs }} displayName: Build product - task: PublishBuildArtifacts@1 diff --git a/eng/pipelines/coreclr/perf.yml b/eng/pipelines/coreclr/perf.yml index aceeb78ed1cbf7..ffa22b8afc7515 100644 --- a/eng/pipelines/coreclr/perf.yml +++ b/eng/pipelines/coreclr/perf.yml @@ -22,7 +22,27 @@ trigger: - eng/pipelines/libraries/* -pr: none +pr: + branches: + include: + - master + paths: + include: + - '*' + - src/libraries/System.Private.CoreLib/* + exclude: + - docs/* + - CODE-OF-CONDUCT.md + - CONTRIBUTING.md + - LICENSE.TXT + - PATENTS.TXT + - README.md + - SECURITY.md + - THIRD-PARTY-NOTICES.TXT + - src/installer/* + - src/libraries/* + - eng/pipelines/installer/* + - eng/pipelines/libraries/* jobs: # diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 2bef6d6c695a5f..34af82b3900e34 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -136,12 +136,11 @@ jobs: - powershell: eng\common\build.ps1 -ci -sign -restore -configuration:$(buildConfig) -warnaserror:0 /p:ArcadeBuild=true /p:OfficialBuild=true /p:BuildOS=$(osGroup) /p:BuildArch=$(archType) /p:BuildType=$(_BuildConfig) /p:DotNetSignType=$env:_SignType -projects $(Build.SourcesDirectory)\eng\empty.csproj displayName: Sign Binaries - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish Signing Logs inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/' - PublishLocation: Container - ArtifactName: ${{ format('SignLogs_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + targetPath: '$(Build.SourcesDirectory)/artifacts/log/' + artifactName: ${{ format('SignLogs_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} continueOnError: true condition: always() @@ -205,10 +204,10 @@ jobs: NUGET_PACKAGES: $(Build.SourcesDirectory)\.packages # Publish Logs - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish Logs inputs: - pathtoPublish: $(Build.SourcesDirectory)/artifacts/log + targetPath: $(Build.SourcesDirectory)/artifacts/log artifactName: 'BuildLogs_CoreCLR_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' continueOnError: true condition: always() diff --git a/eng/pipelines/coreclr/templates/build-test-job.yml b/eng/pipelines/coreclr/templates/build-test-job.yml index 81f9f3113ea79a..59f06f78211a2b 100644 --- a/eng/pipelines/coreclr/templates/build-test-job.yml +++ b/eng/pipelines/coreclr/templates/build-test-job.yml @@ -139,10 +139,10 @@ jobs: # Publish Logs - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish Logs inputs: - pathtoPublish: $(Build.SourcesDirectory)/artifacts/log + targetPath: $(Build.SourcesDirectory)/artifacts/log artifactName: 'TestBuildLogs_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)_${{ parameters.testGroup }}' continueOnError: true condition: always() diff --git a/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml b/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml index db45c6b70d11ed..5ba62d0032f499 100644 --- a/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml +++ b/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml @@ -176,7 +176,7 @@ jobs: --diff_dir %HELIX_WORKITEM_PAYLOAD%\log\$(targetFlavor) # Publish log - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish log inputs: pathtoPublish: $(artifactsDirectory)/log diff --git a/eng/pipelines/coreclr/templates/helix-queues-setup.yml b/eng/pipelines/coreclr/templates/helix-queues-setup.yml index c48c793b5c5e9a..12fb8ad042b3c5 100644 --- a/eng/pipelines/coreclr/templates/helix-queues-setup.yml +++ b/eng/pipelines/coreclr/templates/helix-queues-setup.yml @@ -116,18 +116,16 @@ jobs: # Windows_NT arm - ${{ if eq(parameters.platform, 'Windows_NT_arm') }}: - # Currently down as there's no suitable ARM32 pool at the moment, tracked under - # https://github.com/dotnet/runtime/issues/1097 - # https://github.com/dotnet/runtime/issues/1663 - # https://github.com/dotnet/core-eng/issues/8490 - # - ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.jobParameters.helixQueueGroup, 'pr', 'ci', 'libraries')) }}: - # - Windows.10.Arm64.Open + # Currently blocked by https://github.com/dotnet/runtime/issues/32320 + # - ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.jobParameters.helixQueueGroup, 'pr', 'ci', 'libraries')) }}: + # - Windows.10.Arm64v8.Open - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - Windows.10.Arm64 # Windows_NT arm64 - ${{ if eq(parameters.platform, 'Windows_NT_arm64') }}: - # TODO: Consider adding Windows.10.Arm64.Open here if capacity is enough for handling both Windows_NT/arm and Windows_NT/arm64 testing + - ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.jobParameters.helixQueueGroup, 'pr', 'ci', 'libraries')) }}: + - Windows.10.Arm64.Open - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - Windows.10.Arm64 diff --git a/eng/pipelines/coreclr/templates/run-test-job.yml b/eng/pipelines/coreclr/templates/run-test-job.yml index de04bc69914178..f6b54414d11ef9 100644 --- a/eng/pipelines/coreclr/templates/run-test-job.yml +++ b/eng/pipelines/coreclr/templates/run-test-job.yml @@ -380,10 +380,10 @@ jobs: - jitelthookenabled_tiered # Publish Logs - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish Logs inputs: - pathtoPublish: $(Build.SourcesDirectory)/artifacts/log + targetPath: $(Build.SourcesDirectory)/artifacts/log artifactName: '$(LogNamePrefix)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)_${{ parameters.testGroup }}' continueOnError: true condition: always() diff --git a/eng/pipelines/installer/jobs/base-job.yml b/eng/pipelines/installer/jobs/base-job.yml index 952a51eaac46f9..60e766303adc72 100644 --- a/eng/pipelines/installer/jobs/base-job.yml +++ b/eng/pipelines/installer/jobs/base-job.yml @@ -68,12 +68,8 @@ jobs: eq(parameters.isOfficialBuild, true), ne(parameters.crossrootfsDir, '')) }} - # TODO: (Consolidation) Enable test signing during PR validation. https://github.com/dotnet/runtime/issues/1026 - # - # CoreCLR only produces the UCRT redist file in Release config. When the redist file isn't - # present, signing fails. For now, only sign in official builds which only run Release mode. - name: SignType - value: '' + value: test # Set up non-PR build from internal project - ${{ if eq(parameters.isOfficialBuild, true) }}: diff --git a/eng/pipelines/installer/jobs/steps/upload-job-artifacts.yml b/eng/pipelines/installer/jobs/steps/upload-job-artifacts.yml index a9c1bdcb0dd9ef..05232836e569c5 100644 --- a/eng/pipelines/installer/jobs/steps/upload-job-artifacts.yml +++ b/eng/pipelines/installer/jobs/steps/upload-job-artifacts.yml @@ -33,10 +33,10 @@ steps: continueOnError: true condition: succeededOrFailed() -- task: PublishBuildArtifacts@1 +- task: PublishPipelineArtifact@1 displayName: Publish BuildLogs inputs: - PathtoPublish: '$(Build.StagingDirectory)/BuildLogs' - ArtifactName: Installer-Logs-${{ parameters.name }}-$(_BuildConfig) + targetPath: '$(Build.StagingDirectory)/BuildLogs' + artifactName: Installer-Logs-${{ parameters.name }}-$(_BuildConfig) continueOnError: true condition: succeededOrFailed() diff --git a/eng/pipelines/libraries/base-job.yml b/eng/pipelines/libraries/base-job.yml index 85ea99f75c30f5..0a7389aa23813a 100644 --- a/eng/pipelines/libraries/base-job.yml +++ b/eng/pipelines/libraries/base-job.yml @@ -102,6 +102,8 @@ jobs: # Windows variables - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - _runtimeOSArg: /p:RuntimeOS=win10 + # Remove when: https://github.com/dotnet/runtime/issues/31888 is fixed. + - _warnAsErrorArg: -warnAsError:0 # Non-Windows variables - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml index 346be74f29ff92..4f95464e683df5 100644 --- a/eng/pipelines/libraries/build-job.yml +++ b/eng/pipelines/libraries/build-job.yml @@ -153,7 +153,8 @@ jobs: inputs: sourceFolder: $(Build.SourcesDirectory)/artifacts/packages targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/packages - + condition: and(succeeded(), eq(variables['_librariesBuildProducedPackages'], true)) + - task: CopyFiles@2 displayName: Prepare tmp assets to publish inputs: diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index f15d9c2cf9d6f4..24bee99a968d0b 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -29,6 +29,8 @@ jobs: - ${{ if eq(parameters.platform, 'Linux_arm64') }}: - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: - (Ubuntu.1804.ArmArch.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-helix-arm64v8-bfcd90a-20200127194925 + - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: + - (Ubuntu.1804.ArmArch.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-helix-arm64v8-bfcd90a-20200127194925 # Linux musl x64 - ${{ if eq(parameters.platform, 'Linux_musl_x64') }}: @@ -108,14 +110,16 @@ jobs: # netcoreapp - ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net472') }}: - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: - - Windows.7.Amd64.Open - - Windows.81.Amd64.Open + # TODO: Reopen when https://github.com/dotnet/runtime/issues/32231 is fixed + #- Windows.7.Amd64.Open + #- Windows.81.Amd64.Open - Windows.10.Amd64.ServerRS5.Open - Windows.10.Amd64.Server19H1.Open - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: - ${{ if eq(parameters.jobParameters.buildConfig, 'Release') }}: - - Windows.7.Amd64.Open - - Windows.81.Amd64.Open + # TODO: Reopen when https://github.com/dotnet/runtime/issues/32231 is fixed + #- Windows.7.Amd64.Open + #- Windows.81.Amd64.Open - Windows.10.Amd64.Server19H1.ES.Open - ${{ if eq(parameters.jobParameters.buildConfig, 'Debug') }}: - Windows.10.Amd64.Server19H1.Open diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index e06b2b03d52e5b..2c6d1be9a66652 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -78,6 +78,7 @@ jobs: /p:RuntimeFlavor=${{ parameters.runtimeFlavor }} /p:ArchGroup=${{ parameters.archType }} /p:Configuration=${{ parameters.buildConfig }} + /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/overrideCoreclrFromLiveDrop.binlog displayName: Override $(runtimeFlavorName) from live drop - template: /eng/pipelines/libraries/helix.yml diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index 2b4f9c519d5518..a29c07e4c1170f 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -9,6 +9,8 @@ parameters: variables: {} pool: '' condition: true + llvm: false + crossrootfsDir: '' ### Product build jobs: @@ -21,11 +23,20 @@ jobs: helixType: 'build/product/' enableMicrobuild: true pool: ${{ parameters.pool }} + llvm: ${{ parameters.llvm }} + crossrootfsDir: ${{ parameters.crossroofsDir }} condition: ${{ parameters.condition }} # Compute job name from template parameters - name: ${{ format('mono_product_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - displayName: ${{ format('Mono Product Build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + ${{ if ne(parameters.llvm, true) }}: + name: ${{ format('mono_product_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + displayName: ${{ format('Mono Product Build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + + # if LLVM enabled, set a variable we can consume + ${{ if eq(parameters.llvm, true) }}: + name: ${{ format('mono_llvm_product_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + displayName: ${{ format('Mono LLVM Product Build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + # Run all steps in the container. # Note that the containers are defined in platform-matrix.yml @@ -58,10 +69,10 @@ jobs: # Build - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - - script: ./mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) -ci + - script: ./mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) -ci /p:MonoEnableLLVM=${{ parameters.llvm }} displayName: Build product - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - - script: mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) -ci + - script: mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) -ci /p:MonoEnableLLVM=${{ parameters.llvm }} displayName: Build product # Publish product output directory for consumption by tests. @@ -76,10 +87,13 @@ jobs: displayName: 'product build' # Publish Logs - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish Logs inputs: - pathtoPublish: $(Build.SourcesDirectory)/artifacts/log - artifactName: 'BuildLogs_Mono_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' + targetPath: $(Build.SourcesDirectory)/artifacts/log + ${{ if ne(parameters.llvm, true) }}: + artifactName: 'BuildLogs_Mono_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' + ${{ if eq(parameters.llvm, true) }}: + artifactName: 'BuildLogs_Mono_LLVM_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' continueOnError: true condition: always() diff --git a/eng/pipelines/mono/templates/xplat-pipeline-job.yml b/eng/pipelines/mono/templates/xplat-pipeline-job.yml index 954cbdb20889d0..a0d65845203929 100644 --- a/eng/pipelines/mono/templates/xplat-pipeline-job.yml +++ b/eng/pipelines/mono/templates/xplat-pipeline-job.yml @@ -9,6 +9,7 @@ parameters: liveLibrariesBuildConfig: '' strategy: '' pool: '' + llvm: false # arcade-specific parameters condition: true @@ -33,6 +34,7 @@ jobs: container: ${{ parameters.container }} strategy: ${{ parameters.strategy }} pool: ${{ parameters.pool }} + llvm: ${{ parameters.llvm }} # arcade-specific parameters condition: and(succeeded(), ${{ parameters.condition }}) @@ -45,7 +47,10 @@ jobs: variables: - name: buildProductArtifactName - value: 'MonoProduct_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' + ${{ if ne(parameters.llvm, true) }}: + value: 'MonoProduct_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' + ${{ if eq(parameters.llvm, true) }}: + value: 'MonoProduct_LLVM_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' - name: buildProductRootFolderPath value: '$(Build.SourcesDirectory)/artifacts/bin/mono/$(osGroup).$(archType).$(buildConfigUpper)' diff --git a/eng/pipelines/official/jobs/prepare-signed-artifacts.yml b/eng/pipelines/official/jobs/prepare-signed-artifacts.yml index 8df2deebf9560e..77f33ab315a541 100644 --- a/eng/pipelines/official/jobs/prepare-signed-artifacts.yml +++ b/eng/pipelines/official/jobs/prepare-signed-artifacts.yml @@ -2,6 +2,7 @@ parameters: dependsOn: [] PublishRidAgnosticPackagesFromPlatform: '' isOfficialBuild: false + logArtifactName: 'Logs-PrepareSignedArtifacts' jobs: - job: PrepareSignedArtifacts @@ -62,9 +63,9 @@ jobs: continueOnError: true condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact BuildLogs + - task: PublishPipelineArtifact@1 + displayName: Publish BuildLogs inputs: - PathtoPublish: '$(Build.StagingDirectory)\BuildLogs' - ArtifactName: Logs-PrepareSignedArtifacts + targetPath: '$(Build.StagingDirectory)\BuildLogs' + artifactName: ${{ parameters.logArtifactName }} condition: succeededOrFailed() diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 117601b565a8fa..66b42f95206e74 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -210,8 +210,8 @@ jobs: platforms: - OSX_x64 - Linux_x64 - # - Linux_arm - # - Linux_arm64 + - Linux_arm + - Linux_arm64 - Linux_musl_x64 # - Linux_musl_arm64 - Windows_NT_x64 @@ -237,8 +237,8 @@ jobs: platforms: - OSX_x64 - Linux_x64 - # - Linux_arm - # - Linux_arm64 + - Linux_arm + - Linux_arm64 - Linux_musl_x64 # - Linux_musl_arm64 - Windows_NT_x64 @@ -252,6 +252,62 @@ jobs: eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), eq(variables['isFullMatrix'], true)) +# +# Build Mono LLVM debug +# Only when libraries or mono changed +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/mono/templates/build-job.yml + runtimeFlavor: mono + buildConfig: debug + platforms: + - OSX_x64 + - Linux_x64 + # - Linux_arm + # - Linux_arm64 + # - Linux_musl_x64 + # - Linux_musl_arm64 + # - Windows_NT_x64 + # - Windows_NT_x86 + # - Windows_NT_arm + # - Windows_NT_arm64 + jobParameters: + llvm: true + condition: >- + or( + eq(dependencies.checkout.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isFullMatrix'], true)) + +# +# Build Mono LLVM release +# Only when libraries or mono changed +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/mono/templates/build-job.yml + runtimeFlavor: mono + buildConfig: release + platforms: + - OSX_x64 + - Linux_x64 + # - Linux_arm + # - Linux_arm64 + # - Linux_musl_x64 + # - Linux_musl_arm64 + # - Windows_NT_x64 + # - Windows_NT_x86 + # - Windows_NT_arm + # - Windows_NT_arm64 + jobParameters: + llvm: true + condition: >- + or( + eq(dependencies.checkout.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isFullMatrix'], true)) + # # Build libraries using live CoreLib # These set of libraries are built always no matter what changed @@ -464,6 +520,7 @@ jobs: - Linux_arm - Windows_NT_x86 - Windows_NT_arm + - Windows_NT_arm64 helixQueueGroup: pr helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml jobParameters: @@ -505,6 +562,7 @@ jobs: platforms: # - Windows_NT_x64 - OSX_x64 + - Linux_arm64 - Linux_x64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: @@ -639,4 +697,4 @@ jobs: or( eq(dependencies.checkout.outputs['SetPathVars_coreclr.containsChange'], true), eq(dependencies.checkout.outputs['SetPathVars_libraries.containsChange'], true), - eq(variables['isFullMatrix'], true)) \ No newline at end of file + eq(variables['isFullMatrix'], true)) diff --git a/eng/restore/docs.targets b/eng/restore/docs.targets index 61c81ea99a62ba..b5d9ce90bb55f1 100644 --- a/eng/restore/docs.targets +++ b/eng/restore/docs.targets @@ -9,7 +9,7 @@ AfterTargets="Restore"> - + $([System.String]::new('%(RecursiveDir)').TrimEnd('\/')) diff --git a/eng/testing/outerBuild.targets b/eng/testing/outerBuild.targets index ece58160db3738..4623b0e54d2504 100644 --- a/eng/testing/outerBuild.targets +++ b/eng/testing/outerBuild.targets @@ -1,17 +1,6 @@ - - - - - - - - - - + diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 8a660f917e28c8..b6a119c599fc07 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -80,7 +80,6 @@ <_rspFile Include="$(TestRspFile)" Condition="'$(TestRspFile)' != ''" /> - <_rspFile Include="$(MonoProjectRoot)netcore\CoreFX.issues.rsp" /> <_rspFile Include="$(MonoProjectRoot)netcore\CoreFX.issues_mac.rsp" Condition="'$(TargetOS)' == 'OSX'" /> <_rspFile Include="$(MonoProjectRoot)netcore\CoreFX.issues_linux.rsp" Condition="'$(TargetOS)' == 'Linux'" /> <_rspFile Include="$(MonoProjectRoot)netcore\CoreFX.issues_windows.rsp" Condition="'$(TargetOS)' == 'Windows_NT'" /> diff --git a/global.json b/global.json index 02938d48ca9d09..e747f7a8dd88ac 100644 --- a/global.json +++ b/global.json @@ -5,17 +5,17 @@ "rollForward": "major" }, "tools": { - "dotnet": "5.0.100-alpha.1.20073.4" + "dotnet": "5.0.100-preview.1.20112.7" }, "native-tools": { "cmake": "3.14.2", "python": "2.7.15" }, "msbuild-sdks": { - "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20105.2", - "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20105.2", - "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20105.2", - "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20105.2", + "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20117.3", + "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20117.3", + "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20117.3", + "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20117.3", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "5.0.0-alpha.1.20076.2", "Microsoft.Build.NoTargets": "1.0.53", diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index 5a33d25d6fa4a5..d51dc5ed3cb716 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -131,7 +131,12 @@ endif(CLR_CROSS_COMPONENTS_BUILD) #------------------- include(pgosupport.cmake) -add_subdirectory(src/libraries-native) +#------------------------------- +# Include libraries native shims +#------------------------------- +if(NOT CLR_CROSS_COMPONENTS_BUILD) + add_subdirectory(src/libraries-native) +endif(NOT CLR_CROSS_COMPONENTS_BUILD) #----------------------------------------- # Add Projects diff --git a/src/coreclr/all.locproj b/src/coreclr/all.locproj index 5cccc3d7ff1291..aac54a9b41a9e3 100644 --- a/src/coreclr/all.locproj +++ b/src/coreclr/all.locproj @@ -1,4 +1,4 @@ - + + + diff --git a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj index 096771f8904061..3ee759bf34414c 100644 --- a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -52,7 +52,7 @@ enable - CORECLR;NETCOREAPP + CORECLR;NETCOREAPP;SYSTEM_PRIVATE_CORELIB true + + diff --git a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.sln b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.sln index d1d038ce9085de..86372c56c8a4d6 100644 --- a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.sln +++ b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.28902.138 @@ -9,6 +8,7 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "System.Private.CoreLib.Shar EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\..\..\libraries\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems*{3da06c3a-2e7b-4cb7-80ed-9b12916013f9}*SharedItemsImports = 5 ..\..\..\libraries\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems*{845c8b26-350b-4e63-bd11-2c8150444e28}*SharedItemsImports = 13 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/coreclr/src/System.Private.CoreLib/Tools/GenUnicodeProp/GenUnicodeProp.csproj b/src/coreclr/src/System.Private.CoreLib/Tools/GenUnicodeProp/GenUnicodeProp.csproj index 68c616ea14ab7b..679e3fac9abc31 100644 --- a/src/coreclr/src/System.Private.CoreLib/Tools/GenUnicodeProp/GenUnicodeProp.csproj +++ b/src/coreclr/src/System.Private.CoreLib/Tools/GenUnicodeProp/GenUnicodeProp.csproj @@ -1,4 +1,4 @@ - + Exe diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs index e403949e8979c6..2307f642cd827b 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.cs index abd68baae2bbd4..2634fb4a507f99 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrameHelper.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrameHelper.cs index 3c83ff6bc6bc3c..20a0c57492d8aa 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrameHelper.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrameHelper.cs @@ -4,6 +4,7 @@ using System.Threading; using System.Reflection; +using System.Runtime.CompilerServices; namespace System.Diagnostics { @@ -82,6 +83,13 @@ public StackFrameHelper(Thread? target) // rgiLineNumber and rgiColumnNumber fields using the portable PDB reader if not already // done by GetStackFramesInternal (on Windows for old PDB format). // + + // This is necessary because linker can't add new assemblies to the closure when recognizing Type.GetType + // so the code below is actually recognized by linker, but fails to resolve the type since the System.Diagnostics.StackTrace + // is not always part of the closure linker works on. + // PreserveDependencyAttribute on the other hand can pull in additional assemblies. + [PreserveDependency("GetSourceLineInfo", "System.Diagnostics.StackTraceSymbols", "System.Diagnostics.StackTrace")] + [PreserveDependency(".ctor()", "System.Diagnostics.StackTraceSymbols", "System.Diagnostics.StackTrace")] internal void InitializeSourceInfo(int iSkip, bool fNeedFileInfo, Exception? exception) { StackTrace.GetStackFramesInternal(this, iSkip, fNeedFileInfo, exception); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Environment.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Environment.CoreCLR.cs index 59b2bd9d79040b..f141b1e9cfeb73 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Environment.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Environment.CoreCLR.cs @@ -16,6 +16,7 @@ public static partial class Environment // Terminates this process with the given exit code. [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] + [DoesNotReturn] private static extern void _Exit(int exitCode); [DoesNotReturn] diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EmptyCAHolder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EmptyCAHolder.cs index 11140568060738..102e2f7f554ea0 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EmptyCAHolder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EmptyCAHolder.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs index c9cbeefce15f0f..6763aea8e21f69 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs @@ -600,7 +600,7 @@ internal Type[] GetTypesNoLock() while (startIndex <= className.Length) { // Are there any possible special characters left? - int i = className.IndexOfAny(new char[] { '[', '*', '&' }, startIndex); + int i = className.AsSpan(startIndex).IndexOfAny('[', '*', '&'); if (i == -1) { // No, type name is simple. @@ -608,6 +608,7 @@ internal Type[] GetTypesNoLock() parameters = null; break; } + i += startIndex; // Found a potential special character, but it might be escaped. int slashes = 0; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs index 35df17555f5669..b0905c93f506cd 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs @@ -165,6 +165,9 @@ private static CastResult TryGet(nuint source, nuint target) [MethodImpl(MethodImplOptions.InternalCall)] private static extern object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj); + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern ref byte Unbox_Helper(void* toTypeHnd, object obj); + // IsInstanceOf test used for unusual cases (naked type parameters, variant generic types) // Unlike the IsInstanceOfInterface and IsInstanceOfClass functions, // this test must deal with all kinds of type tests @@ -476,5 +479,17 @@ private static CastResult TryGet(nuint source, nuint target) slowPath: return ChkCastHelper(toTypeHnd, obj); } + + [DebuggerHidden] + [StackTraceHidden] + [DebuggerStepThrough] + private static ref byte Unbox(void* toTypeHnd, object obj) + { + // this will throw NullReferenceException if obj is null, attributed to the user code, as expected. + if (RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) + return ref obj.GetRawData(); + + return ref Unbox_Helper(toTypeHnd, obj); + } } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumVariantViewOfEnumerator.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumVariantViewOfEnumerator.cs index 84ef390bb1fe5f..0b8d002bb73111 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumVariantViewOfEnumerator.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumVariantViewOfEnumerator.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs index 9aab6ba4245d81..0a758211b770db 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs index 4162699f1ab314..d67948660a3a9f 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs index 4e3e456786bcab..fc0bf507d764fc 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorViewOfEnumVariant.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorViewOfEnumVariant.cs index ecb583f2b9c5dd..223330afc2fe94 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorViewOfEnumVariant.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorViewOfEnumVariant.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/IDispatch.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/IDispatch.cs index f002cb661e6b43..fe57a781cb99ae 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/IDispatch.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/IDispatch.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs index a0a0fdfd78bf65..b22f6bc458481b 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs @@ -154,8 +154,7 @@ internal Type LoadTypeForWinRTTypeNameInContext(string typeName) if (ptrAssemblyLoadContext == IntPtr.Zero) { // If the load context is returned null, then the assembly was bound using the TPA binder - // and we shall return reference to the active "Default" binder - which could be the TPA binder - // or an overridden CLRPrivBinderAssemblyLoadContext instance. + // and we shall return reference to the "Default" binder. loadContextForAssembly = AssemblyLoadContext.Default; } else diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs new file mode 100644 index 00000000000000..33437141e76121 --- /dev/null +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs @@ -0,0 +1,242 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Internal.Runtime.CompilerServices; + +namespace System.Threading +{ + public static partial class Interlocked + { + #region Increment + /// Increments a specified variable and stores the result, as an atomic operation. + /// The variable whose value is to be incremented. + /// The incremented value. + /// The address of location is a null pointer. + public static int Increment(ref int location) => + Add(ref location, 1); + + /// Increments a specified variable and stores the result, as an atomic operation. + /// The variable whose value is to be incremented. + /// The incremented value. + /// The address of location is a null pointer. + public static long Increment(ref long location) => + Add(ref location, 1); + #endregion + + #region Decrement + /// Decrements a specified variable and stores the result, as an atomic operation. + /// The variable whose value is to be decremented. + /// The decremented value. + /// The address of location is a null pointer. + public static int Decrement(ref int location) => + Add(ref location, -1); + + /// Decrements a specified variable and stores the result, as an atomic operation. + /// The variable whose value is to be decremented. + /// The decremented value. + /// The address of location is a null pointer. + public static long Decrement(ref long location) => + Add(ref location, -1); + #endregion + + #region Exchange + /// Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation. + /// The variable to set to the specified value. + /// The value to which the parameter is set. + /// The original value of . + /// The address of location1 is a null pointer. + [Intrinsic] + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern int Exchange(ref int location1, int value); + + /// Sets a 64-bit signed integer to a specified value and returns the original value, as an atomic operation. + /// The variable to set to the specified value. + /// The value to which the parameter is set. + /// The original value of . + /// The address of location1 is a null pointer. + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern long Exchange(ref long location1, long value); + + /// Sets a single-precision floating point number to a specified value and returns the original value, as an atomic operation. + /// The variable to set to the specified value. + /// The value to which the parameter is set. + /// The original value of . + /// The address of location1 is a null pointer. + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern float Exchange(ref float location1, float value); + + /// Sets a double-precision floating point number to a specified value and returns the original value, as an atomic operation. + /// The variable to set to the specified value. + /// The value to which the parameter is set. + /// The original value of . + /// The address of location1 is a null pointer. + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern double Exchange(ref double location1, double value); + + /// Sets an object to the specified value and returns a reference to the original object, as an atomic operation. + /// The variable to set to the specified value. + /// The value to which the parameter is set. + /// The original value of . + /// The address of location1 is a null pointer. + [MethodImpl(MethodImplOptions.InternalCall)] + [return: NotNullIfNotNull("location1")] + public static extern object? Exchange([NotNullIfNotNull("value")] ref object? location1, object? value); + + /// Sets a platform-specific handle or pointer to a specified value and returns the original value, as an atomic operation. + /// The variable to set to the specified value. + /// The value to which the parameter is set. + /// The original value of . + /// The address of location1 is a null pointer. + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern IntPtr Exchange(ref IntPtr location1, IntPtr value); + + // The below whole method reduces to a single call to Exchange(ref object, object) but + // the JIT thinks that it will generate more native code than it actually does. + + /// Sets a variable of the specified type to a specified value and returns the original value, as an atomic operation. + /// The variable to set to the specified value. + /// The value to which the parameter is set. + /// The original value of . + /// The address of location1 is a null pointer. + /// The type to be used for and . This type must be a reference type. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [return: NotNullIfNotNull("location1")] + public static T Exchange([NotNullIfNotNull("value")] ref T location1, T value) where T : class? => + Unsafe.As(Exchange(ref Unsafe.As(ref location1), value)); + #endregion + + #region CompareExchange + /// Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value. + /// The destination, whose value is compared with and possibly replaced. + /// The value that replaces the destination value if the comparison results in equality. + /// The value that is compared to the value at . + /// The original value in . + /// The address of is a null pointer. + [Intrinsic] + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern int CompareExchange(ref int location1, int value, int comparand); + + /// Compares two 64-bit signed integers for equality and, if they are equal, replaces the first value. + /// The destination, whose value is compared with and possibly replaced. + /// The value that replaces the destination value if the comparison results in equality. + /// The value that is compared to the value at . + /// The original value in . + /// The address of is a null pointer. + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern long CompareExchange(ref long location1, long value, long comparand); + + /// Compares two single-precision floating point numbers for equality and, if they are equal, replaces the first value. + /// The destination, whose value is compared with and possibly replaced. + /// The value that replaces the destination value if the comparison results in equality. + /// The value that is compared to the value at . + /// The original value in . + /// The address of is a null pointer. + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern float CompareExchange(ref float location1, float value, float comparand); + + /// Compares two double-precision floating point numbers for equality and, if they are equal, replaces the first value. + /// The destination, whose value is compared with and possibly replaced. + /// The value that replaces the destination value if the comparison results in equality. + /// The value that is compared to the value at . + /// The original value in . + /// The address of is a null pointer. + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern double CompareExchange(ref double location1, double value, double comparand); + + /// Compares two objects for reference equality and, if they are equal, replaces the first object. + /// The destination object that is compared by reference with and possibly replaced. + /// The object that replaces the destination object if the reference comparison results in equality. + /// The object that is compared by reference to the object at . + /// The original value in . + /// The address of is a null pointer. + [MethodImpl(MethodImplOptions.InternalCall)] + [return: NotNullIfNotNull("location1")] + public static extern object? CompareExchange(ref object? location1, object? value, object? comparand); + + /// Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one. + /// The destination , whose value is compared with the value of and possibly replaced by . + /// The that replaces the destination value if the comparison results in equality. + /// The that is compared to the value at . + /// The original value in . + /// The address of is a null pointer. + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern IntPtr CompareExchange(ref IntPtr location1, IntPtr value, IntPtr comparand); + + // Note that getILIntrinsicImplementationForInterlocked() in vm\jitinterface.cpp replaces + // the body of the following method with the the following IL: + // ldarg.0 + // ldarg.1 + // ldarg.2 + // call System.Threading.Interlocked::CompareExchange(ref Object, Object, Object) + // ret + // The workaround is no longer strictly necessary now that we have Unsafe.As but it does + // have the advantage of being less sensitive to JIT's inliner decisions. + + /// Compares two instances of the specified reference type for reference equality and, if they are equal, replaces the first one. + /// The destination, whose value is compared by reference with and possibly replaced. + /// The value that replaces the destination value if the comparison by reference results in equality. + /// The object that is compared by reference to the value at . + /// The original value in . + /// The address of is a null pointer. + /// The type to be used for , , and . This type must be a reference type. + [return: NotNullIfNotNull("location1")] + [Intrinsic] + public static T CompareExchange(ref T location1, T value, T comparand) where T : class? => + Unsafe.As(CompareExchange(ref Unsafe.As(ref location1), value, comparand)); + #endregion + + #region Add + /// Adds two 32-bit signed integers and replaces the first integer with the sum, as an atomic operation. + /// A variable containing the first value to be added. The sum of the two values is stored in . + /// The value to be added to the integer at . + /// The new value stored at . + /// The address of is a null pointer. + public static int Add(ref int location1, int value) => + ExchangeAdd(ref location1, value) + value; + + /// Adds two 64-bit signed integers and replaces the first integer with the sum, as an atomic operation. + /// A variable containing the first value to be added. The sum of the two values is stored in . + /// The value to be added to the integer at . + /// The new value stored at . + /// The address of is a null pointer. + public static long Add(ref long location1, long value) => + ExchangeAdd(ref location1, value) + value; + + [Intrinsic] + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern int ExchangeAdd(ref int location1, int value); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern long ExchangeAdd(ref long location1, long value); + #endregion + + #region Read + /// Returns a 64-bit signed value, loaded as an atomic operation. + /// The 64-bit value to be loaded. + /// The loaded value. + public static long Read(ref long location) => + CompareExchange(ref location, 0, 0); + #endregion + + #region MemoryBarrier + /// + /// Synchronizes memory access as follows: + /// The processor that executes the current thread cannot reorder instructions in such a way that memory accesses before + /// the call to execute after memory accesses that follow the call to . + /// + [Intrinsic] + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void MemoryBarrier(); + + [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] + private static extern void _MemoryBarrierProcessWide(); + + /// Provides a process-wide memory barrier that ensures that reads and writes from any CPU cannot move across the barrier. + public static void MemoryBarrierProcessWide() => _MemoryBarrierProcessWide(); + #endregion + } +} diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Interlocked.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Interlocked.cs deleted file mode 100644 index 40c261b6f757d1..00000000000000 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Interlocked.cs +++ /dev/null @@ -1,159 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.CompilerServices; -using Internal.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Diagnostics.CodeAnalysis; - -namespace System.Threading -{ - /// - /// After much discussion, we decided the Interlocked class doesn't need - /// any HPA's for synchronization or external threading. They hurt C#'s - /// codegen for the yield keyword, and arguably they didn't protect much. - /// Instead, they penalized people (and compilers) for writing threadsafe - /// code. - /// - public static class Interlocked - { - /// - /// Implemented: int, long - /// - public static int Increment(ref int location) - { - return Add(ref location, 1); - } - - public static long Increment(ref long location) - { - return Add(ref location, 1); - } - - /// - /// Implemented: int, long - /// - public static int Decrement(ref int location) - { - return Add(ref location, -1); - } - - public static long Decrement(ref long location) - { - return Add(ref location, -1); - } - - /// - /// Implemented: int, long, float, double, Object, IntPtr - /// - [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern int Exchange(ref int location1, int value); - - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern long Exchange(ref long location1, long value); - - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Exchange(ref float location1, float value); - - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Exchange(ref double location1, double value); - - [MethodImpl(MethodImplOptions.InternalCall)] - [return: NotNullIfNotNull("location1")] - public static extern object? Exchange([NotNullIfNotNull("value")] ref object? location1, object? value); - - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern IntPtr Exchange(ref IntPtr location1, IntPtr value); - - // This whole method reduces to a single call to Exchange(ref object, object) but - // the JIT thinks that it will generate more native code than it actually does. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [return: NotNullIfNotNull("location1")] - public static T Exchange([NotNullIfNotNull("value")] ref T location1, T value) where T : class? - { - return Unsafe.As(Exchange(ref Unsafe.As(ref location1), value)); - } - - /// - /// Implemented: int, long, float, double, Object, IntPtr - /// - [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern int CompareExchange(ref int location1, int value, int comparand); - - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern long CompareExchange(ref long location1, long value, long comparand); - - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float CompareExchange(ref float location1, float value, float comparand); - - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double CompareExchange(ref double location1, double value, double comparand); - - [MethodImpl(MethodImplOptions.InternalCall)] - [return: NotNullIfNotNull("location1")] - public static extern object? CompareExchange(ref object? location1, object? value, object? comparand); - - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern IntPtr CompareExchange(ref IntPtr location1, IntPtr value, IntPtr comparand); - - // Note that getILIntrinsicImplementationForInterlocked() in vm\jitinterface.cpp replaces - // the body of this method with the the following IL: - // ldarg.0 - // ldarg.1 - // ldarg.2 - // call System.Threading.Interlocked::CompareExchange(ref Object, Object, Object) - // ret - // The workaround is no longer strictly necessary now that we have Unsafe.As but it does - // have the advantage of being less sensitive to JIT's inliner decisions. - [return: NotNullIfNotNull("location1")] - [Intrinsic] - public static T CompareExchange(ref T location1, T value, T comparand) where T : class? - { - return Unsafe.As(CompareExchange(ref Unsafe.As(ref location1), value, comparand)); - } - - // BCL-internal overload that returns success via a ref bool param, useful for reliable spin locks. - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern int CompareExchange(ref int location1, int value, int comparand, ref bool succeeded); - - /// - /// Implemented: int, long - /// - [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern int ExchangeAdd(ref int location1, int value); - - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern long ExchangeAdd(ref long location1, long value); - - public static int Add(ref int location1, int value) - { - return ExchangeAdd(ref location1, value) + value; - } - - public static long Add(ref long location1, long value) - { - return ExchangeAdd(ref location1, value) + value; - } - - public static long Read(ref long location) - { - return Interlocked.CompareExchange(ref location, 0, 0); - } - - [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern void MemoryBarrier(); - - [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] - private static extern void _MemoryBarrierProcessWide(); - - public static void MemoryBarrierProcessWide() - { - _MemoryBarrierProcessWide(); - } - } -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h index ff28c9bfd5a852..482bc998e63ea7 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h @@ -255,6 +255,11 @@ BOOL isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ unsigned metaTOK /* IN */ ); +LPCWSTR getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ); + BOOL shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope); /**********************************************************************************/ diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h index 45449d1161d46a..59ebf7f35e7bad 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h @@ -147,6 +147,7 @@ LWM(IsInstantiationOfVerifiedGeneric, DWORDLONG, DWORD) LWM(IsSDArray, DWORDLONG, DWORD) LWM(IsStructRequiringStackAllocRetBuf, DWORDLONG, DWORD) LWM(IsValidStringRef, DLD, DWORD) +LWM(GetStringLiteral, DLD, DD) LWM(IsValidToken, DLD, DWORD) LWM(IsValueClass, DWORDLONG, DWORD) LWM(IsWriteBarrierHelperRequired, DWORDLONG, DWORD) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp index 0523e77d9c81c5..2a5da1050b1d01 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp @@ -4606,6 +4606,65 @@ BOOL MethodContext::repIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned m return value; } + +void MethodContext::recGetStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int length, LPCWSTR result) +{ + if (GetStringLiteral == nullptr) + GetStringLiteral = new LightWeightMap(); + + DLD key; + ZeroMemory(&key, sizeof(DLD)); // We use the input structs as a key and use memcmp to compare.. so we need to zero + // out padding too + + key.A = (DWORDLONG)module; + key.B = (DWORD)metaTOK; + + DWORD strBuf = (DWORD)-1; + if (result != nullptr) + strBuf = (DWORD)GetStringLiteral->AddBuffer((unsigned char*)result, (unsigned int)((wcslen(result) * 2) + 2)); + + DD value; + value.A = (DWORD)length; + value.B = (DWORD)strBuf; + + GetStringLiteral->Add(key, value); +} + +void MethodContext::dmpGetStringLiteral(DLD key, DD value) +{ + printf("GetStringLiteral key mod-%016llX tok-%08X, result-%s, len-%u", key.A, key.B, + GetStringLiteral->GetBuffer(value.B), value.A); +} + +LPCWSTR MethodContext::repGetStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int* length) +{ + if (GetStringLiteral == nullptr) + { + *length = -1; + return nullptr; + } + + DLD key; + ZeroMemory(&key, sizeof(DLD)); // We use the input structs as a key and use memcmp to compare.. so we need to zero + // out padding too + + key.A = (DWORDLONG)module; + key.B = (DWORD)metaTOK; + + int itemIndex = GetStringLiteral->GetIndex(key); + if (itemIndex < 0) + { + *length = -1; + return nullptr; + } + else + { + DD result = GetStringLiteral->Get(key); + *length = (int)result.A; + return (LPCWSTR)GetStringLiteral->GetBuffer(itemIndex); + } +} + void MethodContext::recGetHelperName(CorInfoHelpFunc funcNum, const char* result) { if (GetHelperName == nullptr) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h index fb596c263ef0fc..3c1c4792d96a4c 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h @@ -1086,6 +1086,10 @@ class MethodContext void dmpIsValidStringRef(DLD key, DWORD value); BOOL repIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK); + void recGetStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int length, LPCWSTR result); + void dmpGetStringLiteral(DLD key, DD value); + LPCWSTR repGetStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int* length); + void recGetHelperName(CorInfoHelpFunc funcNum, const char* result); void dmpGetHelperName(DWORD key, DWORD value); const char* repGetHelperName(CorInfoHelpFunc funcNum); @@ -1352,7 +1356,7 @@ class MethodContext }; // ********************* Please keep this up-to-date to ease adding more *************** -// Highest packet number: 174 +// Highest packet number: 175 // ************************************************************************************* enum mcPackets { @@ -1493,6 +1497,7 @@ enum mcPackets Packet_IsSDArray = 101, Packet_IsStructRequiringStackAllocRetBuf = 102, Packet_IsValidStringRef = 103, + Packet_GetStringLiteral = 175, // Added 1/7/2020 Retired6 = 104, Packet_IsValidToken = 144, // Added 7/19/2013 - adjusted members to proper types Packet_IsValueClass = 105, diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp index 0384e2c3218d29..9f42b42925344a 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -517,6 +517,17 @@ BOOL interceptor_ICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ return temp; } +LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ) +{ + mc->cr->AddCall("getStringLiteral"); + LPCWSTR temp = original_ICorJitInfo->getStringLiteral(module, metaTOK, length); + mc->recGetStringLiteral(module, metaTOK, *length, temp); + return temp; +} + BOOL interceptor_ICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) { mc->cr->AddCall("shouldEnforceCallvirtRestriction"); diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp index 810aed301dcced..aa7d8a383cc3a9 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp @@ -378,6 +378,15 @@ BOOL interceptor_ICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ return original_ICorJitInfo->isValidStringRef(module, metaTOK); } +LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ) +{ + mcs->AddCall("getStringLiteral"); + return original_ICorJitInfo->getStringLiteral(module, metaTOK, length); +} + BOOL interceptor_ICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) { mcs->AddCall("shouldEnforceCallvirtRestriction"); diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp index b562704433a69e..4a9a71464c8365 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp @@ -340,6 +340,14 @@ BOOL interceptor_ICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ return original_ICorJitInfo->isValidStringRef(module, metaTOK); } +LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ) +{ + return original_ICorJitInfo->getStringLiteral(module, metaTOK, length); +} + BOOL interceptor_ICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) { return original_ICorJitInfo->shouldEnforceCallvirtRestriction(scope); diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp index 630ca18c69b63e..f3bf12be739a7d 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp @@ -408,6 +408,15 @@ BOOL MyICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ return jitInstance->mc->repIsValidStringRef(module, metaTOK); } +LPCWSTR MyICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ) +{ + jitInstance->mc->cr->AddCall("getStringLiteral"); + return jitInstance->mc->repGetStringLiteral(module, metaTOK, length); +} + BOOL MyICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) { jitInstance->mc->cr->AddCall("shouldEnforceCallvirtRestriction"); diff --git a/src/coreclr/src/binder/clrprivbinderassemblyloadcontext.cpp b/src/coreclr/src/binder/clrprivbinderassemblyloadcontext.cpp index 657e6c304d1e2d..0881af5c599832 100644 --- a/src/coreclr/src/binder/clrprivbinderassemblyloadcontext.cpp +++ b/src/coreclr/src/binder/clrprivbinderassemblyloadcontext.cpp @@ -165,13 +165,6 @@ Exit:; return hr; } -HRESULT CLRPrivBinderAssemblyLoadContext::GetBinderID( - UINT_PTR *pBinderId) -{ - *pBinderId = reinterpret_cast(this); - return S_OK; -} - HRESULT CLRPrivBinderAssemblyLoadContext::GetLoaderAllocator(LPVOID* pLoaderAllocator) { _ASSERTE(pLoaderAllocator != NULL); diff --git a/src/coreclr/src/binder/clrprivbindercoreclr.cpp b/src/coreclr/src/binder/clrprivbindercoreclr.cpp index f99fe465078c92..62d5f867beea5c 100644 --- a/src/coreclr/src/binder/clrprivbindercoreclr.cpp +++ b/src/coreclr/src/binder/clrprivbindercoreclr.cpp @@ -198,13 +198,6 @@ Exit:; } #endif // !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE) -HRESULT CLRPrivBinderCoreCLR::GetBinderID( - UINT_PTR *pBinderId) -{ - *pBinderId = reinterpret_cast(this); - return S_OK; -} - HRESULT CLRPrivBinderCoreCLR::SetupBindingPaths(SString &sTrustedPlatformAssemblies, SString &sPlatformResourceRoots, SString &sAppPaths, diff --git a/src/coreclr/src/binder/inc/clrprivbinderassemblyloadcontext.h b/src/coreclr/src/binder/inc/clrprivbinderassemblyloadcontext.h index 6d012d9b1c684f..09695b09fc0108 100644 --- a/src/coreclr/src/binder/inc/clrprivbinderassemblyloadcontext.h +++ b/src/coreclr/src/binder/inc/clrprivbinderassemblyloadcontext.h @@ -23,8 +23,7 @@ class Object; class Assembly; class LoaderAllocator; -class CLRPrivBinderAssemblyLoadContext : - public IUnknownCommon +class CLRPrivBinderAssemblyLoadContext : public AssemblyLoadContext { public: @@ -35,9 +34,6 @@ class CLRPrivBinderAssemblyLoadContext : /* [in] */ IAssemblyName *pIAssemblyName, /* [retval][out] */ ICLRPrivAssembly **ppAssembly); - STDMETHOD(GetBinderID)( - /* [retval][out] */ UINT_PTR *pBinderId); - STDMETHOD(GetLoaderAllocator)( /* [retval][out] */ LPVOID *pLoaderAllocator); diff --git a/src/coreclr/src/binder/inc/clrprivbindercoreclr.h b/src/coreclr/src/binder/inc/clrprivbindercoreclr.h index f5fd7d4653ea71..3779e5bd63a213 100644 --- a/src/coreclr/src/binder/inc/clrprivbindercoreclr.h +++ b/src/coreclr/src/binder/inc/clrprivbindercoreclr.h @@ -8,13 +8,14 @@ #include "coreclrbindercommon.h" #include "applicationcontext.hpp" +#include "assemblyloadcontext.h" namespace BINDER_SPACE { class AssemblyIdentityUTF8; }; -class CLRPrivBinderCoreCLR : public IUnknownCommon +class CLRPrivBinderCoreCLR : public AssemblyLoadContext { public: @@ -25,9 +26,6 @@ class CLRPrivBinderCoreCLR : public IUnknownCommon - diff --git a/src/coreclr/src/debug/CMakeLists.txt b/src/coreclr/src/debug/CMakeLists.txt index bcfc257b9dbeca..fcba648128b102 100644 --- a/src/coreclr/src/debug/CMakeLists.txt +++ b/src/coreclr/src/debug/CMakeLists.txt @@ -1,6 +1,5 @@ add_subdirectory(daccess) -add_subdirectory(dbgutil) add_subdirectory(ildbsymlib) add_subdirectory(ee) add_subdirectory(di) -add_subdirectory(shim) \ No newline at end of file +add_subdirectory(shim) diff --git a/src/coreclr/src/debug/createdump/CMakeLists.txt b/src/coreclr/src/debug/createdump/CMakeLists.txt index 16f79702aab7ee..e110566cb5088e 100644 --- a/src/coreclr/src/debug/createdump/CMakeLists.txt +++ b/src/coreclr/src/debug/createdump/CMakeLists.txt @@ -2,6 +2,8 @@ project(createdump) set(CMAKE_INCLUDE_CURRENT_DIR ON) +include(configure.cmake) + # Set the RPATH of createdump so that it can find dependencies without needing to set LD_LIBRARY_PATH # For more information: http://www.cmake.org/Wiki/CMake_RPATH_handling. if (CORECLR_SET_RPATH) @@ -42,6 +44,7 @@ add_dependencies(createdump pal_redefines_file) target_link_libraries(createdump createdump_lib corguids + dbgutil # share the PAL in the dac module mscordaccore ) diff --git a/src/coreclr/src/debug/createdump/config.h.in b/src/coreclr/src/debug/createdump/config.h.in new file mode 100644 index 00000000000000..368627bbe50fd7 --- /dev/null +++ b/src/coreclr/src/debug/createdump/config.h.in @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#pragma once + +#cmakedefine HAVE_PROCESS_VM_READV diff --git a/src/coreclr/src/debug/createdump/configure.cmake b/src/coreclr/src/debug/createdump/configure.cmake new file mode 100644 index 00000000000000..9587b3f75f392a --- /dev/null +++ b/src/coreclr/src/debug/createdump/configure.cmake @@ -0,0 +1,3 @@ +check_function_exists(process_vm_readv HAVE_PROCESS_VM_READV) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) diff --git a/src/coreclr/src/debug/createdump/crashinfo.cpp b/src/coreclr/src/debug/createdump/crashinfo.cpp index ec2ad71e053a0e..cfc6b5503a7e9d 100644 --- a/src/coreclr/src/debug/createdump/crashinfo.cpp +++ b/src/coreclr/src/debug/createdump/crashinfo.cpp @@ -371,15 +371,6 @@ CrashInfo::EnumerateModuleMappings() if (moduleName != nullptr && *moduleName == '/') { - if (m_coreclrPath.empty()) - { - std::string coreclrPath; - coreclrPath.append(moduleName); - size_t last = coreclrPath.rfind(MAKEDLLNAME_A("coreclr")); - if (last != std::string::npos) { - m_coreclrPath = coreclrPath.substr(0, last); - } - } m_moduleMappings.insert(memoryRegion); } else @@ -425,183 +416,64 @@ CrashInfo::GetDSOInfo() assert(m_auxvValues[AT_PHENT] == sizeof(Phdr)); assert(phnum != PN_XNUM); - if (phnum <= 0 || phdrAddr == nullptr) { + if (!PopulateELFInfo(phdrAddr, phnum)) { return false; } - uint64_t baseAddress = (uint64_t)phdrAddr - sizeof(Ehdr); - ElfW(Dyn)* dynamicAddr = nullptr; - - TRACE("DSO: base %" PRIA PRIx64 " phdr %p phnum %d\n", baseAddress, phdrAddr, phnum); - - // Enumerate program headers searching for the PT_DYNAMIC header, etc. - if (!EnumerateProgramHeaders(phdrAddr, phnum, baseAddress, &dynamicAddr)) - { - return false; - } - if (dynamicAddr == nullptr) { - return false; - } - - // Search for dynamic debug (DT_DEBUG) entry - struct r_debug* rdebugAddr = nullptr; - for (;;) { - ElfW(Dyn) dyn; - if (!ReadMemory(dynamicAddr, &dyn, sizeof(dyn))) { - fprintf(stderr, "ReadMemory(%p, %" PRIx ") dyn FAILED\n", dynamicAddr, sizeof(dyn)); - return false; - } - TRACE("DSO: dyn %p tag %" PRId " (%" PRIx ") d_ptr %" PRIxA "\n", dynamicAddr, dyn.d_tag, dyn.d_tag, dyn.d_un.d_ptr); - if (dyn.d_tag == DT_DEBUG) { - rdebugAddr = reinterpret_cast(dyn.d_un.d_ptr); - } - else if (dyn.d_tag == DT_NULL) { - break; - } - dynamicAddr++; - } - - // Add the DSO r_debug entry - TRACE("DSO: rdebugAddr %p\n", rdebugAddr); - struct r_debug debugEntry; - if (!ReadMemory(rdebugAddr, &debugEntry, sizeof(debugEntry))) { - fprintf(stderr, "ReadMemory(%p, %" PRIx ") r_debug FAILED\n", rdebugAddr, sizeof(debugEntry)); + if (!EnumerateLinkMapEntries()) { return false; } - - // Add the DSO link_map entries - ArrayHolder moduleName = new char[PATH_MAX]; - for (struct link_map* linkMapAddr = debugEntry.r_map; linkMapAddr != nullptr;) { - struct link_map map; - if (!ReadMemory(linkMapAddr, &map, sizeof(map))) { - fprintf(stderr, "ReadMemory(%p, %" PRIx ") link_map FAILED\n", linkMapAddr, sizeof(map)); - return false; - } - // Read the module's name and make sure the memory is added to the core dump - int i = 0; - if (map.l_name != nullptr) { - for (; i < PATH_MAX; i++) - { - if (!ReadMemory(map.l_name + i, &moduleName[i], 1)) { - TRACE("DSO: ReadMemory link_map name %p + %d FAILED\n", map.l_name, i); - break; - } - if (moduleName[i] == '\0') { - break; - } - } - } - moduleName[i] = '\0'; - TRACE("\nDSO: link_map entry %p l_ld %p l_addr (Ehdr) %" PRIx " %s\n", linkMapAddr, map.l_ld, map.l_addr, (char*)moduleName); - - // Read the ELF header and info adding it to the core dump - if (!GetELFInfo(map.l_addr)) { - return false; - } - linkMapAddr = map.l_next; - } - return true; } // // Add all the necessary ELF headers to the core dump // -bool -CrashInfo::GetELFInfo(uint64_t baseAddress) +void +CrashInfo::VisitModule(uint64_t baseAddress, std::string& moduleName) { if (baseAddress == 0 || baseAddress == m_auxvValues[AT_SYSINFO_EHDR] || baseAddress == m_auxvValues[AT_BASE]) { - return true; - } - Ehdr ehdr; - if (!ReadMemory((void*)baseAddress, &ehdr, sizeof(ehdr))) { - TRACE("ReadMemory(%p, %" PRIx ") ehdr FAILED\n", (void*)baseAddress, sizeof(ehdr)); - return true; + return; } - int phnum = ehdr.e_phnum; - assert(phnum != PN_XNUM); - assert(ehdr.e_phentsize == sizeof(Phdr)); -#ifdef HOST_64BIT - assert(ehdr.e_ident[EI_CLASS] == ELFCLASS64); -#else - assert(ehdr.e_ident[EI_CLASS] == ELFCLASS32); -#endif - assert(ehdr.e_ident[EI_DATA] == ELFDATA2LSB); - - TRACE("ELF: type %d mach 0x%x ver %d flags 0x%x phnum %d phoff %" PRIxA " phentsize 0x%02x shnum %d shoff %" PRIxA " shentsize 0x%02x shstrndx %d\n", - ehdr.e_type, ehdr.e_machine, ehdr.e_version, ehdr.e_flags, phnum, ehdr.e_phoff, ehdr.e_phentsize, ehdr.e_shnum, ehdr.e_shoff, ehdr.e_shentsize, ehdr.e_shstrndx); - - if (ehdr.e_phoff != 0 && phnum > 0) + if (m_coreclrPath.empty()) { - Phdr* phdrAddr = reinterpret_cast(baseAddress + ehdr.e_phoff); + size_t last = moduleName.rfind(MAKEDLLNAME_A("coreclr")); + if (last != std::string::npos) { + m_coreclrPath = moduleName.substr(0, last); - if (!EnumerateProgramHeaders(phdrAddr, phnum, baseAddress, nullptr)) - { - return false; + // Now populate the elfreader with the runtime module info and + // lookup the DAC table symbol to ensure that all the memory + // necessary is in the core dump. + if (PopulateELFInfo(baseAddress)) { + uint64_t symbolOffset; + TryLookupSymbol("g_dacTable", &symbolOffset); + } } } - - return true; + EnumerateProgramHeaders(baseAddress, nullptr); } // -// Enumerate the program headers adding the build id note, unwind frame +// Called for each program header adding the build id note, unwind frame // region and module addresses to the crash info. // -bool -CrashInfo::EnumerateProgramHeaders(Phdr* phdrAddr, int phnum, uint64_t baseAddress, ElfW(Dyn)** pdynamicAddr) +void +CrashInfo::VisitProgramHeader(uint64_t loadbias, uint64_t baseAddress, Phdr* phdr) { - uint64_t loadbias = baseAddress; - - for (int i = 0; i < phnum; i++) - { - Phdr ph; - if (!ReadMemory(phdrAddr + i, &ph, sizeof(ph))) { - fprintf(stderr, "ReadMemory(%p, %" PRIx ") phdr FAILED\n", phdrAddr + i, sizeof(ph)); - return false; - } - if (ph.p_type == PT_LOAD && ph.p_offset == 0) - { - loadbias -= ph.p_vaddr; - TRACE("PHDR: loadbias %" PRIA PRIx64 "\n", loadbias); - break; - } - } - - for (int i = 0; i < phnum; i++) + switch (phdr->p_type) { - Phdr ph; - if (!ReadMemory(phdrAddr + i, &ph, sizeof(ph))) { - fprintf(stderr, "ReadMemory(%p, %" PRIx ") phdr FAILED\n", phdrAddr + i, sizeof(ph)); - return false; + case PT_DYNAMIC: + case PT_NOTE: + case PT_GNU_EH_FRAME: + if (phdr->p_vaddr != 0 && phdr->p_memsz != 0) { + InsertMemoryRegion(loadbias + phdr->p_vaddr, phdr->p_memsz); } - TRACE("PHDR: %p type %d (%x) vaddr %" PRIxA " memsz %" PRIxA " paddr %" PRIxA " filesz %" PRIxA " offset %" PRIxA " align %" PRIxA "\n", - phdrAddr + i, ph.p_type, ph.p_type, ph.p_vaddr, ph.p_memsz, ph.p_paddr, ph.p_filesz, ph.p_offset, ph.p_align); - - switch (ph.p_type) - { - case PT_DYNAMIC: - if (pdynamicAddr != nullptr) - { - *pdynamicAddr = reinterpret_cast(loadbias + ph.p_vaddr); - break; - } - // fall into InsertMemoryRegion + break; - case PT_NOTE: - case PT_GNU_EH_FRAME: - if (ph.p_vaddr != 0 && ph.p_memsz != 0) { - InsertMemoryRegion(loadbias + ph.p_vaddr, ph.p_memsz); - } - break; - - case PT_LOAD: - MemoryRegion region(0, loadbias + ph.p_vaddr, loadbias + ph.p_vaddr + ph.p_memsz, baseAddress); - m_moduleAddresses.insert(region); - break; - } + case PT_LOAD: + MemoryRegion region(0, loadbias + phdr->p_vaddr, loadbias + phdr->p_vaddr + phdr->p_memsz, baseAddress); + m_moduleAddresses.insert(region); + break; } - - return true; } // @@ -1092,3 +964,14 @@ CrashInfo::GetStatus(pid_t pid, pid_t* ppid, pid_t* tgid, char** name) fclose(statusFile); return true; } + +void +CrashInfo::Trace(const char* format, ...) +{ + if (g_diagnostics) { + va_list ap; + va_start(ap, format); + vprintf(format, ap); + va_end(ap); + } +} diff --git a/src/coreclr/src/debug/createdump/crashinfo.h b/src/coreclr/src/debug/createdump/crashinfo.h index 9fbc2119be625b..341e3af33e297a 100644 --- a/src/coreclr/src/debug/createdump/crashinfo.h +++ b/src/coreclr/src/debug/createdump/crashinfo.h @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#include "../dbgutil/elfreader.h" + // typedef for our parsing of the auxv variables in /proc/pid/auxv. #if defined(__i386) || defined(__ARM_EABI__) typedef Elf32_auxv_t elf_aux_entry; @@ -24,7 +26,7 @@ typedef __typeof__(((elf_aux_entry*) 0)->a_un.a_val) elf_aux_val_t; // All interesting auvx entry types are AT_SYSINFO_EHDR and below #define AT_MAX (AT_SYSINFO_EHDR + 1) -class CrashInfo : public ICLRDataEnumMemoryRegionsCallback +class CrashInfo : public ElfReader, public ICLRDataEnumMemoryRegionsCallback { private: LONG m_ref; // reference count @@ -78,10 +80,10 @@ class CrashInfo : public ICLRDataEnumMemoryRegionsCallback private: bool GetAuxvEntries(); - bool EnumerateModuleMappings(); bool GetDSOInfo(); - bool GetELFInfo(uint64_t baseAddress); - bool EnumerateProgramHeaders(ElfW(Phdr)* phdrAddr, int phnum, uint64_t baseAddress, ElfW(Dyn)** pdynamicAddr); + void VisitModule(uint64_t baseAddress, std::string& moduleName); + void VisitProgramHeader(uint64_t loadbias, uint64_t baseAddress, ElfW(Phdr)* phdr); + bool EnumerateModuleMappings(); bool EnumerateMemoryRegionsWithDAC(MINIDUMP_TYPE minidumpType); bool EnumerateManagedModules(IXCLRDataProcess* pClrDataProcess); bool UnwindAllThreads(IXCLRDataProcess* pClrDataProcess); @@ -91,4 +93,5 @@ class CrashInfo : public ICLRDataEnumMemoryRegionsCallback uint32_t GetMemoryRegionFlags(uint64_t start); bool ValidRegion(const MemoryRegion& region); void CombineMemoryRegions(); + void Trace(const char* format, ...); }; diff --git a/src/coreclr/src/debug/createdump/createdump.h b/src/coreclr/src/debug/createdump/createdump.h index 9771e24a934390..7627fb6e8611b2 100644 --- a/src/coreclr/src/debug/createdump/createdump.h +++ b/src/coreclr/src/debug/createdump/createdump.h @@ -16,6 +16,8 @@ extern bool g_diagnostics; printf(args); \ } +#include "config.h" + #include #include #include diff --git a/src/coreclr/src/debug/daccess/CMakeLists.txt b/src/coreclr/src/debug/daccess/CMakeLists.txt index dcd6fa1fdd873b..bbee976ecb2469 100644 --- a/src/coreclr/src/debug/daccess/CMakeLists.txt +++ b/src/coreclr/src/debug/daccess/CMakeLists.txt @@ -41,7 +41,9 @@ target_precompile_header(TARGET daccess HEADER stdafx.h) add_dependencies(daccess eventing_headers) -if(CLR_CMAKE_HOST_UNIX) +if(CLR_CMAKE_HOST_DARWIN OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD) + add_definitions(-DUSE_DAC_TABLE_RVA) + add_custom_command( OUTPUT ${GENERATED_INCLUDE_DIR}/dactablerva.h DEPENDS coreclr @@ -61,4 +63,4 @@ if(CLR_CMAKE_HOST_UNIX) ) add_dependencies(daccess dactablerva_header) -endif(CLR_CMAKE_HOST_UNIX) +endif(CLR_CMAKE_HOST_DARWIN OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD) diff --git a/src/coreclr/src/debug/daccess/daccess.cpp b/src/coreclr/src/debug/daccess/daccess.cpp index 72a9c5130a60c0..fea12eb75fcacc 100644 --- a/src/coreclr/src/debug/daccess/daccess.cpp +++ b/src/coreclr/src/debug/daccess/daccess.cpp @@ -24,8 +24,13 @@ #include "dwreport.h" #include "primitives.h" #include "dbgutil.h" + #ifdef TARGET_UNIX +#ifdef USE_DAC_TABLE_RVA #include +#else +extern bool TryGetSymbol(ICorDebugDataTarget* dataTarget, uint64_t baseAddress, const char* symbolName, uint64_t* symbolAddress); +#endif #endif #include "dwbucketmanager.hpp" @@ -7245,16 +7250,39 @@ bool ClrDataAccess::MdCacheGetEEName(TADDR taEEStruct, SString & eeName) #define _WIDE2(x) W(x) HRESULT -ClrDataAccess::GetDacGlobals() +GetDacTableAddress(ICorDebugDataTarget* dataTarget, ULONG64 baseAddress, PULONG64 dacTableAddress) { #ifdef TARGET_UNIX +#ifdef USE_DAC_TABLE_RVA #ifdef DAC_TABLE_SIZE if (DAC_TABLE_SIZE != sizeof(g_dacGlobals)) { return E_INVALIDARG; } #endif - ULONG64 dacTableAddress = m_globalBase + DAC_TABLE_RVA; + // On MacOS, FreeBSD or NetBSD use the RVA include file + *dacTableAddress = baseAddress + DAC_TABLE_RVA; +#else + // On Linux try to get the dac table address via the export symbol + if (!TryGetSymbol(dataTarget, baseAddress, "g_dacTable", dacTableAddress)) + { + return CORDBG_E_MISSING_DEBUGGER_EXPORTS; + } +#endif +#endif + return S_OK; +} + +HRESULT +ClrDataAccess::GetDacGlobals() +{ +#ifdef TARGET_UNIX + ULONG64 dacTableAddress; + HRESULT hr = GetDacTableAddress(m_pTarget, m_globalBase, &dacTableAddress); + if (FAILED(hr)) + { + return hr; + } if (FAILED(ReadFromDataTarget(m_pTarget, dacTableAddress, (BYTE*)&g_dacGlobals, sizeof(g_dacGlobals)))) { return CORDBG_E_MISSING_DEBUGGER_EXPORTS; diff --git a/src/coreclr/src/debug/daccess/enummem.cpp b/src/coreclr/src/debug/daccess/enummem.cpp index 1a5cff87ab0ce9..ec7fd1b0b72bd9 100644 --- a/src/coreclr/src/debug/daccess/enummem.cpp +++ b/src/coreclr/src/debug/daccess/enummem.cpp @@ -21,14 +21,12 @@ #include "binder.h" #include "win32threadpool.h" -#ifdef TARGET_UNIX -#include -#endif - #ifdef FEATURE_APPX #include "appxutil.h" #endif // FEATURE_APPX +extern HRESULT GetDacTableAddress(ICorDebugDataTarget* dataTarget, ULONG64 baseAddress, PULONG64 dacTableAddress); + #if defined(DAC_MEASURE_PERF) unsigned __int64 g_nTotalTime; @@ -196,8 +194,13 @@ HRESULT ClrDataAccess::EnumMemCLRStatic(IN CLRDataEnumMemoryFlags flags) ReportMem(m_globalBase + g_dacGlobals.id, sizeof(size_type)); #ifdef TARGET_UNIX + ULONG64 dacTableAddress; + HRESULT hr = GetDacTableAddress(m_pTarget, m_globalBase, &dacTableAddress); + if (FAILED(hr)) { + return hr; + } // Add the dac table memory in coreclr - CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED ( ReportMem(m_globalBase + DAC_TABLE_RVA, sizeof(g_dacGlobals)); ) + CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED ( ReportMem(dacTableAddress, sizeof(g_dacGlobals)); ) #endif // Cannot use CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED diff --git a/src/coreclr/src/debug/daccess/nidump.cpp b/src/coreclr/src/debug/daccess/nidump.cpp index 1f0c91e5faa82d..0b236337275709 100644 --- a/src/coreclr/src/debug/daccess/nidump.cpp +++ b/src/coreclr/src/debug/daccess/nidump.cpp @@ -8828,7 +8828,7 @@ void NativeImageDumper::DumpDictionaryEntry( const char * elementName, } #ifdef FEATURE_READYTORUN -IMAGE_DATA_DIRECTORY * NativeImageDumper::FindReadyToRunSection(DWORD type) +IMAGE_DATA_DIRECTORY * NativeImageDumper::FindReadyToRunSection(ReadyToRunSectionType type) { PTR_READYTORUN_SECTION pSections = dac_cast(dac_cast(m_pReadyToRunHeader) + sizeof(READYTORUN_HEADER)); for (DWORD i = 0; i < m_pReadyToRunHeader->NumberOfSections; i++) @@ -8852,7 +8852,7 @@ void NativeImageDumper::DumpReadyToRun() m_nativeReader = NativeFormat::NativeReader(dac_cast(m_decoder.GetBase()), m_decoder.GetVirtualSize()); - IMAGE_DATA_DIRECTORY * pRuntimeFunctionsDir = FindReadyToRunSection(READYTORUN_SECTION_RUNTIME_FUNCTIONS); + IMAGE_DATA_DIRECTORY * pRuntimeFunctionsDir = FindReadyToRunSection(ReadyToRunSectionType::RuntimeFunctions); if (pRuntimeFunctionsDir != NULL) { m_pRuntimeFunctions = dac_cast(m_decoder.GetDirectoryData(pRuntimeFunctionsDir)); @@ -8863,7 +8863,7 @@ void NativeImageDumper::DumpReadyToRun() m_nRuntimeFunctions = 0; } - IMAGE_DATA_DIRECTORY * pEntryPointsDir = FindReadyToRunSection(READYTORUN_SECTION_METHODDEF_ENTRYPOINTS); + IMAGE_DATA_DIRECTORY * pEntryPointsDir = FindReadyToRunSection(ReadyToRunSectionType::MethodDefEntryPoints); if (pEntryPointsDir != NULL) m_methodDefEntryPoints = NativeFormat::NativeArray((TADDR)&m_nativeReader, pEntryPointsDir->VirtualAddress); diff --git a/src/coreclr/src/debug/daccess/nidump.h b/src/coreclr/src/debug/daccess/nidump.h index a32a4d96bbbbc8..ab07e53ee71d0a 100644 --- a/src/coreclr/src/debug/daccess/nidump.h +++ b/src/coreclr/src/debug/daccess/nidump.h @@ -244,7 +244,7 @@ class NativeImageDumper NativeFormat::NativeReader m_nativeReader; NativeFormat::NativeArray m_methodDefEntryPoints; - IMAGE_DATA_DIRECTORY * FindReadyToRunSection(DWORD type); + IMAGE_DATA_DIRECTORY * FindReadyToRunSection(ReadyToRunSectionType type); public: void DumpReadyToRun(); diff --git a/src/coreclr/src/debug/dbgutil/CMakeLists.txt b/src/coreclr/src/debug/dbgutil/CMakeLists.txt index c432a32cefa3b1..2276831cbcbd51 100644 --- a/src/coreclr/src/debug/dbgutil/CMakeLists.txt +++ b/src/coreclr/src/debug/dbgutil/CMakeLists.txt @@ -5,8 +5,18 @@ endif(CLR_CMAKE_HOST_WIN32) set(CMAKE_INCLUDE_CURRENT_DIR ON) +include_directories(${CLR_DIR}/src/inc/llvm) + +add_definitions(-DPAL_STDCPP_COMPAT) + set(DBGUTIL_SOURCES dbgutil.cpp ) +if(CLR_CMAKE_TARGET_LINUX) + list(APPEND DBGUTIL_SOURCES + elfreader.cpp + ) +endif(CLR_CMAKE_TARGET_LINUX) + add_library_clr(dbgutil STATIC ${DBGUTIL_SOURCES}) diff --git a/src/coreclr/src/debug/dbgutil/dbgutil.cpp b/src/coreclr/src/debug/dbgutil/dbgutil.cpp index 62135af777d92f..0f30fdf55ff94b 100644 --- a/src/coreclr/src/debug/dbgutil/dbgutil.cpp +++ b/src/coreclr/src/debug/dbgutil/dbgutil.cpp @@ -17,6 +17,8 @@ #include #include +#ifdef HOST_WINDOWS + // Returns the RVA of the resource section for the module specified by the given data target and module base. // Returns failure if the module doesn't have a resource section. // @@ -391,6 +393,8 @@ HRESULT GetNextLevelResourceEntryRVAByName(ICorDebugDataTarget* pDataTarget, return hr; } +#endif // HOST_WINDOWS + // A small wrapper that reads from the data target and throws on error HRESULT ReadFromDataTarget(ICorDebugDataTarget* pDataTarget, ULONG64 addr, diff --git a/src/coreclr/src/debug/dbgutil/elfreader.cpp b/src/coreclr/src/debug/dbgutil/elfreader.cpp new file mode 100644 index 00000000000000..d345495f2e3572 --- /dev/null +++ b/src/coreclr/src/debug/dbgutil/elfreader.cpp @@ -0,0 +1,516 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include "elfreader.h" +#include + +#define Elf_Ehdr ElfW(Ehdr) +#define Elf_Phdr ElfW(Phdr) +#define Elf_Shdr ElfW(Shdr) +#define Elf_Nhdr ElfW(Nhdr) +#define Elf_Dyn ElfW(Dyn) +#define Elf_Sym ElfW(Sym) + +#ifdef HOST_UNIX +#define TRACE(args...) Trace(args) +#else +#define TRACE(args, ...) +#endif + +#ifndef HOST_WINDOWS +static const char ElfMagic[] = { 0x7f, 'E', 'L', 'F', '\0' }; +#endif + +class ElfReaderExport: public ElfReader +{ +private: + ICorDebugDataTarget* m_dataTarget; + +public: + ElfReaderExport(ICorDebugDataTarget* dataTarget) : + m_dataTarget(dataTarget) + { + dataTarget->AddRef(); + } + + virtual ~ElfReaderExport() + { + m_dataTarget->Release(); + } + +private: + virtual bool ReadMemory(void* address, void* buffer, size_t size) + { + uint32_t read = 0; + return SUCCEEDED(m_dataTarget->ReadVirtual(reinterpret_cast(address), reinterpret_cast(buffer), (uint32_t)size, &read)); + } +}; + +// +// Main entry point to get an export symbol +// +bool +TryGetSymbol(ICorDebugDataTarget* dataTarget, uint64_t baseAddress, const char* symbolName, uint64_t* symbolAddress) +{ + ElfReaderExport elfreader(dataTarget); + if (elfreader.PopulateELFInfo(baseAddress)) + { + uint64_t symbolOffset; + if (elfreader.TryLookupSymbol(symbolName, &symbolOffset)) + { + *symbolAddress = baseAddress + symbolOffset; + return true; + } + } + *symbolAddress = 0; + return false; +} + +// +// ELF reader constructor/destructor +// + +ElfReader::ElfReader() : + m_rdebugAddr(nullptr), + m_gnuHashTableAddr(nullptr), + m_stringTableAddr(nullptr), + m_stringTableSize(0), + m_symbolTableAddr(nullptr), + m_buckets(nullptr), + m_chainsAddress(nullptr) +{ + memset(&m_hashTable, 0, sizeof(m_hashTable)); +} + +ElfReader::~ElfReader() +{ + if (m_buckets != nullptr) { + delete m_buckets; + } +} + +// +// Initialize the ELF reader from a module the base address +// +bool +ElfReader::PopulateELFInfo(uint64_t baseAddress) +{ + TRACE("PopulateELFInfo: base %" PRIA PRIx64 "\n", baseAddress); + Elf_Dyn* dynamicAddr = nullptr; + + // Enumerate program headers searching for the PT_DYNAMIC header, etc. + if (!EnumerateProgramHeaders(baseAddress, &dynamicAddr)) { + return false; + } + return EnumerateDynamicEntries(dynamicAddr); +} + +// +// Initialize the ELF reader from the root program header +// +bool +ElfReader::PopulateELFInfo(Elf_Phdr* phdrAddr, int phnum) +{ + TRACE("PopulateELFInfo: phdr %p phnum %d\n", phdrAddr, phnum); + + if (phdrAddr == nullptr || phnum <= 0) { + return false; + } + uint64_t baseAddress = (uint64_t)phdrAddr - sizeof(Elf_Ehdr); + Elf_Dyn* dynamicAddr = nullptr; + + // Enumerate program headers searching for the PT_DYNAMIC header, etc. + if (!EnumerateProgramHeaders(phdrAddr, phnum, baseAddress, &dynamicAddr)) { + return false; + } + return EnumerateDynamicEntries(dynamicAddr); +} + +bool +ElfReader::EnumerateDynamicEntries(Elf_Dyn* dynamicAddr) +{ + if (dynamicAddr == nullptr) { + return false; + } + + // Search for dynamic entries + for (;;) { + Elf_Dyn dyn; + if (!ReadMemory(dynamicAddr, &dyn, sizeof(dyn))) { + TRACE("ERROR: ReadMemory(%p, %" PRIx ") dyn FAILED\n", dynamicAddr, sizeof(dyn)); + return false; + } + TRACE("DSO: dyn %p tag %" PRId " (%" PRIx ") d_ptr %" PRIxA "\n", dynamicAddr, dyn.d_tag, dyn.d_tag, dyn.d_un.d_ptr); + if (dyn.d_tag == DT_NULL) { + break; + } + else if (dyn.d_tag == DT_DEBUG) { + m_rdebugAddr = (void*)dyn.d_un.d_ptr; + } + else if (dyn.d_tag == DT_GNU_HASH) { + m_gnuHashTableAddr = (void*)dyn.d_un.d_ptr; + } + else if (dyn.d_tag == DT_STRTAB) { + m_stringTableAddr = (void*)dyn.d_un.d_ptr; + } + else if (dyn.d_tag == DT_STRSZ) { + m_stringTableSize = (int)dyn.d_un.d_ptr; + } + else if (dyn.d_tag == DT_SYMTAB) { + m_symbolTableAddr = (void*)dyn.d_un.d_ptr; + } + dynamicAddr++; + } + + if (m_gnuHashTableAddr == nullptr || m_stringTableAddr == nullptr || m_symbolTableAddr == nullptr) { + TRACE("ERROR: hash, string or symbol table address not found\n"); + return false; + } + + // Initialize the hash table + if (!InitializeGnuHashTable()) { + return false; + } + + return true; +} + +// +// Symbol table support +// + +bool +ElfReader::TryLookupSymbol(std::string symbolName, uint64_t* symbolOffset) +{ + std::vector symbolIndexes; + if (GetPossibleSymbolIndex(symbolName, symbolIndexes)) { + Elf_Sym symbol; + for (int32_t possibleLocation : symbolIndexes) + { + if (GetSymbol(possibleLocation, &symbol)) + { + std::string possibleName; + if (GetStringAtIndex(symbol.st_name, possibleName)) + { + if (symbolName.compare(possibleName) == 0) + { + *symbolOffset = symbol.st_value; + TRACE("TryLookupSymbol found '%s' at offset %" PRIxA "\n", symbolName.c_str(), *symbolOffset); + return true; + } + } + } + } + } + TRACE("TryLookupSymbol '%s' not found\n", symbolName.c_str()); + *symbolOffset = 0; + return false; +} + +bool +ElfReader::GetSymbol(int32_t index, Elf_Sym* symbol) +{ + int symSize = sizeof(Elf_Sym); + if (!ReadMemory((char*)m_symbolTableAddr + (index * symSize), symbol, symSize)) { + return false; + } + return true; +} + +// +// Hash (GNU) hash table support +// + +bool +ElfReader::InitializeGnuHashTable() +{ + if (!ReadMemory(m_gnuHashTableAddr, &m_hashTable, sizeof(m_hashTable))) { + TRACE("ERROR: InitializeGnuHashTable hashtable ReadMemory(%p) FAILED\n", m_gnuHashTableAddr); + return false; + } + if (m_hashTable.BucketCount <= 0 || m_hashTable.SymbolOffset == 0) { + TRACE("ERROR: InitializeGnuHashTable invalid BucketCount or SymbolOffset\n"); + return false; + } + m_buckets = new (std::nothrow) int32_t[m_hashTable.BucketCount]; + if (m_buckets == nullptr) { + return false; + } + void* bucketsAddress = (char*)m_gnuHashTableAddr + sizeof(GnuHashTable) + (m_hashTable.BloomSize * sizeof(size_t)); + if (!ReadMemory(bucketsAddress, m_buckets, m_hashTable.BucketCount * sizeof(int32_t))) { + TRACE("ERROR: InitializeGnuHashTable buckets ReadMemory(%p) FAILED\n", bucketsAddress); + return false; + } + m_chainsAddress = (char*)bucketsAddress + (m_hashTable.BucketCount * sizeof(int32_t)); + return true; +} + +bool +ElfReader::GetPossibleSymbolIndex(const std::string& symbolName, std::vector& symbolIndexes) +{ + uint32_t hash = Hash(symbolName); + int i = m_buckets[hash % m_hashTable.BucketCount] - m_hashTable.SymbolOffset; + TRACE("GetPossibleSymbolIndex hash %08x index: %d BucketCount %d SymbolOffset %08x\n", hash, i, m_hashTable.BucketCount, m_hashTable.SymbolOffset); + for (;; i++) + { + int32_t chainVal; + if (!GetChain(i, &chainVal)) { + TRACE("ERROR: GetPossibleSymbolIndex GetChain FAILED\n"); + return false; + } + if ((chainVal & 0xfffffffe) == (hash & 0xfffffffe)) + { + symbolIndexes.push_back(i + m_hashTable.SymbolOffset); + } + if ((chainVal & 0x1) == 0x1) + { + break; + } + } + return true; +} + +uint32_t +ElfReader::Hash(const std::string& symbolName) +{ + uint32_t h = 5381; + for (int i = 0; i < symbolName.length(); i++) + { + h = (h << 5) + h + symbolName[i]; + } + return h; +} + +bool +ElfReader::GetChain(int index, int32_t* chain) +{ + return ReadMemory((char*)m_chainsAddress + (index * sizeof(int32_t)), chain, sizeof(int32_t)); +} + +// +// String table support +// + +bool +ElfReader::GetStringAtIndex(int index, std::string& result) +{ + while(true) + { + if (index > m_stringTableSize) { + TRACE("ERROR: GetStringAtIndex index %d > string table size\n", index); + return false; + } + char ch; + void* address = (char*)m_stringTableAddr + index; + if (!ReadMemory(address, &ch, sizeof(ch))) { + TRACE("ERROR: GetStringAtIndex ReadMemory(%p) FAILED\n", address); + return false; + } + if (ch == '\0') { + break; + } + result.append(1, ch); + index++; + } + return true; +} + +#ifdef HOST_UNIX + +// +// Enumerate through the dynamic debug link map entries +// +bool +ElfReader::EnumerateLinkMapEntries() +{ + struct r_debug* rdebugAddr = reinterpret_cast(m_rdebugAddr); + TRACE("DSO: rdebugAddr %p\n", rdebugAddr); + + struct r_debug debugEntry; + if (!ReadMemory(rdebugAddr, &debugEntry, sizeof(debugEntry))) { + TRACE("ERROR: ReadMemory(%p, %" PRIx ") r_debug FAILED\n", rdebugAddr, sizeof(debugEntry)); + return false; + } + + // Add the DSO link_map entries + for (struct link_map* linkMapAddr = debugEntry.r_map; linkMapAddr != nullptr;) { + struct link_map map; + if (!ReadMemory(linkMapAddr, &map, sizeof(map))) { + TRACE("ERROR: ReadMemory(%p, %" PRIx ") link_map FAILED\n", linkMapAddr, sizeof(map)); + return false; + } + // Read the module's name and make sure the memory is added to the core dump + std::string moduleName; + int i = 0; + if (map.l_name != nullptr) { + for (; i < PATH_MAX; i++) + { + char ch; + if (!ReadMemory(map.l_name + i, &ch, sizeof(ch))) { + TRACE("DSO: ReadMemory link_map name %p + %d FAILED\n", map.l_name, i); + break; + } + if (ch == '\0') { + break; + } + moduleName.append(1, ch); + } + } + TRACE("\nDSO: link_map entry %p l_ld %p l_addr (Ehdr) %" PRIx " %s\n", linkMapAddr, map.l_ld, map.l_addr, moduleName.c_str()); + + // Call the derived class for each module + VisitModule(map.l_addr, moduleName); + + linkMapAddr = map.l_next; + } + + return true; +} + +#endif // HOST_UNIX + +bool +ElfReader::EnumerateProgramHeaders(uint64_t baseAddress, Elf_Dyn** pdynamicAddr) +{ + Elf_Ehdr ehdr; + if (!ReadMemory((void*)baseAddress, &ehdr, sizeof(ehdr))) { + TRACE("ERROR: EnumerateProgramHeaders ReadMemory(%p, %" PRIx ") ehdr FAILED\n", (void*)baseAddress, sizeof(ehdr)); + return false; + } + if (memcmp(ehdr.e_ident, ElfMagic, strlen(ElfMagic)) != 0) { + TRACE("ERROR: EnumerateProgramHeaders Invalid elf header signature\n"); + return false; + } + int phnum = ehdr.e_phnum; + if (ehdr.e_phoff == 0 || phnum <= 0) { + return false; + } + TRACE("ELF: type %d mach 0x%x ver %d flags 0x%x phnum %d phoff %" PRIxA " phentsize 0x%02x shnum %d shoff %" PRIxA " shentsize 0x%02x shstrndx %d\n", + ehdr.e_type, ehdr.e_machine, ehdr.e_version, ehdr.e_flags, phnum, ehdr.e_phoff, ehdr.e_phentsize, ehdr.e_shnum, ehdr.e_shoff, ehdr.e_shentsize, ehdr.e_shstrndx); +#ifdef PN_XNUM + _ASSERTE(phnum != PN_XNUM); +#endif + _ASSERTE(ehdr.e_phentsize == sizeof(Elf_Phdr)); +#ifdef TARGET_64BIT + _ASSERTE(ehdr.e_ident[EI_CLASS] == ELFCLASS64); +#else + _ASSERTE(ehdr.e_ident[EI_CLASS] == ELFCLASS32); +#endif + _ASSERTE(ehdr.e_ident[EI_DATA] == ELFDATA2LSB); + + Elf_Phdr* phdrAddr = reinterpret_cast(baseAddress + ehdr.e_phoff); + return EnumerateProgramHeaders(phdrAddr, phnum, baseAddress, pdynamicAddr); +} + +// +// Enumerate and find the dynamic program header entry +// +bool +ElfReader::EnumerateProgramHeaders(Elf_Phdr* phdrAddr, int phnum, uint64_t baseAddress, Elf_Dyn** pdynamicAddr) +{ + uint64_t loadbias = baseAddress; + + for (int i = 0; i < phnum; i++) + { + Elf_Phdr ph; + if (!ReadMemory(phdrAddr + i, &ph, sizeof(ph))) { + TRACE("ERROR: ReadMemory(%p, %" PRIx ") phdr FAILED\n", phdrAddr + i, sizeof(ph)); + return false; + } + if (ph.p_type == PT_LOAD && ph.p_offset == 0) { + loadbias -= ph.p_vaddr; + TRACE("PHDR: loadbias %" PRIA PRIx64 "\n", loadbias); + break; + } + } + + for (int i = 0; i < phnum; i++) + { + Elf_Phdr ph; + if (!ReadMemory(phdrAddr + i, &ph, sizeof(ph))) { + TRACE("ERROR: ReadMemory(%p, %" PRIx ") phdr FAILED\n", phdrAddr + i, sizeof(ph)); + return false; + } + TRACE("PHDR: %p type %d (%x) vaddr %" PRIxA " memsz %" PRIxA " paddr %" PRIxA " filesz %" PRIxA " offset %" PRIxA " align %" PRIxA "\n", + phdrAddr + i, ph.p_type, ph.p_type, ph.p_vaddr, ph.p_memsz, ph.p_paddr, ph.p_filesz, ph.p_offset, ph.p_align); + + switch (ph.p_type) + { + case PT_DYNAMIC: + if (pdynamicAddr != nullptr) { + *pdynamicAddr = reinterpret_cast(loadbias + ph.p_vaddr); + } + break; + } + + // Give any derived classes a chance at the program header + VisitProgramHeader(loadbias, baseAddress, &ph); + } + + return true; +} + +#ifdef HOST_WINDOWS + +/* ELF 32bit header */ +Elf32_Ehdr::Elf32_Ehdr() +{ + e_ident[EI_MAG0] = ElfMagic[0]; + e_ident[EI_MAG1] = ElfMagic[1]; + e_ident[EI_MAG2] = ElfMagic[2]; + e_ident[EI_MAG3] = ElfMagic[3]; + e_ident[EI_CLASS] = ELFCLASS32; + e_ident[EI_DATA] = ELFDATA2LSB; + e_ident[EI_VERSION] = EV_CURRENT; + e_ident[EI_OSABI] = ELFOSABI_NONE; + e_ident[EI_ABIVERSION] = 0; + for (int i = EI_PAD; i < EI_NIDENT; ++i) { + e_ident[i] = 0; + } + e_type = ET_REL; +#if defined(TARGET_X86) + e_machine = EM_386; +#elif defined(TARGET_ARM) + e_machine = EM_ARM; +#endif + e_flags = 0; + e_version = 1; + e_entry = 0; + e_phoff = 0; + e_ehsize = sizeof(Elf32_Ehdr); + e_phentsize = 0; + e_phnum = 0; +} + +/* ELF 64bit header */ +Elf64_Ehdr::Elf64_Ehdr() +{ + e_ident[EI_MAG0] = ElfMagic[0]; + e_ident[EI_MAG1] = ElfMagic[1]; + e_ident[EI_MAG2] = ElfMagic[2]; + e_ident[EI_MAG3] = ElfMagic[3]; + e_ident[EI_CLASS] = ELFCLASS64; + e_ident[EI_DATA] = ELFDATA2LSB; + e_ident[EI_VERSION] = EV_CURRENT; + e_ident[EI_OSABI] = ELFOSABI_NONE; + e_ident[EI_ABIVERSION] = 0; + for (int i = EI_PAD; i < EI_NIDENT; ++i) { + e_ident[i] = 0; + } + e_type = ET_REL; +#if defined(TARGET_AMD64) + e_machine = EM_X86_64; +#elif defined(TARGET_ARM64) + e_machine = EM_AARCH64; +#endif + e_flags = 0; + e_version = 1; + e_entry = 0; + e_phoff = 0; + e_ehsize = sizeof(Elf64_Ehdr); + e_phentsize = 0; + e_phnum = 0; +} + +#endif // HOST_WINDOWS diff --git a/src/coreclr/src/debug/dbgutil/elfreader.h b/src/coreclr/src/debug/dbgutil/elfreader.h new file mode 100644 index 00000000000000..77129bbcf1a38d --- /dev/null +++ b/src/coreclr/src/debug/dbgutil/elfreader.h @@ -0,0 +1,86 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include +#include +#include +#include +#define __STDC_FORMAT_MACROS +#include +#include +#ifdef HOST_UNIX +#include +#endif // HOST_UNIX +#include +#include + +#if TARGET_64BIT +#define PRIx PRIx64 +#define PRIu PRIu64 +#define PRId PRId64 +#define PRIA "016" +#define PRIxA PRIA PRIx +#define TARGET_WORDSIZE 64 +#else +#define PRIx PRIx32 +#define PRIu PRIu32 +#define PRId PRId32 +#define PRIA "08" +#define PRIxA PRIA PRIx +#define TARGET_WORDSIZE 32 +#endif + +#ifndef ElfW +/* We use this macro to refer to ELF types independent of the native wordsize. + `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */ +#define ElfW(type) _ElfW (Elf, TARGET_WORDSIZE, type) +#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t) +#define _ElfW_1(e,w,t) e##w##t +#endif + +typedef struct { + int32_t BucketCount; + int32_t SymbolOffset; + int32_t BloomSize; + int32_t BloomShift; +} GnuHashTable; + +class ElfReader +{ +private: + void* m_rdebugAddr; // DT_DEBUG + void* m_gnuHashTableAddr; // DT_GNU_HASH + void* m_stringTableAddr; // DT_STRTAB + int m_stringTableSize; // DT_STRSIZ + void* m_symbolTableAddr; // DT_SYMTAB + + GnuHashTable m_hashTable; // gnu hash table info + int32_t* m_buckets; // gnu hash table buckets + void* m_chainsAddress; + +public: + ElfReader(); + virtual ~ElfReader(); + bool PopulateELFInfo(uint64_t baseAddress); + bool PopulateELFInfo(ElfW(Phdr)* phdrAddr, int phnum); + bool TryLookupSymbol(std::string symbolName, uint64_t* symbolOffset); +#ifdef HOST_UNIX + bool EnumerateLinkMapEntries(); +#endif + bool EnumerateProgramHeaders(uint64_t baseAddress, ElfW(Dyn)** pdynamicAddr); + bool EnumerateProgramHeaders(ElfW(Phdr)* phdrAddr, int phnum, uint64_t baseAddress, ElfW(Dyn)** pdynamicAddr); + +private: + bool GetSymbol(int32_t index, ElfW(Sym)* symbol); + bool InitializeGnuHashTable(); + bool GetPossibleSymbolIndex(const std::string& symbolName, std::vector& symbolIndexes); + uint32_t Hash(const std::string& symbolName); + bool GetChain(int index, int32_t* chain); + bool GetStringAtIndex(int index, std::string& result); + bool EnumerateDynamicEntries(ElfW(Dyn)* dynamicAddr); + virtual void VisitModule(uint64_t baseAddress, std::string& moduleName) { }; + virtual void VisitProgramHeader(uint64_t loadbias, uint64_t baseAddress, ElfW(Phdr)* phdr) { }; + virtual bool ReadMemory(void* address, void* buffer, size_t size) = 0; + virtual void Trace(const char* format, ...) { }; +}; diff --git a/src/coreclr/src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructionTableGenerator.cs b/src/coreclr/src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructionTableGenerator.cs index 9e2ce2da1190c8..d90a1278c80dcb 100644 --- a/src/coreclr/src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructionTableGenerator.cs +++ b/src/coreclr/src/debug/ee/amd64/gen_amd64InstrDecode/Amd64InstructionTableGenerator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/src/coreclr/src/debug/ee/controller.cpp b/src/coreclr/src/debug/ee/controller.cpp index 03b27612e5a5e6..137fcf774067db 100644 --- a/src/coreclr/src/debug/ee/controller.cpp +++ b/src/coreclr/src/debug/ee/controller.cpp @@ -8961,7 +8961,7 @@ bool DebuggerContinuableExceptionBreakpoint::SendEvent(Thread *thread, bool fIpC CONTEXT contextToAdjust; BOOL adjustedContext = FALSE; memcpy(&contextToAdjust, pContext, sizeof(CONTEXT)); - adjustedContext = g_pEEInterface->AdjustContextForWriteBarrierForDebugger(&contextToAdjust); + adjustedContext = g_pEEInterface->AdjustContextForJITHelpersForDebugger(&contextToAdjust); if (adjustedContext) { LOG((LF_CORDB, LL_INFO10000, "D::DDBP: HIT DATA BREAKPOINT INSIDE WRITE BARRIER...\n")); diff --git a/src/coreclr/src/debug/ee/dactable.cpp b/src/coreclr/src/debug/ee/dactable.cpp index 2f601249064899..967ac69bc28c4d 100644 --- a/src/coreclr/src/debug/ee/dactable.cpp +++ b/src/coreclr/src/debug/ee/dactable.cpp @@ -40,6 +40,7 @@ extern DWORD gAppDomainTLSIndex; extern BOOL g_fAppX; #endif // FEATURE_APPX +DLLEXPORT DacGlobals g_dacTable; // DAC global pointer table initialization diff --git a/src/coreclr/src/debug/inc/twowaypipe.h b/src/coreclr/src/debug/inc/twowaypipe.h index 18942b4a4ba8d6..5a3d78ea97f74c 100644 --- a/src/coreclr/src/debug/inc/twowaypipe.h +++ b/src/coreclr/src/debug/inc/twowaypipe.h @@ -8,7 +8,7 @@ #include "processdescriptor.h" -#ifdef TARGET_UNIX +#ifdef HOST_UNIX #define INVALID_PIPE -1 #else #define INVALID_PIPE INVALID_HANDLE_VALUE @@ -83,7 +83,7 @@ class TwoWayPipe State m_state; -#ifdef TARGET_UNIX +#ifdef HOST_UNIX int m_inboundPipe, m_outboundPipe; // two one sided pipes used for communication char m_inPipeName[MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH]; // filename of the inbound pipe @@ -99,7 +99,7 @@ class TwoWayPipe HANDLE CreateOneWayPipe(DWORD id, bool inbound); HANDLE m_inboundPipe, m_outboundPipe; //two one sided pipes used for communication -#endif //TARGET_UNIX +#endif //HOST_UNIX }; #endif //TwoWayPipe_H diff --git a/src/coreclr/src/dlls/mscordac/CMakeLists.txt b/src/coreclr/src/dlls/mscordac/CMakeLists.txt index ba45564b05296f..e5bc381a0679ef 100644 --- a/src/coreclr/src/dlls/mscordac/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscordac/CMakeLists.txt @@ -5,7 +5,7 @@ set(CLR_DAC_SOURCES add_definitions(-DFX_VER_INTERNALNAME_STR=mscordaccore.dll) -if(CLR_CMAKE_TARGET_WIN32) +if(CLR_CMAKE_HOST_WIN32) list(APPEND CLR_DAC_SOURCES Native.rc ) @@ -24,7 +24,7 @@ if(CLR_CMAKE_TARGET_WIN32) # No library groups for Win32 set(START_LIBRARY_GROUP) set(END_LIBRARY_GROUP) -else(CLR_CMAKE_TARGET_WIN32) +else(CLR_CMAKE_HOST_WIN32) set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/mscordac_unixexports.src) set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/mscordac.exports) @@ -71,7 +71,7 @@ else(CLR_CMAKE_TARGET_WIN32) # Add lib redefines file to DAC list(APPEND CLR_DAC_SOURCES libredefines.S) endif(CLR_CMAKE_HOST_LINUX) -endif(CLR_CMAKE_TARGET_WIN32) +endif(CLR_CMAKE_HOST_WIN32) if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD) # This option is necessary to ensure that the overloaded delete operator defined inside @@ -136,6 +136,12 @@ set(COREDAC_LIBRARIES ) if(CLR_CMAKE_TARGET_WIN32) + list(APPEND COREDAC_LIBRARIES + mdwinmd_dac + ) +endif(CLR_CMAKE_TARGET_WIN32) + +if(CLR_CMAKE_HOST_WIN32) # mscordac.def should be generated before mscordaccore.dll is built add_dependencies(mscordaccore mscordaccore_def) @@ -160,7 +166,6 @@ if(CLR_CMAKE_TARGET_WIN32) set(COREDAC_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/mscordaccore.exp # export file ${COREDAC_LIBRARIES} - mdwinmd_dac kernel32.lib advapi32.lib ole32.lib @@ -170,7 +175,7 @@ if(CLR_CMAKE_TARGET_WIN32) ${STATIC_MT_CRT_LIB} ${STATIC_MT_VCRT_LIB} ) -else(CLR_CMAKE_TARGET_WIN32) +else(CLR_CMAKE_HOST_WIN32) list(APPEND COREDAC_LIBRARIES mscorrc_debug ${START_WHOLE_ARCHIVE} # force all PAL objects to be included so all exports are available @@ -178,7 +183,7 @@ else(CLR_CMAKE_TARGET_WIN32) palrt ${END_WHOLE_ARCHIVE} ) -endif(CLR_CMAKE_TARGET_WIN32) +endif(CLR_CMAKE_HOST_WIN32) target_link_libraries(mscordaccore PRIVATE ${COREDAC_LIBRARIES}) @@ -186,7 +191,7 @@ target_link_libraries(mscordaccore PRIVATE ${COREDAC_LIBRARIES}) install_clr(TARGETS mscordaccore) install_clr(TARGETS mscordaccore DESTINATION sharedFramework SKIP_STRIP) -if(CLR_CMAKE_TARGET_WIN32) +if(CLR_CMAKE_HOST_WIN32) set(LONG_NAME_HOST_ARCH ${CLR_CMAKE_HOST_ARCH}) set(LONG_NAME_TARGET_ARCH ${CLR_CMAKE_TARGET_ARCH}) if (LONG_NAME_HOST_ARCH STREQUAL x64) diff --git a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt index 0745ad4ad22f73..1f5f62509a1409 100644 --- a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt @@ -90,6 +90,7 @@ set(CORECLR_LIBRARIES debug-pal ${LIB_UNWINDER} cee_wks + v3binder ${END_LIBRARY_GROUP} # End group of libraries that have circular references mdcompiler_wks mdruntime_wks @@ -103,7 +104,7 @@ set(CORECLR_LIBRARIES gcinfo # Condition="'$(TargetCpu)'=='amd64' or '$(TargetCpu)' == 'arm' or '$(TargetCpu)' == 'arm64'" ildbsymlib utilcode - v3binder + libraries-native ) if(CLR_CMAKE_TARGET_WIN32) diff --git a/src/coreclr/src/dlls/mscoree/mscorwks_unixexports.src b/src/coreclr/src/dlls/mscoree/mscorwks_unixexports.src index 1085876f981dc1..2f742f327198fb 100644 --- a/src/coreclr/src/dlls/mscoree/mscorwks_unixexports.src +++ b/src/coreclr/src/dlls/mscoree/mscorwks_unixexports.src @@ -8,3 +8,6 @@ coreclr_shutdown_2 ; Functions exported by the coreclr DllMain GetCLRRuntimeHost +; DAC table export +g_dacTable + diff --git a/src/coreclr/src/dlls/mscorrc/full/CMakeLists.txt b/src/coreclr/src/dlls/mscorrc/full/CMakeLists.txt index 5414e790146b5e..ffdb8a3b146419 100644 --- a/src/coreclr/src/dlls/mscorrc/full/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscorrc/full/CMakeLists.txt @@ -1,6 +1,6 @@ add_definitions(-DFX_VER_INTERNALNAME_STR=mscorrc.debug.dll) -if(CLR_CMAKE_TARGET_WIN32) +if(CLR_CMAKE_HOST_WIN32) add_library_clr(mscorrc.debug SHARED ../include.rc @@ -16,5 +16,5 @@ else() ${TARGET_CPP_FILE} ) -endif(CLR_CMAKE_TARGET_WIN32) +endif(CLR_CMAKE_HOST_WIN32) diff --git a/src/coreclr/src/dlls/mscorrc/mscorrc.rc b/src/coreclr/src/dlls/mscorrc/mscorrc.rc index 6cb75fb81d7df6..fb8905d8e9d3e0 100644 --- a/src/coreclr/src/dlls/mscorrc/mscorrc.rc +++ b/src/coreclr/src/dlls/mscorrc/mscorrc.rc @@ -795,7 +795,6 @@ BEGIN IDS_HOST_ASSEMBLY_RESOLVER_ASSEMBLY_ALREADY_LOADED_IN_CONTEXT "Assembly with same name is already loaded" IDS_HOST_ASSEMBLY_RESOLVER_DYNAMICALLY_EMITTED_ASSEMBLIES_UNSUPPORTED "Dynamically emitted assemblies are unsupported during host-based resolution." IDS_HOST_ASSEMBLY_RESOLVER_INCOMPATIBLE_BINDING_CONTEXT "Assembly is already bound to an incompatible binding context." - IDS_HOST_ASSEMBLY_RESOLVER_INCOMPATIBLE_TPA_BINDING_CONTEXT "Default binding context is already attached to managed load context." END STRINGTABLE DISCARDABLE diff --git a/src/coreclr/src/dlls/mscorrc/resource.h b/src/coreclr/src/dlls/mscorrc/resource.h index 519e17273b2bd3..05f7346773d4d8 100644 --- a/src/coreclr/src/dlls/mscorrc/resource.h +++ b/src/coreclr/src/dlls/mscorrc/resource.h @@ -618,7 +618,6 @@ #define IDS_HOST_ASSEMBLY_RESOLVER_ASSEMBLY_ALREADY_LOADED_IN_CONTEXT 0x2636 #define IDS_HOST_ASSEMBLY_RESOLVER_DYNAMICALLY_EMITTED_ASSEMBLIES_UNSUPPORTED 0x2637 #define IDS_HOST_ASSEMBLY_RESOLVER_INCOMPATIBLE_BINDING_CONTEXT 0x2638 -#define IDS_HOST_ASSEMBLY_RESOLVER_INCOMPATIBLE_TPA_BINDING_CONTEXT 0x2639 #define IDS_NATIVE_IMAGE_CANNOT_BE_LOADED_MULTIPLE_TIMES 0x263a diff --git a/src/coreclr/src/gc/env/gcenv.unix.inl b/src/coreclr/src/gc/env/gcenv.unix.inl index 42b8a434a05813..cc71651c57fc0b 100644 --- a/src/coreclr/src/gc/env/gcenv.unix.inl +++ b/src/coreclr/src/gc/env/gcenv.unix.inl @@ -11,9 +11,11 @@ extern uint32_t g_pageSizeUnixInl; #define OS_PAGE_SIZE GCToOSInterface::GetPageSize() +#ifndef DACCESS_COMPILE __forceinline size_t GCToOSInterface::GetPageSize() { return g_pageSizeUnixInl; } +#endif // DACCESS_COMPILE #endif // __GCENV_UNIX_INL__ diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp index 63598a3fa34b2e..44020b3b74a155 100644 --- a/src/coreclr/src/gc/gc.cpp +++ b/src/coreclr/src/gc/gc.cpp @@ -1022,50 +1022,44 @@ class t_join if (Interlocked::CompareExchange(&join_struct.r_join_lock, 0, join_struct.n_threads) == 0) { - if (!join_struct.wait_done) - { - dprintf (JOIN_LOG, ("r_join() Waiting...")); + fire_event (gch->heap_number, time_start, type_join, join_id); - fire_event (gch->heap_number, time_start, type_join, join_id); + dprintf (JOIN_LOG, ("r_join() Waiting...")); - //busy wait around the color - if (!join_struct.wait_done) - { + //busy wait around the color respin: - int spin_count = 256 * yp_spin_count_unit; - for (int j = 0; j < spin_count; j++) - { - if (join_struct.wait_done) - { - break; - } - YieldProcessor(); // indicate to the processor that we are spinning - } - - // we've spun, and if color still hasn't changed, fall into hard wait - if (!join_struct.wait_done) - { - dprintf (JOIN_LOG, ("Join() hard wait on reset event %d", first_thread_arrived)); - uint32_t dwJoinWait = join_struct.joined_event[first_thread_arrived].Wait(INFINITE, FALSE); - if (dwJoinWait != WAIT_OBJECT_0) - { - STRESS_LOG1 (LF_GC, LL_FATALERROR, "joined event wait failed with code: %Ix", dwJoinWait); - FATAL_GC_ERROR (); - } - } - - // avoid race due to the thread about to reset the event (occasionally) being preempted before ResetEvent() - if (!join_struct.wait_done) - { - goto respin; - } + int spin_count = 256 * yp_spin_count_unit; + for (int j = 0; j < spin_count; j++) + { + if (join_struct.wait_done) + { + break; + } + YieldProcessor(); // indicate to the processor that we are spinning + } - dprintf (JOIN_LOG, ("r_join() done")); + // we've spun, and if color still hasn't changed, fall into hard wait + if (!join_struct.wait_done) + { + dprintf (JOIN_LOG, ("Join() hard wait on reset event %d", first_thread_arrived)); + uint32_t dwJoinWait = join_struct.joined_event[first_thread_arrived].Wait(INFINITE, FALSE); + if (dwJoinWait != WAIT_OBJECT_0) + { + STRESS_LOG1 (LF_GC, LL_FATALERROR, "joined event wait failed with code: %Ix", dwJoinWait); + FATAL_GC_ERROR (); } + } - fire_event (gch->heap_number, time_end, type_join, join_id); + // avoid race due to the thread about to reset the event (occasionally) being preempted before ResetEvent() + if (!join_struct.wait_done) + { + goto respin; } + dprintf (JOIN_LOG, ("r_join() done")); + + fire_event (gch->heap_number, time_end, type_join, join_id); + return FALSE; } else @@ -2415,7 +2409,10 @@ static static_data static_data_table[latency_level_last - latency_level_first + // gen2 {256*1024, SSIZE_T_MAX, 200000, 0.25f, 1.2f, 1.8f, 100000, 100}, // loh - {3*1024*1024, SSIZE_T_MAX, 0, 0.0f, 1.25f, 4.5f, 0, 0} + {3*1024*1024, SSIZE_T_MAX, 0, 0.0f, 1.25f, 4.5f, 0, 0}, + // poh + // TODO: tuning https://github.com/dotnet/runtime/issues/13739 + {3*1024*1024, SSIZE_T_MAX, 0, 0.0f, 1.25f, 4.5f, 0, 0}, }, // latency_level_balanced @@ -2433,6 +2430,9 @@ static static_data static_data_table[latency_level_last - latency_level_first + // gen2 {256*1024, SSIZE_T_MAX, 200000, 0.25f, 1.2f, 1.8f, 100000, 100}, // loh + {3*1024*1024, SSIZE_T_MAX, 0, 0.0f, 1.25f, 4.5f, 0, 0}, + // poh + // TODO: tuning https://github.com/dotnet/runtime/issues/13739 {3*1024*1024, SSIZE_T_MAX, 0, 0.0f, 1.25f, 4.5f, 0, 0} }, }; @@ -2764,6 +2764,8 @@ size_t gc_heap::bgc_overflow_count = 0; size_t gc_heap::bgc_begin_loh_size = 0; size_t gc_heap::end_loh_size = 0; +size_t gc_heap::bgc_begin_poh_size = 0; +size_t gc_heap::end_poh_size = 0; #ifdef BGC_SERVO_TUNING uint64_t gc_heap::loh_a_no_bgc = 0; @@ -2779,6 +2781,8 @@ uint32_t gc_heap::bgc_alloc_spin_uoh = 0; size_t gc_heap::bgc_loh_size_increased = 0; +size_t gc_heap::bgc_poh_size_increased = 0; + size_t gc_heap::background_soh_alloc_count = 0; size_t gc_heap::background_uoh_alloc_count = 0; @@ -2963,6 +2967,7 @@ BOOL gc_heap::heap_analyze_enabled = FALSE; alloc_list gc_heap::loh_alloc_list [NUM_LOH_ALIST-1]; alloc_list gc_heap::gen2_alloc_list[NUM_GEN2_ALIST-1]; +alloc_list gc_heap::poh_alloc_list [NUM_POH_ALIST-1]; dynamic_data gc_heap::dynamic_data_table [total_generation_count]; gc_history_per_heap gc_heap::gc_data_per_heap; @@ -3008,6 +3013,7 @@ CFinalize* gc_heap::finalize_queue = 0; VOLATILE(uint32_t) gc_heap::card_mark_chunk_index_soh; VOLATILE(bool) gc_heap::card_mark_done_soh; VOLATILE(uint32_t) gc_heap::card_mark_chunk_index_loh; +VOLATILE(uint32_t) gc_heap::card_mark_chunk_index_poh; VOLATILE(bool) gc_heap::card_mark_done_uoh; #endif // FEATURE_CARD_MARKING_STEALING @@ -4338,13 +4344,16 @@ typedef struct imemory_data *initial_memory; imemory_data *initial_normal_heap; // points into initial_memory_array imemory_data *initial_large_heap; // points into initial_memory_array + imemory_data *initial_pinned_heap; // points into initial_memory_array size_t block_size_normal; size_t block_size_large; + size_t block_size_pinned; int block_count; // # of blocks in each int current_block_normal; int current_block_large; + int current_block_pinned; enum { @@ -4361,6 +4370,7 @@ typedef struct { case 0: return block_size_normal; case 1: return block_size_large; + case 2: return block_size_pinned; default: __UNREACHABLE(); } }; @@ -4373,6 +4383,7 @@ typedef struct case soh_gen1: case soh_gen2: return initial_normal_heap[h_number].memory_base; case loh_generation: return initial_large_heap[h_number].memory_base; + case poh_generation: return initial_pinned_heap[h_number].memory_base; default: __UNREACHABLE(); } }; @@ -4385,6 +4396,7 @@ typedef struct case soh_gen1: case soh_gen2: return block_size_normal; case loh_generation: return block_size_large; + case poh_generation: return block_size_pinned; default: __UNREACHABLE(); } }; @@ -4393,15 +4405,15 @@ typedef struct initial_memory_details memory_details; -BOOL reserve_initial_memory (size_t normal_size, size_t large_size, int num_heaps, bool use_large_pages_p) +BOOL reserve_initial_memory (size_t normal_size, size_t large_size, size_t pinned_size, int num_heaps, bool use_large_pages_p) { BOOL reserve_success = FALSE; // should only be called once assert (memory_details.initial_memory == 0); - // soh + loh segments * num_heaps - memory_details.initial_memory = new (nothrow) imemory_data[num_heaps * (total_generation_count - ephemeral_generation_count)]; + // soh + loh + poh segments * num_heaps + memory_details.initial_memory = new (nothrow) imemory_data[num_heaps * (total_generation_count - ephemeral_generation_count)]; if (memory_details.initial_memory == 0) { dprintf (2, ("failed to reserve %Id bytes for imemory_data", num_heaps * (total_generation_count - ephemeral_generation_count) * sizeof (imemory_data))); @@ -4410,13 +4422,16 @@ BOOL reserve_initial_memory (size_t normal_size, size_t large_size, int num_heap memory_details.initial_normal_heap = memory_details.initial_memory; memory_details.initial_large_heap = memory_details.initial_normal_heap + num_heaps; + memory_details.initial_pinned_heap = memory_details.initial_large_heap + num_heaps; memory_details.block_size_normal = normal_size; memory_details.block_size_large = large_size; + memory_details.block_size_pinned = pinned_size; memory_details.block_count = num_heaps; memory_details.current_block_normal = 0; memory_details.current_block_large = 0; + memory_details.current_block_pinned = 0; g_gc_lowest_address = MAX_PTR; g_gc_highest_address = 0; @@ -4428,13 +4443,13 @@ BOOL reserve_initial_memory (size_t normal_size, size_t large_size, int num_heap return FALSE; } - if (((size_t)MAX_PTR / memory_details.block_count) < (normal_size + large_size)) + if (((size_t)MAX_PTR / memory_details.block_count) < (normal_size + large_size + pinned_size)) { dprintf (2, ("(0x%Ix + 0x%Ix)*0x%Ix overflow", normal_size, large_size, memory_details.block_count)); return FALSE; } - size_t requestedMemory = memory_details.block_count * (normal_size + large_size); + size_t requestedMemory = memory_details.block_count * (normal_size + large_size + pinned_size); uint8_t* allatonce_block = (uint8_t*)virtual_alloc (requestedMemory, use_large_pages_p); if (allatonce_block) @@ -4449,27 +4464,32 @@ BOOL reserve_initial_memory (size_t normal_size, size_t large_size, int num_heap (i * normal_size); memory_details.initial_large_heap[i].memory_base = allatonce_block + (memory_details.block_count * normal_size) + (i * large_size); + memory_details.initial_pinned_heap[i].memory_base = allatonce_block + + (memory_details.block_count * (normal_size + large_size)) + (i * pinned_size); reserve_success = TRUE; } } else { - // try to allocate 2 blocks + // try to allocate 3 blocks uint8_t* b1 = (uint8_t*)virtual_alloc (memory_details.block_count * normal_size, use_large_pages_p); uint8_t* b2 = (uint8_t*)virtual_alloc (memory_details.block_count * large_size, use_large_pages_p); + uint8_t* b3 = (uint8_t*)virtual_alloc (memory_details.block_count * pinned_size, use_large_pages_p); - if (b1 && b2) + if (b1 && b2 && b3) { memory_details.allocation_pattern = initial_memory_details::EACH_GENERATION; - g_gc_lowest_address = min (b1, b2); + g_gc_lowest_address = min (b1, min(b2, b3)); g_gc_highest_address = max (b1 + memory_details.block_count * normal_size, - b2 + memory_details.block_count * large_size); + max (b2 + memory_details.block_count * large_size, + b3 + memory_details.block_count * pinned_size)); for (int i = 0; i < memory_details.block_count; i++) { memory_details.initial_normal_heap[i].memory_base = b1 + (i * normal_size); memory_details.initial_large_heap[i].memory_base = b2 + (i * large_size); + memory_details.initial_pinned_heap[i].memory_base = b3 + (i * pinned_size); } reserve_success = TRUE; @@ -4482,6 +4502,8 @@ BOOL reserve_initial_memory (size_t normal_size, size_t large_size, int num_heap virtual_free (b1, memory_details.block_count * normal_size); if (b2) virtual_free (b2, memory_details.block_count * large_size); + if (b3) + virtual_free (b3, memory_details.block_count * pinned_size); } if ((b2 == NULL) && (memory_details.block_count > 1)) @@ -4539,12 +4561,15 @@ void destroy_initial_memory() virtual_free (memory_details.initial_large_heap[0].memory_base, memory_details.block_count*memory_details.block_size_large); + + virtual_free (memory_details.initial_pinned_heap[0].memory_base, + memory_details.block_count*memory_details.block_size_pinned); } else { assert (memory_details.allocation_pattern == initial_memory_details::EACH_BLOCK); imemory_data *current_block = memory_details.initial_memory; - for(int i = 0; i < (memory_details.block_count*2); i++, current_block++) + for (int i = 0; i < (memory_details.block_count*(total_generation_count - ephemeral_generation_count)); i++, current_block++) { size_t block_size = memory_details.block_size (i); if (current_block->memory_base != NULL) @@ -4558,6 +4583,7 @@ void destroy_initial_memory() memory_details.initial_memory = NULL; memory_details.initial_normal_heap = NULL; memory_details.initial_large_heap = NULL; + memory_details.initial_pinned_heap = NULL; } } @@ -5018,7 +5044,9 @@ heap_segment* gc_heap::get_segment_for_uoh (int gen_number, size_t size #ifdef MULTIPLE_HEAPS heap_segment_heap (res) = hp; #endif //MULTIPLE_HEAPS - res->flags |= heap_segment_flags_loh; + res->flags |= gen_number == poh_generation ? + heap_segment_flags_poh : + heap_segment_flags_loh; FIRE_EVENT(GCCreateSegment_V1, heap_segment_mem(res), (size_t)(heap_segment_reserved (res) - heap_segment_mem(res)), gc_etw_segment_large_object_heap); @@ -6426,7 +6454,7 @@ void gc_heap::fix_uoh_allocation_area (BOOL for_gc_p) { UNREFERENCED_PARAMETER(for_gc_p); - for(int i = uoh_start_generation; i < total_generation_count; i++) + for (int i = uoh_start_generation; i < total_generation_count; i++) { #ifdef _DEBUG alloc_context* acontext = @@ -8207,7 +8235,7 @@ void gc_heap::copy_brick_card_range (uint8_t* la, uint32_t* old_card_table, // We don't need to go through all the card tables here because // we only need to copy from the GC version of the mark array - when we - // mark (even in allocate_large_object) we always use that mark array. + // mark (even in allocate_uoh_object) we always use that mark array. if ((card_table_highest_address (old_ct) >= start) && (card_table_lowest_address (old_ct) <= end)) { @@ -10380,7 +10408,8 @@ size_t gc_heap::get_segment_size_hard_limit (uint32_t* num_heaps, bool should_ad } HRESULT gc_heap::initialize_gc (size_t soh_segment_size, - size_t loh_segment_size + size_t loh_segment_size, + size_t poh_segment_size #ifdef MULTIPLE_HEAPS ,int number_of_heaps #endif //MULTIPLE_HEAPS @@ -10500,7 +10529,7 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size, #endif //BACKGROUND_GC reserved_memory = 0; - size_t initial_heap_size = soh_segment_size + loh_segment_size; + size_t initial_heap_size = soh_segment_size + loh_segment_size + poh_segment_size; #ifdef MULTIPLE_HEAPS reserved_memory_limit = initial_heap_size * number_of_heaps; #else //MULTIPLE_HEAPS @@ -10513,7 +10542,7 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size, check_commit_cs.Initialize(); } - if (!reserve_initial_memory (soh_segment_size, loh_segment_size, number_of_heaps, use_large_pages_p)) + if (!reserve_initial_memory (soh_segment_size, loh_segment_size, poh_segment_size, number_of_heaps, use_large_pages_p)) return E_OUTOFMEMORY; #ifdef CARD_BUNDLE @@ -11179,7 +11208,7 @@ gc_heap::init_gc_heap (int h_number) #endif //!SEG_MAPPING_TABLE - // Create segments for the large generation + // Create segments for the large and pinned generations heap_segment* lseg = make_initial_segment(loh_generation, h_number); if (!lseg) return 0; @@ -11190,19 +11219,36 @@ gc_heap::init_gc_heap (int h_number) (size_t)(heap_segment_reserved (lseg) - heap_segment_mem(lseg)), gc_etw_segment_large_object_heap); + heap_segment* pseg = make_initial_segment(poh_generation, h_number); + if (!pseg) + return 0; + + pseg->flags |= heap_segment_flags_poh; + + FIRE_EVENT(GCCreateSegment_V1, heap_segment_mem(pseg), + (size_t)(heap_segment_reserved (pseg) - heap_segment_mem(pseg)), + gc_etw_segment_pinned_object_heap); + #ifdef SEG_MAPPING_TABLE seg_mapping_table_add_segment (lseg, __this); + seg_mapping_table_add_segment (pseg, __this); #else //SEG_MAPPING_TABLE seg_table->insert ((uint8_t*)lseg, sdelta); + seg_table->insert ((uint8_t*)pseg, sdelta); #endif //SEG_MAPPING_TABLE make_generation (loh_generation, lseg, heap_segment_mem (lseg), 0); + make_generation (poh_generation, pseg, heap_segment_mem (pseg), 0); heap_segment_allocated (lseg) = heap_segment_mem (lseg) + Align (min_obj_size, get_alignment_constant (FALSE)); heap_segment_used (lseg) = heap_segment_allocated (lseg) - plug_skew; + heap_segment_allocated (pseg) = heap_segment_mem (pseg) + Align (min_obj_size, get_alignment_constant (FALSE)); + heap_segment_used (pseg) = heap_segment_allocated (pseg) - plug_skew; + generation_of (max_generation)->free_list_allocator = allocator(NUM_GEN2_ALIST, BASE_GEN2_ALIST, gen2_alloc_list); generation_of (loh_generation)->free_list_allocator = allocator(NUM_LOH_ALIST, BASE_LOH_ALIST, loh_alloc_list); + generation_of (poh_generation)->free_list_allocator = allocator(NUM_POH_ALIST, BASE_POH_ALIST, poh_alloc_list); for (int gen_num = 0; gen_num < total_generation_count; gen_num++) { @@ -11212,10 +11258,12 @@ gc_heap::init_gc_heap (int h_number) #ifdef MULTIPLE_HEAPS heap_segment_heap (lseg) = this; + heap_segment_heap (pseg) = this; //initialize the alloc context heap generation_alloc_context (generation_of (soh_gen0))->set_alloc_heap(vm_heap); generation_alloc_context (generation_of (loh_generation))->set_alloc_heap(vm_heap); + generation_alloc_context (generation_of (poh_generation))->set_alloc_heap(vm_heap); #endif //MULTIPLE_HEAPS @@ -11385,6 +11433,7 @@ gc_heap::init_gc_heap (int h_number) background_uoh_alloc_count = 0; bgc_overflow_count = 0; end_loh_size = dd_min_size (dynamic_data_of (loh_generation)); + end_poh_size = dd_min_size (dynamic_data_of (poh_generation)); #endif //BACKGROUND_GC #ifdef GC_CONFIG_DRIVEN @@ -13444,6 +13493,15 @@ int gc_heap::bgc_loh_allocate_spin() return bgc_allocate_spin(min_gc_size, bgc_begin_size, bgc_size_increased, end_size); } +int gc_heap::bgc_poh_allocate_spin() +{ + size_t min_gc_size = dd_min_size (dynamic_data_of (poh_generation)); + size_t bgc_begin_size = bgc_begin_poh_size; + size_t bgc_size_increased = bgc_poh_size_increased; + size_t end_size = end_poh_size; + + return bgc_allocate_spin(min_gc_size, bgc_begin_size, bgc_size_increased, end_size); +} #endif //BACKGROUND_GC size_t gc_heap::get_uoh_seg_size (size_t size) @@ -13699,7 +13757,9 @@ allocation_state gc_heap::allocate_uoh (int gen_number, } #endif //BGC_SERVO_TUNING - int spin_for_allocation = bgc_loh_allocate_spin(); + int spin_for_allocation = (gen_number == loh_generation) ? + bgc_loh_allocate_spin() : + bgc_poh_allocate_spin(); if (spin_for_allocation >= 0) { @@ -15560,7 +15620,7 @@ int gc_heap::joined_generation_to_condemn (BOOL should_evaluate_elevation, else { dprintf (GTC_LOG, ("reducing gen in PM: %d->%d->%d", initial_gen, n, (max_generation - 1))); - gc_data_global.gen_to_condemn_reasons.set_condition(gen_joined_last_gen2_fragmented); + gc_data_global.gen_to_condemn_reasons.set_condition(gen_joined_gen1_in_pm); n = max_generation - 1; } } @@ -15601,8 +15661,11 @@ int gc_heap::joined_generation_to_condemn (BOOL should_evaluate_elevation, // If there's not much fragmentation but it looks like it'll be productive to // collect LOH, do that. size_t est_loh_reclaim = get_total_gen_estimated_reclaim (loh_generation); - gc_data_global.gen_to_condemn_reasons.set_condition(gen_joined_limit_loh_reclaim); - full_compact_gc_p = ((est_loh_reclaim * 8) >= heap_hard_limit); + if ((est_loh_reclaim * 8) >= heap_hard_limit) + { + gc_data_global.gen_to_condemn_reasons.set_condition(gen_joined_limit_loh_reclaim); + full_compact_gc_p = true; + } dprintf (GTC_LOG, ("loh est reclaim: %Id, 1/8 of limit %Id", est_loh_reclaim, (heap_hard_limit / 8))); } } @@ -16411,7 +16474,8 @@ int gc_heap::generation_to_condemn (int n_initial, for (int i = 0; i < n_heaps; i++) { if (((g_heaps[i]->current_generation_size (max_generation)) > bgc_min_per_heap) || - ((g_heaps[i]->current_generation_size (loh_generation)) > bgc_min_per_heap)) + ((g_heaps[i]->current_generation_size (loh_generation)) > bgc_min_per_heap) || + ((g_heaps[i]->current_generation_size (poh_generation)) > bgc_min_per_heap)) { bgc_heap_too_small = FALSE; break; @@ -16419,7 +16483,8 @@ int gc_heap::generation_to_condemn (int n_initial, } #else //MULTIPLE_HEAPS if ((current_generation_size (max_generation) > bgc_min_per_heap) || - (current_generation_size (loh_generation) > bgc_min_per_heap)) + (current_generation_size (loh_generation) > bgc_min_per_heap) || + (current_generation_size (poh_generation) > bgc_min_per_heap)) { bgc_heap_too_small = FALSE; } @@ -17650,6 +17715,7 @@ void gc_heap::update_collection_counts () if (i == max_generation) { dd_collection_count (dynamic_data_of (loh_generation))++; + dd_collection_count(dynamic_data_of(poh_generation))++; } dd_gc_clock (dd) = dd_gc_clock (dd0); @@ -21149,9 +21215,12 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p) #endif // MULTIPLE_HEAPS && FEATURE_CARD_MARKING_STEALING { dprintf (3, ("Marking cross generation pointers for uoh objects on heap %d", heap_number)); - for(int i = uoh_start_generation; i < total_generation_count; i++) + for (int i = uoh_start_generation; i < total_generation_count; i++) { - mark_through_cards_for_uoh_objects(mark_object_fn, i, FALSE THIS_ARG); +#ifndef ALLOW_REFERENCES_IN_POH + if (i != poh_generation) +#endif //ALLOW_REFERENCES_IN_POH + mark_through_cards_for_uoh_objects(mark_object_fn, i, FALSE THIS_ARG); } #if defined(MULTIPLE_HEAPS) && defined(FEATURE_CARD_MARKING_STEALING) @@ -21175,9 +21244,12 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p) if (!hp->card_mark_done_uoh) { dprintf(3, ("Marking cross generation pointers for large objects on heap %d", hp->heap_number)); - for(int i = uoh_start_generation; i < total_generation_count; i++) + for (int i = uoh_start_generation; i < total_generation_count; i++) { - hp->mark_through_cards_for_uoh_objects(mark_object_fn, i, FALSE THIS_ARG); +#ifndef ALLOW_REFERENCES_IN_POH + if (i != poh_generation) +#endif //ALLOW_REFERENCES_IN_POH + hp->mark_through_cards_for_uoh_objects(mark_object_fn, i, FALSE THIS_ARG); } hp->card_mark_done_uoh = true; @@ -23924,6 +23996,8 @@ void gc_heap::plan_phase (int condemned_gen_number) GCToEEInterface::DiagWalkLOHSurvivors(__this); sweep_uoh_objects (loh_generation); } + + sweep_uoh_objects (poh_generation); } else { @@ -25897,8 +25971,14 @@ void gc_heap::relocate_phase (int condemned_gen_number, if (!card_mark_done_uoh) #endif // MULTIPLE_HEAPS && FEATURE_CARD_MARKING_STEALING { - dprintf (3, ("Relocating cross generation pointers for large objects on heap %d", heap_number)); - mark_through_cards_for_uoh_objects(&gc_heap::relocate_address, loh_generation, TRUE THIS_ARG); + dprintf (3, ("Relocating cross generation pointers for uoh objects on heap %d", heap_number)); + for (int i = uoh_start_generation; i < total_generation_count; i++) + { +#ifndef ALLOW_REFERENCES_IN_POH + if (i != poh_generation) +#endif //ALLOW_REFERENCES_IN_POH + mark_through_cards_for_uoh_objects(&gc_heap::relocate_address, i, TRUE THIS_ARG); + } #if defined(MULTIPLE_HEAPS) && defined(FEATURE_CARD_MARKING_STEALING) card_mark_done_uoh = true; @@ -25918,6 +25998,10 @@ void gc_heap::relocate_phase (int condemned_gen_number, { relocate_in_uoh_objects (loh_generation); } + +#ifdef ALLOW_REFERENCES_IN_POH + relocate_in_uoh_objects (poh_generation); +#endif } #ifndef FEATURE_CARD_MARKING_STEALING // moved this code *before* we scan the older generations via mark_through_cards_xxx @@ -25961,8 +26045,14 @@ void gc_heap::relocate_phase (int condemned_gen_number, if (!hp->card_mark_done_uoh) { - dprintf(3, ("Relocating cross generation pointers for large objects on heap %d", hp->heap_number)); - hp->mark_through_cards_for_uoh_objects(&gc_heap::relocate_address, loh_generation, TRUE THIS_ARG); + dprintf(3, ("Relocating cross generation pointers for uoh objects on heap %d", hp->heap_number)); + for (int i = uoh_start_generation; i < total_generation_count; i++) + { +#ifndef ALLOW_REFERENCES_IN_POH + if (i != poh_generation) +#endif //ALLOW_REFERENCES_IN_POH + hp->mark_through_cards_for_uoh_objects(&gc_heap::relocate_address, i, TRUE THIS_ARG); + } hp->card_mark_done_uoh = true; } } @@ -27169,10 +27259,13 @@ void gc_heap::background_mark_phase () size_t total_soh_size = generation_sizes (generation_of (max_generation)); size_t total_loh_size = generation_size (loh_generation); + size_t total_poh_size = generation_size (poh_generation); bgc_begin_loh_size = total_loh_size; + bgc_begin_poh_size = total_poh_size; bgc_loh_size_increased = 0; + bgc_poh_size_increased = 0; - dprintf (GTC_LOG, ("BM: h%d: loh: %Id, soh: %Id", heap_number, total_loh_size, total_soh_size)); + dprintf (GTC_LOG, ("BM: h%d: loh: %Id, soh: %Id, poh: %Id", heap_number, total_loh_size, total_soh_size, total_poh_size)); { //concurrent_print_time_delta ("copying stack roots"); @@ -27449,8 +27542,9 @@ void gc_heap::background_mark_phase () total_soh_size = generation_sizes (generation_of (max_generation)); total_loh_size = generation_size (loh_generation); + total_poh_size = generation_size (poh_generation); - dprintf (GTC_LOG, ("FM: h%d: loh: %Id, soh: %Id", heap_number, total_loh_size, total_soh_size)); + dprintf (GTC_LOG, ("FM: h%d: loh: %Id, soh: %Id, poh: %Id", heap_number, total_loh_size, total_soh_size, total_poh_size)); dprintf (2, ("nonconcurrent marking stack roots")); GCScan::GcScanRoots(background_promote, @@ -27594,8 +27688,9 @@ void gc_heap::background_mark_phase () gen0_bricks_cleared = FALSE; - dprintf (2, ("end of bgc mark: loh: %d, soh: %d", + dprintf (2, ("end of bgc mark: loh: %d, poh: %d, soh: %d", generation_size (loh_generation), + generation_size (poh_generation), generation_sizes (generation_of (max_generation)))); for (int gen_idx = max_generation; gen_idx < total_generation_count; gen_idx++) @@ -27906,7 +28001,7 @@ void gc_heap::revisit_written_pages (BOOL concurrent_p, BOOL reset_only_p) bool reset_watch_state = !!concurrent_p; bool is_runtime_suspended = !concurrent_p; BOOL small_object_segments = TRUE; - for(int i = max_generation; i < total_generation_count; i++) + for (int i = max_generation; i < total_generation_count; i++) { heap_segment* seg = heap_segment_rw (generation_start_segment (generation_of (i))); PREFIX_ASSUME(seg != NULL); @@ -32801,6 +32896,10 @@ void gc_heap::compute_new_dynamic_data (int gen_number) #ifdef BACKGROUND_GC if (i == loh_generation) end_loh_size = total_gen_size; + + if (i == poh_generation) + end_poh_size = total_gen_size; + #endif //BACKGROUND_GC //update counter dd_promoted_size (dd) = out; @@ -33373,7 +33472,7 @@ BOOL gc_heap::ephemeral_gen_fit_p (gc_tuning_point tp) } } -CObjectHeader* gc_heap::allocate_large_object (size_t jsize, uint32_t flags, int64_t& alloc_bytes) +CObjectHeader* gc_heap::allocate_uoh_object (size_t jsize, uint32_t flags, int gen_number, int64_t& alloc_bytes) { //create a new alloc context because gen3context is shared. alloc_context acontext; @@ -33396,17 +33495,19 @@ CObjectHeader* gc_heap::allocate_large_object (size_t jsize, uint32_t flags, int size_t size = AlignQword (jsize); int align_const = get_alignment_constant (FALSE); -#ifdef FEATURE_LOH_COMPACTION - size_t pad = Align (loh_padding_obj_size, align_const); -#else size_t pad = 0; +#ifdef FEATURE_LOH_COMPACTION + if (gen_number == loh_generation) + { + pad = Align (loh_padding_obj_size, align_const); + } #endif //FEATURE_LOH_COMPACTION assert (size >= Align (min_obj_size, align_const)); #ifdef _MSC_VER #pragma inline_depth(0) #endif //_MSC_VER - if (! allocate_more_space (&acontext, (size + pad), flags, loh_generation)) + if (! allocate_more_space (&acontext, (size + pad), flags, gen_number)) { return 0; } @@ -33450,8 +33551,6 @@ CObjectHeader* gc_heap::allocate_large_object (size_t jsize, uint32_t flags, int mark_array_clear_marked (result); } #ifdef BACKGROUND_GC - //the object has to cover one full mark uint32_t - assert (size >= mark_word_size); if (current_c_gc_state != c_gc_state_free) { dprintf (3, ("Concurrent allocation of a large object %Ix", @@ -34298,8 +34397,9 @@ void gc_heap::background_sweep() size_t total_soh_size = generation_sizes (generation_of (max_generation)); size_t total_loh_size = generation_size (loh_generation); + size_t total_poh_size = generation_size (poh_generation); - dprintf (GTC_LOG, ("loh: %Id, soh: %Id", heap_number, total_loh_size, total_soh_size)); + dprintf (GTC_LOG, ("h%d: S: poh: %Id, loh: %Id, soh: %Id", heap_number, total_poh_size, total_loh_size, total_soh_size)); dprintf (GTC_LOG, ("end of bgc sweep: gen2 FL: %Id, FO: %Id", generation_free_list_space (generation_of (max_generation)), @@ -34310,6 +34410,11 @@ void gc_heap::background_sweep() generation_free_list_space (generation_of (loh_generation)), generation_free_obj_space (generation_of (loh_generation)))); + dprintf (GTC_LOG, ("h%d: end of bgc sweep: poh FL: %Id, FO: %Id", + heap_number, + generation_free_list_space (generation_of (poh_generation)), + generation_free_obj_space (generation_of (poh_generation)))); + FIRE_EVENT(BGC2ndConEnd); concurrent_print_time_delta ("background sweep"); @@ -34559,7 +34664,9 @@ void gc_heap::mark_through_cards_for_uoh_objects (card_fn fn, size_t total_cards_cleared = 0; #ifdef FEATURE_CARD_MARKING_STEALING - VOLATILE(uint32_t)* chunk_index = (VOLATILE(uint32_t)*) & card_mark_chunk_index_loh; + VOLATILE(uint32_t)* chunk_index = (VOLATILE(uint32_t)*) &(gen_num == loh_generation ? + card_mark_chunk_index_loh : + card_mark_chunk_index_poh); card_marking_enumerator card_mark_enumerator(seg, low, chunk_index); card_word_end = 0; @@ -35454,7 +35561,7 @@ void gc_heap::verify_partial () BOOL bad_ref_p = FALSE; BOOL free_ref_p = FALSE; - for(int i = max_generation; i < total_generation_count; i++) + for (int i = max_generation; i < total_generation_count; i++) { generation* gen = generation_of (i); int align_const = get_alignment_constant (i == max_generation); @@ -36353,9 +36460,11 @@ HRESULT GCHeap::Initialize() #ifdef MULTIPLE_HEAPS gc_heap::n_heaps = nhp; - hr = gc_heap::initialize_gc (seg_size, large_seg_size /*loh_segment_size*/, nhp); + // TODO: tuning https://github.com/dotnet/runtime/issues/13739 + hr = gc_heap::initialize_gc (seg_size, large_seg_size /*loh_segment_size*/, large_seg_size /*poh_segment_size*/, nhp); #else - hr = gc_heap::initialize_gc (seg_size, large_seg_size /*loh_segment_size*/); + // TODO: tuning https://github.com/dotnet/runtime/issues/13739 + hr = gc_heap::initialize_gc (seg_size, large_seg_size /*loh_segment_size*/, large_seg_size /*poh_segment_size*/); #endif //MULTIPLE_HEAPS if (hr != S_OK) @@ -36414,7 +36523,7 @@ HRESULT GCHeap::Initialize() #ifndef FEATURE_REDHAWK // Redhawk forces relocation a different way #if defined (STRESS_HEAP) && !defined (MULTIPLE_HEAPS) if (GCStress::IsEnabled()) { - for(int i = 0; i < GCHeap::NUM_HEAP_STRESS_OBJS; i++) + for (int i = 0; i < GCHeap::NUM_HEAP_STRESS_OBJS; i++) { m_StressObjs[i] = CreateGlobalHandle(0); } @@ -37160,7 +37269,7 @@ GCHeap::AllocAlign8Common(void* _hp, alloc_context* acontext, size_t size, uint3 alloc_context* acontext = generation_alloc_context (hp->generation_of (loh_generation)); - newAlloc = (Object*) hp->allocate_large_object (size, flags, acontext->alloc_bytes_uoh); + newAlloc = (Object*) hp->allocate_uoh_object (size, flags, loh_generation, acontext->alloc_bytes_uoh); ASSERT(((size_t)newAlloc & 7) == 0); } @@ -37205,7 +37314,7 @@ GCHeap::AllocLHeap( size_t size, uint32_t flags REQD_ALIGN_DCL) #endif //MULTIPLE_HEAPS alloc_context* acontext = generation_alloc_context (hp->generation_of (loh_generation)); - newAlloc = (Object*) hp->allocate_large_object (size + ComputeMaxStructAlignPadLarge(requiredAlignment), flags, acontext->alloc_bytes_uoh); + newAlloc = (Object*) hp->allocate_uoh_object (size + ComputeMaxStructAlignPadLarge(requiredAlignment), flags, loh_generation, acontext->alloc_bytes_uoh); #ifdef FEATURE_STRUCTALIGN newAlloc = (Object*) hp->pad_for_alignment_large ((uint8_t*) newAlloc, requiredAlignment, size); @@ -37261,7 +37370,7 @@ GCHeap::Alloc(gc_alloc_context* context, size_t size, uint32_t flags REQD_ALIGN_ } else { - newAlloc = (Object*) hp->allocate_large_object (size + ComputeMaxStructAlignPadLarge(requiredAlignment), flags, acontext->alloc_bytes_uoh); + newAlloc = (Object*) hp->allocate_uoh_object (size + ComputeMaxStructAlignPadLarge(requiredAlignment), flags, loh_generation, acontext->alloc_bytes_uoh); #ifdef FEATURE_STRUCTALIGN newAlloc = (Object*) hp->pad_for_alignment_large ((uint8_t*) newAlloc, requiredAlignment, size); #endif // FEATURE_STRUCTALIGN diff --git a/src/coreclr/src/gc/gc.h b/src/coreclr/src/gc/gc.h index 2ac171028da1aa..51bb27007e4f4e 100644 --- a/src/coreclr/src/gc/gc.h +++ b/src/coreclr/src/gc/gc.h @@ -89,7 +89,8 @@ enum gc_etw_segment_type { gc_etw_segment_small_object_heap = 0, gc_etw_segment_large_object_heap = 1, - gc_etw_segment_read_only_heap = 2 + gc_etw_segment_read_only_heap = 2, + gc_etw_segment_pinned_object_heap = 3 }; // Types of allocations, emitted by the GCAllocationTick ETW event. @@ -119,13 +120,16 @@ enum gc_generation_num // large object heap, technically not a generation, but it is convenient to represent it as such loh_generation = 3, + // pinned heap, a separate generation for the same reasons as loh + poh_generation = 4, + uoh_start_generation = loh_generation, // number of ephemeral generations ephemeral_generation_count = max_generation, // number of all generations - total_generation_count = loh_generation + 1 + total_generation_count = poh_generation + 1 }; #ifdef GC_CONFIG_DRIVEN diff --git a/src/coreclr/src/gc/gcpriv.h b/src/coreclr/src/gc/gcpriv.h index 952eb83c695a83..4801a19f1d487f 100644 --- a/src/coreclr/src/gc/gcpriv.h +++ b/src/coreclr/src/gc/gcpriv.h @@ -106,6 +106,8 @@ inline void FATAL_GC_ERROR() #define CARD_BUNDLE //enable card bundle feature.(requires WRITE_WATCH) +#define ALLOW_REFERENCES_IN_POH //Allow POH objects to contain references. + // If this is defined we use a map for segments in order to find the heap for // a segment fast. But it does use more memory as we have to cover the whole // heap range and for each entry we allocate a struct of 5 ptr-size words @@ -1227,7 +1229,8 @@ class gc_heap static HRESULT initialize_gc (size_t soh_segment_size, - size_t loh_segment_size + size_t loh_segment_size, + size_t poh_segment_size #ifdef MULTIPLE_HEAPS , int number_of_heaps #endif //MULTIPLE_HEAPS @@ -1269,13 +1272,13 @@ class gc_heap void gc_thread_stub (void* arg); #endif //MULTIPLE_HEAPS - // For LOH allocations we only update the alloc_bytes_uoh in allocation + // For UOH allocations we only update the alloc_bytes_uoh in allocation // context - we don't actually use the ptr/limit from it so I am // making this explicit by not passing in the alloc_context. - // Note: This is an instance method, but the heap instance is only used for + // Note: This are instance methods, but the heap instance is only used for // lowest_address and highest_address, which are currently the same accross all heaps. PER_HEAP - CObjectHeader* allocate_large_object (size_t size, uint32_t flags, int64_t& alloc_bytes); + CObjectHeader* allocate_uoh_object (size_t size, uint32_t flags, int gen_num, int64_t& alloc_bytes); #ifdef FEATURE_STRUCTALIGN PER_HEAP @@ -1541,6 +1544,9 @@ class gc_heap PER_HEAP BOOL bgc_loh_allocate_spin(); + + PER_HEAP + BOOL bgc_poh_allocate_spin(); #endif //BACKGROUND_GC #define max_saved_spinlock_info 48 @@ -3724,7 +3730,11 @@ class gc_heap PER_HEAP size_t bgc_begin_loh_size; PER_HEAP + size_t bgc_begin_poh_size; + PER_HEAP size_t end_loh_size; + PER_HEAP + size_t end_poh_size; #ifdef BGC_SERVO_TUNING PER_HEAP @@ -3758,6 +3768,8 @@ class gc_heap // in free list doesn't increase the heap size. PER_HEAP size_t bgc_loh_size_increased; + PER_HEAP + size_t bgc_poh_size_increased; PER_HEAP size_t background_soh_alloc_count; @@ -3895,6 +3907,7 @@ class gc_heap #define youngest_generation (generation_of (0)) #define large_object_generation (generation_of (loh_generation)) +#define pinned_object_generation (generation_of (poh_generation)) // The more_space_lock and gc_lock is used for 3 purposes: // @@ -3982,6 +3995,16 @@ class gc_heap PER_HEAP alloc_list gen2_alloc_list[NUM_GEN2_ALIST-1]; +// TODO: tuning https://github.com/dotnet/runtime/issues/13739 +#define NUM_POH_ALIST (12) +#ifdef BIT64 +#define BASE_POH_ALIST (1*256) +#else +#define BASE_POH_ALIST (1*128) +#endif // BIT64 + PER_HEAP + alloc_list poh_alloc_list[NUM_POH_ALIST-1]; + //------------------------------------------ PER_HEAP @@ -4271,6 +4294,9 @@ class gc_heap PER_HEAP VOLATILE(uint32_t) card_mark_chunk_index_loh; + PER_HEAP + VOLATILE(uint32_t) card_mark_chunk_index_poh; + PER_HEAP VOLATILE(bool) card_mark_done_uoh; @@ -4282,6 +4308,7 @@ class gc_heap card_mark_done_soh = false; card_mark_chunk_index_loh = ~0; + card_mark_chunk_index_poh = ~0; card_mark_done_uoh = false; } @@ -4772,6 +4799,7 @@ struct loh_padding_obj #define heap_segment_flags_ma_pcommitted 128 #define heap_segment_flags_uoh_delete 256 +#define heap_segment_flags_poh 512 #endif //BACKGROUND_GC //need to be careful to keep enough pad items to fit a relocation node @@ -4860,7 +4888,7 @@ BOOL heap_segment_unmappable_p (heap_segment* inst) inline BOOL heap_segment_uoh_p (heap_segment * inst) { - return !!(inst->flags & heap_segment_flags_loh); + return !!(inst->flags & (heap_segment_flags_loh | heap_segment_flags_poh)); } #ifdef BACKGROUND_GC diff --git a/src/coreclr/src/gc/gcrecord.h b/src/coreclr/src/gc/gcrecord.h index 8b50708e59192d..7e623052f12c9e 100644 --- a/src/coreclr/src/gc/gcrecord.h +++ b/src/coreclr/src/gc/gcrecord.h @@ -61,19 +61,19 @@ enum gc_condemn_reason_condition gen_induced_noforce_p = 14, gen_before_bgc = 15, gen_almost_max_alloc = 16, - gen_joined_avoid_unproductive = 17, /* This happens when the GC detects previous attempts to do a full compacting GC is not making progress and therefore reduce its generation */ - gen_joined_pm_induced_fullgc_p = 18, /* This happens when a full gc is induced under provisional mode */ - gen_joined_pm_alloc_loh = 19, /* This happens when a large object heap allocation is requested under provisional mode */ - gen_joined_last_gen2_fragmented = 20, /* This happens when we had a high memory and high fragmentation detected after the last full blocking GC, indicating we have lot of pinned objects in gen 2, so reducing its generation */ - gen_joined_limit_before_oom = 21, /* This happens when the last gc was oom */ - gen_joined_limit_loh_frag = 22, /* This happens when we had a heap limit and the fragmentation is reaching 1/8 of it */ - gen_joined_limit_loh_reclaim = 23, /* This happens when we had a heap limit and we could reclaim 1/8 of it */ - gen_joined_servo_initial = 24, /* This happen when the servo tuning is trying to get some initial data */ - gen_joined_servo_ngc = 25, /* This happen when the servo tuning decides a background gc is appropriate */ - gen_joined_servo_bgc = 26, /* This happen when the servo tuning decides a background gc is appropriate */ - gen_joined_servo_postpone = 27, /* This happen when the servo tuning decides a gen2 gc should be postponed */ - gen_joined_stress_mix = 28, /* This happen in GCStress mix mode, every 10th GC is gen2 */ - gen_joined_stress = 29, /* This happen in GCStress, every GC is gen2 */ + gen_joined_avoid_unproductive = 17, + gen_joined_pm_induced_fullgc_p = 18, + gen_joined_pm_alloc_loh = 19, + gen_joined_gen1_in_pm = 20, + gen_joined_limit_before_oom = 21, + gen_joined_limit_loh_frag = 22, + gen_joined_limit_loh_reclaim = 23, + gen_joined_servo_initial = 24, + gen_joined_servo_ngc = 25, + gen_joined_servo_bgc = 26, + gen_joined_servo_postpone = 27, + gen_joined_stress_mix = 28, + gen_joined_stress = 29, gcrc_max = 30 }; diff --git a/src/coreclr/src/gc/sample/GCSample.vcxproj b/src/coreclr/src/gc/sample/GCSample.vcxproj index 74c48d85e18510..6e33738d18d0dd 100644 --- a/src/coreclr/src/gc/sample/GCSample.vcxproj +++ b/src/coreclr/src/gc/sample/GCSample.vcxproj @@ -1,4 +1,4 @@ - + diff --git a/src/coreclr/src/gc/sample/GCSample.vcxproj.filters b/src/coreclr/src/gc/sample/GCSample.vcxproj.filters index b5647b3fcb4df2..9fac162f4ac83e 100644 --- a/src/coreclr/src/gc/sample/GCSample.vcxproj.filters +++ b/src/coreclr/src/gc/sample/GCSample.vcxproj.filters @@ -1,4 +1,4 @@ - + diff --git a/src/coreclr/src/gc/unix/gcenv.unix.cpp b/src/coreclr/src/gc/unix/gcenv.unix.cpp index 9f6e2c31d485ad..f32308c90106c8 100644 --- a/src/coreclr/src/gc/unix/gcenv.unix.cpp +++ b/src/coreclr/src/gc/unix/gcenv.unix.cpp @@ -478,6 +478,7 @@ uint32_t GCToOSInterface::GetCurrentProcessorNumber() assert(processorNumber != -1); return processorNumber; #else + assert(false); // This method is expected to be called only if CanGetCurrentProcessorNumber is true return 0; #endif } diff --git a/src/coreclr/src/hosts/CMakeLists.txt b/src/coreclr/src/hosts/CMakeLists.txt index fed5a0f81c0a58..c3a6875feb6e86 100644 --- a/src/coreclr/src/hosts/CMakeLists.txt +++ b/src/coreclr/src/hosts/CMakeLists.txt @@ -1,14 +1,14 @@ include_directories(inc) -if(CLR_CMAKE_TARGET_WIN32) +if(CLR_CMAKE_HOST_WIN32) add_subdirectory(corerun) add_subdirectory(coreconsole) add_subdirectory(coreshim) -else(CLR_CMAKE_TARGET_WIN32) +else(CLR_CMAKE_HOST_WIN32) add_subdirectory(unixcoreruncommon) add_subdirectory(unixcorerun) add_subdirectory(unixcoreconsole) if(CLR_CMAKE_HOST_DARWIN) add_subdirectory(osxbundlerun) endif(CLR_CMAKE_HOST_DARWIN) -endif(CLR_CMAKE_TARGET_WIN32) +endif(CLR_CMAKE_HOST_WIN32) diff --git a/src/coreclr/src/hosts/corerun/corerun.cpp b/src/coreclr/src/hosts/corerun/corerun.cpp index 6f175b567935a1..da62b217adee72 100644 --- a/src/coreclr/src/hosts/corerun/corerun.cpp +++ b/src/coreclr/src/hosts/corerun/corerun.cpp @@ -582,18 +582,6 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo return false; } - StackSString tpaList; - if (!managedAssemblyFullName.IsEmpty()) - { - // Target assembly should be added to the tpa list. Otherwise corerun.exe - // may find wrong assembly to execute. - // Details can be found at https://github.com/dotnet/coreclr/issues/5631 - tpaList = managedAssemblyFullName; - tpaList.Append(W(';')); - } - - tpaList.Append(hostEnvironment.GetTpaList()); - //------------------------------------------------------------- // Create an AppDomain @@ -623,7 +611,7 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo }; const wchar_t *property_values[] = { // TRUSTED_PLATFORM_ASSEMBLIES - tpaList, + hostEnvironment.GetTpaList(), // APP_PATHS appPath, // APP_NI_PATHS diff --git a/src/coreclr/src/hosts/coreshim/CoreShim.cpp b/src/coreclr/src/hosts/coreshim/CoreShim.cpp index 238e40fb87d2dd..44ff77e4cab638 100644 --- a/src/coreclr/src/hosts/coreshim/CoreShim.cpp +++ b/src/coreclr/src/hosts/coreshim/CoreShim.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/hosts/unixcoreruncommon/coreruncommon.cpp b/src/coreclr/src/hosts/unixcoreruncommon/coreruncommon.cpp index dd50a5dc4ac4dd..a2c00b1c3b4ab4 100644 --- a/src/coreclr/src/hosts/unixcoreruncommon/coreruncommon.cpp +++ b/src/coreclr/src/hosts/unixcoreruncommon/coreruncommon.cpp @@ -350,15 +350,6 @@ int ExecuteManagedAssembly( GetDirectory(managedAssemblyAbsolutePath, appPath); std::string tpaList; - if (strlen(managedAssemblyAbsolutePath) > 0) - { - // Target assembly should be added to the tpa list. Otherwise corerun.exe - // may find wrong assembly to execute. - // Details can be found at https://github.com/dotnet/coreclr/issues/5631 - tpaList = managedAssemblyAbsolutePath; - tpaList.append(":"); - } - // Construct native search directory paths std::string nativeDllSearchDirs(appPath); char *coreLibraries = getenv("CORE_LIBRARIES"); @@ -371,7 +362,6 @@ int ExecuteManagedAssembly( AddFilesFromDirectoryToTpaList(coreLibraries, tpaList); } } - nativeDllSearchDirs.append(":"); nativeDllSearchDirs.append(clrFilesAbsolutePath); diff --git a/src/coreclr/src/inc/clrconfigvalues.h b/src/coreclr/src/inc/clrconfigvalues.h index 2e2474fa766322..1527ffe87008ad 100644 --- a/src/coreclr/src/inc/clrconfigvalues.h +++ b/src/coreclr/src/inc/clrconfigvalues.h @@ -717,7 +717,7 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeProcNumbers, W("EventPipeProcNumbers" // // Diagnostics Server // -RETAIL_CONFIG_STRING_INFO(EXTERNAL_DiagnosticsServerTransportPath, W("DiagnosticsServerTransportPath"), "The full path including filename for the OS transport (NamedPipe on Windows; Unix Domain Socket on Linux) to be used by the Diagnostics Server"); +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_DiagnosticsServerAddress, W("DOTNET_DiagnosticsServerAddress"), "The full path including filename for the OS transport (NamedPipe on Windows; Unix Domain Socket on Linux) to be used by the Diagnostics Server", CLRConfig::DontPrependCOMPlus_); // // LTTng diff --git a/src/coreclr/src/inc/clrnt.h b/src/coreclr/src/inc/clrnt.h index de596918ca6ff6..078299ee9938f6 100644 --- a/src/coreclr/src/inc/clrnt.h +++ b/src/coreclr/src/inc/clrnt.h @@ -945,7 +945,7 @@ RtlUnwindEx ( __in_opt PEXCEPTION_RECORD ExceptionRecord, __in PVOID ReturnValue, __in PT_CONTEXT ContextRecord, - __in_opt PUNWIND_HISTORY_TABLE HistoryTable + __in_opt PVOID HistoryTable ); EXTERN_C @@ -956,7 +956,7 @@ RtlVirtualUnwind ( __in DWORD HandlerType, __in DWORD ImageBase, __in DWORD ControlPc, - __in PRUNTIME_FUNCTION FunctionEntry, + __in PT_RUNTIME_FUNCTION FunctionEntry, __inout PT_CONTEXT ContextRecord, __out PVOID *HandlerData, __out PDWORD EstablisherFrame, diff --git a/src/coreclr/src/inc/corinfo.h b/src/coreclr/src/inc/corinfo.h index bf5d8b8ed1e622..ca7cdabf45d4fd 100644 --- a/src/coreclr/src/inc/corinfo.h +++ b/src/coreclr/src/inc/corinfo.h @@ -217,11 +217,11 @@ TODO: Talk about initializing strutures before use #endif #endif -SELECTANY const GUID JITEEVersionIdentifier = { /* abcf830c-56d1-4b33-a8ec-5063bb5495f1 */ - 0xabcf830c, - 0x56d1, - 0x4b33, - {0xa8, 0xec, 0x50, 0x63, 0xbb, 0x54, 0x95, 0xf1} +SELECTANY const GUID JITEEVersionIdentifier = { /* 96fc0c0a-9f77-450d-9663-ee33ae0fcae8 */ + 0x96fc0c0a, + 0x9f77, + 0x450d, + {0x96, 0x63, 0xee, 0x33, 0xae, 0x0f, 0xca, 0xe8} }; ////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -2293,6 +2293,14 @@ class ICorStaticInfo unsigned metaTOK /* IN */ ) = 0; + // Returns string length and content (can be null for dynamic context) + // for given metaTOK and module, length `-1` means input is incorrect + virtual LPCWSTR getStringLiteral ( + CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ) = 0; + virtual BOOL shouldEnforceCallvirtRestriction( CORINFO_MODULE_HANDLE scope ) = 0; diff --git a/src/coreclr/src/inc/corjit.h b/src/coreclr/src/inc/corjit.h index 2e0a42c95d41a3..190d911f4d54fb 100644 --- a/src/coreclr/src/inc/corjit.h +++ b/src/coreclr/src/inc/corjit.h @@ -179,6 +179,8 @@ enum CorJitAllocMemFlag CORJIT_ALLOCMEM_DEFAULT_CODE_ALIGN = 0x00000000, // The code will be use the normal alignment CORJIT_ALLOCMEM_FLG_16BYTE_ALIGN = 0x00000001, // The code will be 16-byte aligned CORJIT_ALLOCMEM_FLG_RODATA_16BYTE_ALIGN = 0x00000002, // The read-only data will be 16-byte aligned + CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN = 0x00000004, // The code will be 32-byte aligned + CORJIT_ALLOCMEM_FLG_RODATA_32BYTE_ALIGN = 0x00000008, // The read-only data will be 32-byte aligned }; inline CorJitAllocMemFlag operator |(CorJitAllocMemFlag a, CorJitAllocMemFlag b) diff --git a/src/coreclr/src/inc/crosscomp.h b/src/coreclr/src/inc/crosscomp.h index 9d3a29e6cb3a4e..f05c3d32ca670b 100644 --- a/src/coreclr/src/inc/crosscomp.h +++ b/src/coreclr/src/inc/crosscomp.h @@ -18,7 +18,7 @@ #define MAKE_TARGET_DLLNAME_W(name) name W(".dll") #define MAKE_TARGET_DLLNAME_A(name) name ".dll" #else // TARGET_WINDOWS -#ifdef TARGET_OSX +#ifdef TARGET_DARWIN #define MAKE_TARGET_DLLNAME_W(name) W("lib") name W(".dylib") #define MAKE_TARGET_DLLNAME_A(name) "lib" name ".dylib" #else @@ -113,37 +113,15 @@ typedef struct DECLSPEC_ALIGN(8) _T_CONTEXT { // each frame function. // -#ifndef TARGET_UNIX -#ifdef HOST_X86 -typedef struct _RUNTIME_FUNCTION { +#if defined(HOST_WINDOWS) +typedef struct _T_RUNTIME_FUNCTION { DWORD BeginAddress; DWORD UnwindData; -} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION; - -// -// Define unwind history table structure. -// - -#define UNWIND_HISTORY_TABLE_SIZE 12 - -typedef struct _UNWIND_HISTORY_TABLE_ENTRY { - DWORD ImageBase; - PRUNTIME_FUNCTION FunctionEntry; -} UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY; - -typedef struct _UNWIND_HISTORY_TABLE { - DWORD Count; - BYTE LocalHint; - BYTE GlobalHint; - BYTE Search; - BYTE Once; - DWORD LowAddress; - DWORD HighAddress; - UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE]; -} UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE; -#endif // HOST_X86 -#endif // !TARGET_UNIX - +} T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION; +#else // HOST_WINDOWS +#define T_RUNTIME_FUNCTION RUNTIME_FUNCTION +#define PT_RUNTIME_FUNCTION PRUNTIME_FUNCTION +#endif // HOST_WINDOWS // // Nonvolatile context pointer record. @@ -177,7 +155,7 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS { // typedef -PRUNTIME_FUNCTION +PT_RUNTIME_FUNCTION (*PGET_RUNTIME_FUNCTION_CALLBACK) ( IN DWORD64 ControlPc, IN PVOID Context @@ -186,27 +164,18 @@ PRUNTIME_FUNCTION typedef struct _T_DISPATCHER_CONTEXT { ULONG ControlPc; ULONG ImageBase; - PRUNTIME_FUNCTION FunctionEntry; + PT_RUNTIME_FUNCTION FunctionEntry; ULONG EstablisherFrame; ULONG TargetPc; PT_CONTEXT ContextRecord; PEXCEPTION_ROUTINE LanguageHandler; PVOID HandlerData; - PUNWIND_HISTORY_TABLE HistoryTable; + PVOID HistoryTable; ULONG ScopeIndex; BOOLEAN ControlPcIsUnwound; PUCHAR NonVolatileRegisters; } T_DISPATCHER_CONTEXT, *PT_DISPATCHER_CONTEXT; -#if defined(TARGET_UNIX) || defined(HOST_X86) -#define T_RUNTIME_FUNCTION RUNTIME_FUNCTION -#define PT_RUNTIME_FUNCTION PRUNTIME_FUNCTION -#else -typedef struct _T_RUNTIME_FUNCTION { - DWORD BeginAddress; - DWORD UnwindData; -} T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION; -#endif #elif defined(HOST_AMD64) && defined(TARGET_ARM64) // Host amd64 managing ARM64 related code @@ -339,7 +308,7 @@ typedef struct _T_DISPATCHER_CONTEXT { PCONTEXT ContextRecord; PEXCEPTION_ROUTINE LanguageHandler; PVOID HandlerData; - PUNWIND_HISTORY_TABLE HistoryTable; + PVOID HistoryTable; DWORD ScopeIndex; BOOLEAN ControlPcIsUnwound; PBYTE NonVolatileRegisters; @@ -393,6 +362,62 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS { #endif +#if defined(DAC_COMPILE) && defined(TARGET_UNIX) +// This is a TARGET oriented copy of CRITICAL_SECTION and PAL_CS_NATIVE_DATA_SIZE +// It is configured based on TARGET configuration rather than HOST configuration +// There is validation code in src/coreclr/src/vm/crst.cpp to keep these from +// getting out of sync + +#define T_CRITICAL_SECTION_VALIDATION_MESSAGE "T_CRITICAL_SECTION validation failed. It is not in sync with CRITICAL_SECTION" + +#if defined(TARGET_DARWIN) && defined(TARGET_X86) +#define DAC_CS_NATIVE_DATA_SIZE 76 +#elif defined(TARGET_DARWIN) && defined(TARGET_AMD64) +#define DAC_CS_NATIVE_DATA_SIZE 120 +#elif defined(TARGET_FREEBSD) && defined(TARGET_X86) +#define DAC_CS_NATIVE_DATA_SIZE 12 +#elif defined(TARGET_FREEBSD) && defined(TARGET_AMD64) +#define DAC_CS_NATIVE_DATA_SIZE 24 +#elif defined(TARGET_LINUX) && defined(TARGET_ARM) +#define DAC_CS_NATIVE_DATA_SIZE 80 +#elif defined(TARGET_LINUX) && defined(TARGET_ARM64) +#define DAC_CS_NATIVE_DATA_SIZE 116 +#elif defined(TARGET_LINUX) && defined(TARGET_X86) +#define DAC_CS_NATIVE_DATA_SIZE 76 +#elif defined(TARGET_LINUX) && defined(TARGET_AMD64) +#define DAC_CS_NATIVE_DATA_SIZE 96 +#elif defined(TARGET_NETBSD) && defined(TARGET_AMD64) +#define DAC_CS_NATIVE_DATA_SIZE 96 +#elif defined(TARGET_NETBSD) && defined(TARGET_ARM) +#define DAC_CS_NATIVE_DATA_SIZE 56 +#elif defined(TARGET_NETBSD) && defined(TARGET_X86) +#define DAC_CS_NATIVE_DATA_SIZE 56 +#else +#warning +#error DAC_CS_NATIVE_DATA_SIZE is not defined for this architecture +#endif + +struct T_CRITICAL_SECTION { + PVOID DebugInfo; + LONG LockCount; + LONG RecursionCount; + HANDLE OwningThread; + ULONG_PTR SpinCount; + +#ifdef PAL_TRACK_CRITICAL_SECTIONS_DATA + BOOL bInternal; +#endif // PAL_TRACK_CRITICAL_SECTIONS_DATA + volatile DWORD dwInitState; + + union CSNativeDataStorage + { + BYTE rgNativeDataStorage[DAC_CS_NATIVE_DATA_SIZE]; + PVOID pvAlign; // make sure the storage is machine-pointer-size aligned + } csnds; +}; +#else +#define T_CRITICAL_SECTION CRITICAL_SECTION +#endif #ifdef CROSSGEN_COMPILE void CrossGenNotSupported(const char * message); diff --git a/src/coreclr/src/inc/debugmacros.h b/src/coreclr/src/inc/debugmacros.h index 14cba426f148a5..4fb4fb86711e70 100644 --- a/src/coreclr/src/inc/debugmacros.h +++ b/src/coreclr/src/inc/debugmacros.h @@ -201,7 +201,7 @@ do { hr = (EXPR); if(hr != ERROR_SUCCESS) { hr = HRESULT_FROM_WIN32(hr); goto LA #define _ASSERT _ASSERTE -#if defined(_DEBUG) && !defined(TARGET_UNIX) +#if defined(_DEBUG) && defined(HOST_WINDOWS) // This function returns the EXE time stamp (effectively a random number) // Under retail it always returns 0. This is meant to be used in the diff --git a/src/coreclr/src/inc/ex.h b/src/coreclr/src/inc/ex.h index 548fa2200dcc38..21ce9d3d4b0ec7 100644 --- a/src/coreclr/src/inc/ex.h +++ b/src/coreclr/src/inc/ex.h @@ -6,15 +6,15 @@ #if !defined(_EX_H_) #define _EX_H_ -#ifdef TARGET_UNIX +#ifdef HOST_UNIX #define EX_TRY_HOLDER \ HardwareExceptionHolder \ NativeExceptionHolderCatchAll __exceptionHolder; \ __exceptionHolder.Push(); \ -#else // TARGET_UNIX +#else // HOST_UNIX #define EX_TRY_HOLDER -#endif // TARGET_UNIX +#endif // HOST_UNIX #include "sstring.h" #include "crtwrap.h" @@ -112,7 +112,7 @@ void GenerateTopLevelHRExceptionMessage(HRESULT hresult, SString &result); // We save current ExceptionPointers using VectoredExceptionHandler. The save data is only valid // duing exception handling. GetCurrentExceptionPointers returns the saved data. // --------------------------------------------------------------------------- -void GetCurrentExceptionPointers(PEXCEPTION_POINTERS pExceptionInfo); +void GetCurrentExceptionPointers(PEXCEPTION_POINTERS pExceptionInfo DEBUG_ARG(bool checkExceptionRecordLocation)); // --------------------------------------------------------------------------- // We save current ExceptionPointers using VectoredExceptionHandler. The save data is only valid diff --git a/src/coreclr/src/inc/holder.h b/src/coreclr/src/inc/holder.h index 4ac41827172333..1d34f2b091f3e8 100644 --- a/src/coreclr/src/inc/holder.h +++ b/src/coreclr/src/inc/holder.h @@ -1175,10 +1175,10 @@ FORCEINLINE void CounterDecrease(RAW_KEYWORD(volatile) LONG* p) {InterlockedDecr typedef Wrapper> CounterHolder; -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS FORCEINLINE void RegKeyRelease(HKEY k) {RegCloseKey(k);}; typedef Wrapper RegKeyHolder; -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS class ErrorModeHolder { @@ -1189,7 +1189,7 @@ class ErrorModeHolder UINT OldMode() {return m_oldMode;}; }; -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS //----------------------------------------------------------------------------- // HKEYHolder : HKEY holder, Calls RegCloseKey on scope exit. // @@ -1244,7 +1244,7 @@ class HKEYHolder private: HKEY m_value; }; -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS //---------------------------------------------------------------------------- // diff --git a/src/coreclr/src/inc/jithelpers.h b/src/coreclr/src/inc/jithelpers.h index 73b5d2b54cf070..feeb880ac8a048 100644 --- a/src/coreclr/src/inc/jithelpers.h +++ b/src/coreclr/src/inc/jithelpers.h @@ -104,7 +104,7 @@ DYNAMICJITHELPER(CORINFO_HELP_BOX, JIT_Box, CORINFO_HELP_SIG_REG_ONLY) JITHELPER(CORINFO_HELP_BOX_NULLABLE, JIT_Box, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_UNBOX, JIT_Unbox, CORINFO_HELP_SIG_REG_ONLY) + DYNAMICJITHELPER(CORINFO_HELP_UNBOX, NULL, CORINFO_HELP_SIG_REG_ONLY) JITHELPER(CORINFO_HELP_UNBOX_NULLABLE, JIT_Unbox_Nullable, CORINFO_HELP_SIG_4_STACK) JITHELPER(CORINFO_HELP_GETREFANY, JIT_GetRefAny, CORINFO_HELP_SIG_8_STACK) diff --git a/src/coreclr/src/inc/palclr.h b/src/coreclr/src/inc/palclr.h index 1fcd9513d2b9f4..5978ea167642a9 100644 --- a/src/coreclr/src/inc/palclr.h +++ b/src/coreclr/src/inc/palclr.h @@ -10,7 +10,7 @@ // =========================================================================== -#if !defined(HOST_UNIX) +#if defined(HOST_WINDOWS) #ifndef __PALCLR_H__ #define __PALCLR_H__ @@ -19,11 +19,7 @@ // Unix L"" is UTF32, and on windows it's UTF16. Because of built-in assumptions on the size // of string literals, it's important to match behaviour between Unix and Windows. Unix will be defined // as u"" (char16_t) -#ifdef HOST_UNIX -#define W(str) u##str -#else // HOST_UNIX #define W(str) L##str -#endif // HOST_UNIX #include @@ -515,7 +511,7 @@ #endif -#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(JIT64_BUILD) && !defined(CROSS_COMPILE) && !defined(DISABLE_CONTRACTS) +#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(CROSS_COMPILE) && !defined(DISABLE_CONTRACTS) #define PAL_TRY_HANDLER_DBG_BEGIN \ BOOL ___oldOkayToThrowValue = FALSE; \ ClrDebugState *___pState = ::GetClrDebugState(); \ @@ -560,7 +556,7 @@ #define PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason) ANNOTATION_TRY_BEGIN; #define PAL_TRY_HANDLER_DBG_END ANNOTATION_TRY_END; #define PAL_ENDTRY_NAKED_DBG -#endif // defined(ENABLE_CONTRACTS_IMPL) && !defined(JIT64_BUILD) +#endif // defined(ENABLE_CONTRACTS_IMPL) #if !BIGENDIAN @@ -631,4 +627,4 @@ #include "palclr_win.h" -#endif // !defined(HOST_UNIX) +#endif // defined(HOST_WINDOWS) diff --git a/src/coreclr/src/inc/palclr_win.h b/src/coreclr/src/inc/palclr_win.h index 2d88e6fcc378f5..4db25f6eab42c5 100644 --- a/src/coreclr/src/inc/palclr_win.h +++ b/src/coreclr/src/inc/palclr_win.h @@ -85,7 +85,7 @@ -#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(JIT64_BUILD) && !defined(HOST_ARM) // @ARMTODO +#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(HOST_ARM) // @ARMTODO #define WIN_PAL_TRY_HANDLER_DBG_BEGIN \ BOOL ___oldOkayToThrowValue = FALSE; \ ClrDebugState *___pState = GetClrDebugState(); \ @@ -133,12 +133,12 @@ #define WIN_PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason) ANNOTATION_TRY_BEGIN; #define WIN_PAL_TRY_HANDLER_DBG_END ANNOTATION_TRY_END; #define WIN_PAL_ENDTRY_NAKED_DBG -#endif // defined(ENABLE_CONTRACTS_IMPL) && !defined(JIT64_BUILD) +#endif // defined(ENABLE_CONTRACTS_IMPL) -#if !defined (TARGET_UNIX) +#if defined(HOST_WINDOWS) // Native system libray handle. // In Windows, NATIVE_LIBRARY_HANDLE is the same as HMODULE. typedef HMODULE NATIVE_LIBRARY_HANDLE; -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS #endif // __PALCLR_WIN_H__ diff --git a/src/coreclr/src/inc/readytorun.h b/src/coreclr/src/inc/readytorun.h index cd06ba68565994..7df03784ced816 100644 --- a/src/coreclr/src/inc/readytorun.h +++ b/src/coreclr/src/inc/readytorun.h @@ -18,8 +18,8 @@ #define READYTORUN_MAJOR_VERSION 0x0004 #define READYTORUN_MINOR_VERSION 0x0001 #define MINIMUM_READYTORUN_MAJOR_VERSION 0x003 -// R2R Version 2.1 adds the READYTORUN_SECTION_INLINING_INFO section -// R2R Version 2.2 adds the READYTORUN_SECTION_PROFILEDATA_INFO section +// R2R Version 2.1 adds the InliningInfo section +// R2R Version 2.2 adds the ProfileDataInfo section // R2R Version 3.0 changes calling conventions to correctly handle explicit structures to spec. // R2R 3.0 is not backward compatible with 2.x. @@ -37,12 +37,6 @@ struct READYTORUN_HEADER // READYTORUN_SECTION Sections[]; }; -struct READYTORUN_SECTION -{ - DWORD Type; // READYTORUN_SECTION_XXX - IMAGE_DATA_DIRECTORY Section; -}; - enum ReadyToRunFlag { READYTORUN_FLAG_PLATFORM_NEUTRAL_SOURCE = 0x00000001, // Set if the original IL assembly was platform-neutral @@ -51,29 +45,35 @@ enum ReadyToRunFlag READYTORUN_FLAG_NONSHARED_PINVOKE_STUBS = 0x00000008 // PInvoke stubs compiled into image are non-shareable (no secret parameter) }; -enum ReadyToRunSectionType +enum class ReadyToRunSectionType : uint32_t { - READYTORUN_SECTION_COMPILER_IDENTIFIER = 100, - READYTORUN_SECTION_IMPORT_SECTIONS = 101, - READYTORUN_SECTION_RUNTIME_FUNCTIONS = 102, - READYTORUN_SECTION_METHODDEF_ENTRYPOINTS = 103, - READYTORUN_SECTION_EXCEPTION_INFO = 104, - READYTORUN_SECTION_DEBUG_INFO = 105, - READYTORUN_SECTION_DELAYLOAD_METHODCALL_THUNKS = 106, - // 107 used by an older format of READYTORUN_SECTION_AVAILABLE_TYPES - READYTORUN_SECTION_AVAILABLE_TYPES = 108, - READYTORUN_SECTION_INSTANCE_METHOD_ENTRYPOINTS = 109, - READYTORUN_SECTION_INLINING_INFO = 110, // Added in V2.1, deprecated in 4.1 - READYTORUN_SECTION_PROFILEDATA_INFO = 111, // Added in V2.2 - READYTORUN_SECTION_MANIFEST_METADATA = 112, // Added in V2.3 - READYTORUN_SECTION_ATTRIBUTEPRESENCE = 113, // Added in V3.1 - READYTORUN_SECTION_INLINING_INFO2 = 114, // Added in V4.1 - - // If you add a new section consider whether it is a breaking or non-breaking change. - // Usually it is non-breaking, but if it is preferable to have older runtimes fail - // to load the image vs. ignoring the new section it could be marked breaking. - // Increment the READYTORUN_MINOR_VERSION (non-breaking) or READYTORUN_MAJOR_VERSION - // (breaking) as appropriate. + CompilerIdentifier = 100, + ImportSections = 101, + RuntimeFunctions = 102, + MethodDefEntryPoints = 103, + ExceptionInfo = 104, + DebugInfo = 105, + DelayLoadMethodCallThunks = 106, + // 107 used by an older format of AvailableTypes + AvailableTypes = 108, + InstanceMethodEntryPoints = 109, + InliningInfo = 110, // Added in V2.1, deprecated in 4.1 + ProfileDataInfo = 111, // Added in V2.2 + ManifestMetadata = 112, // Added in V2.3 + AttributePresence = 113, // Added in V3.1 + InliningInfo2 = 114, // Added in V4.1 + + // If you add a new section consider whether it is a breaking or non-breaking change. + // Usually it is non-breaking, but if it is preferable to have older runtimes fail + // to load the image vs. ignoring the new section it could be marked breaking. + // Increment the READYTORUN_MINOR_VERSION (non-breaking) or READYTORUN_MAJOR_VERSION + // (breaking) as appropriate. +}; + +struct READYTORUN_SECTION +{ + ReadyToRunSectionType Type; // READYTORUN_SECTION_XXX + IMAGE_DATA_DIRECTORY Section; }; // diff --git a/src/coreclr/src/inc/utilcode.h b/src/coreclr/src/inc/utilcode.h index 4fb33d1d7746c0..73971b5b97ad1d 100644 --- a/src/coreclr/src/inc/utilcode.h +++ b/src/coreclr/src/inc/utilcode.h @@ -704,9 +704,9 @@ class CCompRC m_nHashSize = 0; m_csMap = NULL; m_pResourceFile = NULL; -#ifdef TARGET_UNIX +#ifdef HOST_UNIX m_pResourceDomain = NULL; -#endif // TARGET_UNIX +#endif // HOST_UNIX }// CCompRC @@ -794,12 +794,12 @@ class CCompRC CRITSEC_COOKIE m_csMap; LPCWSTR m_pResourceFile; -#ifdef TARGET_UNIX +#ifdef HOST_UNIX // Resource domain is an ANSI string identifying a native resources file static LPCSTR m_pDefaultResourceDomain; static LPCSTR m_pFallbackResourceDomain; LPCSTR m_pResourceDomain; -#endif // TARGET_UNIX +#endif // HOST_UNIX // Main accessors for hash HRESOURCEDLL LookupNode(LocaleID langId, BOOL &fMissing); @@ -1280,16 +1280,16 @@ class NumaNodeInfo static LPVOID VirtualAllocExNuma(HANDLE hProc, LPVOID lpAddr, SIZE_T size, DWORD allocType, DWORD prot, DWORD node); -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS static BOOL GetNumaProcessorNodeEx(PPROCESSOR_NUMBER proc_no, PUSHORT node_no); static bool GetNumaInfo(PUSHORT total_nodes, DWORD* max_procs_per_node); -#else // !TARGET_UNIX +#else // HOST_WINDOWS static BOOL GetNumaProcessorNodeEx(USHORT proc_no, PUSHORT node_no); -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS #endif }; -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS struct CPU_Group_Info { @@ -1353,7 +1353,7 @@ class CPUGroupInfo DWORD_PTR GetCurrentProcessCpuMask(); -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS //****************************************************************************** // Returns the number of processors that a process has been configured to run on @@ -4321,7 +4321,7 @@ class ClrTeb return PAL_GetStackLimit(); } -#else // !HOST_UNIX +#else // HOST_UNIX // returns pointer that uniquely identifies the fiber static void* GetFiberPtrId() @@ -4370,7 +4370,7 @@ class ClrTeb { return (void*) 1; } -#endif // !HOST_UNIX +#endif // HOST_UNIX }; #if !defined(DACCESS_COMPILE) @@ -4809,7 +4809,7 @@ namespace util * Overloaded operators for the executable heap * ------------------------------------------------------------------------ */ -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS struct CExecutable { int x; }; extern const CExecutable executable; @@ -4833,7 +4833,7 @@ template void DeleteExecutable(T *p) } } -#endif // TARGET_UNIX +#endif // HOST_WINDOWS INDEBUG(BOOL DbgIsExecutable(LPVOID lpMem, SIZE_T length);) diff --git a/src/coreclr/src/jit/ICorJitInfo_API_names.h b/src/coreclr/src/jit/ICorJitInfo_API_names.h index 2e578342cc1e12..a17127ed6d29a8 100644 --- a/src/coreclr/src/jit/ICorJitInfo_API_names.h +++ b/src/coreclr/src/jit/ICorJitInfo_API_names.h @@ -38,6 +38,7 @@ DEF_CLR_API(getTokenTypeAsHandle) DEF_CLR_API(canSkipVerification) DEF_CLR_API(isValidToken) DEF_CLR_API(isValidStringRef) +DEF_CLR_API(getStringLiteral) DEF_CLR_API(shouldEnforceCallvirtRestriction) DEF_CLR_API(asCorInfoType) DEF_CLR_API(getClassName) diff --git a/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp b/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp index 83ca2a2c7488f3..824f86b8dd9955 100644 --- a/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp +++ b/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp @@ -367,6 +367,17 @@ BOOL WrapICorJitInfo::isValidStringRef( return temp; } +LPCWSTR WrapICorJitInfo::getStringLiteral( + CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */) +{ + API_ENTER(getStringLiteral); + LPCWSTR temp = wrapHnd->getStringLiteral(module, metaTOK, length); + API_LEAVE(getStringLiteral); + return temp; +} + BOOL WrapICorJitInfo::shouldEnforceCallvirtRestriction( CORINFO_MODULE_HANDLE scope) { diff --git a/src/coreclr/src/jit/codegen.h b/src/coreclr/src/jit/codegen.h index ad74a0b79adea4..04fd7208f1f00d 100644 --- a/src/coreclr/src/jit/codegen.h +++ b/src/coreclr/src/jit/codegen.h @@ -833,6 +833,12 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX void genLongToIntCast(GenTree* treeNode); #endif + // Generate code for a GT_BITCAST that is not contained. + void genCodeForBitCast(GenTreeOp* treeNode); + + // Generate the instruction to move a value between register files + void genBitCast(var_types targetType, regNumber targetReg, var_types srcType, regNumber srcReg); + struct GenIntCastDesc { enum CheckKind @@ -1364,6 +1370,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX instruction ins_Move_Extend(var_types srcType, bool srcInReg); instruction ins_Copy(var_types dstType); + instruction ins_Copy(regNumber srcReg, var_types dstType); instruction ins_CopyIntToFloat(var_types srcType, var_types dstTyp); instruction ins_CopyFloatToInt(var_types srcType, var_types dstTyp); static instruction ins_FloatStore(var_types type = TYP_DOUBLE); diff --git a/src/coreclr/src/jit/codegenarm64.cpp b/src/coreclr/src/jit/codegenarm64.cpp index 39b81bc1dc723d..9c7a4447d241b8 100644 --- a/src/coreclr/src/jit/codegenarm64.cpp +++ b/src/coreclr/src/jit/codegenarm64.cpp @@ -4518,11 +4518,11 @@ void CodeGen::genSIMDIntrinsicDotProduct(GenTreeSIMD* simdNode) { GetEmitter()->emitIns_R_R_R(INS_faddp, attr, tmpReg, tmpReg, tmpReg, INS_OPTS_4S); } - GetEmitter()->emitIns_R_R(INS_faddp, EA_4BYTE, targetReg, tmpReg); + GetEmitter()->emitIns_R_R(INS_faddp, EA_4BYTE, targetReg, tmpReg, INS_OPTS_2S); } else { - GetEmitter()->emitIns_R_R(INS_faddp, EA_8BYTE, targetReg, tmpReg); + GetEmitter()->emitIns_R_R(INS_faddp, EA_8BYTE, targetReg, tmpReg, INS_OPTS_2D); } } else @@ -6892,6 +6892,34 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R(INS_fabs, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_4S); theEmitter->emitIns_R_R(INS_fabs, EA_16BYTE, REG_V8, REG_V9, INS_OPTS_2D); + // fmaxp scalar + theEmitter->emitIns_R_R(INS_fmaxp, EA_4BYTE, REG_V0, REG_V1, INS_OPTS_2S); + theEmitter->emitIns_R_R(INS_fmaxp, EA_8BYTE, REG_V2, REG_V3, INS_OPTS_2D); + + // fmaxnmp scalar + theEmitter->emitIns_R_R(INS_fmaxnmp, EA_4BYTE, REG_V0, REG_V1, INS_OPTS_2S); + theEmitter->emitIns_R_R(INS_fmaxnmp, EA_8BYTE, REG_V2, REG_V3, INS_OPTS_2D); + + // fmaxnmv vector + theEmitter->emitIns_R_R(INS_fmaxnmv, EA_4BYTE, REG_V0, REG_V1, INS_OPTS_4S); + + // fmaxv vector + theEmitter->emitIns_R_R(INS_fmaxv, EA_4BYTE, REG_V0, REG_V1, INS_OPTS_4S); + + // fminp vector + theEmitter->emitIns_R_R(INS_fminp, EA_4BYTE, REG_V0, REG_V1, INS_OPTS_2S); + theEmitter->emitIns_R_R(INS_fminp, EA_8BYTE, REG_V2, REG_V3, INS_OPTS_2D); + + // fminnmp scalar + theEmitter->emitIns_R_R(INS_fminnmp, EA_4BYTE, REG_V0, REG_V1, INS_OPTS_2S); + theEmitter->emitIns_R_R(INS_fminnmp, EA_8BYTE, REG_V2, REG_V3, INS_OPTS_2D); + + // fminnmv vector + theEmitter->emitIns_R_R(INS_fminnmv, EA_4BYTE, REG_V0, REG_V1, INS_OPTS_4S); + + // fminv vector + theEmitter->emitIns_R_R(INS_fminv, EA_4BYTE, REG_V0, REG_V1, INS_OPTS_4S); + // fneg scalar theEmitter->emitIns_R_R(INS_fneg, EA_4BYTE, REG_V0, REG_V1); theEmitter->emitIns_R_R(INS_fneg, EA_8BYTE, REG_V2, REG_V3); @@ -7006,21 +7034,19 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R(INS_saddlv, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); theEmitter->emitIns_R_R(INS_saddlv, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); - // smaxlv vector - theEmitter->emitIns_R_R(INS_smaxlv, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); - theEmitter->emitIns_R_R(INS_smaxlv, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); - theEmitter->emitIns_R_R(INS_smaxlv, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); - theEmitter->emitIns_R_R(INS_smaxlv, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R(INS_smaxlv, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); - theEmitter->emitIns_R_R(INS_smaxlv, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); - - // sminlv vector - theEmitter->emitIns_R_R(INS_sminlv, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); - theEmitter->emitIns_R_R(INS_sminlv, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); - theEmitter->emitIns_R_R(INS_sminlv, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); - theEmitter->emitIns_R_R(INS_sminlv, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R(INS_sminlv, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); - theEmitter->emitIns_R_R(INS_sminlv, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); + // smaxv vector + theEmitter->emitIns_R_R(INS_smaxv, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); + theEmitter->emitIns_R_R(INS_smaxv, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); + theEmitter->emitIns_R_R(INS_smaxv, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); + theEmitter->emitIns_R_R(INS_smaxv, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R(INS_smaxv, EA_16BYTE, REG_V12, REG_V13, INS_OPTS_4S); + + // sminv vector + theEmitter->emitIns_R_R(INS_sminv, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); + theEmitter->emitIns_R_R(INS_sminv, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); + theEmitter->emitIns_R_R(INS_sminv, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); + theEmitter->emitIns_R_R(INS_sminv, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R(INS_sminv, EA_16BYTE, REG_V12, REG_V13, INS_OPTS_4S); // uaddlv vector theEmitter->emitIns_R_R(INS_uaddlv, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); @@ -7030,79 +7056,23 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R(INS_uaddlv, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); theEmitter->emitIns_R_R(INS_uaddlv, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); - // umaxlv vector - theEmitter->emitIns_R_R(INS_umaxlv, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); - theEmitter->emitIns_R_R(INS_umaxlv, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); - theEmitter->emitIns_R_R(INS_umaxlv, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); - theEmitter->emitIns_R_R(INS_umaxlv, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R(INS_umaxlv, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); - theEmitter->emitIns_R_R(INS_umaxlv, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); - - // uminlv vector - theEmitter->emitIns_R_R(INS_uminlv, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); - theEmitter->emitIns_R_R(INS_uminlv, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); - theEmitter->emitIns_R_R(INS_uminlv, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); - theEmitter->emitIns_R_R(INS_uminlv, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R(INS_uminlv, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); - theEmitter->emitIns_R_R(INS_uminlv, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); + // umaxv vector + theEmitter->emitIns_R_R(INS_umaxv, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); + theEmitter->emitIns_R_R(INS_umaxv, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); + theEmitter->emitIns_R_R(INS_umaxv, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); + theEmitter->emitIns_R_R(INS_umaxv, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R(INS_umaxv, EA_16BYTE, REG_V12, REG_V13, INS_OPTS_4S); - // uzp1 vector - theEmitter->emitIns_R_R(INS_uzp1, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); - theEmitter->emitIns_R_R(INS_uzp1, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); - theEmitter->emitIns_R_R(INS_uzp1, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); - theEmitter->emitIns_R_R(INS_uzp1, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R(INS_uzp1, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); - theEmitter->emitIns_R_R(INS_uzp1, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); - theEmitter->emitIns_R_R(INS_uzp1, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_2D); - - // uzp2 vector - theEmitter->emitIns_R_R(INS_uzp2, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); - theEmitter->emitIns_R_R(INS_uzp2, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); - theEmitter->emitIns_R_R(INS_uzp2, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); - theEmitter->emitIns_R_R(INS_uzp2, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R(INS_uzp2, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); - theEmitter->emitIns_R_R(INS_uzp2, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); - theEmitter->emitIns_R_R(INS_uzp2, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_2D); - - // zip1 vector - theEmitter->emitIns_R_R(INS_zip1, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); - theEmitter->emitIns_R_R(INS_zip1, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); - theEmitter->emitIns_R_R(INS_zip1, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); - theEmitter->emitIns_R_R(INS_zip1, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R(INS_zip1, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); - theEmitter->emitIns_R_R(INS_zip1, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); - theEmitter->emitIns_R_R(INS_zip1, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_2D); - - // zip2 vector - theEmitter->emitIns_R_R(INS_zip2, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); - theEmitter->emitIns_R_R(INS_zip2, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); - theEmitter->emitIns_R_R(INS_zip2, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); - theEmitter->emitIns_R_R(INS_zip2, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R(INS_zip2, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); - theEmitter->emitIns_R_R(INS_zip2, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); - theEmitter->emitIns_R_R(INS_zip2, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_2D); - - // trn1 vector - theEmitter->emitIns_R_R(INS_trn1, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); - theEmitter->emitIns_R_R(INS_trn1, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); - theEmitter->emitIns_R_R(INS_trn1, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); - theEmitter->emitIns_R_R(INS_trn1, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R(INS_trn1, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); - theEmitter->emitIns_R_R(INS_trn1, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); - theEmitter->emitIns_R_R(INS_trn1, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_2D); - - // trn2 vector - theEmitter->emitIns_R_R(INS_trn2, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); - theEmitter->emitIns_R_R(INS_trn2, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); - theEmitter->emitIns_R_R(INS_trn2, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); - theEmitter->emitIns_R_R(INS_trn2, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R(INS_trn2, EA_8BYTE, REG_V12, REG_V13, INS_OPTS_2S); - theEmitter->emitIns_R_R(INS_trn2, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_4S); - theEmitter->emitIns_R_R(INS_trn2, EA_16BYTE, REG_V14, REG_V15, INS_OPTS_2D); + // uminv vector + theEmitter->emitIns_R_R(INS_uminv, EA_8BYTE, REG_V4, REG_V5, INS_OPTS_8B); + theEmitter->emitIns_R_R(INS_uminv, EA_16BYTE, REG_V6, REG_V7, INS_OPTS_16B); + theEmitter->emitIns_R_R(INS_uminv, EA_8BYTE, REG_V8, REG_V9, INS_OPTS_4H); + theEmitter->emitIns_R_R(INS_uminv, EA_16BYTE, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R(INS_uminv, EA_16BYTE, REG_V12, REG_V13, INS_OPTS_4S); // faddp scalar - theEmitter->emitIns_R_R(INS_faddp, EA_4BYTE, REG_V0, REG_V1); - theEmitter->emitIns_R_R(INS_faddp, EA_8BYTE, REG_V2, REG_V3); + theEmitter->emitIns_R_R(INS_faddp, EA_4BYTE, REG_V0, REG_V1, INS_OPTS_2S); + theEmitter->emitIns_R_R(INS_faddp, EA_8BYTE, REG_V2, REG_V3, INS_OPTS_2D); // INS_fcvtl theEmitter->emitIns_R_R(INS_fcvtl, EA_4BYTE, REG_V0, REG_V1); @@ -7194,36 +7164,75 @@ void CodeGen::genArm64EmitterUnitTests() genDefineTempLabel(genCreateTempLabel()); + // fadd theEmitter->emitIns_R_R_R(INS_fadd, EA_4BYTE, REG_V0, REG_V1, REG_V2); // scalar 4BYTE theEmitter->emitIns_R_R_R(INS_fadd, EA_8BYTE, REG_V3, REG_V4, REG_V5); // scalar 8BYTE theEmitter->emitIns_R_R_R(INS_fadd, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_fadd, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_4S); theEmitter->emitIns_R_R_R(INS_fadd, EA_16BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2D); + // fsub theEmitter->emitIns_R_R_R(INS_fsub, EA_4BYTE, REG_V0, REG_V1, REG_V2); // scalar 4BYTE theEmitter->emitIns_R_R_R(INS_fsub, EA_8BYTE, REG_V3, REG_V4, REG_V5); // scalar 8BYTE theEmitter->emitIns_R_R_R(INS_fsub, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_fsub, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_4S); theEmitter->emitIns_R_R_R(INS_fsub, EA_16BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2D); + // fdiv theEmitter->emitIns_R_R_R(INS_fdiv, EA_4BYTE, REG_V0, REG_V1, REG_V2); // scalar 4BYTE theEmitter->emitIns_R_R_R(INS_fdiv, EA_8BYTE, REG_V3, REG_V4, REG_V5); // scalar 8BYTE theEmitter->emitIns_R_R_R(INS_fdiv, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_fdiv, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_4S); theEmitter->emitIns_R_R_R(INS_fdiv, EA_16BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2D); + // fmax theEmitter->emitIns_R_R_R(INS_fmax, EA_4BYTE, REG_V0, REG_V1, REG_V2); // scalar 4BYTE theEmitter->emitIns_R_R_R(INS_fmax, EA_8BYTE, REG_V3, REG_V4, REG_V5); // scalar 8BYTE theEmitter->emitIns_R_R_R(INS_fmax, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_fmax, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_4S); theEmitter->emitIns_R_R_R(INS_fmax, EA_16BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2D); + // fmaxp + theEmitter->emitIns_R_R_R(INS_fmaxp, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_fmaxp, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_fmaxp, EA_16BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2D); + + // fmaxnm + theEmitter->emitIns_R_R_R(INS_fmaxnm, EA_4BYTE, REG_V0, REG_V1, REG_V2); // scalar 4BYTE + theEmitter->emitIns_R_R_R(INS_fmaxnm, EA_8BYTE, REG_V3, REG_V4, REG_V5); // scalar 8BYTE + theEmitter->emitIns_R_R_R(INS_fmaxnm, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_fmaxnm, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_fmaxnm, EA_16BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2D); + + // fmaxnmp vector + theEmitter->emitIns_R_R_R(INS_fmaxnmp, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_fmaxnmp, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_fmaxnmp, EA_16BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2D); + + // fmin theEmitter->emitIns_R_R_R(INS_fmin, EA_4BYTE, REG_V0, REG_V1, REG_V2); // scalar 4BYTE theEmitter->emitIns_R_R_R(INS_fmin, EA_8BYTE, REG_V3, REG_V4, REG_V5); // scalar 8BYTE theEmitter->emitIns_R_R_R(INS_fmin, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_fmin, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_4S); theEmitter->emitIns_R_R_R(INS_fmin, EA_16BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2D); + // fminp + theEmitter->emitIns_R_R_R(INS_fminp, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_fminp, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_fminp, EA_16BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2D); + + // fminnm + theEmitter->emitIns_R_R_R(INS_fminnm, EA_4BYTE, REG_V0, REG_V1, REG_V2); // scalar 4BYTE + theEmitter->emitIns_R_R_R(INS_fminnm, EA_8BYTE, REG_V3, REG_V4, REG_V5); // scalar 8BYTE + theEmitter->emitIns_R_R_R(INS_fminnm, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_fminnm, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_fminnm, EA_16BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2D); + + // fminnmp vector + theEmitter->emitIns_R_R_R(INS_fminnmp, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_fminnmp, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_fminnmp, EA_16BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_2D); + // fabd theEmitter->emitIns_R_R_R(INS_fabd, EA_4BYTE, REG_V0, REG_V1, REG_V2); // scalar 4BYTE theEmitter->emitIns_R_R_R(INS_fabd, EA_8BYTE, REG_V3, REG_V4, REG_V5); // scalar 8BYTE @@ -7555,6 +7564,7 @@ void CodeGen::genArm64EmitterUnitTests() genDefineTempLabel(genCreateTempLabel()); + // add theEmitter->emitIns_R_R_R(INS_add, EA_8BYTE, REG_V0, REG_V1, REG_V2); // scalar 8BYTE theEmitter->emitIns_R_R_R(INS_add, EA_8BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_8B); theEmitter->emitIns_R_R_R(INS_add, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); @@ -7564,6 +7574,17 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_add, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_4S); theEmitter->emitIns_R_R_R(INS_add, EA_16BYTE, REG_V21, REG_V22, REG_V23, INS_OPTS_2D); + // addp + theEmitter->emitIns_R_R(INS_addp, EA_8BYTE, REG_V0, REG_V1, INS_OPTS_2D); // scalar 8BYTE + theEmitter->emitIns_R_R_R(INS_addp, EA_8BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_addp, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_addp, EA_8BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_addp, EA_16BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_addp, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_addp, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_addp, EA_16BYTE, REG_V21, REG_V22, REG_V23, INS_OPTS_2D); + + // sub theEmitter->emitIns_R_R_R(INS_sub, EA_8BYTE, REG_V1, REG_V2, REG_V3); // scalar 8BYTE theEmitter->emitIns_R_R_R(INS_sub, EA_8BYTE, REG_V4, REG_V5, REG_V6, INS_OPTS_8B); theEmitter->emitIns_R_R_R(INS_sub, EA_8BYTE, REG_V7, REG_V8, REG_V9, INS_OPTS_4H); @@ -7617,6 +7638,14 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_smax, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_smax, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + // smaxp vector + theEmitter->emitIns_R_R_R(INS_smaxp, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_smaxp, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_smaxp, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_smaxp, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_smaxp, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_smaxp, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + // smin vector theEmitter->emitIns_R_R_R(INS_smin, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); theEmitter->emitIns_R_R_R(INS_smin, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); @@ -7625,6 +7654,14 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_smin, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_smin, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + // sminp vector + theEmitter->emitIns_R_R_R(INS_sminp, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_sminp, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_sminp, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_sminp, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_sminp, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_sminp, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + // umax vector theEmitter->emitIns_R_R_R(INS_umax, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); theEmitter->emitIns_R_R_R(INS_umax, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); @@ -7633,6 +7670,14 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_umax, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_umax, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + // umaxp vector + theEmitter->emitIns_R_R_R(INS_umaxp, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_umaxp, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_umaxp, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_umaxp, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_umaxp, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_umaxp, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + // umin vector theEmitter->emitIns_R_R_R(INS_umin, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); theEmitter->emitIns_R_R_R(INS_umin, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); @@ -7641,6 +7686,14 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_umin, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_umin, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + // uminp vector + theEmitter->emitIns_R_R_R(INS_uminp, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_uminp, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_uminp, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_uminp, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_uminp, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_uminp, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + // cmeq vector theEmitter->emitIns_R_R_R(INS_cmeq, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); theEmitter->emitIns_R_R_R(INS_cmeq, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); @@ -7648,8 +7701,7 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_cmeq, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); theEmitter->emitIns_R_R_R(INS_cmeq, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_cmeq, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); - theEmitter->emitIns_R_R_R(INS_cmeq, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_1D); - theEmitter->emitIns_R_R_R(INS_cmeq, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_2D); + theEmitter->emitIns_R_R_R(INS_cmeq, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); // cmge vector theEmitter->emitIns_R_R_R(INS_cmge, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); @@ -7658,8 +7710,7 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_cmge, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); theEmitter->emitIns_R_R_R(INS_cmge, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_cmge, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); - theEmitter->emitIns_R_R_R(INS_cmge, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_1D); - theEmitter->emitIns_R_R_R(INS_cmge, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_2D); + theEmitter->emitIns_R_R_R(INS_cmge, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); // cmgt vector theEmitter->emitIns_R_R_R(INS_cmgt, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); @@ -7668,8 +7719,7 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_cmgt, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); theEmitter->emitIns_R_R_R(INS_cmgt, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_cmgt, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); - theEmitter->emitIns_R_R_R(INS_cmgt, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_1D); - theEmitter->emitIns_R_R_R(INS_cmgt, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_2D); + theEmitter->emitIns_R_R_R(INS_cmgt, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); // cmhi vector theEmitter->emitIns_R_R_R(INS_cmhi, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); @@ -7678,8 +7728,7 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_cmhi, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); theEmitter->emitIns_R_R_R(INS_cmhi, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_cmhi, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); - theEmitter->emitIns_R_R_R(INS_cmhi, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_1D); - theEmitter->emitIns_R_R_R(INS_cmhi, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_2D); + theEmitter->emitIns_R_R_R(INS_cmhi, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); // cmhs vector theEmitter->emitIns_R_R_R(INS_cmhs, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); @@ -7688,18 +7737,16 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_cmhs, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); theEmitter->emitIns_R_R_R(INS_cmhs, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); theEmitter->emitIns_R_R_R(INS_cmhs, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); - theEmitter->emitIns_R_R_R(INS_cmhs, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_1D); - theEmitter->emitIns_R_R_R(INS_cmhs, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_2D); - - // ctst vector - theEmitter->emitIns_R_R_R(INS_ctst, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); - theEmitter->emitIns_R_R_R(INS_ctst, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); - theEmitter->emitIns_R_R_R(INS_ctst, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); - theEmitter->emitIns_R_R_R(INS_ctst, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); - theEmitter->emitIns_R_R_R(INS_ctst, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); - theEmitter->emitIns_R_R_R(INS_ctst, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); - theEmitter->emitIns_R_R_R(INS_ctst, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_1D); - theEmitter->emitIns_R_R_R(INS_ctst, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_2D); + theEmitter->emitIns_R_R_R(INS_cmhs, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); + + // cmtst vector + theEmitter->emitIns_R_R_R(INS_cmtst, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_cmtst, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_cmtst, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_cmtst, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_cmtst, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_cmtst, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_cmtst, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); // faddp vector theEmitter->emitIns_R_R_R(INS_faddp, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); @@ -7722,6 +7769,62 @@ void CodeGen::genArm64EmitterUnitTests() theEmitter->emitIns_R_R_R(INS_fcmgt, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_2D); #endif // ALL_ARM64_EMITTER_UNIT_TESTS +#ifdef ALL_ARM64_EMITTER_UNIT_TESTS + // trn1 vector + theEmitter->emitIns_R_R_R(INS_trn1, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_trn1, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_trn1, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_trn1, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_trn1, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_trn1, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_trn1, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); + + // trn2 vector + theEmitter->emitIns_R_R_R(INS_trn2, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_trn2, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_trn2, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_trn2, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_trn2, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_trn2, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_trn2, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); + + // uzp1 vector + theEmitter->emitIns_R_R_R(INS_uzp1, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_uzp1, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_uzp1, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_uzp1, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_uzp1, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_uzp1, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_uzp1, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); + + // uzp2 vector + theEmitter->emitIns_R_R_R(INS_uzp2, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_uzp2, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_uzp2, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_uzp2, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_uzp2, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_uzp2, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_uzp2, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); + + // zip1 vector + theEmitter->emitIns_R_R_R(INS_zip1, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_zip1, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_zip1, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_zip1, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_zip1, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_zip1, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_zip1, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); + + // zip2 vector + theEmitter->emitIns_R_R_R(INS_zip2, EA_8BYTE, REG_V0, REG_V1, REG_V2, INS_OPTS_8B); + theEmitter->emitIns_R_R_R(INS_zip2, EA_16BYTE, REG_V3, REG_V4, REG_V5, INS_OPTS_16B); + theEmitter->emitIns_R_R_R(INS_zip2, EA_8BYTE, REG_V6, REG_V7, REG_V8, INS_OPTS_4H); + theEmitter->emitIns_R_R_R(INS_zip2, EA_16BYTE, REG_V9, REG_V10, REG_V11, INS_OPTS_8H); + theEmitter->emitIns_R_R_R(INS_zip2, EA_8BYTE, REG_V12, REG_V13, REG_V14, INS_OPTS_2S); + theEmitter->emitIns_R_R_R(INS_zip2, EA_16BYTE, REG_V15, REG_V16, REG_V17, INS_OPTS_4S); + theEmitter->emitIns_R_R_R(INS_zip2, EA_16BYTE, REG_V18, REG_V19, REG_V20, INS_OPTS_2D); +#endif // ALL_ARM64_EMITTER_UNIT_TESTS + #ifdef ALL_ARM64_EMITTER_UNIT_TESTS // // R_R_R vector multiply diff --git a/src/coreclr/src/jit/codegenarmarch.cpp b/src/coreclr/src/jit/codegenarmarch.cpp index ab0e11f1a03df2..47678ff275adc4 100644 --- a/src/coreclr/src/jit/codegenarmarch.cpp +++ b/src/coreclr/src/jit/codegenarmarch.cpp @@ -239,43 +239,8 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) break; case GT_BITCAST: - { - GenTree* op1 = treeNode->AsOp()->gtOp1; - if (varTypeIsFloating(treeNode) != varTypeIsFloating(op1)) - { -#ifdef TARGET_ARM64 - inst_RV_RV(INS_fmov, targetReg, genConsumeReg(op1), targetType); -#else // !TARGET_ARM64 - if (varTypeIsFloating(treeNode)) - { - // GT_BITCAST on ARM is only used to cast floating-point arguments to integer - // registers. Nobody generates GT_BITCAST from int to float currently. - NYI_ARM("GT_BITCAST from 'int' to 'float'"); - } - else - { - assert(varTypeIsFloating(op1)); - - if (op1->TypeGet() == TYP_FLOAT) - { - inst_RV_RV(INS_vmov_f2i, targetReg, genConsumeReg(op1), targetType); - } - else - { - assert(op1->TypeGet() == TYP_DOUBLE); - regNumber otherReg = treeNode->AsMultiRegOp()->gtOtherReg; - assert(otherReg != REG_NA); - inst_RV_RV_RV(INS_vmov_d2i, targetReg, otherReg, genConsumeReg(op1), EA_8BYTE); - } - } -#endif // !TARGET_ARM64 - } - else - { - inst_RV_RV(ins_Copy(targetType), targetReg, genConsumeReg(op1), targetType); - } - } - break; + genCodeForBitCast(treeNode->AsOp()); + break; case GT_LCL_FLD_ADDR: case GT_LCL_VAR_ADDR: @@ -763,7 +728,7 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode) #else // !TARGET_ARM64 // There is no zero register on ARM32 unreached(); -#endif // !_TARGET_ARM64 +#endif // !TARGET_ARM64 } else { @@ -1105,6 +1070,59 @@ void CodeGen::genPutArgReg(GenTreeOp* tree) genProduceReg(tree); } +//---------------------------------------------------------------------- +// genCodeForBitCast - Generate code for a GT_BITCAST that is not contained +// +// Arguments +// treeNode - the GT_BITCAST for which we're generating code +// +void CodeGen::genCodeForBitCast(GenTreeOp* treeNode) +{ + regNumber targetReg = treeNode->GetRegNum(); + var_types targetType = treeNode->TypeGet(); + GenTree* op1 = treeNode->gtGetOp1(); + genConsumeRegs(op1); + if (op1->isContained()) + { + assert(op1->IsLocal() || op1->isIndir()); + op1->gtType = treeNode->TypeGet(); + op1->SetRegNum(targetReg); + op1->ClearContained(); + JITDUMP("Changing type of BITCAST source to load directly."); + genCodeForTreeNode(op1); + } + else if (varTypeIsFloating(treeNode) != varTypeIsFloating(op1)) + { + regNumber srcReg = op1->GetRegNum(); + assert(genTypeSize(op1->TypeGet()) == genTypeSize(targetType)); +#ifdef TARGET_ARM + if (genTypeSize(targetType) == 8) + { + // Converting between long and double on ARM is a special case. + if (targetType == TYP_LONG) + { + regNumber otherReg = treeNode->AsMultiRegOp()->gtOtherReg; + assert(otherReg != REG_NA); + inst_RV_RV_RV(INS_vmov_d2i, targetReg, otherReg, srcReg, EA_8BYTE); + } + else + { + NYI_ARM("Converting from long to double"); + } + } + else +#endif // TARGET_ARM + { + instruction ins = ins_Copy(srcReg, targetType); + inst_RV_RV(ins, targetReg, srcReg, targetType); + } + } + else + { + inst_RV_RV(ins_Copy(targetType), targetReg, genConsumeReg(op1), targetType); + } +} + #if FEATURE_ARG_SPLIT //--------------------------------------------------------------------- // genPutArgSplit - generate code for a GT_PUTARG_SPLIT node @@ -1344,7 +1362,7 @@ void CodeGen::genMultiRegCallStoreToLocal(GenTree* treeNode) #elif defined(TARGET_ARM64) // Structs of size >=9 and <=16 are returned in two return registers on ARM64 and HFAs. assert(varTypeIsStruct(treeNode)); -#endif // _TARGET_* +#endif // TARGET* // Assumption: current implementation requires that a multi-reg // var in 'var = call' is flagged as lvIsMultiRegRet to prevent it from @@ -2496,7 +2514,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) GetEmitter()->emitIns_R_R_I(INS_ldr, EA_4BYTE, tmpReg, regThis, 0); #elif defined(TARGET_ARM64) GetEmitter()->emitIns_R_R_I(INS_ldr, EA_4BYTE, REG_ZR, regThis, 0); -#endif // _TARGET_* +#endif // TARGET* } // Either gtControlExpr != null or gtCallAddr != null or it is a direct non-virtual call to a user or helper @@ -3334,7 +3352,7 @@ void CodeGen::genFloatToFloatCast(GenTree* treeNode) GetEmitter()->emitIns_R_R(INS_mov, emitActualTypeSize(treeNode), treeNode->GetRegNum(), op1->GetRegNum()); } -#endif // _TARGET_* +#endif // TARGET* genProduceReg(treeNode); } diff --git a/src/coreclr/src/jit/codegencommon.cpp b/src/coreclr/src/jit/codegencommon.cpp index 92f8fed1e1596d..f15259334eb722 100644 --- a/src/coreclr/src/jit/codegencommon.cpp +++ b/src/coreclr/src/jit/codegencommon.cpp @@ -243,8 +243,8 @@ int CodeGenInterface::genCallerSPtoFPdelta() const // pushed ebp callerSPtoFPdelta -= 2 * REGSIZE_BYTES; #else -#error "Unknown _TARGET_" -#endif // _TARGET_* +#error "Unknown TARGET" +#endif // TARGET* assert(callerSPtoFPdelta <= 0); return callerSPtoFPdelta; @@ -273,8 +273,8 @@ int CodeGenInterface::genCallerSPtoInitialSPdelta() const callerSPtoSPdelta -= REGSIZE_BYTES; } #else -#error "Unknown _TARGET_" -#endif // _TARGET_* +#error "Unknown TARGET" +#endif // TARGET* assert(callerSPtoSPdelta <= 0); return callerSPtoSPdelta; @@ -1509,7 +1509,7 @@ bool CodeGen::genCreateAddrMode(GenTree* addr, break; #endif // SCALED_ADDR_MODES -#endif // !_TARGET_ARMARCH +#endif // !TARGET_ARMARCH case GT_NOP: @@ -1587,7 +1587,7 @@ bool CodeGen::genCreateAddrMode(GenTree* addr, break; #endif // SCALED_ADDR_MODES -#endif // !_TARGET_ARMARCH +#endif // !TARGET_ARMARCH case GT_NOP: @@ -4363,8 +4363,18 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere size = EA_8BYTE; } #endif - - GetEmitter()->emitIns_R_R(ins_Copy(destMemType), size, destRegNum, regNum); + instruction copyIns = ins_Copy(regNum, destMemType); +#if defined(TARGET_XARCH) + // For INS_mov_xmm2i, the source xmm reg comes first. + if (copyIns == INS_mov_xmm2i) + { + GetEmitter()->emitIns_R_R(copyIns, size, regNum, destRegNum); + } + else +#endif // TARGET_XARCH + { + GetEmitter()->emitIns_R_R(copyIns, size, destRegNum, regNum); + } #ifdef USING_SCOPE_INFO psiMoveToReg(varNum); #endif // USING_SCOPE_INFO @@ -4656,6 +4666,9 @@ void CodeGen::genCheckUseBlockInit() continue; } +// TODO-Review: The code below is currently unreachable. We are guaranteed to execute one of the +// 'continue' statements above. +#if 0 /* If we don't know lifetimes of variables, must be conservative */ if (!compiler->backendRequiresLocalVarLifetimes()) { @@ -4690,6 +4703,7 @@ void CodeGen::genCheckUseBlockInit() { largeGcStructs++; } +#endif } /* Don't forget about spill temps that hold pointers */ @@ -4718,6 +4732,11 @@ void CodeGen::genCheckUseBlockInit() // Secondary factor is the presence of large structs that // potentially only need some fields set to zero. We likely don't // model this very well, but have left the logic as is for now. + + // Compiler::fgVarNeedsExplicitZeroInit relies on this logic to + // find structs that are guaranteed to be block initialized. + // If this logic changes, Compiler::fgVarNeedsExplicitZeroInit needs + // to be modified. CLANG_FORMAT_COMMENT_ANCHOR; #ifdef TARGET_64BIT @@ -5383,7 +5402,7 @@ void CodeGen::genPushCalleeSavedRegisters() #else assert(!"Unknown TARGET"); -#endif // _TARGET_* +#endif // TARGET* } #if defined(TARGET_ARM) @@ -5622,7 +5641,7 @@ void CodeGen::genZeroInitFltRegs(const regMaskTP& initFltRegs, const regMaskTP& #elif defined(TARGET_ARM64) // We will just zero out the entire vector register. This sets it to a double/float zero value GetEmitter()->emitIns_R_I(INS_movi, EA_16BYTE, reg, 0x00, INS_OPTS_16B); -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture #endif fltInitReg = reg; @@ -5657,7 +5676,7 @@ void CodeGen::genZeroInitFltRegs(const regMaskTP& initFltRegs, const regMaskTP& #elif defined(TARGET_ARM64) // We will just zero out the entire vector register. This sets it to a double/float zero value GetEmitter()->emitIns_R_I(INS_movi, EA_16BYTE, reg, 0x00, INS_OPTS_16B); -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture #endif dblInitReg = reg; @@ -6071,7 +6090,7 @@ void CodeGen::genPopCalleeSavedRegisters(bool jmpEpilog) noway_assert(compiler->compCalleeRegsPushed == popCount); } -#endif // _TARGET_* +#endif // TARGET* // We need a register with value zero. Zero the initReg, if necessary, and set *pInitRegZeroed if so. // Return the register to use. On ARM64, we never touch the initReg, and always just return REG_ZR. @@ -6353,9 +6372,9 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, } #endif // !UNIX_AMD64_ABI -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture -#endif // _TARGET_* +#endif // TARGET* } else if (genInitStkLclCnt > 0) { @@ -8249,7 +8268,7 @@ void CodeGen::genFnEpilog(BasicBlock* block) regSet.verifyRegUsed(REG_ECX); } else -#endif // _TARGET_X86 +#endif // TARGET_X86 { /* Add 'compiler->compLclFrameSize' to ESP */ /* Generate "add esp, " */ @@ -8319,7 +8338,7 @@ void CodeGen::genFnEpilog(BasicBlock* block) inst_RV(INS_pop, REG_ECX, TYP_I_IMPL); regSet.verifyRegUsed(REG_ECX); } -#endif // _TARGET_X86 +#endif // TARGET_X86 else { // We need to make ESP point to the callee-saved registers @@ -8547,9 +8566,9 @@ void CodeGen::genFnEpilog(BasicBlock* block) } } -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture -#endif // _TARGET_* +#endif // TARGET* #if defined(FEATURE_EH_FUNCLETS) @@ -9239,7 +9258,7 @@ void CodeGen::genCaptureFuncletPrologEpilogInfo() } } -#else // _TARGET_* +#else // TARGET* /***************************************************************************** * @@ -9274,7 +9293,7 @@ void CodeGen::genCaptureFuncletPrologEpilogInfo() } } -#endif // _TARGET_* +#endif // TARGET* /*----------------------------------------------------------------------------- * @@ -9423,11 +9442,11 @@ void CodeGen::genSetPSPSym(regNumber initReg, bool* pInitRegZeroed) GetEmitter()->emitIns_S_R(ins_Store(TYP_I_IMPL), EA_PTRSIZE, REG_SPBASE, compiler->lvaPSPSym, 0); -#else // _TARGET_* +#else // TARGET* NYI("Set function PSP sym"); -#endif // _TARGET_* +#endif // TARGET* } #endif // FEATURE_EH_FUNCLETS @@ -9866,7 +9885,7 @@ unsigned CodeGen::getFirstArgWithStackSlot() return baseVarNum; #elif defined(TARGET_AMD64) return 0; -#else // _TARGET_X86 +#else // TARGET_X86 // Not implemented for x86. NYI_X86("getFirstArgWithStackSlot not yet implemented for x86."); return BAD_VAR_NUM; diff --git a/src/coreclr/src/jit/codegenlinear.cpp b/src/coreclr/src/jit/codegenlinear.cpp index 45b2e9afefa237..c6f7b6f8c483cd 100644 --- a/src/coreclr/src/jit/codegenlinear.cpp +++ b/src/coreclr/src/jit/codegenlinear.cpp @@ -1413,6 +1413,10 @@ void CodeGen::genConsumeRegs(GenTree* tree) } #endif // FEATURE_HW_INTRINSICS #endif // TARGET_XARCH + else if (tree->OperIs(GT_BITCAST)) + { + genConsumeReg(tree->gtGetOp1()); + } else { #ifdef FEATURE_SIMD diff --git a/src/coreclr/src/jit/codegenxarch.cpp b/src/coreclr/src/jit/codegenxarch.cpp index 977a9e274fc23c..0eadce2c17f97b 100644 --- a/src/coreclr/src/jit/codegenxarch.cpp +++ b/src/coreclr/src/jit/codegenxarch.cpp @@ -1736,39 +1736,8 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) break; case GT_BITCAST: - { - GenTree* const op1 = treeNode->AsOp()->gtOp1; - genConsumeReg(op1); - - const bool srcFltReg = varTypeIsFloating(op1) || varTypeIsSIMD(op1); - const bool dstFltReg = varTypeIsFloating(treeNode) || varTypeIsSIMD(treeNode); - if (srcFltReg != dstFltReg) - { - instruction ins; - regNumber fltReg; - regNumber intReg; - if (dstFltReg) - { - ins = ins_CopyIntToFloat(op1->TypeGet(), treeNode->TypeGet()); - fltReg = treeNode->GetRegNum(); - intReg = op1->GetRegNum(); - } - else - { - ins = ins_CopyFloatToInt(op1->TypeGet(), treeNode->TypeGet()); - intReg = treeNode->GetRegNum(); - fltReg = op1->GetRegNum(); - } - inst_RV_RV(ins, fltReg, intReg, treeNode->TypeGet()); - } - else if (treeNode->GetRegNum() != op1->GetRegNum()) - { - inst_RV_RV(ins_Copy(treeNode->TypeGet()), treeNode->GetRegNum(), op1->GetRegNum(), treeNode->TypeGet()); - } - - genProduceReg(treeNode); + genCodeForBitCast(treeNode->AsOp()); break; - } case GT_LCL_FLD_ADDR: case GT_LCL_VAR_ADDR: @@ -4588,7 +4557,8 @@ void CodeGen::genCodeForLclVar(GenTreeLclVar* tree) // lcl_vars are not defs assert((tree->gtFlags & GTF_VAR_DEF) == 0); - bool isRegCandidate = compiler->lvaTable[tree->GetLclNum()].lvIsRegCandidate(); + LclVarDsc* varDsc = compiler->lvaGetDesc(tree); + bool isRegCandidate = varDsc->lvIsRegCandidate(); // If this is a register candidate that has been spilled, genConsumeReg() will // reload it at the point of use. Otherwise, if it's not in a register, we load it here. @@ -4621,8 +4591,9 @@ void CodeGen::genCodeForStoreLclFld(GenTreeLclFld* tree) assert(tree->OperIs(GT_STORE_LCL_FLD)); var_types targetType = tree->TypeGet(); + GenTree* op1 = tree->gtGetOp1(); + noway_assert(targetType != TYP_STRUCT); - assert(!varTypeIsFloating(targetType) || (targetType == tree->gtOp1->TypeGet())); #ifdef FEATURE_SIMD // storing of TYP_SIMD12 (i.e. Vector3) field @@ -4633,7 +4604,9 @@ void CodeGen::genCodeForStoreLclFld(GenTreeLclFld* tree) } #endif // FEATURE_SIMD - GenTree* op1 = tree->gtGetOp1(); + assert(varTypeUsesFloatReg(targetType) == varTypeUsesFloatReg(op1)); + assert(genTypeSize(genActualType(targetType)) == genTypeSize(genActualType(op1->TypeGet()))); + genConsumeRegs(op1); GetEmitter()->emitInsBinary(ins_Store(targetType), emitTypeSize(tree), tree, op1); @@ -4704,7 +4677,24 @@ void CodeGen::genCodeForStoreLclVar(GenTreeLclVar* tree) genConsumeRegs(op1); - if (targetReg == REG_NA) + if (op1->OperIs(GT_BITCAST) && op1->isContained()) + { + GenTree* bitCastSrc = op1->gtGetOp1(); + var_types srcType = bitCastSrc->TypeGet(); + noway_assert(!bitCastSrc->isContained()); + if (targetReg == REG_NA) + { + emit->emitIns_S_R(ins_Store(srcType, compiler->isSIMDTypeLocalAligned(lclNum)), + emitTypeSize(targetType), bitCastSrc->GetRegNum(), lclNum, 0); + genUpdateLife(tree); + varDsc->SetRegNum(REG_STK); + } + else + { + genBitCast(targetType, targetReg, srcType, bitCastSrc->GetRegNum()); + } + } + else if (targetReg == REG_NA) { // stack store emit->emitInsStoreLcl(ins_Store(targetType, compiler->isSIMDTypeLocalAligned(lclNum)), @@ -5028,7 +5018,7 @@ void CodeGen::genCodeForStoreInd(GenTreeStoreInd* tree) GenTree* addr = tree->Addr(); var_types targetType = tree->TypeGet(); - assert(!varTypeIsFloating(targetType) || (targetType == data->TypeGet())); + assert(!varTypeIsFloating(targetType) || (genTypeSize(targetType) == genTypeSize(data->TypeGet()))); GCInfo::WriteBarrierForm writeBarrierForm = gcInfo.gcIsWriteBarrierCandidate(tree, data); if (writeBarrierForm != GCInfo::WBF_NoBarrier) @@ -7435,6 +7425,84 @@ void CodeGen::genIntrinsic(GenTree* treeNode) genProduceReg(treeNode); } +//---------------------------------------------------------------------- +// genBitCast - Generate the instruction to move a value between register files +// +// Arguments +// targetType - the destination type +// targetReg - the destination register +// srcType - the source type +// srcReg - the source register +// +void CodeGen::genBitCast(var_types targetType, regNumber targetReg, var_types srcType, regNumber srcReg) +{ + const bool srcFltReg = varTypeIsFloating(srcType) || varTypeIsSIMD(srcType); + assert(srcFltReg == genIsValidFloatReg(srcReg)); + const bool dstFltReg = varTypeIsFloating(targetType) || varTypeIsSIMD(targetType); + assert(dstFltReg == genIsValidFloatReg(targetReg)); + if (srcFltReg != dstFltReg) + { + instruction ins; + regNumber fltReg; + regNumber intReg; + if (dstFltReg) + { + ins = ins_CopyIntToFloat(srcType, targetType); + fltReg = targetReg; + intReg = srcReg; + } + else + { + ins = ins_CopyFloatToInt(srcType, targetType); + intReg = targetReg; + fltReg = srcReg; + } + inst_RV_RV(ins, fltReg, intReg, targetType); + } + else if (targetReg != srcReg) + { + inst_RV_RV(ins_Copy(targetType), targetReg, srcReg, targetType); + } +} + +//---------------------------------------------------------------------- +// genCodeForBitCast - Generate code for a GT_BITCAST that is not contained +// +// Arguments +// treeNode - the GT_BITCAST for which we're generating code +// +void CodeGen::genCodeForBitCast(GenTreeOp* treeNode) +{ + regNumber targetReg = treeNode->GetRegNum(); + var_types targetType = treeNode->TypeGet(); + GenTree* op1 = treeNode->gtGetOp1(); + genConsumeRegs(op1); + + if (op1->isContained()) + { + assert(op1->IsLocal() || op1->isIndir()); + if (genIsRegCandidateLocal(op1)) + { + unsigned lclNum = op1->AsLclVar()->GetLclNum(); + GetEmitter()->emitIns_R_S(ins_Load(treeNode->TypeGet(), compiler->isSIMDTypeLocalAligned(lclNum)), + emitTypeSize(treeNode), targetReg, lclNum, 0); + } + else + { + op1->gtType = treeNode->TypeGet(); + op1->SetRegNum(targetReg); + op1->ClearContained(); + JITDUMP("Changing type of BITCAST source to load directly."); + genCodeForTreeNode(op1); + } + } + else + { + genBitCast(targetType, targetReg, op1->TypeGet(), op1->GetRegNum()); + } + genProduceReg(treeNode); +} + //-------------------------------------------------------------------------- // // getBaseVarForPutArgStk - returns the baseVarNum for passing a stack arg. // @@ -7585,7 +7653,7 @@ void CodeGen::genRemoveAlignmentAfterCall(GenTreeCall* call, unsigned bias) #endif // !UNIX_X86_ABI_ #else // TARGET_X86 assert(bias == 0); -#endif // !_TARGET_X86 +#endif // !TARGET_X86 } #ifdef TARGET_X86 diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index f4bc154c59aa3e..c066d2b1be9f11 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -822,11 +822,11 @@ var_types Compiler::getArgTypeForStruct(CORINFO_CLASS_HANDLE clsHnd, howToPassStruct = SPK_ByValue; useType = TYP_STRUCT; -#else // _TARGET_XXX_ +#else // TARGET_XXX noway_assert(!"Unhandled TARGET in getArgTypeForStruct (with FEATURE_MULTIREG_ARGS=1)"); -#endif // _TARGET_XXX_ +#endif // TARGET_XXX } } else // (structSize > MAX_PASS_MULTIREG_BYTES) @@ -849,11 +849,11 @@ var_types Compiler::getArgTypeForStruct(CORINFO_CLASS_HANDLE clsHnd, howToPassStruct = SPK_ByReference; useType = TYP_UNKNOWN; -#else // _TARGET_XXX_ +#else // TARGET_XXX noway_assert(!"Unhandled TARGET in getArgTypeForStruct"); -#endif // _TARGET_XXX_ +#endif // TARGET_XXX } } @@ -1080,11 +1080,11 @@ var_types Compiler::getReturnTypeForStruct(CORINFO_CLASS_HANDLE clsHnd, howToReturnStruct = SPK_ByReference; useType = TYP_UNKNOWN; -#else // _TARGET_XXX_ +#else // TARGET_XXX noway_assert(!"Unhandled TARGET in getReturnTypeForStruct (with FEATURE_MULTIREG_ARGS=1)"); -#endif // _TARGET_XXX_ +#endif // TARGET_XXX } } else // (structSize > MAX_RET_MULTIREG_BYTES) || (FEATURE_MULTIREG_RET == 0) @@ -9102,6 +9102,21 @@ void cTreeFlags(Compiler* comp, GenTree* tree) { chars += printf("[CALL_M_PINVOKE]"); } + + if (call->IsFatPointerCandidate()) + { + chars += printf("[CALL_FAT_POINTER_CANDIDATE]"); + } + + if (call->IsGuarded()) + { + chars += printf("[CALL_GUARDED]"); + } + + if (call->IsExpRuntimeLookup()) + { + chars += printf("[CALL_EXP_RUNTIME_LOOKUP]"); + } } break; default: diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index 33a1859f91c948..d8aff229e8156d 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -1616,7 +1616,7 @@ struct fgArgTabEntry bool isPassedInFloatRegisters() { -#ifdef _TARGET_X86 +#ifdef TARGET_X86 return false; #else return isValidFloatArgReg(GetRegNum()); @@ -2447,7 +2447,7 @@ class Compiler // For binary opers. GenTree* gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1, GenTree* op2); - GenTree* gtNewQmarkNode(var_types type, GenTree* cond, GenTree* colon); + GenTreeQmark* gtNewQmarkNode(var_types type, GenTree* cond, GenTree* colon); GenTree* gtNewLargeOperNode(genTreeOps oper, var_types type = TYP_I_IMPL, @@ -4542,8 +4542,8 @@ class Compiler unsigned fgSsaPassesCompleted; // Number of times fgSsaBuild has been run. - // Returns "true" if a struct temp of the given type requires needs zero init in this block - inline bool fgStructTempNeedsExplicitZeroInit(LclVarDsc* varDsc, BasicBlock* block); + // Returns "true" if the variable needs explicit zero initialization. + inline bool fgVarNeedsExplicitZeroInit(LclVarDsc* varDsc, bool bbInALoop, bool bbIsReturn); // The value numbers for this compilation. ValueNumStore* vnStore; @@ -6326,14 +6326,15 @@ class Compiler } }; -#define OMF_HAS_NEWARRAY 0x00000001 // Method contains 'new' of an array -#define OMF_HAS_NEWOBJ 0x00000002 // Method contains 'new' of an object type. -#define OMF_HAS_ARRAYREF 0x00000004 // Method contains array element loads or stores. -#define OMF_HAS_VTABLEREF 0x00000008 // Method contains method table reference. -#define OMF_HAS_NULLCHECK 0x00000010 // Method contains null check. -#define OMF_HAS_FATPOINTER 0x00000020 // Method contains call, that needs fat pointer transformation. -#define OMF_HAS_OBJSTACKALLOC 0x00000040 // Method contains an object allocated on the stack. -#define OMF_HAS_GUARDEDDEVIRT 0x00000080 // Method contains guarded devirtualization candidate +#define OMF_HAS_NEWARRAY 0x00000001 // Method contains 'new' of an array +#define OMF_HAS_NEWOBJ 0x00000002 // Method contains 'new' of an object type. +#define OMF_HAS_ARRAYREF 0x00000004 // Method contains array element loads or stores. +#define OMF_HAS_VTABLEREF 0x00000008 // Method contains method table reference. +#define OMF_HAS_NULLCHECK 0x00000010 // Method contains null check. +#define OMF_HAS_FATPOINTER 0x00000020 // Method contains call, that needs fat pointer transformation. +#define OMF_HAS_OBJSTACKALLOC 0x00000040 // Method contains an object allocated on the stack. +#define OMF_HAS_GUARDEDDEVIRT 0x00000080 // Method contains guarded devirtualization candidate +#define OMF_HAS_EXPRUNTIMELOOKUP 0x00000100 // Method contains a runtime lookup to an expandable dictionary. bool doesMethodHaveFatPointer() { @@ -6373,6 +6374,23 @@ class Compiler unsigned methodAttr, unsigned classAttr); + bool doesMethodHaveExpRuntimeLookup() + { + return (optMethodFlags & OMF_HAS_EXPRUNTIMELOOKUP) != 0; + } + + void setMethodHasExpRuntimeLookup() + { + optMethodFlags |= OMF_HAS_EXPRUNTIMELOOKUP; + } + + void clearMethodHasExpRuntimeLookup() + { + optMethodFlags &= ~OMF_HAS_EXPRUNTIMELOOKUP; + } + + void addExpRuntimeLookupCandidate(GenTreeCall* call); + unsigned optMethodFlags; bool doesMethodHaveNoReturnCalls() diff --git a/src/coreclr/src/jit/compiler.hpp b/src/coreclr/src/jit/compiler.hpp index d0de0f1f1e1be5..889d5017b0d769 100644 --- a/src/coreclr/src/jit/compiler.hpp +++ b/src/coreclr/src/jit/compiler.hpp @@ -4106,26 +4106,59 @@ inline void Compiler::CLR_API_Leave(API_ICorJitInfo_Names ename) #endif // MEASURE_CLRAPI_CALLS //------------------------------------------------------------------------------ -// fgStructTempNeedsExplicitZeroInit : Check whether temp struct needs -// explicit zero initialization in this basic block. +// fgVarNeedsExplicitZeroInit : Check whether the variable needs an explicit zero initialization. // // Arguments: -// varDsc - struct local var description -// block - basic block to check +// varDsc - local var description +// bbInALoop - true if the basic block may be in a loop +// bbIsReturn - true if the basic block always returns // // Returns: -// true if the struct temp needs explicit zero-initialization in this basic block; +// true if the var needs explicit zero-initialization in this basic block; // false otherwise // // Notes: -// If compInitMem is true, structs with GC pointer fields and long-lifetime structs -// are fully zero-initialized in the prologue. Therefore, we don't need to insert -// zero-initialization in this block if it is not in a loop. +// If the variable is not being initialized in a loop, we can avoid explicit zero initialization if +// - the variable is a gc pointer, or +// - the variable is a struct with gc pointer fields and either all fields are gc pointer fields +// or the struct is big enough to guarantee block initialization, or +// - compInitMem is set and the variable has a long lifetime or has gc fields. +// In these cases we will insert zero-initialization in the prolog if necessary. -bool Compiler::fgStructTempNeedsExplicitZeroInit(LclVarDsc* varDsc, BasicBlock* block) +bool Compiler::fgVarNeedsExplicitZeroInit(LclVarDsc* varDsc, bool bbInALoop, bool bbIsReturn) { - return !info.compInitMem || ((block->bbFlags & BBF_BACKWARD_JUMP) != 0) || - (!varDsc->HasGCPtr() && varDsc->lvIsTemp); + if (bbInALoop && !bbIsReturn) + { + return true; + } + + if (varTypeIsGC(varDsc->lvType)) + { + return false; + } + + if ((varDsc->lvType == TYP_STRUCT) && varDsc->HasGCPtr()) + { + ClassLayout* layout = varDsc->GetLayout(); + if (layout->GetSlotCount() == layout->GetGCPtrCount()) + { + return false; + } + +// Below conditions guarantee block initialization, which will initialize +// all struct fields. If the logic for block initialization in CodeGen::genCheckUseBlockInit() +// changes, these conditions need to be updated. +#ifdef TARGET_64BIT + if (roundUp(varDsc->lvSize(), TARGET_POINTER_SIZE) / sizeof(int) > 8) +#else + if (roundUp(varDsc->lvSize(), TARGET_POINTER_SIZE) / sizeof(int) > 4) +#endif + { + return false; + } + } + + return !info.compInitMem || (varDsc->lvIsTemp && !varDsc->HasGCPtr()); } /*****************************************************************************/ diff --git a/src/coreclr/src/jit/disasm.cpp b/src/coreclr/src/jit/disasm.cpp index 9190820ff0168c..5896454685f685 100644 --- a/src/coreclr/src/jit/disasm.cpp +++ b/src/coreclr/src/jit/disasm.cpp @@ -319,9 +319,9 @@ size_t DisAssembler::disCchAddrMember( break; } -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture -#endif // _TARGET_* +#endif // TARGET* if (retval == 0) { @@ -568,9 +568,9 @@ size_t DisAssembler::disCchFixupMember( break; } -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture -#endif // _TARGET_* +#endif // TARGET* /* no displacement */ @@ -781,9 +781,9 @@ size_t DisAssembler::disCchRegRelMember( break; } -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture -#endif // _TARGET_* +#endif // TARGET* /* save displacement */ @@ -1083,9 +1083,9 @@ size_t DisAssembler::CbDisassemble(DIS* pdis, break; } // end switch -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture -#endif // _TARGET_* +#endif // TARGET* return cb; } // end if @@ -1252,7 +1252,7 @@ void DisAssembler::DisasmBuffer(FILE* pfile, bool printit) pdis = DIS::PdisNew(DIS::distX8664); #elif defined(TARGET_ARM64) pdis = DIS::PdisNew(DIS::distArm64); -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture #endif diff --git a/src/coreclr/src/jit/disasm.h b/src/coreclr/src/jit/disasm.h index c4d09a38376f74..f7cea20b5c4151 100644 --- a/src/coreclr/src/jit/disasm.h +++ b/src/coreclr/src/jit/disasm.h @@ -45,7 +45,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #include "disx86.h" #elif defined(TARGET_ARM64) #include "disarm64.h" -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture #endif diff --git a/src/coreclr/src/jit/ee_il_dll.cpp b/src/coreclr/src/jit/ee_il_dll.cpp index d5d3bbdefd46bf..cbf8d59135338d 100644 --- a/src/coreclr/src/jit/ee_il_dll.cpp +++ b/src/coreclr/src/jit/ee_il_dll.cpp @@ -517,7 +517,7 @@ unsigned Compiler::eeGetArgSize(CORINFO_ARG_LIST_HANDLE list, CORINFO_SIG_INFO* // otherwise will we pass this struct by value in multiple registers #else NYI("unknown target"); -#endif // defined(_TARGET_XXX_) +#endif // defined(TARGET_XXX) #endif // FEATURE_MULTIREG_ARGS // we pass this struct by value in multiple registers diff --git a/src/coreclr/src/jit/eeinterface.cpp b/src/coreclr/src/jit/eeinterface.cpp index d2efd790a0e595..d0a08959f43db8 100644 --- a/src/coreclr/src/jit/eeinterface.cpp +++ b/src/coreclr/src/jit/eeinterface.cpp @@ -102,23 +102,24 @@ const char* Compiler::eeGetMethodFullName(CORINFO_METHOD_HANDLE hnd) /* add length of methodName and opening bracket */ length += strlen(methodName) + 1; - /* figure out the signature */ + PAL_TRY(FilterSuperPMIExceptionsParam_eeinterface*, pParam, ¶m) + { - param.pThis->eeGetMethodSig(param.hnd, ¶m.sig); + /* figure out the signature */ - // allocate space to hold the class names for each of the parameters + pParam->pThis->eeGetMethodSig(pParam->hnd, &pParam->sig); - if (param.sig.numArgs > 0) - { - param.pArgNames = getAllocator(CMK_DebugOnly).allocate(param.sig.numArgs); - } - else - { - param.pArgNames = nullptr; - } + // allocate space to hold the class names for each of the parameters + + if (pParam->sig.numArgs > 0) + { + pParam->pArgNames = pParam->pThis->getAllocator(CMK_DebugOnly).allocate(pParam->sig.numArgs); + } + else + { + pParam->pArgNames = nullptr; + } - PAL_TRY(FilterSuperPMIExceptionsParam_eeinterface*, pParam, ¶m) - { unsigned i; pParam->argLst = pParam->sig.args; diff --git a/src/coreclr/src/jit/emit.cpp b/src/coreclr/src/jit/emit.cpp index d621d5a060481a..9288f6c2c7392d 100644 --- a/src/coreclr/src/jit/emit.cpp +++ b/src/coreclr/src/jit/emit.cpp @@ -4615,6 +4615,16 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, } #endif +#ifdef TARGET_XARCH + // For x64/x86, align Tier1 methods to 32 byte boundaries if + // they are larger than 16 bytes and contain a loop. + // + if (emitComp->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER1) && (emitTotalHotCodeSize > 16) && emitComp->fgHasLoops) + { + allocMemFlag = CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN; + } +#endif + if (emitConsDsc.align16) { allocMemFlag = static_cast(allocMemFlag | CORJIT_ALLOCMEM_FLG_RODATA_16BYTE_ALIGN); diff --git a/src/coreclr/src/jit/emit.h b/src/coreclr/src/jit/emit.h index cec64ecb811881..37a1795aa13e24 100644 --- a/src/coreclr/src/jit/emit.h +++ b/src/coreclr/src/jit/emit.h @@ -1309,7 +1309,7 @@ class emitter #define PERFSCORE_LATENCY_WR_GENERAL PERFSCORE_LATENCY_1C #define PERFSCORE_LATENCY_RD_WR_GENERAL PERFSCORE_LATENCY_4C -#endif // _TARGET_XXX +#endif // TARGET_XXX // Make this an enum: // diff --git a/src/coreclr/src/jit/emitarm64.cpp b/src/coreclr/src/jit/emitarm64.cpp index 4771a95e9202a8..c196d95ebf4da4 100644 --- a/src/coreclr/src/jit/emitarm64.cpp +++ b/src/coreclr/src/jit/emitarm64.cpp @@ -730,6 +730,35 @@ void emitter::emitInsSanityCheck(instrDesc* id) assert(isVectorRegister(id->idReg2())); break; + case IF_DV_2Q: // DV_2Q .........X...... ......nnnnnddddd Sd Vn (faddp, fmaxnmp, fmaxp, fminnmp, + // fminp - scalar) + if (id->idOpSize() == EA_8BYTE) + { + assert(id->idInsOpt() == INS_OPTS_2D); + } + else + { + assert(id->idOpSize() == EA_4BYTE); + assert(id->idInsOpt() == INS_OPTS_2S); + } + assert(isVectorRegister(id->idReg1())); + assert(isVectorRegister(id->idReg2())); + break; + + case IF_DV_2R: // DV_2R .Q.......X...... ......nnnnnddddd Sd Vn (fmaxnmv, fmaxv, fminnmv, fminv) + assert(id->idOpSize() == EA_4BYTE); + assert(id->idInsOpt() == INS_OPTS_4S); + assert(isVectorRegister(id->idReg1())); + assert(isVectorRegister(id->idReg2())); + break; + + case IF_DV_2S: // DV_2S ........XX...... ......nnnnnddddd Sd Vn (addp - scalar) + assert(id->idOpSize() == EA_8BYTE); + assert(id->idInsOpt() == INS_OPTS_2D); + assert(isVectorRegister(id->idReg1())); + assert(isVectorRegister(id->idReg2())); + break; + case IF_DV_3A: // DV_3A .Q......XX.mmmmm ......nnnnnddddd Vd Vn Vm (vector) assert(isValidVectorDatasize(id->idOpSize())); assert(isValidArrangement(id->idOpSize(), id->idInsOpt())); @@ -895,6 +924,11 @@ bool emitter::emitInsMayWriteToGCReg(instrDesc* id) case IF_DV_2P: // DV_2P ................ ......nnnnnddddd Vd Vn (aes*, sha1su1) - Vd both source and // destination + case IF_DV_2Q: // DV_2Q .........X...... ......nnnnnddddd Sd Vn (faddp, fmaxnmp, fmaxp, fminnmp, + // fminp - scalar) + case IF_DV_2R: // DV_2R .Q.......X...... ......nnnnnddddd Sd Vn (fmaxnmv, fmaxv, fminnmv, fminv) + case IF_DV_2S: // DV_2S ........XX...... ......nnnnnddddd Sd Vn (addp - scalar) + case IF_DV_3A: // DV_3A .Q......XX.mmmmm ......nnnnnddddd Vd Vn Vm (vector) case IF_DV_3AI: // DV_3AI .Q......XXLMmmmm ....H.nnnnnddddd Vd Vn Vm[] (vector) case IF_DV_3B: // DV_3B .Q.......X.mmmmm ......nnnnnddddd Vd Vn Vm (vector) @@ -1527,7 +1561,8 @@ emitter::code_t emitter::emitInsCode(instruction ins, insFormat fmt) const static insFormat formatEncode2M[2] = {IF_DV_3A, IF_DV_3AI}; const static insFormat formatEncode2N[2] = {IF_DV_2N, IF_DV_2O}; const static insFormat formatEncode2O[2] = {IF_DV_3E, IF_DV_3A}; - const static insFormat formatEncode2P[2] = {IF_DV_2G, IF_DV_3B}; + const static insFormat formatEncode2P[2] = {IF_DV_2Q, IF_DV_3B}; + const static insFormat formatEncode2Q[2] = {IF_DV_2S, IF_DV_3A}; code_t code = BAD_CODE; insFormat insFmt = emitInsFormat(ins); @@ -1976,6 +2011,17 @@ emitter::code_t emitter::emitInsCode(instruction ins, insFormat fmt) } break; + case IF_EN2Q: + for (index = 0; index < 2; index++) + { + if (fmt == formatEncode2Q[index]) + { + encoding_found = true; + break; + } + } + break; + case IF_BI_0A: case IF_BI_0B: case IF_BI_0C: @@ -2038,6 +2084,7 @@ emitter::code_t emitter::emitInsCode(instruction ins, insFormat fmt) case IF_DV_2N: case IF_DV_2O: case IF_DV_2P: + case IF_DV_2R: case IF_DV_3A: case IF_DV_3AI: case IF_DV_3B: @@ -4293,12 +4340,34 @@ void emitter::emitIns_R_R( break; case INS_faddp: + case INS_fmaxnmp: + case INS_fmaxp: + case INS_fminnmp: + case INS_fminp: // Scalar operation - assert(insOptsNone(opt)); - assert(isValidVectorElemsizeFloat(size)); + assert(((size == EA_4BYTE) && (opt == INS_OPTS_2S)) || ((size == EA_8BYTE) && (opt == INS_OPTS_2D))); assert(isVectorRegister(reg1)); assert(isVectorRegister(reg2)); - fmt = IF_DV_2G; + fmt = IF_DV_2Q; + break; + + case INS_fmaxnmv: + case INS_fmaxv: + case INS_fminnmv: + case INS_fminv: + assert(size == EA_4BYTE); + assert(opt == INS_OPTS_4S); + assert(isVectorRegister(reg1)); + assert(isVectorRegister(reg2)); + fmt = IF_DV_2R; + break; + + case INS_addp: + assert(size == EA_8BYTE); + assert(opt == INS_OPTS_2D); + assert(isVectorRegister(reg1)); + assert(isVectorRegister(reg2)); + fmt = IF_DV_2S; break; case INS_fcvt: @@ -5304,14 +5373,19 @@ void emitter::emitIns_R_R_R( case INS_saba: case INS_sabd: case INS_smax: + case INS_smaxp: case INS_smin: + case INS_sminp: case INS_uaba: case INS_uabd: case INS_umax: + case INS_umaxp: case INS_umin: + case INS_uminp: assert(elemsize != EA_8BYTE); // can't use 2D or 1D __fallthrough; + case INS_addp: case INS_uzp1: case INS_uzp2: case INS_zip1: @@ -5393,7 +5467,9 @@ void emitter::emitIns_R_R_R( case INS_fsub: case INS_fdiv: case INS_fmax: + case INS_fmaxnm: case INS_fmin: + case INS_fminnm: case INS_fabd: case INS_fmul: case INS_fmulx: @@ -5432,6 +5508,11 @@ void emitter::emitIns_R_R_R( break; case INS_faddp: + case INS_fmaxnmp: + case INS_fmaxp: + case INS_fminnmp: + case INS_fminp: + case INS_fmla: case INS_fmls: assert(isVectorRegister(reg1)); @@ -10074,7 +10155,9 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) dst += emitOutput_Instr(dst, code); break; - case IF_DV_2G: // DV_2G .........X...... ......nnnnnddddd Vd Vn (fmov,fcvtXX - register) + case IF_DV_2G: // DV_2G .........X...... ......nnnnnddddd Vd Vn (fmov, fcvtXX - register) + case IF_DV_2Q: // DV_2Q .........X...... ......nnnnnddddd Vd Vn (faddp, fmaxnmp, fmaxp, fminnmp, + // fminp - scalar) elemsize = id->idOpSize(); code = emitInsCode(ins, fmt); code |= insEncodeFloatElemsize(elemsize); // X @@ -10119,6 +10202,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) break; case IF_DV_2L: // DV_2L ........XX...... ......nnnnnddddd Vd Vn (abs, neg - scalar) + case IF_DV_2S: // DV_2S ........XX...... ......nnnnnddddd Sd Vn (addp - scalar) elemsize = id->idOpSize(); code = emitInsCode(ins, fmt); code |= insEncodeElemsize(elemsize); // XX @@ -10165,6 +10249,17 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) dst += emitOutput_Instr(dst, code); break; + case IF_DV_2R: // DV_2R .Q.......X...... ......nnnnnddddd Sd Vn (fmaxnmv, fmaxv, fminnmv, fminv) + code = emitInsCode(ins, fmt); + datasize = optGetDatasize(id->idInsOpt()); + elemsize = optGetElemsize(id->idInsOpt()); + code |= insEncodeVectorsize(datasize); // Q + code |= insEncodeFloatElemsize(elemsize); // X + code |= insEncodeReg_Vd(id->idReg1()); // ddddd + code |= insEncodeReg_Vn(id->idReg2()); // nnnnn + dst += emitOutput_Instr(dst, code); + break; + case IF_DV_3A: // DV_3A .Q......XX.mmmmm ......nnnnnddddd Vd Vn Vm (vector) code = emitInsCode(ins, fmt); elemsize = optGetElemsize(id->idInsOpt()); @@ -11713,6 +11808,15 @@ void emitter::emitDispIns( emitDispReg(id->idReg2(), srcsize, false); break; + case IF_DV_2Q: // DV_2Q .........X...... ......nnnnnddddd Sd Vn (faddp, fmaxnmp, fmaxp, fminnmp, + // fminp - scalar) + case IF_DV_2R: // DV_2R .Q.......X...... ......nnnnnddddd Sd Vn (fmaxnmv, fmaxv, fminnmv, fminv) + case IF_DV_2S: // DV_2S ........XX...... ......nnnnnddddd Sd Vn (addp - scalar) + elemsize = id->idOpSize(); + emitDispReg(id->idReg1(), elemsize, true); + emitDispVectorReg(id->idReg2(), id->idInsOpt(), false); + break; + case IF_DV_3A: // DV_3A .Q......XX.mmmmm ......nnnnnddddd Vd Vn Vm (vector) case IF_DV_3B: // DV_3B .Q.........mmmmm ......nnnnnddddd Vd Vn Vm (vector) emitDispVectorReg(id->idReg1(), id->idInsOpt(), true); @@ -12699,7 +12803,7 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins } break; - case IF_DV_2G: // fmov, fabs, fneg, fsqrt, faddp, fcmXX, fcvtXX, frintX, scvtf, ucvtf (scalar) + case IF_DV_2G: // fmov, fabs, fneg, fsqrt, fcmXX, fcvtXX, frintX, scvtf, ucvtf (scalar) switch (ins) { case INS_fmov: @@ -12710,7 +12814,6 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins case INS_fabs: case INS_fneg: - case INS_faddp: case INS_fcvtas: case INS_fcvtau: @@ -12764,21 +12867,49 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins } break; - case IF_DV_3B: // fadd, fsub, fdiv, fmul, fmulx, fmla, fmls, fmin, fmax, fabd, faddp, fcmXX (vector) + case IF_DV_2Q: // faddp, fmaxnmp, fmaxp, fminnmp, fminp (scalar) + case IF_DV_2R: // fmaxnmv, fmaxv, fminnmv, fminv + case IF_DV_2S: // addp (scalar) + result.insThroughput = PERFSCORE_THROUGHPUT_2X; + result.insLatency = PERFSCORE_LATENCY_4C; + break; + + case IF_DV_3B: // fadd, fsub, fdiv, fmul, fmulx, fmla, fmls, fmin, fminnm, fmax, fmaxnm, fabd, fcmXX + // faddp, fmaxnmp, fmaxp, fminnmp, fminp, addp (vector) switch (ins) { case INS_fmin: + case INS_fminnm: case INS_fmax: + case INS_fmaxnm: case INS_fabd: case INS_fadd: case INS_fsub: - case INS_faddp: case INS_fmul: case INS_fmulx: result.insThroughput = PERFSCORE_THROUGHPUT_2X; result.insLatency = PERFSCORE_LATENCY_4C; break; + case INS_faddp: + case INS_fmaxnmp: + case INS_fmaxp: + case INS_fminnmp: + case INS_fminp: + case INS_addp: + if (id->idOpSize() == EA_16BYTE) + { + // Q-form + result.insThroughput = PERFSCORE_THROUGHPUT_1C; + result.insLatency = PERFSCORE_LATENCY_4C; + } + else + { + result.insThroughput = PERFSCORE_THROUGHPUT_2X; + result.insLatency = PERFSCORE_LATENCY_4C; + } + break; + case INS_facge: case INS_facgt: case INS_fcmeq: @@ -12833,13 +12964,15 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins result.insLatency = PERFSCORE_LATENCY_4C; break; - case IF_DV_3D: // fadd, fsub, fdiv, fmul, fmulx, fmla, fmls, fmin, fmax, fabd, faddp, fcmXX (scalar) + case IF_DV_3D: // fadd, fsub, fdiv, fmul, fmulx, fmla, fmls, fmin, fminnm, fmax, fmaxnm, fabd, fcmXX (scalar) switch (ins) { case INS_fadd: case INS_fsub: case INS_fmin: + case INS_fminnm: case INS_fmax: + case INS_fmaxnm: case INS_fmul: case INS_fmulx: case INS_fnmul: @@ -12948,7 +13081,7 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins case IF_DV_3A: // (vector) // add, sub, mul, mla, mls, cmeq, cmge, cmgt, cmhi, cmhs, ctst, - // pmul, saba, uaba, sabd, uabd, umin, umax, smin, smax, + // pmul, saba, uaba, sabd, uabd, umin, uminp, umax, umaxp, smin, sminp, smax, smaxp switch (ins) { case INS_add: @@ -12958,10 +13091,14 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins case INS_cmgt: case INS_cmhi: case INS_cmhs: - case INS_umin: - case INS_umax: - case INS_smin: case INS_smax: + case INS_smaxp: + case INS_smin: + case INS_sminp: + case INS_umax: + case INS_umaxp: + case INS_umin: + case INS_uminp: case INS_uzp1: case INS_uzp2: case INS_zip1: diff --git a/src/coreclr/src/jit/emitfmtsarm64.h b/src/coreclr/src/jit/emitfmtsarm64.h index 78d8da7d30082e..42e4c5287b47b6 100644 --- a/src/coreclr/src/jit/emitfmtsarm64.h +++ b/src/coreclr/src/jit/emitfmtsarm64.h @@ -86,6 +86,7 @@ IF_DEF(EN2M, IS_NONE, NONE) // Instruction has 2 possible encoding types, type M IF_DEF(EN2N, IS_NONE, NONE) // Instruction has 2 possible encoding types, type N IF_DEF(EN2O, IS_NONE, NONE) // Instruction has 2 possible encoding types, type O IF_DEF(EN2P, IS_NONE, NONE) // Instruction has 2 possible encoding types, type P +IF_DEF(EN2Q, IS_NONE, NONE) // Instruction has 2 possible encoding types, type Q ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @@ -181,8 +182,7 @@ IF_DEF(DV_1C, IS_NONE, NONE) // DV_1C .........X...... ......nnnnn..... V IF_DEF(DV_2A, IS_NONE, NONE) // DV_2A .Q.......X...... ......nnnnnddddd Vd Vn (fabs, fcvtXX - vector) IF_DEF(DV_2B, IS_NONE, NONE) // DV_2B .Q.........iiiii ......nnnnnddddd Rd Vn[] (umov/smov - to general) -IF_DEF(DV_2C, IS_NONE, NONE) // DV_2C .Q.........iiiii ......nnnnnddddd Vd Rn (dup/ins - vector from - // general) +IF_DEF(DV_2C, IS_NONE, NONE) // DV_2C .Q.........iiiii ......nnnnnddddd Vd Rn (dup/ins - vector from general) IF_DEF(DV_2D, IS_NONE, NONE) // DV_2D .Q.........iiiii ......nnnnnddddd Vd Vn[] (dup - vector) IF_DEF(DV_2E, IS_NONE, NONE) // DV_2E ...........iiiii ......nnnnnddddd Vd Vn[] (dup - scalar) IF_DEF(DV_2F, IS_NONE, NONE) // DV_2F ...........iiiii .jjjj.nnnnnddddd Vd[] Vn[] (ins - element) @@ -195,7 +195,10 @@ IF_DEF(DV_2L, IS_NONE, NONE) // DV_2L ........XX...... ......nnnnnddddd V IF_DEF(DV_2M, IS_NONE, NONE) // DV_2M .Q......XX...... ......nnnnnddddd Vd Vn (abs, neg - vector) IF_DEF(DV_2N, IS_NONE, NONE) // DV_2N .........iiiiiii ......nnnnnddddd Vd Vn imm (shift - scalar) IF_DEF(DV_2O, IS_NONE, NONE) // DV_2O .Q.......iiiiiii ......nnnnnddddd Vd Vn imm (shift - vector) -IF_DEF(DV_2P, IS_NONE, NONE) // DV_2P .,.............. ......nnnnnddddd Vd Vn (Vd used as both source and destination) +IF_DEF(DV_2P, IS_NONE, NONE) // DV_2P ................ ......nnnnnddddd Vd Vn (Vd used as both source and destination) +IF_DEF(DV_2Q, IS_NONE, NONE) // DV_2Q .........X...... ......nnnnnddddd Sd Vn (faddp, fmaxnmp, fmaxp, fminnmp, fminp - scalar) +IF_DEF(DV_2R, IS_NONE, NONE) // DV_2R .Q.......X...... ......nnnnnddddd Sd Vn (fmaxnmv, fmaxv, fminnmv, fminv) +IF_DEF(DV_2S, IS_NONE, NONE) // DV_2S ........XX...... ......nnnnnddddd Sd Vn (addp - scalar) IF_DEF(DV_3A, IS_NONE, NONE) // DV_3A .Q......XX.mmmmm ......nnnnnddddd Vd Vn Vm (vector) IF_DEF(DV_3AI, IS_NONE, NONE) // DV_3AI .Q......XXLMmmmm ....H.nnnnnddddd Vd Vn Vm[] (vector by elem) diff --git a/src/coreclr/src/jit/emitinl.h b/src/coreclr/src/jit/emitinl.h index 6647c61bbdcf37..82ea2e4f4f8f1d 100644 --- a/src/coreclr/src/jit/emitinl.h +++ b/src/coreclr/src/jit/emitinl.h @@ -13,7 +13,7 @@ inline bool emitter::instrIs3opImul(instruction ins) { #ifdef TARGET_X86 return ((ins >= INS_imul_AX) && (ins <= INS_imul_DI)); -#else // _TARGET_AMD64 +#else // TARGET_AMD64 return ((ins >= INS_imul_AX) && (ins <= INS_imul_15)); #endif } @@ -23,7 +23,7 @@ inline bool emitter::instrIsExtendedReg3opImul(instruction ins) { #ifdef TARGET_X86 return false; -#else // _TARGET_AMD64 +#else // TARGET_AMD64 return ((ins >= INS_imul_08) && (ins <= INS_imul_15)); #endif } diff --git a/src/coreclr/src/jit/emitxarch.cpp b/src/coreclr/src/jit/emitxarch.cpp index ca5b1623275388..22b800ecee4fae 100644 --- a/src/coreclr/src/jit/emitxarch.cpp +++ b/src/coreclr/src/jit/emitxarch.cpp @@ -456,7 +456,7 @@ bool TakesRexWPrefix(instruction ins, emitAttr attr) { return false; } -#else //!_TARGET_AMD64 = TARGET_X86 +#else //! TARGET_AMD64 = TARGET_X86 return false; #endif //! TARGET_AMD64 } @@ -7952,7 +7952,7 @@ void emitter::emitDispInsHex(instrDesc* id, BYTE* code, size_t sz) #ifdef TARGET_AMD64 // how many bytes per instruction we format for const size_t digits = 10; -#else // _TARGET_X86 +#else // TARGET_X86 const size_t digits = 6; #endif printf(" "); @@ -14283,7 +14283,7 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins result.insLatency = PERFSCORE_LATENCY_1C; } break; -#endif // _TARGET_X86 +#endif // TARGET_X86 #ifdef TARGET_AMD64 case INS_movsq: diff --git a/src/coreclr/src/jit/flowgraph.cpp b/src/coreclr/src/jit/flowgraph.cpp index 9528f47361532a..6cbab31aceef16 100644 --- a/src/coreclr/src/jit/flowgraph.cpp +++ b/src/coreclr/src/jit/flowgraph.cpp @@ -22617,8 +22617,10 @@ Compiler::fgWalkResult Compiler::fgLateDevirtualization(GenTree** pTree, fgWalkD JITDUMP(" ... found foldable jtrue at [%06u] in BB%02u\n", dspTreeID(tree), block->bbNum); noway_assert((block->bbNext->countOfInEdges() > 0) && (block->bbJumpDest->countOfInEdges() > 0)); - // Had hoped to assert here that we are not losing any - // side effects, but can't find a way to express it properly. + // We have a constant operand, and should have the all clear to optimize. + // Update side effects on the tree, assert there aren't any, and bash to nop. + comp->gtUpdateNodeSideEffects(tree); + assert((tree->gtFlags & GTF_SIDE_EFFECT) == 0); tree->gtBashToNOP(); BasicBlock* bTaken = nullptr; @@ -23579,10 +23581,15 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) CORINFO_METHOD_INFO* InlineeMethodInfo = InlineeCompiler->info.compMethodInfo; - unsigned lclCnt = InlineeMethodInfo->locals.numArgs; + unsigned lclCnt = InlineeMethodInfo->locals.numArgs; + bool bbInALoop = (block->bbFlags & BBF_BACKWARD_JUMP) != 0; + bool bbIsReturn = block->bbJumpKind == BBJ_RETURN; - // Does callee contain any zero-init local? - if ((lclCnt != 0) && (InlineeMethodInfo->options & CORINFO_OPT_INIT_LOCALS) != 0) + // If the callee contains zero-init locals, we need to explicitly initialize them if we are + // in a loop or if the caller doesn't have compInitMem set. Otherwise we can rely on the + // normal logic in the caller to insert zero-init in the prolog if necessary. + if ((lclCnt != 0) && ((InlineeMethodInfo->options & CORINFO_OPT_INIT_LOCALS) != 0) && + ((bbInALoop && !bbIsReturn) || !info.compInitMem)) { #ifdef DEBUG @@ -23596,9 +23603,20 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) { unsigned tmpNum = inlineInfo->lclTmpNum[lclNum]; - // Is the local used at all? + // If the local is used check whether we need to insert explicit zero initialization. if (tmpNum != BAD_VAR_NUM) { + if (!fgVarNeedsExplicitZeroInit(lvaGetDesc(tmpNum), bbInALoop, bbIsReturn)) + { +#ifdef DEBUG + if (verbose) + { + printf("\nSkipping zero initialization of V%02u\n", tmpNum); + } +#endif // DEBUG + continue; + } + var_types lclTyp = (var_types)lvaTable[tmpNum].lvType; noway_assert(lclTyp == lclVarInfo[lclNum + inlineInfo->argCnt].lclTypeInfo); @@ -23613,18 +23631,14 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) { CORINFO_CLASS_HANDLE structType = lclVarInfo[lclNum + inlineInfo->argCnt].lclVerTypeInfo.GetClassHandle(); - - if (fgStructTempNeedsExplicitZeroInit(lvaTable + tmpNum, block)) - { - tree = gtNewBlkOpNode(gtNewLclvNode(tmpNum, lclTyp), // Dest - gtNewIconNode(0), // Value - false, // isVolatile - false); // not copyBlock - - newStmt = gtNewStmt(tree, callILOffset); - fgInsertStmtAfter(block, afterStmt, newStmt); - afterStmt = newStmt; - } + tree = gtNewBlkOpNode(gtNewLclvNode(tmpNum, lclTyp), // Dest + gtNewIconNode(0), // Value + false, // isVolatile + false); // not copyBlock + + newStmt = gtNewStmt(tree, callILOffset); + fgInsertStmtAfter(block, afterStmt, newStmt); + afterStmt = newStmt; } #ifdef DEBUG diff --git a/src/coreclr/src/jit/gentree.cpp b/src/coreclr/src/jit/gentree.cpp index 5e0eb6aef1dcc4..a9aac9d6d4c22e 100644 --- a/src/coreclr/src/jit/gentree.cpp +++ b/src/coreclr/src/jit/gentree.cpp @@ -3035,7 +3035,7 @@ bool Compiler::gtMarkAddrMode(GenTree* addr, int* pCostEx, int* pCostSz, var_typ } } #else -#error "Unknown _TARGET_" +#error "Unknown TARGET" #endif assert(addr->gtOper == GT_ADD); @@ -3333,7 +3333,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) case GT_CNS_LNG: case GT_CNS_STR: case GT_CNS_INT: -#error "Unknown _TARGET_" +#error "Unknown TARGET" #endif COMMON_CNS: @@ -3532,7 +3532,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) costSz = 6; } #else -#error "Unknown _TARGET_" +#error "Unknown TARGET" #endif /* Overflow casts are a lot more expensive */ @@ -5670,11 +5670,11 @@ GenTree* Compiler::gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1, return node; } -GenTree* Compiler::gtNewQmarkNode(var_types type, GenTree* cond, GenTree* colon) +GenTreeQmark* Compiler::gtNewQmarkNode(var_types type, GenTree* cond, GenTree* colon) { compQmarkUsed = true; cond->gtFlags |= GTF_RELOP_QMARK; - GenTree* result = new (this, GT_QMARK) GenTreeQmark(type, cond, colon, this); + GenTreeQmark* result = new (this, GT_QMARK) GenTreeQmark(type, cond, colon, this); #ifdef DEBUG if (compQmarkRationalized) { @@ -14849,7 +14849,7 @@ GenTree* Compiler::gtNewTempAssign( } #ifdef DEBUG - /* Make sure the actual types match */ + // Make sure the actual types match. if (genActualType(valTyp) != genActualType(dstTyp)) { // Plus some other exceptions that are apparently legal: @@ -14869,6 +14869,12 @@ GenTree* Compiler::gtNewTempAssign( { ok = true; } + else if (!varTypeIsGC(dstTyp) && (genTypeSize(valTyp) == genTypeSize(dstTyp))) + { + // We can have assignments that require a change of register file, e.g. for arguments + // and call returns. Lowering and Codegen will handle these. + ok = true; + } if (!ok) { @@ -14898,7 +14904,7 @@ GenTree* Compiler::gtNewTempAssign( // internal trees use SIMD types that are not used by the input IL. In this case, we allow // a null type handle and derive the necessary information about the type from its varType. CORINFO_CLASS_HANDLE structHnd = gtGetStructHandleIfPresent(val); - if (varTypeIsStruct(valTyp) && ((structHnd != NO_CLASS_HANDLE) || (varTypeIsSIMD(valTyp)))) + if (varTypeIsStruct(varDsc) && ((structHnd != NO_CLASS_HANDLE) || (varTypeIsSIMD(valTyp)))) { // The struct value may be be a child of a GT_COMMA. GenTree* valx = val->gtEffectiveVal(/*commaOnly*/ true); @@ -14917,6 +14923,11 @@ GenTree* Compiler::gtNewTempAssign( } else { + // We may have a scalar type variable assigned a struct value, e.g. a 'genReturnLocal' + // when the ABI calls for returning a struct as a primitive type. + // TODO-1stClassStructs: When we stop "lying" about the types for ABI purposes, the + // 'genReturnLocal' should be the original struct type. + assert(!varTypeIsStruct(valTyp) || typGetObjLayout(structHnd)->GetSize() == genTypeSize(varDsc)); asg = gtNewAssignNode(dest, val); } @@ -16759,7 +16770,7 @@ GenTree* Compiler::gtGetSIMDZero(var_types simdType, var_types baseType, CORINFO } break; -#if defined(_TARGET_XARCH4_) && defined(FEATURE_HW_INTRINSICS) +#if defined(TARGET_XARCH) && defined(FEATURE_HW_INTRINSICS) case TYP_SIMD32: switch (baseType) { @@ -16858,6 +16869,9 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleIfPresent(GenTree* tree) case GT_OBJ: structHnd = tree->AsObj()->GetLayout()->GetClassHandle(); break; + case GT_BLK: + structHnd = tree->AsBlk()->GetLayout()->GetClassHandle(); + break; case GT_CALL: structHnd = tree->AsCall()->gtRetClsHnd; break; @@ -16933,6 +16947,10 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleIfPresent(GenTree* tree) } } } + else if (addr->OperGet() == GT_LCL_VAR) + { + structHnd = gtGetStructHandleIfPresent(addr); + } } } break; @@ -18490,7 +18508,7 @@ void ReturnTypeDesc::InitializeStructReturnType(Compiler* comp, CORINFO_CLASS_HA m_regType[i] = comp->getJitGCType(gcPtrs[i]); } -#else // _TARGET_XXX_ +#else // TARGET_XXX // This target needs support here! // diff --git a/src/coreclr/src/jit/gentree.h b/src/coreclr/src/jit/gentree.h index 8d5578190eea05..755b5ee4c5d0f1 100644 --- a/src/coreclr/src/jit/gentree.h +++ b/src/coreclr/src/jit/gentree.h @@ -3919,6 +3919,7 @@ struct GenTreeCall final : public GenTree #define GTF_CALL_M_GUARDED 0x00200000 // GT_CALL -- this call was transformed by guarded devirtualization #define GTF_CALL_M_ALLOC_SIDE_EFFECTS 0x00400000 // GT_CALL -- this is a call to an allocator with side effects #define GTF_CALL_M_SUPPRESS_GC_TRANSITION 0x00800000 // GT_CALL -- suppress the GC transition (i.e. during a pinvoke) but a separate GC safe point is required. +#define GTF_CALL_M_EXP_RUNTIME_LOOKUP 0x01000000 // GT_CALL -- this call needs to be tranformed into CFG for the dynamic dictionary expansion feature. // clang-format on @@ -4168,6 +4169,21 @@ struct GenTreeCall final : public GenTree gtCallMoreFlags |= GTF_CALL_M_GUARDED; } + void SetExpRuntimeLookup() + { + gtFlags |= GTF_CALL_M_EXP_RUNTIME_LOOKUP; + } + + void ClearExpRuntimeLookup() + { + gtFlags &= ~GTF_CALL_M_EXP_RUNTIME_LOOKUP; + } + + bool IsExpRuntimeLookup() const + { + return (gtFlags & GTF_CALL_M_EXP_RUNTIME_LOOKUP) != 0; + } + unsigned gtCallMoreFlags; // in addition to gtFlags unsigned char gtCallType : 3; // value from the gtCallTypes enumeration diff --git a/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp index f3e6e8e5bb3010..6908d975ce075a 100644 --- a/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp @@ -293,6 +293,14 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) GetEmitter()->emitIns_R_R_R(ins, emitSize, targetReg, op2Reg, op1Reg, opt); break; + case NI_AdvSimd_FusedMultiplyAddScalar: + case NI_AdvSimd_FusedMultiplyAddNegatedScalar: + case NI_AdvSimd_FusedMultiplySubtractNegatedScalar: + case NI_AdvSimd_FusedMultiplySubtractScalar: + assert(opt == INS_OPTS_NONE); + GetEmitter()->emitIns_R_R_R_R(ins, emitSize, targetReg, op2Reg, op3Reg, op1Reg); + break; + default: unreached(); } diff --git a/src/coreclr/src/jit/hwintrinsiclistarm64.h b/src/coreclr/src/jit/hwintrinsiclistarm64.h index d619ccbd4cb6e7..b44740d6cf1759 100644 --- a/src/coreclr/src/jit/hwintrinsiclistarm64.h +++ b/src/coreclr/src/jit/hwintrinsiclistarm64.h @@ -67,6 +67,12 @@ HARDWARE_INTRINSIC(AdvSimd, CompareLessThan, - HARDWARE_INTRINSIC(AdvSimd, CompareLessThanOrEqual, -1, -1, 2, {INS_cmge, INS_cmhs, INS_cmge, INS_cmhs, INS_cmge, INS_cmhs, INS_invalid, INS_invalid, INS_fcmge, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(AdvSimd, CompareTest, -1, -1, 2, {INS_cmtst, INS_cmtst, INS_cmtst, INS_cmtst, INS_cmtst, INS_cmtst, INS_invalid, INS_invalid, INS_cmtst, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_Commutative|HW_Flag_UnfixedSIMDSize) HARDWARE_INTRINSIC(AdvSimd, DivideScalar, -1, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fdiv, INS_fdiv}, HW_Category_SIMDScalar, HW_Flag_NoContainment) +HARDWARE_INTRINSIC(AdvSimd, FusedMultiplyAdd, -1, -1, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fmla, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize) +HARDWARE_INTRINSIC(AdvSimd, FusedMultiplyAddScalar, -1, 8, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fmadd, INS_fmadd}, HW_Category_SIMDScalar, HW_Flag_NoContainment|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(AdvSimd, FusedMultiplyAddNegatedScalar, -1, 8, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fnmadd, INS_fnmadd}, HW_Category_SIMDScalar, HW_Flag_NoContainment|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(AdvSimd, FusedMultiplySubtract, -1, -1, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fmls, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize) +HARDWARE_INTRINSIC(AdvSimd, FusedMultiplySubtractScalar, -1, 8, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fmsub, INS_fmsub}, HW_Category_SIMDScalar, HW_Flag_NoContainment|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(AdvSimd, FusedMultiplySubtractNegatedScalar, -1, 8, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fnmsub, INS_fnmsub}, HW_Category_SIMDScalar, HW_Flag_NoContainment|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(AdvSimd, LeadingSignCount, -1, -1, 1, {INS_cls, INS_invalid, INS_cls, INS_invalid, INS_cls, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize) HARDWARE_INTRINSIC(AdvSimd, LeadingZeroCount, -1, -1, 1, {INS_clz, INS_clz, INS_clz, INS_clz, INS_clz, INS_clz, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize) HARDWARE_INTRINSIC(AdvSimd, LoadVector64, -1, 8, 1, {INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1}, HW_Category_MemoryLoad, HW_Flag_NoRMWSemantics) @@ -75,6 +81,8 @@ HARDWARE_INTRINSIC(AdvSimd, Max, - HARDWARE_INTRINSIC(AdvSimd, Min, -1, -1, 2, {INS_smin, INS_umin, INS_smin, INS_umin, INS_smin, INS_umin, INS_invalid, INS_invalid, INS_fmin, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize|HW_Flag_Commutative) HARDWARE_INTRINSIC(AdvSimd, Multiply, -1, -1, 2, {INS_mul, INS_mul, INS_mul, INS_mul, INS_mul, INS_mul, INS_invalid, INS_invalid, INS_fmul, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize|HW_Flag_Commutative) HARDWARE_INTRINSIC(AdvSimd, MultiplyScalar, -1, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fmul, INS_fmul}, HW_Category_SIMDScalar, HW_Flag_NoContainment|HW_Flag_Commutative) +HARDWARE_INTRINSIC(AdvSimd, MultiplyAdd, -1, -1, 3, {INS_mla, INS_mla, INS_mla, INS_mla, INS_mla, INS_mla, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize) +HARDWARE_INTRINSIC(AdvSimd, MultiplySubtract, -1, -1, 3, {INS_mls, INS_mls, INS_mls, INS_mls, INS_mls, INS_mls, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize) HARDWARE_INTRINSIC(AdvSimd, Negate, -1, -1, 1, {INS_neg, INS_invalid, INS_neg, INS_invalid, INS_neg, INS_invalid, INS_invalid, INS_invalid, INS_fneg, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize) HARDWARE_INTRINSIC(AdvSimd, NegateScalar, -1, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fneg, INS_fneg}, HW_Category_SIMDScalar, HW_Flag_NoContainment) HARDWARE_INTRINSIC(AdvSimd, Not, -1, -1, 1, {INS_mvn, INS_mvn, INS_mvn, INS_mvn, INS_mvn, INS_mvn, INS_mvn, INS_mvn, INS_mvn, INS_mvn}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize) @@ -118,6 +126,8 @@ HARDWARE_INTRINSIC(AdvSimd_Arm64, CompareLessThanOrEqualScalar, - HARDWARE_INTRINSIC(AdvSimd_Arm64, CompareTest, -1, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_cmtst, INS_cmtst, INS_invalid, INS_cmtst}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_Commutative) HARDWARE_INTRINSIC(AdvSimd_Arm64, CompareTestScalar, -1, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_cmtst, INS_cmtst, INS_invalid, INS_cmtst}, HW_Category_SIMDScalar, HW_Flag_NoContainment|HW_Flag_Commutative) HARDWARE_INTRINSIC(AdvSimd_Arm64, Divide, -1, -1, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fdiv, INS_fdiv}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize) +HARDWARE_INTRINSIC(AdvSimd_Arm64, FusedMultiplyAdd, -1, 16, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fmla}, HW_Category_SimpleSIMD, HW_Flag_NoContainment) +HARDWARE_INTRINSIC(AdvSimd_Arm64, FusedMultiplySubtract, -1, 16, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fmls}, HW_Category_SimpleSIMD, HW_Flag_NoContainment) HARDWARE_INTRINSIC(AdvSimd_Arm64, Max, -1, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fmax}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_Commutative) HARDWARE_INTRINSIC(AdvSimd_Arm64, MaxScalar, -1, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fmax, INS_fmax}, HW_Category_SIMDScalar, HW_Flag_NoContainment|HW_Flag_Commutative) HARDWARE_INTRINSIC(AdvSimd_Arm64, Min, -1, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fmin}, HW_Category_SimpleSIMD, HW_Flag_NoContainment|HW_Flag_Commutative) diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index 8875a291abaf1d..c38d0cd85318d1 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -1214,7 +1214,9 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr, // If it is a multi-reg struct return, don't change the oper to GT_LCL_FLD. // That is, the IR will be of the form lclVar = call for multi-reg return // - GenTreeLclVar* lcl = destAddr->AsOp()->gtOp1->AsLclVar(); + GenTreeLclVar* lcl = destAddr->AsOp()->gtOp1->AsLclVar(); + unsigned lclNum = lcl->GetLclNum(); + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (src->AsCall()->HasMultiRegRetVal()) { // Mark the struct LclVar as used in a MultiReg return context @@ -1222,13 +1224,13 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr, // TODO-1stClassStructs: Eliminate this pessimization when we can more generally // handle multireg returns. lcl->gtFlags |= GTF_DONT_CSE; - lvaTable[lcl->AsLclVarCommon()->GetLclNum()].lvIsMultiRegRet = true; + varDsc->lvIsMultiRegRet = true; } else if (lcl->gtType != src->gtType) { // We change this to a GT_LCL_FLD (from a GT_ADDR of a GT_LCL_VAR) lcl->ChangeOper(GT_LCL_FLD); - fgLclFldAssign(lcl->AsLclVarCommon()->GetLclNum()); + fgLclFldAssign(lclNum); lcl->gtType = src->gtType; asgType = src->gtType; } @@ -1238,7 +1240,7 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr, #if defined(TARGET_ARM) // TODO-Cleanup: This should have been taken care of in the above HasMultiRegRetVal() case, // but that method has not been updadted to include ARM. - impMarkLclDstNotPromotable(lcl->AsLclVarCommon()->GetLclNum(), src, structHnd); + impMarkLclDstNotPromotable(lclNum, src, structHnd); lcl->gtFlags |= GTF_DONT_CSE; #elif defined(UNIX_AMD64_ABI) // Not allowed for FEATURE_CORCLR which is the only SKU available for System V OSs. @@ -1250,7 +1252,7 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr, // TODO-Cleanup: Why is this needed here? This seems that it will set this even for // non-multireg returns. lcl->gtFlags |= GTF_DONT_CSE; - lvaTable[lcl->AsLclVarCommon()->GetLclNum()].lvIsMultiRegRet = true; + varDsc->lvIsMultiRegRet = true; #endif } else // we don't have a GT_ADDR of a GT_LCL_VAR @@ -2059,7 +2061,8 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken nullptr DEBUGARG("impRuntimeLookup slot")); } - GenTree* indOffTree = nullptr; + GenTree* indOffTree = nullptr; + GenTree* lastIndOfTree = nullptr; // Applied repeated indirections for (WORD i = 0; i < pRuntimeLookup->indirections; i++) @@ -2084,6 +2087,15 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken if (pRuntimeLookup->offsets[i] != 0) { +// The last indirection could be subject to a size check (dynamic dictionary expansion feature) +#if 0 // Uncomment that block when you add sizeOffset field to pRuntimeLookup. + if (i == pRuntimeLookup->indirections - 1 && pRuntimeLookup->sizeOffset != 0xFFFF) + { + lastIndOfTree = impCloneExpr(slotPtrTree, &slotPtrTree, NO_CLASS_HANDLE, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("impRuntimeLookup indirectOffset")); + } +#endif // 0 + slotPtrTree = gtNewOperNode(GT_ADD, TYP_I_IMPL, slotPtrTree, gtNewIconNode(pRuntimeLookup->offsets[i], TYP_I_IMPL)); } @@ -2138,38 +2150,56 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken impSpillSideEffects(true, CHECK_SPILL_ALL DEBUGARG("bubbling QMark1")); // Extract the handle - GenTree* handle = gtNewOperNode(GT_IND, TYP_I_IMPL, slotPtrTree); - handle->gtFlags |= GTF_IND_NONFAULTING; - - GenTree* handleCopy = impCloneExpr(handle, &handle, NO_CLASS_HANDLE, (unsigned)CHECK_SPILL_ALL, - nullptr DEBUGARG("impRuntimeLookup typehandle")); + GenTree* handleForNullCheck = gtNewOperNode(GT_IND, TYP_I_IMPL, slotPtrTree); + handleForNullCheck->gtFlags |= GTF_IND_NONFAULTING; // Call to helper GenTree* argNode = gtNewIconEmbHndNode(pRuntimeLookup->signature, nullptr, GTF_ICON_TOKEN_HDL, compileTimeHandle); GenTreeCall::Use* helperArgs = gtNewCallArgs(ctxTree, argNode); - GenTree* helperCall = gtNewHelperCallNode(pRuntimeLookup->helper, TYP_I_IMPL, helperArgs); + GenTreeCall* helperCall = gtNewHelperCallNode(pRuntimeLookup->helper, TYP_I_IMPL, helperArgs); // Check for null and possibly call helper - GenTree* relop = gtNewOperNode(GT_NE, TYP_INT, handle, gtNewIconNode(0, TYP_I_IMPL)); + GenTree* nullCheck = gtNewOperNode(GT_NE, TYP_INT, handleForNullCheck, gtNewIconNode(0, TYP_I_IMPL)); + GenTree* handleForResult = gtCloneExpr(handleForNullCheck); - GenTree* colon = new (this, GT_COLON) GenTreeColon(TYP_I_IMPL, - gtNewNothingNode(), // do nothing if nonnull - helperCall); + GenTree* result = nullptr; - GenTree* qmark = gtNewQmarkNode(TYP_I_IMPL, relop, colon); - - unsigned tmp; - if (handleCopy->IsLocal()) +#if 0 // Uncomment that block when you add sizeOffset field to pRuntimeLookup. + if (pRuntimeLookup->sizeOffset != 0xFFFF) // dynamic dictionary expansion feature { - tmp = handleCopy->AsLclVarCommon()->GetLclNum(); + assert((lastIndOfTree != nullptr) && (pRuntimeLookup->indirections > 0)); + + // sizeValue = dictionary[pRuntimeLookup->sizeOffset] + GenTreeIntCon* sizeOffset = gtNewIconNode(pRuntimeLookup->sizeOffset, TYP_I_IMPL); + GenTree* sizeValueOffset = gtNewOperNode(GT_ADD, TYP_I_IMPL, lastIndOfTree, sizeOffset); + GenTree* sizeValue = gtNewOperNode(GT_IND, TYP_I_IMPL, sizeValueOffset); + + // sizeCheck fails if sizeValue < pRuntimeLookup->offsets[i] + GenTree* offsetValue = gtNewIconNode(pRuntimeLookup->offsets[pRuntimeLookup->indirections - 1], TYP_I_IMPL); + GenTree* sizeCheck = gtNewOperNode(GT_LE, TYP_INT, sizeValue, offsetValue); + + // revert null check condition. + nullCheck->ChangeOperUnchecked(GT_EQ); + + // ((sizeCheck fails || nullCheck fails))) ? (helperCall : handle). + // Add checks and the handle as call arguments, indirect call transformer will handle this. + helperCall->gtCallArgs = gtPrependNewCallArg(handleForResult, helperCall->gtCallArgs); + helperCall->gtCallArgs = gtPrependNewCallArg(sizeCheck, helperCall->gtCallArgs); + helperCall->gtCallArgs = gtPrependNewCallArg(nullCheck, helperCall->gtCallArgs); + result = helperCall; + addExpRuntimeLookupCandidate(helperCall); } else +#endif // 0 { - tmp = lvaGrabTemp(true DEBUGARG("spilling QMark1")); + GenTreeColon* colonNullCheck = new (this, GT_COLON) GenTreeColon(TYP_I_IMPL, handleForResult, helperCall); + result = gtNewQmarkNode(TYP_I_IMPL, nullCheck, colonNullCheck); } - impAssignTempGen(tmp, qmark, (unsigned)CHECK_SPILL_NONE); + unsigned tmp = lvaGrabTemp(true DEBUGARG("spilling Runtime Lookup tree")); + + impAssignTempGen(tmp, result, (unsigned)CHECK_SPILL_NONE); return gtNewLclvNode(tmp, TYP_I_IMPL); } @@ -2558,7 +2588,7 @@ BasicBlock* Compiler::impPushCatchArgOnStack(BasicBlock* hndBlk, CORINFO_CLASS_H #if defined(JIT32_GCENCODER) const bool forceInsertNewBlock = isSingleBlockFilter || compStressCompile(STRESS_CATCH_ARG, 5); #else - const bool forceInsertNewBlock = compStressCompile(STRESS_CATCH_ARG, 5); + const bool forceInsertNewBlock = compStressCompile(STRESS_CATCH_ARG, 5); #endif // defined(JIT32_GCENCODER) /* Spill GT_CATCH_ARG to a temp if there are jumps to the beginning of the handler */ @@ -3632,6 +3662,27 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, op1 = impPopStack().val; if (opts.OptimizationEnabled()) { + if (op1->OperIs(GT_CNS_STR)) + { + // Optimize `ldstr + String::get_Length()` to CNS_INT + // e.g. "Hello".Length => 5 + int length = -1; + LPCWSTR str = info.compCompHnd->getStringLiteral(op1->AsStrCon()->gtScpHnd, + op1->AsStrCon()->gtSconCPX, &length); + if (length >= 0) + { + retNode = gtNewIconNode(length); + if (str != nullptr) // can be NULL for dynamic context + { + JITDUMP("Optimizing '\"%ws\".Length' to just '%d'\n", str, length); + } + else + { + JITDUMP("Optimizing 'CNS_STR.Length' to just '%d'\n", length); + } + break; + } + } GenTreeArrLen* arrLen = gtNewArrLen(TYP_INT, op1, OFFSETOF__CORINFO_String__stringLen, compCurBB); op1 = arrLen; } @@ -5728,7 +5779,7 @@ void Compiler::verVerifyCond(const typeInfo& tiOp1, const typeInfo& tiOp2, unsig { #ifdef TARGET_64BIT Verify(tiCompatibleWith(tiOp1, tiOp2, true), "Cond type mismatch"); -#else // _TARGET_64BIT +#else // TARGET_64BIT // [10/17/2013] Consider changing this: to put on my verification lawyer hat, // this is non-conforming to the ECMA Spec: types don't have to be equivalent, // but compatible, since we can coalesce native int with int32 (see section III.1.5). @@ -13819,7 +13870,13 @@ void Compiler::impImportBlockCode(BasicBlock* block) // and potentially exploitable. lvaSetStruct(lclNum, resolvedToken.hClass, true /* unsafe value cls check */); } - if (compIsForInlining() || fgStructTempNeedsExplicitZeroInit(lvaTable + lclNum, block)) + + bool bbInALoop = + (compIsForInlining() && ((impInlineInfo->iciBlock->bbFlags & BBF_BACKWARD_JUMP) != 0)) || + ((block->bbFlags & BBF_BACKWARD_JUMP) != 0); + bool bbIsReturn = (block->bbJumpKind == BBJ_RETURN) && + (!compIsForInlining() || (impInlineInfo->iciBlock->bbJumpKind == BBJ_RETURN)); + if (fgVarNeedsExplicitZeroInit(lvaGetDesc(lclNum), bbInALoop, bbIsReturn)) { // Append a tree to zero-out the temp newObjThisPtr = gtNewLclvNode(lclNum, lvaTable[lclNum].TypeGet()); @@ -14120,10 +14177,6 @@ void Compiler::impImportBlockCode(BasicBlock* block) lclTyp = JITtype2varType(ciType); -#ifdef _TARGET_AMD64 - noway_assert(varTypeIsIntegralOrI(lclTyp) || varTypeIsFloating(lclTyp) || lclTyp == TYP_STRUCT); -#endif // _TARGET_AMD64 - if (compIsForInlining()) { switch (fieldInfo.fieldAccessor) @@ -20847,6 +20900,12 @@ void Compiler::addGuardedDevirtualizationCandidate(GenTreeCall* call, call->gtGuardedDevirtualizationCandidateInfo = pInfo; } +void Compiler::addExpRuntimeLookupCandidate(GenTreeCall* call) +{ + setMethodHasExpRuntimeLookup(); + call->SetExpRuntimeLookup(); +} + //------------------------------------------------------------------------ // impIsClassExact: check if a class handle can only describe values // of exactly one class. diff --git a/src/coreclr/src/jit/indirectcalltransformer.cpp b/src/coreclr/src/jit/indirectcalltransformer.cpp index 20f2abf0559ac3..caec347798031c 100644 --- a/src/coreclr/src/jit/indirectcalltransformer.cpp +++ b/src/coreclr/src/jit/indirectcalltransformer.cpp @@ -8,8 +8,8 @@ #endif // The IndirectCallTransformer transforms indirect calls that involve fat function -// pointers or guarded devirtualization candidates. These transformations introduce -// control flow and so can't easily be done in the importer. +// pointers, guarded devirtualization candidates, or runtime lookup with dynamic dictionary expansion. +// These transformations introduce control flow and so can't easily be done in the importer. // // A fat function pointer is a pointer with the second least significant bit // (aka FAT_POINTER_MASK) set. If the bit is set, the pointer (after clearing the bit) @@ -103,19 +103,25 @@ class IndirectCallTransformer for (Statement* stmt : block->Statements()) { - if (ContainsFatCalli(stmt)) + if (compiler->doesMethodHaveFatPointer() && ContainsFatCalli(stmt)) { FatPointerCallTransformer transformer(compiler, block, stmt); transformer.Run(); count++; } - - if (ContainsGuardedDevirtualizationCandidate(stmt)) + else if (compiler->doesMethodHaveGuardedDevirtualization() && + ContainsGuardedDevirtualizationCandidate(stmt)) { GuardedDevirtualizationTransformer transformer(compiler, block, stmt); transformer.Run(); count++; } + else if (compiler->doesMethodHaveExpRuntimeLookup() && ContainsExpRuntimeLookup(stmt)) + { + ExpRuntimeLookupTransformer transformer(compiler, block, stmt); + transformer.Run(); + count++; + } } return count; @@ -154,6 +160,28 @@ class IndirectCallTransformer return candidate->IsCall() && candidate->AsCall()->IsGuardedDevirtualizationCandidate(); } + //------------------------------------------------------------------------ + // ContainsExpRuntimeLookup: check if this statement contains a dictionary + // with dynamic dictionary expansion that we want to transform in CFG. + // + // Return Value: + // true if contains, false otherwise. + // + bool ContainsExpRuntimeLookup(Statement* stmt) + { + GenTree* candidate = stmt->GetRootNode(); + if (candidate->OperIs(GT_ASG)) + { + candidate = candidate->gtGetOp2(); + } + if (candidate->OperIs(GT_CALL)) + { + GenTreeCall* call = candidate->AsCall(); + return call->IsExpRuntimeLookup(); + } + return false; + } + class Transformer { public: @@ -243,7 +271,7 @@ class IndirectCallTransformer //------------------------------------------------------------------------ // SetWeights: set weights for new blocks. // - void SetWeights() + virtual void SetWeights() { remainderBlock->inheritWeight(currBlock); checkBlock->inheritWeight(currBlock); @@ -254,7 +282,7 @@ class IndirectCallTransformer //------------------------------------------------------------------------ // ChainFlow: link new blocks into correct cfg. // - void ChainFlow() + virtual void ChainFlow() { assert(!compiler->fgComputePredsDone); checkBlock->bbJumpDest = elseBlock; @@ -767,6 +795,178 @@ class IndirectCallTransformer unsigned returnTemp; }; + // Runtime lookup with dynamic dictionary expansion transformer, + // it expects helper runtime lookup call with additional arguments that are: + // result handle, nullCheck tree, sizeCheck tree. + // before: + // current block + // { + // previous statements + // transforming statement + // { + // ASG lclVar, call with GTF_CALL_M_EXP_RUNTIME_LOOKUP flag set and additional arguments. + // } + // subsequent statements + // } + // + // after: + // current block + // { + // previous statements + // } BBJ_NONE check block + // check block + // { + // jump to else if the handle fails size check + // } BBJ_COND check block2, else block + // check block2 + // { + // jump to else if the handle fails null check + // } BBJ_COND then block, else block + // then block + // { + // return handle + // } BBJ_ALWAYS remainder block + // else block + // { + // do a helper call + // } BBJ_NONE remainder block + // remainder block + // { + // subsequent statements + // } + // + class ExpRuntimeLookupTransformer final : public Transformer + { + public: + ExpRuntimeLookupTransformer(Compiler* compiler, BasicBlock* block, Statement* stmt) + : Transformer(compiler, block, stmt) + { + GenTreeOp* asg = stmt->GetRootNode()->AsOp(); + resultLclNum = asg->gtOp1->AsLclVar()->GetLclNum(); + origCall = GetCall(stmt); + checkBlock2 = nullptr; + } + + protected: + virtual const char* Name() override + { + return "ExpRuntimeLookup"; + } + + //------------------------------------------------------------------------ + // GetCall: find a call in a statement. + // + // Arguments: + // callStmt - the statement with the call inside. + // + // Return Value: + // call tree node pointer. + virtual GenTreeCall* GetCall(Statement* callStmt) override + { + GenTree* tree = callStmt->GetRootNode(); + assert(tree->OperIs(GT_ASG)); + GenTreeOp* asg = tree->AsOp(); + GenTreeCall* call = tree->gtGetOp2()->AsCall(); + return call; + } + + //------------------------------------------------------------------------ + // ClearFlag: clear runtime exp lookup flag from the original call. + // + virtual void ClearFlag() override + { + origCall->ClearExpRuntimeLookup(); + } + + // FixupRetExpr: no action needed. + virtual void FixupRetExpr() override + { + } + + //------------------------------------------------------------------------ + // CreateCheck: create check blocks, that checks dictionary size and does null test. + // + virtual void CreateCheck() override + { + GenTreeCall::UseIterator argsIter = origCall->Args().begin(); + GenTree* nullCheck = argsIter.GetUse()->GetNode(); + ++argsIter; + GenTree* sizeCheck = argsIter.GetUse()->GetNode(); + ++argsIter; + origCall->gtCallArgs = argsIter.GetUse(); + // The first argument is the handle now. + checkBlock = CreateAndInsertBasicBlock(BBJ_COND, currBlock); + + assert(sizeCheck->OperIs(GT_LE)); + GenTree* sizeJmpTree = compiler->gtNewOperNode(GT_JTRUE, TYP_VOID, sizeCheck); + Statement* sizeJmpStmt = compiler->fgNewStmtFromTree(sizeJmpTree, stmt->GetILOffsetX()); + compiler->fgInsertStmtAtEnd(checkBlock, sizeJmpStmt); + + checkBlock2 = CreateAndInsertBasicBlock(BBJ_COND, checkBlock); + assert(nullCheck->OperIs(GT_EQ)); + GenTree* nullJmpTree = compiler->gtNewOperNode(GT_JTRUE, TYP_VOID, nullCheck); + Statement* nullJmpStmt = compiler->fgNewStmtFromTree(nullJmpTree, stmt->GetILOffsetX()); + compiler->fgInsertStmtAtEnd(checkBlock2, nullJmpStmt); + } + + //------------------------------------------------------------------------ + // CreateThen: create then block, that is executed if the checks succeed. + // This simply returns the handle. + // + virtual void CreateThen() override + { + thenBlock = CreateAndInsertBasicBlock(BBJ_ALWAYS, checkBlock2); + + GenTreeCall::UseIterator argsIter = origCall->Args().begin(); + GenTree* resultHandle = argsIter.GetUse()->GetNode(); + ++argsIter; + // The first argument is the real first argument for the call now. + origCall->gtCallArgs = argsIter.GetUse(); + + GenTree* asg = compiler->gtNewTempAssign(resultLclNum, resultHandle); + Statement* asgStmt = compiler->gtNewStmt(asg, stmt->GetILOffsetX()); + compiler->fgInsertStmtAtEnd(thenBlock, asgStmt); + } + + //------------------------------------------------------------------------ + // CreateElse: create else block, that is executed if the checks fail. + // + virtual void CreateElse() override + { + elseBlock = CreateAndInsertBasicBlock(BBJ_NONE, thenBlock); + GenTree* asg = compiler->gtNewTempAssign(resultLclNum, origCall); + Statement* asgStmt = compiler->gtNewStmt(asg, stmt->GetILOffsetX()); + compiler->fgInsertStmtAtEnd(elseBlock, asgStmt); + } + + //------------------------------------------------------------------------ + // SetWeights: set weights for new blocks. + // + virtual void SetWeights() override + { + remainderBlock->inheritWeight(currBlock); + checkBlock->inheritWeight(currBlock); + checkBlock2->inheritWeightPercentage(checkBlock, HIGH_PROBABILITY); + thenBlock->inheritWeightPercentage(currBlock, HIGH_PROBABILITY); + elseBlock->inheritWeightPercentage(currBlock, 100 - HIGH_PROBABILITY); + } + + //------------------------------------------------------------------------ + // ChainFlow: link new blocks into correct cfg. + // + virtual void ChainFlow() override + { + assert(!compiler->fgComputePredsDone); + checkBlock->bbJumpDest = elseBlock; + checkBlock2->bbJumpDest = elseBlock; + thenBlock->bbJumpDest = remainderBlock; + } + + private: + BasicBlock* checkBlock2; + unsigned resultLclNum; + }; + Compiler* compiler; }; @@ -782,8 +982,10 @@ Compiler::fgWalkResult Compiler::fgDebugCheckForTransformableIndirectCalls(GenTr GenTree* tree = *pTree; if (tree->IsCall()) { - assert(!tree->AsCall()->IsFatPointerCandidate()); - assert(!tree->AsCall()->IsGuardedDevirtualizationCandidate()); + GenTreeCall* call = tree->AsCall(); + assert(!call->IsFatPointerCandidate()); + assert(!call->IsGuardedDevirtualizationCandidate()); + assert(!call->IsExpRuntimeLookup()); } return WALK_CONTINUE; } @@ -796,6 +998,7 @@ void Compiler::CheckNoTransformableIndirectCallsRemain() { assert(!doesMethodHaveFatPointer()); assert(!doesMethodHaveGuardedDevirtualization()); + assert(!doesMethodHaveExpRuntimeLookup()); for (BasicBlock* block = fgFirstBB; block != nullptr; block = block->bbNext) { @@ -817,7 +1020,7 @@ void Compiler::fgTransformIndirectCalls() { JITDUMP("\n*************** in fgTransformIndirectCalls(%s)\n", compIsForInlining() ? "inlinee" : "root"); - if (doesMethodHaveFatPointer() || doesMethodHaveGuardedDevirtualization()) + if (doesMethodHaveFatPointer() || doesMethodHaveGuardedDevirtualization() || doesMethodHaveExpRuntimeLookup()) { IndirectCallTransformer indirectCallTransformer(this); int count = indirectCallTransformer.Run(); @@ -834,6 +1037,7 @@ void Compiler::fgTransformIndirectCalls() clearMethodHasFatPointer(); clearMethodHasGuardedDevirtualization(); + clearMethodHasExpRuntimeLookup(); } else { diff --git a/src/coreclr/src/jit/instr.cpp b/src/coreclr/src/jit/instr.cpp index 0b31b8a18586b6..7a0a6c63f37fd0 100644 --- a/src/coreclr/src/jit/instr.cpp +++ b/src/coreclr/src/jit/instr.cpp @@ -67,7 +67,7 @@ const char* CodeGen::genInsName(instruction ins) #include "instrs.h" #else -#error "Unknown _TARGET_" +#error "Unknown TARGET" #endif }; // clang-format on @@ -905,7 +905,7 @@ void CodeGen::inst_RV_SH( #else NYI("inst_RV_SH - unknown target"); -#endif // _TARGET_* +#endif // TARGET* } /***************************************************************************** @@ -1817,6 +1817,7 @@ instruction CodeGenInterface::ins_Load(var_types srcType, bool aligned /*=false* */ instruction CodeGen::ins_Copy(var_types dstType) { + assert(emitTypeActSz[dstType] != 0); #if defined(TARGET_XARCH) if (varTypeIsSIMD(dstType)) { @@ -1850,12 +1851,62 @@ instruction CodeGen::ins_Copy(var_types dstType) { return INS_mov; } -#elif defined(TARGET_X86) +#else // TARGET_* +#error "Unknown TARGET_" +#endif +} + +//------------------------------------------------------------------------ +// ins_Copy: Get the machine dependent instruction for performing a reg-reg copy +// from srcReg to a register of dstType. +// +// Arguments: +// srcReg - source register +// dstType - destination type +// +// Notes: +// This assumes the size of the value in 'srcReg' is the same as the size of +// 'dstType'. +// +instruction CodeGen::ins_Copy(regNumber srcReg, var_types dstType) +{ + bool dstIsFloatReg = isFloatRegType(dstType); + bool srcIsFloatReg = genIsValidFloatReg(srcReg); + if (srcIsFloatReg == dstIsFloatReg) + { + return ins_Copy(dstType); + } +#if defined(TARGET_XARCH) + if (dstIsFloatReg) + { + return INS_mov_i2xmm; + } + else + { + return INS_mov_xmm2i; + } +#elif defined(TARGET_ARM64) + if (dstIsFloatReg) + { + return INS_fmov; + } + else + { + return INS_mov; + } +#elif defined(TARGET_ARM) + // No SIMD support yet assert(!varTypeIsSIMD(dstType)); - assert(!varTypeIsFloating(dstType)); - return INS_mov; -#else // _TARGET_* -#error "Unknown _TARGET_" + if (dstIsFloatReg) + { + return (dstType == TYP_DOUBLE) ? INS_vmov_i2d : INS_vmov_i2f; + } + else + { + return (dstType == TYP_LONG) ? INS_vmov_d2i : INS_vmov_f2i; + } +#else // TARGET* +#error "Unknown TARGET" #endif } @@ -2255,7 +2306,24 @@ instruction CodeGen::ins_FloatConv(var_types to, var_types from) } } -#endif // #elif defined(TARGET_ARM) +#elif defined(TARGET_ARM64) +instruction CodeGen::ins_CopyIntToFloat(var_types srcType, var_types dstType) +{ + assert((dstType == TYP_FLOAT) || (dstType == TYP_DOUBLE)); + assert((srcType == TYP_INT) || (srcType == TYP_UINT) || (srcType == TYP_LONG) || (srcType == TYP_ULONG)); + + return INS_mov; +} + +instruction CodeGen::ins_CopyFloatToInt(var_types srcType, var_types dstType) +{ + assert((srcType == TYP_FLOAT) || (srcType == TYP_DOUBLE)); + assert((dstType == TYP_INT) || (dstType == TYP_UINT) || (dstType == TYP_LONG) || (dstType == TYP_ULONG)); + + return INS_mov; +} + +#endif // TARGET_ARM64 /***************************************************************************** * @@ -2316,7 +2384,7 @@ void CodeGen::instGen_MemoryBarrier() #elif defined(TARGET_ARM64) GetEmitter()->emitIns_BARR(INS_dmb, barrierType); #else -#error "Unknown _TARGET_" +#error "Unknown TARGET" #endif } @@ -2331,7 +2399,7 @@ void CodeGen::instGen_Set_Reg_To_Zero(emitAttr size, regNumber reg, insFlags fla #elif defined(TARGET_ARMARCH) GetEmitter()->emitIns_R_I(INS_mov, size, reg, 0 ARM_ARG(flags)); #else -#error "Unknown _TARGET_" +#error "Unknown TARGET" #endif regSet.verifyRegUsed(reg); } @@ -2348,7 +2416,7 @@ void CodeGen::instGen_Compare_Reg_To_Zero(emitAttr size, regNumber reg) #elif defined(TARGET_ARMARCH) GetEmitter()->emitIns_R_I(INS_cmp, size, reg, 0); #else -#error "Unknown _TARGET_" +#error "Unknown TARGET" #endif } @@ -2362,7 +2430,7 @@ void CodeGen::instGen_Compare_Reg_To_Reg(emitAttr size, regNumber reg1, regNumbe #if defined(TARGET_XARCH) || defined(TARGET_ARMARCH) GetEmitter()->emitIns_R_R(INS_cmp, size, reg1, reg2); #else -#error "Unknown _TARGET_" +#error "Unknown TARGET" #endif } @@ -2409,7 +2477,7 @@ void CodeGen::instGen_Compare_Reg_To_Imm(emitAttr size, regNumber reg, target_ss assert(!"Invalid immediate for instGen_Compare_Reg_To_Imm"); } #else -#error "Unknown _TARGET_" +#error "Unknown TARGET" #endif } } diff --git a/src/coreclr/src/jit/instrsarm64.h b/src/coreclr/src/jit/instrsarm64.h index 6c8b196cba2b7f..5647c801e9b770 100644 --- a/src/coreclr/src/jit/instrsarm64.h +++ b/src/coreclr/src/jit/instrsarm64.h @@ -462,10 +462,18 @@ INST2(fmax, "fmax", 0, 0, IF_EN2G, 0x0E20F400, 0x1E204800) // fmax Vd,Vn,Vm DV_3B 0Q0011100X1mmmmm 111101nnnnnddddd 0E20 F400 Vd,Vn,Vm (vector) // fmax Vd,Vn,Vm DV_3D 000111100X1mmmmm 010010nnnnnddddd 1E20 4800 Vd,Vn,Vm (scalar) +INST2(fmaxnm, "fmaxnm", 0, 0, IF_EN2G, 0x0E20C400, 0x1E206800) + // fmaxnm Vd,Vn,Vm DV_3B 0Q0011100X1mmmmm 110001nnnnnddddd 0E20 C400 Vd,Vn,Vm (vector) + // fmaxnm Vd,Vn,Vm DV_3D 000111100X1mmmmm 011010nnnnnddddd 1E20 6800 Vd,Vn,Vm (scalar) + INST2(fmin, "fmin", 0, 0, IF_EN2G, 0x0EA0F400, 0x1E205800) // fmin Vd,Vn,Vm DV_3B 0Q0011101X1mmmmm 111101nnnnnddddd 0EA0 F400 Vd,Vn,Vm (vector) // fmin Vd,Vn,Vm DV_3D 000111100X1mmmmm 010110nnnnnddddd 1E20 5800 Vd,Vn,Vm (scalar) +INST2(fminnm, "fminnm", 0, 0, IF_EN2G, 0x0EA0C400, 0x1E207800) + // fminnm Vd,Vn,Vm DV_3B 0Q0011101X1mmmmm 110001nnnnnddddd 0EA0 C400 Vd,Vn,Vm (vector) + // fminnm Vd,Vn,Vm DV_3D 000111100X1mmmmm 011110nnnnnddddd 1E20 7800 Vd,Vn,Vm (scalar) + INST2(fabd, "fabd", 0, 0, IF_EN2G, 0x2EA0D400, 0x7EA0D400) // fabd Vd,Vn,Vm DV_3B 0Q1011101X1mmmmm 110101nnnnnddddd 2EA0 D400 Vd,Vn,Vm (vector) // fabd Vd,Vn,Vm DV_3D 011111101X1mmmmm 110101nnnnnddddd 7EA0 D400 Vd,Vn,Vm (scalar) @@ -639,9 +647,29 @@ INST2(cmtst, "cmtst", 0, 0, IF_EN2O, 0x5EE08C00, 0x0E208C00) // enum name FP LD/ST DV_2G DV_3B INST2(faddp, "faddp", 0, 0, IF_EN2P, 0x7E30D800, 0x2E20D400) - // faddp Vd,Vn DV_2G 011111100X110000 110110nnnnnddddd 7E30 D800 Vd,Vn (scalar) + // faddp Vd,Vn DV_2Q 011111100X110000 110110nnnnnddddd 7E30 D800 Vd,Vn (scalar) // faddp Vd,Vn,Vm DV_3B 0Q1011100X1mmmmm 110101nnnnnddddd 2E20 D400 Vd,Vn,Vm (vector) +INST2(fmaxnmp, "fmaxnmp",0, 0, IF_EN2P, 0x7E30C800, 0x2E20C400) + // fmaxnmp Vd,Vn DV_2Q 011111100X110000 110010nnnnnddddd 7E30 C800 Vd,Vn (scalar) + // fmaxnmp Vd,Vn,Vm DV_3B 0Q1011100X1mmmmm 110001nnnnnddddd 2E20 C400 Vd,Vn,Vm (vector) + +INST2(fmaxp, "fmaxp", 0, 0, IF_EN2P, 0x7E30F800, 0x2E20F400) + // fmaxp Vd,Vn DV_2Q 011111100X110000 111110nnnnnddddd 7E30 F800 Vd,Vn (scalar) + // fmaxp Vd,Vn,Vm DV_3B 0Q1011100X1mmmmm 111101nnnnnddddd 2E20 F400 Vd,Vn,Vm (vector) + +INST2(fminnmp, "fminnmp",0, 0, IF_EN2P, 0x7EB0C800, 0x2EA0C400) + // fminnmp Vd,Vn DV_2Q 011111101X110000 110010nnnnnddddd 7EB0 C800 Vd,Vn (scalar) + // fminnmp Vd,Vn,Vm DV_3B 0Q1011101X1mmmmm 110001nnnnnddddd 2EA0 C400 Vd,Vn,Vm (vector) + +INST2(fminp, "fminp", 0, 0, IF_EN2P, 0x7EB0F800, 0x2EA0F400) + // fminp Vd,Vn DV_2Q 011111101X110000 111110nnnnnddddd 7EB0 F800 Vd,Vn (scalar) + // fminp Vd,Vn,Vm DV_3B 0Q1011101X1mmmmm 111101nnnnnddddd 2EA0 F400 Vd,Vn,Vm (vector) + +INST2(addp, "addp", 0, 0, IF_EN2Q, 0x5E31B800, 0x0E20BC00) + // addp Vd,Vn DV_2S 01011110XX110001 101110nnnnnddddd 5E31 B800 Vd,Vn (scalar) + // addp Vd,Vn,Vm DV_3A 0Q001110XX1mmmmm 101111nnnnnddddd 0E20 BC00 Vd,Vn,Vm (vector) + INST1(ldar, "ldar", 0,LD, IF_LS_2A, 0x88DFFC00) // ldar Rt,[Xn] LS_2A 1X00100011011111 111111nnnnnttttt 88DF FC00 @@ -1221,6 +1249,18 @@ INST1(umaxv, "umaxv", 0, 0, IF_DV_2M, 0x2E30A800) INST1(uminv, "uminv", 0, 0, IF_DV_2M, 0x2E31A800) // uminv Vd,Vn DV_2M 0Q101110XX110001 101010nnnnnddddd 2E31 A800 Vd,Vn (vector) +INST1(fmaxnmv, "fmaxnmv",0, 0, IF_DV_2R, 0x2E30C800) + // fmaxnmv Vd,Vn DV_2R 0Q1011100X110000 110010nnnnnddddd 2E30 C800 Vd,Vn (vector) + +INST1(fmaxv, "fmaxv", 0, 0, IF_DV_2R, 0x2E30F800) + // fmaxv Vd,Vn DV_2R 0Q1011100X110000 111110nnnnnddddd 2E30 F800 Vd,Vn (vector) + +INST1(fminnmv, "fminnmv",0, 0, IF_DV_2R, 0x2EB0C800) + // fminnmv Vd,Vn DV_2R 0Q1011101X110000 110010nnnnnddddd 2EB0 C800 Vd,Vn (vector) + +INST1(fminv, "fminv", 0, 0, IF_DV_2R, 0x2EB0F800) + // fminv Vd,Vn DV_2R 0Q1011101X110000 111110nnnnnddddd 2EB0 F800 Vd,Vn (vector) + INST1(uzp1, "uzp1", 0, 0, IF_DV_3A, 0x0E001800) // uzp1 Vd,Vn,Vm DV_3A 0Q001110XX0mmmmm 000110nnnnnddddd 0E00 1800 Vd,Vn,Vm (vector) @@ -1275,9 +1315,15 @@ INST1(sabd, "sabd", 0, 0, IF_DV_3A, 0x0E207400) INST1(smax, "smax", 0, 0, IF_DV_3A, 0x0E206400) // smax Vd,Vn,Vm DV_3A 0Q001110XX1mmmmm 011001nnnnnddddd 0E20 6400 Vd,Vn,Vm (vector) +INST1(smaxp, "smaxp", 0, 0, IF_DV_3A, 0x0E20A400) + // smaxp Vd,Vn,Vm DV_3A 0Q001110XX1mmmmm 101001nnnnnddddd 0E20 A400 Vd,Vn,Vm (vector) + INST1(smin, "smin", 0, 0, IF_DV_3A, 0x0E206C00) // smax Vd,Vn,Vm DV_3A 0Q001110XX1mmmmm 011011nnnnnddddd 0E20 6C00 Vd,Vn,Vm (vector) +INST1(sminp, "sminp", 0, 0, IF_DV_3A, 0x0E20AC00) + // smax Vd,Vn,Vm DV_3A 0Q001110XX1mmmmm 101011nnnnnddddd 0E20 AC00 Vd,Vn,Vm (vector) + INST1(uaba, "uaba", 0, 0, IF_DV_3A, 0x2E207C00) // uaba Vd,Vn,Vm DV_3A 0Q101110XX1mmmmm 011111nnnnnddddd 2E20 7C00 Vd,Vn,Vm (vector) @@ -1287,9 +1333,15 @@ INST1(uabd, "uabd", 0, 0, IF_DV_3A, 0x2E207400) INST1(umax, "umax", 0, 0, IF_DV_3A, 0x2E206400) // umax Vd,Vn,Vm DV_3A 0Q101110XX1mmmmm 011001nnnnnddddd 2E20 6400 Vd,Vn,Vm (vector) +INST1(umaxp, "umaxp", 0, 0, IF_DV_3A, 0x2E20A400) + // umaxp Vd,Vn,Vm DV_3A 0Q101110XX1mmmmm 101001nnnnnddddd 2E20 A400 Vd,Vn,Vm (vector) + INST1(umin, "umin", 0, 0, IF_DV_3A, 0x2E206C00) // umin Vd,Vn,Vm DV_3A 0Q101110XX1mmmmm 011011nnnnnddddd 2E20 6C00 Vd,Vn,Vm (vector) +INST1(uminp, "uminp", 0, 0, IF_DV_3A, 0x2E20AC00) + // umin Vd,Vn,Vm DV_3A 0Q101110XX1mmmmm 101011nnnnnddddd 2E20 AC00 Vd,Vn,Vm (vector) + INST1(fcvtl, "fcvtl", 0, 0, IF_DV_2G, 0x0E217800) // fcvtl Vd,Vn DV_2G 000011100X100001 011110nnnnnddddd 0E21 7800 Vd,Vn (scalar) diff --git a/src/coreclr/src/jit/instrsxarch.h b/src/coreclr/src/jit/instrsxarch.h index 0bd795d8b34870..986ce9ab450c13 100644 --- a/src/coreclr/src/jit/instrsxarch.h +++ b/src/coreclr/src/jit/instrsxarch.h @@ -694,7 +694,7 @@ INST1(shrd, "shrd", IUM_RW, 0x0F00AC, #ifdef TARGET_X86 INST1(fld, "fld", IUM_WR, 0x0000D9, INS_FLAGS_x87Instr) INST1(fstp, "fstp", IUM_WR, 0x0018D9, INS_FLAGS_x87Instr) -#endif // _TARGET_X86 +#endif // TARGET_X86 INST1(seto, "seto", IUM_WR, 0x0F0090, INS_FLAGS_ReadsFlags) INST1(setno, "setno", IUM_WR, 0x0F0091, INS_FLAGS_ReadsFlags) diff --git a/src/coreclr/src/jit/lclvars.cpp b/src/coreclr/src/jit/lclvars.cpp index a4110734d17ab1..4a5b2f1132efbe 100644 --- a/src/coreclr/src/jit/lclvars.cpp +++ b/src/coreclr/src/jit/lclvars.cpp @@ -557,7 +557,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo) #elif defined(TARGET_AMD64) && !defined(UNIX_AMD64_ABI) // On System V type environment the float registers are not indexed together with the int ones. varDscInfo->floatRegArgNum = varDscInfo->intRegArgNum; -#endif // _TARGET_* +#endif // TARGET* CORINFO_ARG_LIST_HANDLE argLst = info.compMethodInfo->args.args; @@ -1000,7 +1000,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo) // varDscInfo->setAllRegArgUsed(argType); -#endif // _TARGET_XXX_ +#endif // TARGET_XXX #if FEATURE_FASTTAILCALL varDsc->lvStkOffs = varDscInfo->stackArgSize; @@ -5370,9 +5370,9 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, varDsc->lvStkOffs = argOffs; argOffs += argSize; } -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture -#endif // _TARGET_* +#endif // TARGET* } else { diff --git a/src/coreclr/src/jit/lower.cpp b/src/coreclr/src/jit/lower.cpp index b6def42a547870..ab2820d72c2848 100644 --- a/src/coreclr/src/jit/lower.cpp +++ b/src/coreclr/src/jit/lower.cpp @@ -98,8 +98,14 @@ bool Lowering::IsSafeToContainMem(GenTree* parentNode, GenTree* childNode) } //------------------------------------------------------------------------ - -// This is the main entry point for Lowering. +// LowerNode: this is the main entry point for Lowering. +// +// Arguments: +// node - the node we are lowering. +// +// Returns: +// next node in the transformed node sequence that needs to be lowered. +// GenTree* Lowering::LowerNode(GenTree* node) { assert(node != nullptr); @@ -128,8 +134,14 @@ GenTree* Lowering::LowerNode(GenTree* node) break; case GT_ADD: - LowerAdd(node->AsOp()); - break; + { + GenTree* next = LowerAdd(node->AsOp()); + if (next != nullptr) + { + return next; + } + } + break; #if !defined(TARGET_64BIT) case GT_ADD_LO: @@ -190,7 +202,7 @@ GenTree* Lowering::LowerNode(GenTree* node) break; case GT_RETURN: - LowerRet(node); + LowerRet(node->AsUnOp()); break; case GT_RETURNTRAP: @@ -286,16 +298,25 @@ GenTree* Lowering::LowerNode(GenTree* node) case GT_STORE_LCL_FLD: { -#if defined(TARGET_AMD64) && defined(FEATURE_SIMD) GenTreeLclVarCommon* const store = node->AsLclVarCommon(); - if ((store->TypeGet() == TYP_SIMD8) != (store->gtOp1->TypeGet() == TYP_SIMD8)) + GenTree* op1 = store->gtGetOp1(); + if ((varTypeUsesFloatReg(store) != varTypeUsesFloatReg(op1)) && !store->IsPhiDefn() && + (op1->TypeGet() != TYP_STRUCT)) { - GenTreeUnOp* bitcast = - new (comp, GT_BITCAST) GenTreeOp(GT_BITCAST, store->TypeGet(), store->gtOp1, nullptr); - store->gtOp1 = bitcast; - BlockRange().InsertBefore(store, bitcast); + if (m_lsra->isRegCandidate(comp->lvaGetDesc(store->GetLclNum()))) + { + GenTreeUnOp* bitcast = + new (comp, GT_BITCAST) GenTreeOp(GT_BITCAST, store->TypeGet(), store->gtOp1, nullptr); + store->gtOp1 = bitcast; + BlockRange().InsertBefore(store, bitcast); + ContainCheckBitCast(bitcast); + } + else + { + // This is an actual store, we'll just retype it. + store->gtType = op1->TypeGet(); + } } -#endif // TARGET_AMD64 // TODO-1stClassStructs: Once we remove the requirement that all struct stores // are block stores (GT_STORE_BLK or GT_STORE_OBJ), here is where we would put the local // store under a block store if codegen will require it. @@ -2306,7 +2327,7 @@ GenTree* Lowering::LowerTailCallViaHelper(GenTreeCall* call, GenTree* callTarget #else NYI("LowerTailCallViaHelper"); -#endif // _TARGET_* +#endif // TARGET* // Transform this call node into a call to Jit tail call helper. call->gtCallType = CT_HELPER; @@ -3075,7 +3096,7 @@ void Lowering::LowerJmpMethod(GenTree* jmp) } // Lower GT_RETURN node to insert PInvoke method epilog if required. -void Lowering::LowerRet(GenTree* ret) +void Lowering::LowerRet(GenTreeUnOp* ret) { assert(ret->OperGet() == GT_RETURN); @@ -3083,22 +3104,22 @@ void Lowering::LowerRet(GenTree* ret) DISPNODE(ret); JITDUMP("============"); -#if defined(TARGET_AMD64) && defined(FEATURE_SIMD) - GenTreeUnOp* const unOp = ret->AsUnOp(); - if ((unOp->TypeGet() == TYP_LONG) && (unOp->gtOp1->TypeGet() == TYP_SIMD8)) + GenTree* op1 = ret->gtGetOp1(); + if ((ret->TypeGet() != TYP_VOID) && (ret->TypeGet() != TYP_STRUCT) && + (varTypeUsesFloatReg(ret) != varTypeUsesFloatReg(ret->gtGetOp1()))) { - GenTreeUnOp* bitcast = new (comp, GT_BITCAST) GenTreeOp(GT_BITCAST, TYP_LONG, unOp->gtOp1, nullptr); - unOp->gtOp1 = bitcast; - BlockRange().InsertBefore(unOp, bitcast); + GenTreeUnOp* bitcast = new (comp, GT_BITCAST) GenTreeOp(GT_BITCAST, ret->TypeGet(), ret->gtGetOp1(), nullptr); + ret->gtOp1 = bitcast; + BlockRange().InsertBefore(ret, bitcast); + ContainCheckBitCast(bitcast); } -#endif // TARGET_AMD64 // Method doing PInvokes has exactly one return block unless it has tail calls. if (comp->compMethodRequiresPInvokeFrame() && (comp->compCurBB == comp->genReturnBB)) { InsertPInvokeMethodEpilog(comp->compCurBB DEBUGARG(ret)); } - ContainCheckRet(ret->AsOp()); + ContainCheckRet(ret); } GenTree* Lowering::LowerDirectCall(GenTreeCall* call) @@ -4489,12 +4510,43 @@ bool Lowering::TryCreateAddrMode(GenTree* addr, bool isContainable) // Arguments: // node - the node we care about // -void Lowering::LowerAdd(GenTreeOp* node) +// Returns: +// nullptr if no transformation was done, or the next node in the transformed node sequence that +// needs to be lowered. +// +GenTree* Lowering::LowerAdd(GenTreeOp* node) { -#ifndef TARGET_ARMARCH if (varTypeIsIntegralOrI(node->TypeGet())) { + GenTree* op1 = node->gtGetOp1(); + GenTree* op2 = node->gtGetOp2(); LIR::Use use; + + // It is not the best place to do such simple arithmetic optimizations, + // but it allows us to avoid `LEA(addr, 0)` nodes and doing that in morph + // requires more changes. Delete that part if we get an expression optimizer. + if (op2->IsIntegralConst(0)) + { + JITDUMP("Lower: optimize val + 0: "); + DISPNODE(node); + JITDUMP("Replaced with: "); + DISPNODE(op1); + if (BlockRange().TryGetUse(node, &use)) + { + use.ReplaceWith(comp, op1); + } + else + { + op1->SetUnusedValue(); + } + GenTree* next = node->gtNext; + BlockRange().Remove(op2); + BlockRange().Remove(node); + JITDUMP("Remove [06%u], [06%u]\n", op2->gtTreeID, node->gtTreeID); + return next; + } + +#ifndef TARGET_ARMARCH if (BlockRange().TryGetUse(node, &use)) { // If this is a child of an indir, let the parent handle it. @@ -4505,13 +4557,14 @@ void Lowering::LowerAdd(GenTreeOp* node) TryCreateAddrMode(node, false); } } - } #endif // !TARGET_ARMARCH + } if (node->OperIs(GT_ADD)) { ContainCheckBinary(node); } + return nullptr; } //------------------------------------------------------------------------ @@ -5755,7 +5808,7 @@ void Lowering::ContainCheckLclHeap(GenTreeOp* node) // Arguments: // node - pointer to the node // -void Lowering::ContainCheckRet(GenTreeOp* ret) +void Lowering::ContainCheckRet(GenTreeUnOp* ret) { assert(ret->OperIs(GT_RETURN)); @@ -5802,3 +5855,38 @@ void Lowering::ContainCheckJTrue(GenTreeOp* node) cmp->gtType = TYP_VOID; cmp->gtFlags |= GTF_SET_FLAGS; } + +//------------------------------------------------------------------------ +// ContainCheckBitCast: determine whether the source of a BITCAST should be contained. +// +// Arguments: +// node - pointer to the node +// +void Lowering::ContainCheckBitCast(GenTree* node) +{ + GenTree* const op1 = node->AsOp()->gtOp1; + if (op1->isMemoryOp()) + { + op1->SetContained(); + } + else if (op1->OperIs(GT_LCL_VAR)) + { + if (!m_lsra->willEnregisterLocalVars()) + { + op1->SetContained(); + } + LclVarDsc* varDsc = &comp->lvaTable[op1->AsLclVar()->GetLclNum()]; + if (!m_lsra->isRegCandidate(varDsc)) + { + op1->SetContained(); + } + else + { + op1->SetRegOptional(); + } + } + else if (op1->IsLocal()) + { + op1->SetContained(); + } +} diff --git a/src/coreclr/src/jit/lower.h b/src/coreclr/src/jit/lower.h index 3fef773bd58da3..f3db1dfd747340 100644 --- a/src/coreclr/src/jit/lower.h +++ b/src/coreclr/src/jit/lower.h @@ -83,9 +83,10 @@ class Lowering final : public Phase void ContainCheckReturnTrap(GenTreeOp* node); void ContainCheckArrOffset(GenTreeArrOffs* node); void ContainCheckLclHeap(GenTreeOp* node); - void ContainCheckRet(GenTreeOp* node); + void ContainCheckRet(GenTreeUnOp* ret); void ContainCheckJTrue(GenTreeOp* node); + void ContainCheckBitCast(GenTree* node); void ContainCheckCallOperands(GenTreeCall* call); void ContainCheckIndir(GenTreeIndir* indirNode); void ContainCheckStoreIndir(GenTreeIndir* indirNode); @@ -132,7 +133,7 @@ class Lowering final : public Phase GenTree* LowerJTrue(GenTreeOp* jtrue); GenTreeCC* LowerNodeCC(GenTree* node, GenCondition condition); void LowerJmpMethod(GenTree* jmp); - void LowerRet(GenTree* ret); + void LowerRet(GenTreeUnOp* ret); GenTree* LowerDelegateInvoke(GenTreeCall* call); GenTree* LowerIndirectNonvirtCall(GenTreeCall* call); GenTree* LowerDirectCall(GenTreeCall* call); @@ -277,7 +278,7 @@ class Lowering final : public Phase // Per tree node member functions void LowerStoreIndir(GenTreeIndir* node); - void LowerAdd(GenTreeOp* node); + GenTree* LowerAdd(GenTreeOp* node); bool LowerUnsignedDivOrMod(GenTreeOp* divMod); GenTree* LowerConstIntDivOrMod(GenTree* node); GenTree* LowerSignedDivOrMod(GenTree* node); diff --git a/src/coreclr/src/jit/lowerarmarch.cpp b/src/coreclr/src/jit/lowerarmarch.cpp index 7963a3ba716067..0254af429e37be 100644 --- a/src/coreclr/src/jit/lowerarmarch.cpp +++ b/src/coreclr/src/jit/lowerarmarch.cpp @@ -151,14 +151,14 @@ bool Lowering::IsContainableImmed(GenTree* parentNode, GenTree* childNode) // void Lowering::LowerStoreLoc(GenTreeLclVarCommon* storeLoc) { - // Try to widen the ops if they are going into a local var. GenTree* op1 = storeLoc->gtGetOp1(); if ((storeLoc->gtOper == GT_STORE_LCL_VAR) && (op1->gtOper == GT_CNS_INT)) { + // Try to widen the ops if they are going into a local var. GenTreeIntCon* con = op1->AsIntCon(); ssize_t ival = con->gtIconVal; unsigned varNum = storeLoc->GetLclNum(); - LclVarDsc* varDsc = comp->lvaTable + varNum; + LclVarDsc* varDsc = comp->lvaGetDesc(varNum); if (varDsc->lvIsSIMDType()) { @@ -708,6 +708,18 @@ void Lowering::ContainCheckStoreLoc(GenTreeLclVarCommon* storeLoc) assert(storeLoc->OperIsLocalStore()); GenTree* op1 = storeLoc->gtGetOp1(); + if (op1->OperIs(GT_BITCAST)) + { + // If we know that the source of the bitcast will be in a register, then we can make + // the bitcast itself contained. This will allow us to store directly from the other + // type if this node doesn't get a register. + GenTree* bitCastSrc = op1->gtGetOp1(); + if (!bitCastSrc->isContained() && !bitCastSrc->IsRegOptional()) + { + op1->SetContained(); + return; + } + } #ifdef FEATURE_SIMD if (varTypeIsSIMD(storeLoc)) { diff --git a/src/coreclr/src/jit/lowerxarch.cpp b/src/coreclr/src/jit/lowerxarch.cpp index 86f7e71885a983..272b8b3946ba87 100644 --- a/src/coreclr/src/jit/lowerxarch.cpp +++ b/src/coreclr/src/jit/lowerxarch.cpp @@ -1925,6 +1925,18 @@ void Lowering::ContainCheckStoreLoc(GenTreeLclVarCommon* storeLoc) assert(storeLoc->OperIsLocalStore()); GenTree* op1 = storeLoc->gtGetOp1(); + if (op1->OperIs(GT_BITCAST)) + { + // If we know that the source of the bitcast will be in a register, then we can make + // the bitcast itself contained. This will allow us to store directly from the other + // type if this node doesn't get a register. + GenTree* bitCastSrc = op1->gtGetOp1(); + if (!bitCastSrc->isContained() && !bitCastSrc->IsRegOptional()) + { + op1->SetContained(); + return; + } + } #ifdef FEATURE_SIMD if (varTypeIsSIMD(storeLoc)) { diff --git a/src/coreclr/src/jit/lsra.cpp b/src/coreclr/src/jit/lsra.cpp index 0949203cadb285..c2b03ace694c4b 100644 --- a/src/coreclr/src/jit/lsra.cpp +++ b/src/coreclr/src/jit/lsra.cpp @@ -1428,7 +1428,7 @@ bool LinearScan::isRegCandidate(LclVarDsc* varDsc) // Lowering will have split any candidate lclVars into lo/hi vars. return false; } -#endif // !defined(_TARGET_64BIT) +#endif // !defined(TARGET_64BIT) // If we have JMP, reg args must be put on the stack @@ -1507,15 +1507,11 @@ bool LinearScan::isRegCandidate(LclVarDsc* varDsc) break; #ifdef FEATURE_SIMD + case TYP_SIMD8: case TYP_SIMD12: case TYP_SIMD16: case TYP_SIMD32: return !varDsc->lvPromoted; - - // TODO-1stClassStructs: Move TYP_SIMD8 up with the other SIMD types, after handling the param issue - // (passing & returning as TYP_LONG). - case TYP_SIMD8: - return false; #endif // FEATURE_SIMD case TYP_STRUCT: @@ -5453,6 +5449,15 @@ void LinearScan::allocateRegisters() // TODO-CQ: Consider doing this only for stack parameters, since otherwise we may be needlessly // inserting a store. allocate = false; + } + else if ((currentInterval->physReg == REG_STK) && nextRefPosition->treeNode->OperIs(GT_BITCAST)) + { + // In the case of ABI mismatches, avoid allocating a register only to have to immediately move + // it to a different register file. + allocate = false; + } + if (!allocate) + { INDEBUG(dumpLsraAllocationEvent(LSRA_EVENT_NO_ENTRY_REG_ALLOCATED, currentInterval)); didDump = true; setIntervalAsSpilled(currentInterval); diff --git a/src/coreclr/src/jit/lsraarm.cpp b/src/coreclr/src/jit/lsraarm.cpp index 0e633c1a5ad76a..8891653f749ca7 100644 --- a/src/coreclr/src/jit/lsraarm.cpp +++ b/src/coreclr/src/jit/lsraarm.cpp @@ -749,7 +749,6 @@ int LinearScan::BuildNode(GenTree* tree) case GT_BITCAST: { - srcCount = 1; assert(dstCount == 1); regNumber argReg = tree->GetRegNum(); regMaskTP argMask = genRegMask(argReg); @@ -763,8 +762,15 @@ int LinearScan::BuildNode(GenTree* tree) argMask |= genRegMask(REG_NEXT(argReg)); dstCount = 2; } - - BuildUse(tree->gtGetOp1()); + if (!tree->gtGetOp1()->isContained()) + { + BuildUse(tree->gtGetOp1()); + srcCount = 1; + } + else + { + srcCount = 0; + } BuildDefs(tree, dstCount, argMask); } break; diff --git a/src/coreclr/src/jit/lsraarm64.cpp b/src/coreclr/src/jit/lsraarm64.cpp index 961716a591f82e..0bcb661a8e4a02 100644 --- a/src/coreclr/src/jit/lsraarm64.cpp +++ b/src/coreclr/src/jit/lsraarm64.cpp @@ -1079,7 +1079,6 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) { case NI_Aes_Decrypt: case NI_Aes_Encrypt: - { assert((numArgs == 2) && (op1 != nullptr) && (op2 != nullptr)); buildUses = false; @@ -1087,14 +1086,11 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) tgtPrefUse = BuildUse(op1); srcCount += 1; srcCount += BuildDelayFreeUses(op2); - break; - } case NI_Sha1_HashUpdateChoose: case NI_Sha1_HashUpdateMajority: case NI_Sha1_HashUpdateParity: - { assert((numArgs == 3) && (op2 != nullptr) && (op3 != nullptr)); if (!op2->isContained()) @@ -1112,19 +1108,15 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) buildInternalFloatRegisterDefForNode(intrinsicTree); break; - } case NI_Sha1_FixedRotate: - { buildInternalFloatRegisterDefForNode(intrinsicTree); break; - } case NI_Sha1_ScheduleUpdate0: case NI_Sha256_HashUpdate1: case NI_Sha256_HashUpdate2: case NI_Sha256_ScheduleUpdate1: - { assert((numArgs == 3) && (op2 != nullptr) && (op3 != nullptr)); if (!op2->isContained()) @@ -1138,13 +1130,26 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) srcCount += BuildDelayFreeUses(op3); } break; - } + + case NI_AdvSimd_FusedMultiplyAdd: + case NI_AdvSimd_FusedMultiplySubtract: + case NI_AdvSimd_Arm64_FusedMultiplyAdd: + case NI_AdvSimd_Arm64_FusedMultiplySubtract: + case NI_AdvSimd_MultiplyAdd: + case NI_AdvSimd_MultiplySubtract: + assert((numArgs == 3) && (op2 != nullptr) && (op3 != nullptr)); + + buildUses = false; + + tgtPrefUse = BuildUse(op1); + srcCount += 1; + srcCount += BuildDelayFreeUses(op2); + srcCount += BuildDelayFreeUses(op3); + break; default: - { assert((intrinsicId > NI_HW_INTRINSIC_START) && (intrinsicId < NI_HW_INTRINSIC_END)); break; - } } if (buildUses) diff --git a/src/coreclr/src/jit/lsraarmarch.cpp b/src/coreclr/src/jit/lsraarmarch.cpp index 3ddab72698dedb..fab94aaf112520 100644 --- a/src/coreclr/src/jit/lsraarmarch.cpp +++ b/src/coreclr/src/jit/lsraarmarch.cpp @@ -38,13 +38,9 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // int LinearScan::BuildIndir(GenTreeIndir* indirTree) { - int srcCount = 0; - // If this is the rhs of a block copy (i.e. non-enregisterable struct), - // it has no register requirements. - if (indirTree->TypeGet() == TYP_STRUCT) - { - return srcCount; - } + // struct typed indirs are expected only on rhs of a block copy, + // but in this case they must be contained. + assert(indirTree->TypeGet() != TYP_STRUCT); GenTree* addr = indirTree->Addr(); GenTree* index = nullptr; @@ -109,7 +105,7 @@ int LinearScan::BuildIndir(GenTreeIndir* indirTree) } #endif // FEATURE_SIMD - srcCount = BuildIndirUses(indirTree); + int srcCount = BuildIndirUses(indirTree); buildInternalRegisterUses(); if (indirTree->gtOper != GT_STOREIND) @@ -502,7 +498,7 @@ int LinearScan::BuildPutArgSplit(GenTreePutArgSplit* argNode) currentRegCount = node->AsMultiRegOp()->GetRegCount(); } else -#endif // _TARGET_ARM +#endif // TARGET_ARM { assert(!node->IsMultiRegNode()); currentRegCount = 1; diff --git a/src/coreclr/src/jit/lsrabuild.cpp b/src/coreclr/src/jit/lsrabuild.cpp index 16ca5e288adf3a..fb4b8ff61be89b 100644 --- a/src/coreclr/src/jit/lsrabuild.cpp +++ b/src/coreclr/src/jit/lsrabuild.cpp @@ -2473,14 +2473,18 @@ void setTgtPref(Interval* interval, RefPosition* tgtPrefUse) RefPosition* LinearScan::BuildDef(GenTree* tree, regMaskTP dstCandidates, int multiRegIdx) { assert(!tree->isContained()); - RegisterType type = getDefType(tree); if (dstCandidates != RBM_NONE) { assert((tree->GetRegNum() == REG_NA) || (dstCandidates == genRegMask(tree->GetRegByIndex(multiRegIdx)))); } - if (tree->IsMultiRegNode()) + RegisterType type = getDefType(tree); + if (!tree->IsMultiRegNode()) + { + type = getDefType(tree); + } + else { type = tree->GetRegTypeByIndex(multiRegIdx); } @@ -2931,7 +2935,6 @@ int LinearScan::BuildStoreLoc(GenTreeLclVarCommon* storeLoc) // srcCount = number of registers in which the value is returned by call GenTreeCall* call = op1->AsCall(); ReturnTypeDesc* retTypeDesc = call->GetReturnTypeDesc(); - unsigned regCount = retTypeDesc->GetReturnRegCount(); srcCount = retTypeDesc->GetReturnRegCount(); for (int i = 0; i < srcCount; ++i) @@ -2939,6 +2942,16 @@ int LinearScan::BuildStoreLoc(GenTreeLclVarCommon* storeLoc) BuildUse(op1, RBM_NONE, i); } } + else if (op1->isContained() && op1->OperIs(GT_BITCAST)) + { + GenTree* bitCastSrc = op1->gtGetOp1(); + RegisterType registerType = bitCastSrc->TypeGet(); + singleUseRef = BuildUse(bitCastSrc, allRegs(registerType)); + + Interval* srcInterval = singleUseRef->getInterval(); + assert(srcInterval->registerType == registerType); + srcCount = 1; + } #ifndef TARGET_64BIT else if (varTypeIsLong(op1)) { @@ -3012,26 +3025,6 @@ int LinearScan::BuildStoreLoc(GenTreeLclVarCommon* storeLoc) } newRefPosition(varDefInterval, currentLoc + 1, RefTypeDef, storeLoc, allRegs(storeLoc->TypeGet())); } - else - { - if (storeLoc->gtOp1->OperIs(GT_BITCAST)) - { - storeLoc->gtType = storeLoc->gtOp1->gtType = storeLoc->gtOp1->AsUnOp()->gtOp1->TypeGet(); - RegisterType registerType = regType(storeLoc->TypeGet()); - noway_assert(singleUseRef != nullptr); - - Interval* srcInterval = singleUseRef->getInterval(); - srcInterval->registerType = registerType; - - RefPosition* srcDefPosition = srcInterval->firstRefPosition; - assert(srcDefPosition != nullptr); - assert(srcDefPosition->refType == RefTypeDef); - assert(srcDefPosition->treeNode == storeLoc->gtOp1); - - srcDefPosition->registerAssignment = allRegs(registerType); - singleUseRef->registerAssignment = allRegs(registerType); - } - } return srcCount; } diff --git a/src/coreclr/src/jit/lsraxarch.cpp b/src/coreclr/src/jit/lsraxarch.cpp index 400ab3da282134..e23d1c80da6ded 100644 --- a/src/coreclr/src/jit/lsraxarch.cpp +++ b/src/coreclr/src/jit/lsraxarch.cpp @@ -372,13 +372,18 @@ int LinearScan::BuildNode(GenTree* tree) break; case GT_BITCAST: - { assert(dstCount == 1); - tgtPrefUse = BuildUse(tree->gtGetOp1()); + if (!tree->gtGetOp1()->isContained()) + { + BuildUse(tree->gtGetOp1()); + srcCount = 1; + } + else + { + srcCount = 0; + } BuildDef(tree); - srcCount = 1; - } - break; + break; case GT_NEG: // TODO-XArch-CQ: @@ -2746,12 +2751,9 @@ int LinearScan::BuildCast(GenTreeCast* cast) // int LinearScan::BuildIndir(GenTreeIndir* indirTree) { - // If this is the rhs of a block copy (i.e. non-enregisterable struct), - // it has no register requirements. - if (indirTree->TypeGet() == TYP_STRUCT) - { - return 0; - } + // struct typed indirs are expected only on rhs of a block copy, + // but in this case they must be contained. + assert(indirTree->TypeGet() != TYP_STRUCT); #ifdef FEATURE_SIMD RefPosition* internalFloatDef = nullptr; diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp index aed99029b49179..7594aa2273aed3 100644 --- a/src/coreclr/src/jit/morph.cpp +++ b/src/coreclr/src/jit/morph.cpp @@ -2975,7 +2975,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) #else #error Unsupported or unset target architecture -#endif // _TARGET_* +#endif // TARGET* bool isBackFilled = false; unsigned nextFltArgRegNum = fltArgRegNum; // This is the next floating-point argument register number to use @@ -3079,7 +3079,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) } #else #error Unsupported or unset target architecture -#endif // _TARGET_XXX_ +#endif // TARGET_XXX if (isStructArg) { // We have an argument with a struct type, but it may be be a child of a GT_COMMA @@ -3857,7 +3857,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) copyBlkClass = objClass; } } - else if (genActualType(varDsc->TypeGet()) != structBaseType) + else if (genTypeSize(varDsc->TypeGet()) != genTypeSize(structBaseType)) { // Not a promoted struct, so just swizzle the type by using GT_LCL_FLD argObj->ChangeOper(GT_LCL_FLD); @@ -4177,7 +4177,7 @@ void Compiler::fgMorphMultiregStructArgs(GenTreeCall* call) foundStructArg = true; if (varTypeIsStruct(argx) && !argx->OperIs(GT_FIELD_LIST)) { - if (fgEntryPtr->IsHfaArg()) + if (fgEntryPtr->IsHfaRegArg()) { var_types hfaType = fgEntryPtr->GetHfaType(); unsigned structSize; @@ -8888,7 +8888,8 @@ GenTree* Compiler::fgMorphOneAsgBlockOp(GenTree* tree) if (dest == destLclVarTree) { - dest = gtNewIndir(asgType, gtNewOperNode(GT_ADDR, TYP_BYREF, dest)); + GenTree* addr = gtNewOperNode(GT_ADDR, TYP_BYREF, dest); + dest = gtNewIndir(asgType, addr); } } } @@ -9713,12 +9714,12 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) bool isLateArg = (tree->gtFlags & GTF_LATE_ARG) != 0; GenTree* asg = tree; - GenTree* rhs = asg->gtGetOp2(); + GenTree* src = asg->gtGetOp2(); GenTree* dest = asg->gtGetOp1(); #if FEATURE_MULTIREG_RET // If this is a multi-reg return, we will not do any morphing of this node. - if (rhs->IsMultiRegCall()) + if (src->IsMultiRegCall()) { assert(dest->OperGet() == GT_LCL_VAR); JITDUMP(" not morphing a multireg call return\n"); @@ -9738,9 +9739,9 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) } } asg->gtType = dest->TypeGet(); - rhs = fgMorphBlkNode(rhs, false); + src = fgMorphBlkNode(src, false); - asg->AsOp()->gtOp2 = rhs; + asg->AsOp()->gtOp2 = src; GenTree* oldTree = tree; GenTree* oneAsgTree = fgMorphOneAsgBlockOp(tree); @@ -9876,24 +9877,24 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) LclVarDsc* srcLclVar = nullptr; bool srcDoFldAsg = false; - if (rhs->IsLocal()) + if (src->IsLocal()) { - srcLclVarTree = rhs->AsLclVarCommon(); + srcLclVarTree = src->AsLclVarCommon(); srcLclNum = srcLclVarTree->GetLclNum(); - if (rhs->OperGet() == GT_LCL_FLD) + if (src->OperGet() == GT_LCL_FLD) { - srcFldSeq = rhs->AsLclFld()->GetFieldSeq(); + srcFldSeq = src->AsLclFld()->GetFieldSeq(); } } - else if (rhs->OperIsIndir()) + else if (src->OperIsIndir()) { - if (rhs->AsOp()->gtOp1->IsLocalAddrExpr(this, &srcLclVarTree, &srcFldSeq)) + if (src->AsOp()->gtOp1->IsLocalAddrExpr(this, &srcLclVarTree, &srcFldSeq)) { srcLclNum = srcLclVarTree->GetLclNum(); } else { - srcAddr = rhs->AsOp()->gtOp1; + srcAddr = src->AsOp()->gtOp1; } } @@ -9960,9 +9961,9 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) } #if defined(TARGET_ARM) - if ((rhs->OperIsIndir()) && (rhs->gtFlags & GTF_IND_UNALIGNED)) + if ((src->OperIsIndir()) && (src->gtFlags & GTF_IND_UNALIGNED)) { - JITDUMP(" rhs is unaligned"); + JITDUMP(" src is unaligned"); requiresCopyBlock = true; } @@ -9974,7 +9975,7 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) #endif // TARGET_ARM // Can't use field by field assignment if the src is a call. - if (rhs->OperGet() == GT_CALL) + if (src->OperGet() == GT_CALL) { JITDUMP(" src is a call"); // C++ style CopyBlock with holes @@ -10115,9 +10116,9 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) asg->AsOp()->gtOp1 = dest; asg->gtFlags |= (dest->gtFlags & GTF_ALL_EFFECT); - // Eliminate the "OBJ or BLK" node on the rhs. - rhs = fgMorphBlockOperand(rhs, asgType, blockWidth, false /*!isBlkReqd*/); - asg->AsOp()->gtOp2 = rhs; + // Eliminate the "OBJ or BLK" node on the src. + src = fgMorphBlockOperand(src, asgType, blockWidth, false /*!isBlkReqd*/); + asg->AsOp()->gtOp2 = src; goto _Done; } @@ -10127,7 +10128,6 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) // tree = nullptr; - GenTree* src; GenTree* addrSpill = nullptr; unsigned addrSpillTemp = BAD_VAR_NUM; bool addrSpillIsStackDest = false; // true if 'addrSpill' represents the address in our local stack frame @@ -10148,10 +10148,10 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) else if (destDoFldAsg) { fieldCnt = destLclVar->lvFieldCnt; - rhs = fgMorphBlockOperand(rhs, asgType, blockWidth, false /*isBlkReqd*/); + src = fgMorphBlockOperand(src, asgType, blockWidth, false /*isBlkReqd*/); if (srcAddr == nullptr) { - srcAddr = fgMorphGetStructAddr(&rhs, destLclVar->lvVerTypeInfo.GetClassHandle(), true /* rValue */); + srcAddr = fgMorphGetStructAddr(&src, destLclVar->lvVerTypeInfo.GetClassHandle(), true /* rValue */); } } else @@ -10281,31 +10281,29 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) // So, beyond this point we cannot rely on the old values of 'srcLclVar' and 'destLclVar'. for (unsigned i = 0; i < fieldCnt; ++i) { - FieldSeqNode* curFieldSeq = nullptr; + GenTree* dstFld; if (destDoFldAsg) { noway_assert(destLclNum != BAD_VAR_NUM); - unsigned fieldLclNum = lvaTable[destLclNum].lvFieldLclStart + i; - dest = gtNewLclvNode(fieldLclNum, lvaTable[fieldLclNum].TypeGet()); + unsigned dstFieldLclNum = lvaTable[destLclNum].lvFieldLclStart + i; + dstFld = gtNewLclvNode(dstFieldLclNum, lvaTable[dstFieldLclNum].TypeGet()); // If it had been labeled a "USEASG", assignments to the the individual promoted fields are not. if (destAddr != nullptr) { noway_assert(destAddr->AsOp()->gtOp1->gtOper == GT_LCL_VAR); - dest->gtFlags |= destAddr->AsOp()->gtOp1->gtFlags & ~(GTF_NODE_MASK | GTF_VAR_USEASG); + dstFld->gtFlags |= destAddr->AsOp()->gtOp1->gtFlags & ~(GTF_NODE_MASK | GTF_VAR_USEASG); } else { noway_assert(lclVarTree != nullptr); - dest->gtFlags |= lclVarTree->gtFlags & ~(GTF_NODE_MASK | GTF_VAR_USEASG); + dstFld->gtFlags |= lclVarTree->gtFlags & ~(GTF_NODE_MASK | GTF_VAR_USEASG); } // Don't CSE the lhs of an assignment. - dest->gtFlags |= GTF_DONT_CSE; + dstFld->gtFlags |= GTF_DONT_CSE; } else { noway_assert(srcDoFldAsg); - noway_assert(srcLclNum != BAD_VAR_NUM); - unsigned fieldLclNum = lvaTable[srcLclNum].lvFieldLclStart + i; if (destSingleLclVarAsg) { @@ -10313,25 +10311,25 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) noway_assert(destLclVar != nullptr); noway_assert(addrSpill == nullptr); - dest = gtNewLclvNode(destLclNum, destLclVar->TypeGet()); + dstFld = gtNewLclvNode(destLclNum, destLclVar->TypeGet()); } else { if (addrSpill) { assert(addrSpillTemp != BAD_VAR_NUM); - dest = gtNewLclvNode(addrSpillTemp, TYP_BYREF); + dstFld = gtNewLclvNode(addrSpillTemp, TYP_BYREF); } else { - dest = gtCloneExpr(destAddr); - noway_assert(dest != nullptr); + dstFld = gtCloneExpr(destAddr); + noway_assert(dstFld != nullptr); // Is the address of a local? GenTreeLclVarCommon* lclVarTree = nullptr; bool isEntire = false; bool* pIsEntire = (blockWidthIsConst ? &isEntire : nullptr); - if (dest->DefinesLocalAddr(this, blockWidth, &lclVarTree, pIsEntire)) + if (dstFld->DefinesLocalAddr(this, blockWidth, &lclVarTree, pIsEntire)) { lclVarTree->gtFlags |= GTF_VAR_DEF; if (!isEntire) @@ -10341,38 +10339,51 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) } } - GenTree* fieldOffsetNode = gtNewIconNode(lvaTable[fieldLclNum].lvFldOffset, TYP_I_IMPL); + LclVarDsc* srcVarDsc = lvaGetDesc(srcLclNum); + unsigned srcFieldLclNum = srcVarDsc->lvFieldLclStart + i; + LclVarDsc* srcFieldVarDsc = lvaGetDesc(srcFieldLclNum); + // Have to set the field sequence -- which means we need the field handle. - CORINFO_CLASS_HANDLE classHnd = lvaTable[srcLclNum].lvVerTypeInfo.GetClassHandle(); + CORINFO_CLASS_HANDLE classHnd = srcVarDsc->lvVerTypeInfo.GetClassHandle(); CORINFO_FIELD_HANDLE fieldHnd = - info.compCompHnd->getFieldInClass(classHnd, lvaTable[fieldLclNum].lvFldOrdinal); - curFieldSeq = GetFieldSeqStore()->CreateSingleton(fieldHnd); - fieldOffsetNode->AsIntCon()->gtFieldSeq = curFieldSeq; + info.compCompHnd->getFieldInClass(classHnd, srcFieldVarDsc->lvFldOrdinal); + FieldSeqNode* curFieldSeq = GetFieldSeqStore()->CreateSingleton(fieldHnd); - dest = gtNewOperNode(GT_ADD, TYP_BYREF, dest, fieldOffsetNode); + unsigned srcFieldOffset = lvaGetDesc(srcFieldLclNum)->lvFldOffset; - dest = gtNewIndir(lvaTable[fieldLclNum].TypeGet(), dest); + if (srcFieldOffset == 0) + { + fgAddFieldSeqForZeroOffset(dstFld, curFieldSeq); + } + else + { + GenTree* fieldOffsetNode = gtNewIconNode(srcFieldVarDsc->lvFldOffset, curFieldSeq); + dstFld = gtNewOperNode(GT_ADD, TYP_BYREF, dstFld, fieldOffsetNode); + } + + dstFld = gtNewIndir(srcFieldVarDsc->TypeGet(), dstFld); // !!! The destination could be on stack. !!! // This flag will let us choose the correct write barrier. - dest->gtFlags |= GTF_IND_TGTANYWHERE; + dstFld->gtFlags |= GTF_IND_TGTANYWHERE; } } + GenTree* srcFld; if (srcDoFldAsg) { noway_assert(srcLclNum != BAD_VAR_NUM); - unsigned fieldLclNum = lvaTable[srcLclNum].lvFieldLclStart + i; - src = gtNewLclvNode(fieldLclNum, lvaTable[fieldLclNum].TypeGet()); + unsigned srcFieldLclNum = lvaTable[srcLclNum].lvFieldLclStart + i; + srcFld = gtNewLclvNode(srcFieldLclNum, lvaTable[srcFieldLclNum].TypeGet()); noway_assert(srcLclVarTree != nullptr); - src->gtFlags |= srcLclVarTree->gtFlags & ~GTF_NODE_MASK; + srcFld->gtFlags |= srcLclVarTree->gtFlags & ~GTF_NODE_MASK; } else { noway_assert(destDoFldAsg); noway_assert(destLclNum != BAD_VAR_NUM); - unsigned fieldLclNum = lvaTable[destLclNum].lvFieldLclStart + i; + unsigned dstFieldLclNum = lvaTable[destLclNum].lvFieldLclStart + i; if (srcSingleLclVarAsg) { @@ -10380,29 +10391,29 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) noway_assert(srcLclNum != BAD_VAR_NUM); noway_assert(addrSpill == nullptr); - src = gtNewLclvNode(srcLclNum, lvaGetDesc(srcLclNum)->TypeGet()); + srcFld = gtNewLclvNode(srcLclNum, lvaGetDesc(srcLclNum)->TypeGet()); } else { if (addrSpill) { assert(addrSpillTemp != BAD_VAR_NUM); - src = gtNewLclvNode(addrSpillTemp, TYP_BYREF); + srcFld = gtNewLclvNode(addrSpillTemp, TYP_BYREF); } else { - src = gtCloneExpr(srcAddr); - noway_assert(src != nullptr); + srcFld = gtCloneExpr(srcAddr); + noway_assert(srcFld != nullptr); } CORINFO_CLASS_HANDLE classHnd = lvaTable[destLclNum].lvVerTypeInfo.GetClassHandle(); CORINFO_FIELD_HANDLE fieldHnd = - info.compCompHnd->getFieldInClass(classHnd, lvaTable[fieldLclNum].lvFldOrdinal); - curFieldSeq = GetFieldSeqStore()->CreateSingleton(fieldHnd); - var_types destType = lvaGetDesc(fieldLclNum)->lvType; + info.compCompHnd->getFieldInClass(classHnd, lvaTable[dstFieldLclNum].lvFldOrdinal); + FieldSeqNode* curFieldSeq = GetFieldSeqStore()->CreateSingleton(fieldHnd); + var_types destType = lvaGetDesc(dstFieldLclNum)->lvType; bool done = false; - if (lvaGetDesc(fieldLclNum)->lvFldOffset == 0) + if (lvaGetDesc(dstFieldLclNum)->lvFldOffset == 0) { // If this is a full-width use of the src via a different type, we need to create a GT_LCL_FLD. // (Note that if it was the same type, 'srcSingleLclVarAsg' would be true.) @@ -10420,28 +10431,31 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) srcLclVarTree->ChangeOper(GT_LCL_FLD); srcLclVarTree->gtType = destType; srcLclVarTree->AsLclFld()->SetFieldSeq(curFieldSeq); - src = srcLclVarTree; - done = true; + srcFld = srcLclVarTree; + done = true; } } } - else // if (lvaGetDesc(fieldLclNum)->lvFldOffset != 0) - { - src = gtNewOperNode(GT_ADD, TYP_BYREF, src, - new (this, GT_CNS_INT) - GenTreeIntCon(TYP_I_IMPL, lvaGetDesc(fieldLclNum)->lvFldOffset, - curFieldSeq)); - } if (!done) { - src = gtNewIndir(destType, src); + unsigned fldOffset = lvaGetDesc(dstFieldLclNum)->lvFldOffset; + if (fldOffset == 0) + { + fgAddFieldSeqForZeroOffset(srcFld, curFieldSeq); + } + else + { + GenTreeIntCon* fldOffsetNode = gtNewIconNode(fldOffset, curFieldSeq); + srcFld = gtNewOperNode(GT_ADD, TYP_BYREF, srcFld, fldOffsetNode); + } + srcFld = gtNewIndir(destType, srcFld); } } } - noway_assert(dest->TypeGet() == src->TypeGet()); + noway_assert(dstFld->TypeGet() == srcFld->TypeGet()); - asg = gtNewAssignNode(dest, src); + asg = gtNewAssignNode(dstFld, srcFld); // If we spilled the address, and we didn't do individual field assignments to promoted fields, // and it was of a local, ensure that the destination local variable has been marked as address @@ -11185,7 +11199,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) // // Note for TARGET_ARMARCH we don't have a remainder instruction, so we don't do this optimization // -#else // _TARGET_XARCH +#else // TARGET_XARCH /* If this is an unsigned long mod with op2 which is a cast to long from a constant int, then don't morph to a call to the helper. This can be done faster inline using idiv. @@ -11224,7 +11238,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) return tree; } } -#endif // _TARGET_XARCH +#endif // TARGET_XARCH ASSIGN_HELPER_FOR_MOD: @@ -13262,13 +13276,6 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) if (isZeroOffset) { - // The "op1" node might already be annotated with a zero-offset field sequence. - FieldSeqNode* existingZeroOffsetFldSeq = nullptr; - if (GetZeroOffsetFieldMap()->Lookup(op1, &existingZeroOffsetFldSeq)) - { - // Append the zero field sequences - zeroFieldSeq = GetFieldSeqStore()->Append(existingZeroOffsetFldSeq, zeroFieldSeq); - } // Transfer the annotation to the new GT_ADDR node. fgAddFieldSeqForZeroOffset(op1, zeroFieldSeq); } @@ -16831,64 +16838,64 @@ void Compiler::fgMorphLocalField(GenTree* tree, GenTree* parent) unsigned lclNum = tree->AsLclFld()->GetLclNum(); LclVarDsc* varDsc = &lvaTable[lclNum]; - if (varTypeIsStruct(varDsc) && (varDsc->lvPromoted)) + if (varTypeIsStruct(varDsc)) { - // Promoted struct - unsigned fldOffset = tree->AsLclFld()->GetLclOffs(); - unsigned fieldLclIndex = 0; - LclVarDsc* fldVarDsc = nullptr; - - if (fldOffset != BAD_VAR_NUM) + if (varDsc->lvPromoted) { - fieldLclIndex = lvaGetFieldLocal(varDsc, fldOffset); - noway_assert(fieldLclIndex != BAD_VAR_NUM); - fldVarDsc = &lvaTable[fieldLclIndex]; - } + // Promoted struct + unsigned fldOffset = tree->AsLclFld()->GetLclOffs(); + unsigned fieldLclIndex = 0; + LclVarDsc* fldVarDsc = nullptr; - if (fldOffset != BAD_VAR_NUM && genTypeSize(fldVarDsc->TypeGet()) == genTypeSize(tree->gtType) -#ifdef TARGET_X86 - && varTypeIsFloating(fldVarDsc->TypeGet()) == varTypeIsFloating(tree->gtType) -#endif - ) - { - // There is an existing sub-field we can use. - tree->AsLclFld()->SetLclNum(fieldLclIndex); + if (fldOffset != BAD_VAR_NUM) + { + fieldLclIndex = lvaGetFieldLocal(varDsc, fldOffset); + noway_assert(fieldLclIndex != BAD_VAR_NUM); + fldVarDsc = &lvaTable[fieldLclIndex]; + } - // The field must be an enregisterable type; otherwise it would not be a promoted field. - // The tree type may not match, e.g. for return types that have been morphed, but both - // must be enregisterable types. var_types treeType = tree->TypeGet(); var_types fieldType = fldVarDsc->TypeGet(); - assert((varTypeIsEnregisterable(treeType) || varTypeIsSIMD(treeType)) && - (varTypeIsEnregisterable(fieldType) || varTypeIsSIMD(fieldType))); - - tree->ChangeOper(GT_LCL_VAR); - assert(tree->AsLclVarCommon()->GetLclNum() == fieldLclIndex); - tree->gtType = fldVarDsc->TypeGet(); -#ifdef DEBUG - if (verbose) + if (fldOffset != BAD_VAR_NUM && (genTypeSize(fieldType) == genTypeSize(treeType))) { - printf("Replacing the GT_LCL_FLD in promoted struct with local var V%02u\n", fieldLclIndex); - } -#endif // DEBUG + // There is an existing sub-field we can use. + tree->AsLclFld()->SetLclNum(fieldLclIndex); - if ((parent->gtOper == GT_ASG) && (parent->AsOp()->gtOp1 == tree)) - { - tree->gtFlags |= GTF_VAR_DEF; - tree->gtFlags |= GTF_DONT_CSE; + // The field must be an enregisterable type; otherwise it would not be a promoted field. + // The tree type may not match, e.g. for return types that have been morphed, but both + // must be enregisterable types. + assert(varTypeIsEnregisterable(treeType) && varTypeIsEnregisterable(fieldType)); + + tree->ChangeOper(GT_LCL_VAR); + assert(tree->AsLclVarCommon()->GetLclNum() == fieldLclIndex); + tree->gtType = fldVarDsc->TypeGet(); + + if ((parent->gtOper == GT_ASG) && (parent->AsOp()->gtOp1 == tree)) + { + tree->gtFlags |= GTF_VAR_DEF; + tree->gtFlags |= GTF_DONT_CSE; + } + JITDUMP("Replacing the GT_LCL_FLD in promoted struct with local var V%02u\n", fieldLclIndex); } - } - else - { - // There is no existing field that has all the parts that we need - // So we must ensure that the struct lives in memory. - lvaSetVarDoNotEnregister(lclNum DEBUGARG(DNER_LocalField)); + else + { + // There is no existing field that has all the parts that we need + // So we must ensure that the struct lives in memory. + lvaSetVarDoNotEnregister(lclNum DEBUGARG(DNER_LocalField)); #ifdef DEBUG - // We can't convert this guy to a float because he really does have his - // address taken.. - varDsc->lvKeepType = 1; + // We can't convert this guy to a float because he really does have his + // address taken.. + varDsc->lvKeepType = 1; #endif // DEBUG + } + } + else if (varTypeIsSIMD(varDsc) && (genTypeSize(tree->TypeGet()) == genTypeSize(varDsc))) + { + assert(tree->AsLclFld()->GetLclOffs() == 0); + tree->gtType = varDsc->TypeGet(); + tree->ChangeOper(GT_LCL_VAR); + JITDUMP("Replacing GT_LCL_FLD of struct with local var V%02u\n", lclNum); } } } @@ -17576,6 +17583,16 @@ bool Compiler::fgMorphCombineSIMDFieldAssignments(BasicBlock* block, Statement* dstNode = originalLHS; dstNode->gtType = simdType; dstNode->AsLclFld()->SetFieldSeq(FieldSeqStore::NotAField()); + + // This may have changed a partial local field into full local field + if (dstNode->IsPartialLclFld(this)) + { + dstNode->gtFlags |= GTF_VAR_USEASG; + } + else + { + dstNode->gtFlags &= ~GTF_VAR_USEASG; + } } else { diff --git a/src/coreclr/src/jit/objectalloc.cpp b/src/coreclr/src/jit/objectalloc.cpp index e5cccf2eb3cc5a..79a2685d601f9f 100644 --- a/src/coreclr/src/jit/objectalloc.cpp +++ b/src/coreclr/src/jit/objectalloc.cpp @@ -510,8 +510,10 @@ unsigned int ObjectAllocator::MorphAllocObjNodeIntoStackAlloc(GenTreeAllocObj* a const int unsafeValueClsCheck = true; comp->lvaSetStruct(lclNum, allocObj->gtAllocObjClsHnd, unsafeValueClsCheck); - // Initialize the object memory if necessary - if (comp->fgStructTempNeedsExplicitZeroInit(comp->lvaTable + lclNum, block)) + // Initialize the object memory if necessary. + bool bbInALoop = (block->bbFlags & BBF_BACKWARD_JUMP) != 0; + bool bbIsReturn = block->bbJumpKind == BBJ_RETURN; + if (comp->fgVarNeedsExplicitZeroInit(comp->lvaGetDesc(lclNum), bbInALoop, bbIsReturn)) { //------------------------------------------------------------------------ // STMTx (IL 0x... ???) diff --git a/src/coreclr/src/jit/optcse.cpp b/src/coreclr/src/jit/optcse.cpp index cb106f4467f8bb..4a9a40541304c6 100644 --- a/src/coreclr/src/jit/optcse.cpp +++ b/src/coreclr/src/jit/optcse.cpp @@ -1664,7 +1664,7 @@ class CSE_Heuristic largeFrame = true; break; // early out, we don't need to keep increasing frameSize } -#elif _TARGET_ARM32 +#elif defined(TARGET_ARM) if (frameSize > 0x0400) { // We likely have a large stack frame. @@ -1679,7 +1679,7 @@ class CSE_Heuristic hugeFrame = true; break; // early out, we don't need to keep increasing frameSize } -#elif TARGET_ARM64 +#elif defined(TARGET_ARM64) if (frameSize > 0x1000) { // We likely have a large stack frame. diff --git a/src/coreclr/src/jit/reglist.h b/src/coreclr/src/jit/reglist.h index 58b02b011cac39..16239b81cd8ef2 100644 --- a/src/coreclr/src/jit/reglist.h +++ b/src/coreclr/src/jit/reglist.h @@ -13,6 +13,6 @@ typedef TinyArray regList; #else // The regList is unused for all other targets. -#endif // _TARGET_* +#endif // TARGET* #endif // REGLIST_H diff --git a/src/coreclr/src/jit/simd.cpp b/src/coreclr/src/jit/simd.cpp index 6a25c9ef35586c..1d7b9bf7443a92 100644 --- a/src/coreclr/src/jit/simd.cpp +++ b/src/coreclr/src/jit/simd.cpp @@ -438,7 +438,7 @@ var_types Compiler::getBaseTypeAndSizeOfSIMDType(CORINFO_CLASS_HANDLE typeHnd, u JITDUMP(" Known type Vector256\n"); } else -#endif // defined(_TARGET_XARCH) +#endif // defined(TARGET_XARCH) if (typeHnd == m_simdHandleCache->Vector128FloatHandle) { simdBaseType = TYP_FLOAT; @@ -1763,7 +1763,7 @@ GenTree* Compiler::impSIMDAbs(CORINFO_CLASS_HANDLE typeHnd, var_types baseType, { retVal = gtNewSIMDNode(simdType, op1, SIMDIntrinsicAbs, baseType, size); } -#else // !defined(_TARGET_XARCH)_ && !defined(TARGET_ARM64) +#else // !defined(TARGET_XARCH)_ && !defined(TARGET_ARM64) assert(!"Abs intrinsic on non-xarch target not implemented"); #endif // !TARGET_XARCH diff --git a/src/coreclr/src/jit/ssabuilder.cpp b/src/coreclr/src/jit/ssabuilder.cpp index 0ca9276038147d..53cffb67c9e341 100644 --- a/src/coreclr/src/jit/ssabuilder.cpp +++ b/src/coreclr/src/jit/ssabuilder.cpp @@ -772,6 +772,7 @@ void SsaBuilder::RenameDef(GenTreeOp* asgNode, BasicBlock* block) } else { + assert((lclNode->gtFlags & GTF_VAR_USEASG) == 0); lclNode->SetSsaNum(ssaNum); } diff --git a/src/coreclr/src/jit/target.h b/src/coreclr/src/jit/target.h index cab9272052a9b6..117a3e6df2ba5c 100644 --- a/src/coreclr/src/jit/target.h +++ b/src/coreclr/src/jit/target.h @@ -3,8 +3,8 @@ // See the LICENSE file in the project root for more information. /*****************************************************************************/ -#ifndef _TARGET_H_ -#define _TARGET_H_ +#ifndef TARGET_H_ +#define TARGET_H_ #if defined(FEATURE_CORECLR) && defined(TARGET_UNIX) #define FEATURE_VARARG 0 @@ -1986,5 +1986,5 @@ C_ASSERT(sizeof(target_size_t) == TARGET_POINTER_SIZE); C_ASSERT(sizeof(target_ssize_t) == TARGET_POINTER_SIZE); /*****************************************************************************/ -#endif // _TARGET_H_ +#endif // TARGET_H_ /*****************************************************************************/ diff --git a/src/coreclr/src/jit/unwind.cpp b/src/coreclr/src/jit/unwind.cpp index 96c8a98fd5da43..dff2df668bc5b2 100644 --- a/src/coreclr/src/jit/unwind.cpp +++ b/src/coreclr/src/jit/unwind.cpp @@ -426,8 +426,8 @@ UNATIVE_OFFSET Compiler::unwindGetCurrentOffset(FuncInfoDsc* func) // See unwindX86.cpp -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture -#endif // _TARGET_* +#endif // TARGET* diff --git a/src/coreclr/src/jit/utils.cpp b/src/coreclr/src/jit/utils.cpp index 7ac15135280748..d493c991e3a995 100644 --- a/src/coreclr/src/jit/utils.cpp +++ b/src/coreclr/src/jit/utils.cpp @@ -336,9 +336,9 @@ void dspRegMask(regMaskTP regMask, size_t minSiz) } #elif defined(TARGET_X86) // No register ranges -#else // _TARGET_* +#else // TARGET* #error Unsupported or unset target architecture -#endif // _TARGET_* +#endif // TARGET* } #if defined(TARGET_ARM64) diff --git a/src/coreclr/src/jit/valuenum.cpp b/src/coreclr/src/jit/valuenum.cpp index d8038937c1b6ff..2509bb1912ec79 100644 --- a/src/coreclr/src/jit/valuenum.cpp +++ b/src/coreclr/src/jit/valuenum.cpp @@ -6558,18 +6558,17 @@ void Compiler::fgValueNumberBlockAssignment(GenTree* tree) { if (srcAddrFuncApp.m_func == VNF_PtrToStatic) { - var_types indType = lclVarTree->TypeGet(); - ValueNum fieldSeqVN = srcAddrFuncApp.m_args[0]; - + var_types indType = lclVarTree->TypeGet(); + ValueNum fieldSeqVN = srcAddrFuncApp.m_args[0]; + FieldSeqNode* fldSeqForStaticVar = vnStore->FieldSeqVNToFieldSeq(fieldSeqVN); +#ifdef DEBUG FieldSeqNode* zeroOffsetFldSeq = nullptr; if (GetZeroOffsetFieldMap()->Lookup(srcAddr, &zeroOffsetFldSeq)) { - fieldSeqVN = - vnStore->FieldSeqVNAppend(fieldSeqVN, vnStore->VNForFieldSeq(zeroOffsetFldSeq)); + // Check that the zero offset field seq was attached for `srcAddr`. + assert(fldSeqForStaticVar->GetTail() == zeroOffsetFldSeq); } - - FieldSeqNode* fldSeqForStaticVar = vnStore->FieldSeqVNToFieldSeq(fieldSeqVN); - +#endif if (fldSeqForStaticVar != FieldSeqStore::NotAField()) { // We model statics as indices into GcHeap (which is a subset of ByrefExposed). diff --git a/src/coreclr/src/libraries-native/CMakeLists.txt b/src/coreclr/src/libraries-native/CMakeLists.txt index 4835c645261e41..aaf7f9bbbb7ae1 100644 --- a/src/coreclr/src/libraries-native/CMakeLists.txt +++ b/src/coreclr/src/libraries-native/CMakeLists.txt @@ -1,5 +1,17 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(GLOBALIZATION_NATIVE_DIR ${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Globalization.Native) -if(CLR_CMAKE_HOST_UNIX AND NOT CLR_CROSS_COMPONENTS_BUILD) - add_subdirectory(${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Globalization.Native System.Globalization.Native) +# Suppress exporting of the PAL APIs +add_definitions(-DPALEXPORT=) + +if(CLR_CMAKE_HOST_UNIX) + include_directories("${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/Common") + include_directories("${GLOBALIZATION_NATIVE_DIR}") + + add_subdirectory(${GLOBALIZATION_NATIVE_DIR} System.Globalization.Native) endif() + +add_library(libraries-native + STATIC + entrypoints.c +) diff --git a/src/coreclr/src/libraries-native/entrypoints.c b/src/coreclr/src/libraries-native/entrypoints.c new file mode 100644 index 00000000000000..75c5b7311b1570 --- /dev/null +++ b/src/coreclr/src/libraries-native/entrypoints.c @@ -0,0 +1,67 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#ifdef TARGET_UNIX + +#include "pal_types.h" + +typedef uint16_t UChar; + +// Include System.Globalization.Native headers +#include "pal_calendarData.h" +#include "pal_casing.h" +#include "pal_collation.h" +#include "pal_locale.h" +#include "pal_localeNumberData.h" +#include "pal_localeStringData.h" +#include "pal_icushim.h" +#include "pal_idna.h" +#include "pal_normalization.h" +#include "pal_timeZoneInfo.h" +#endif // TARGET_UNIX + +#define FCFuncStart(name) extern const void* name[]; const void* name[] = { +#define FCFuncEnd() (void*)0x01 /* FCFuncFlag_EndOfArray */ }; + +#define QCFuncElement(name,impl) \ + (void*)0x8 /* FCFuncFlag_QCall */, (void*)(impl), (void*)name, + +#ifdef TARGET_UNIX +FCFuncStart(gPalGlobalizationNative) + QCFuncElement("ChangeCase", GlobalizationNative_ChangeCase) + QCFuncElement("ChangeCaseInvariant", GlobalizationNative_ChangeCaseInvariant) + QCFuncElement("ChangeCaseTurkish", GlobalizationNative_ChangeCaseTurkish) + QCFuncElement("CloseSortHandle", GlobalizationNative_CloseSortHandle) + QCFuncElement("CompareString", GlobalizationNative_CompareString) + QCFuncElement("CompareStringOrdinalIgnoreCase", GlobalizationNative_CompareStringOrdinalIgnoreCase) + QCFuncElement("EndsWith", GlobalizationNative_EndsWith) + QCFuncElement("EnumCalendarInfo", GlobalizationNative_EnumCalendarInfo) + QCFuncElement("GetCalendarInfo", GlobalizationNative_GetCalendarInfo) + QCFuncElement("GetCalendars", GlobalizationNative_GetCalendars) + QCFuncElement("GetDefaultLocaleName", GlobalizationNative_GetDefaultLocaleName) + QCFuncElement("GetICUVersion", GlobalizationNative_GetICUVersion) + QCFuncElement("GetJapaneseEraStartDate", GlobalizationNative_GetJapaneseEraStartDate) + QCFuncElement("GetLatestJapaneseEra", GlobalizationNative_GetLatestJapaneseEra) + QCFuncElement("GetLocaleInfoGroupingSizes", GlobalizationNative_GetLocaleInfoGroupingSizes) + QCFuncElement("GetLocaleInfoInt", GlobalizationNative_GetLocaleInfoInt) + QCFuncElement("GetLocaleInfoString", GlobalizationNative_GetLocaleInfoString) + QCFuncElement("GetLocaleName", GlobalizationNative_GetLocaleName) + QCFuncElement("GetLocales", GlobalizationNative_GetLocales) + QCFuncElement("GetLocaleTimeFormat", GlobalizationNative_GetLocaleTimeFormat) + QCFuncElement("GetSortHandle", GlobalizationNative_GetSortHandle) + QCFuncElement("GetSortKey", GlobalizationNative_GetSortKey) + QCFuncElement("GetSortVersion", GlobalizationNative_GetSortVersion) + QCFuncElement("GetTimeZoneDisplayName", GlobalizationNative_GetTimeZoneDisplayName) + QCFuncElement("IndexOf", GlobalizationNative_IndexOf) + QCFuncElement("IndexOfOrdinalIgnoreCase", GlobalizationNative_IndexOfOrdinalIgnoreCase) + QCFuncElement("IsNormalized", GlobalizationNative_IsNormalized) + QCFuncElement("IsPredefinedLocale", GlobalizationNative_IsPredefinedLocale) + QCFuncElement("LastIndexOf", GlobalizationNative_LastIndexOf) + QCFuncElement("LoadICU", GlobalizationNative_LoadICU) + QCFuncElement("NormalizeString", GlobalizationNative_NormalizeString) + QCFuncElement("StartsWith", GlobalizationNative_StartsWith) + QCFuncElement("ToAscii", GlobalizationNative_ToAscii) + QCFuncElement("ToUnicode", GlobalizationNative_ToUnicode) +FCFuncEnd() +#endif // TARGET_UNIX diff --git a/src/coreclr/src/md/ceefilegen/ceesectionstring.cpp b/src/coreclr/src/md/ceefilegen/ceesectionstring.cpp index 073e6eeca8672a..4a0af7970d2010 100644 --- a/src/coreclr/src/md/ceefilegen/ceesectionstring.cpp +++ b/src/coreclr/src/md/ceefilegen/ceesectionstring.cpp @@ -66,7 +66,7 @@ CeeSectionString::~CeeSectionString() StringTableEntry* CeeSectionString::createEntry(__in_z LPWSTR target, ULONG hashId) { - StringTableEntry *entry = new StringTableEntry; + StringTableEntry *entry = new (nothrow) StringTableEntry; if (!entry) return NULL; entry->m_next = NULL; diff --git a/src/coreclr/src/md/compiler/filtermanager.cpp b/src/coreclr/src/md/compiler/filtermanager.cpp index 9a5033fb3f102f..3648c5c58bd72f 100644 --- a/src/coreclr/src/md/compiler/filtermanager.cpp +++ b/src/coreclr/src/md/compiler/filtermanager.cpp @@ -135,7 +135,7 @@ HRESULT FilterManager::MarkAssembly(mdAssembly as) { HRESULT hr = NOERROR; - if (hasAssemblyBeenMarked == false) + if (!hasAssemblyBeenMarked) { hasAssemblyBeenMarked = true; IfFailGo( MarkCustomAttributesWithParentToken(as) ); @@ -153,7 +153,7 @@ HRESULT FilterManager::MarkModule(mdModule mo) { HRESULT hr = NOERROR; - if (hasModuleBeenMarked == false) + if (!hasModuleBeenMarked) { hasModuleBeenMarked = true; IfFailGo( MarkCustomAttributesWithParentToken(mo) ); diff --git a/src/coreclr/src/pal/inc/pal.h b/src/coreclr/src/pal/inc/pal.h index 7546046ef41b60..9cfe2e8495ab5c 100644 --- a/src/coreclr/src/pal/inc/pal.h +++ b/src/coreclr/src/pal/inc/pal.h @@ -2377,11 +2377,13 @@ typedef struct _CRITICAL_SECTION { LONG LockCount; LONG RecursionCount; HANDLE OwningThread; - HANDLE LockSemaphore; ULONG_PTR SpinCount; +#ifdef PAL_TRACK_CRITICAL_SECTIONS_DATA BOOL bInternal; +#endif // PAL_TRACK_CRITICAL_SECTIONS_DATA volatile DWORD dwInitState; + union CSNativeDataStorage { BYTE rgNativeDataStorage[PAL_CS_NATIVE_DATA_SIZE]; diff --git a/src/coreclr/src/pal/inc/rt/palrt.h b/src/coreclr/src/pal/inc/rt/palrt.h index d7245d934a5e7d..0de8be16cea27e 100644 --- a/src/coreclr/src/pal/inc/rt/palrt.h +++ b/src/coreclr/src/pal/inc/rt/palrt.h @@ -1173,37 +1173,6 @@ typedef OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK *POUT_OF_PROCESS_FUNCTION_TABLE_C #define OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME \ "OutOfProcessFunctionTableCallback" -// #if !defined(TARGET_OSX) -// typedef LONG (*PEXCEPTION_ROUTINE)( - // IN PEXCEPTION_POINTERS pExceptionPointers, - // IN LPVOID lpvParam); - -// #define DISPATCHER_CONTEXT LPVOID - -// #else // defined(TARGET_OSX) - -// -// Define unwind history table structure. -// - -#define UNWIND_HISTORY_TABLE_SIZE 12 - -typedef struct _UNWIND_HISTORY_TABLE_ENTRY { - DWORD64 ImageBase; - PRUNTIME_FUNCTION FunctionEntry; -} UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY; - -typedef struct _UNWIND_HISTORY_TABLE { - DWORD Count; - BYTE LocalHint; - BYTE GlobalHint; - BYTE Search; - BYTE Once; - DWORD64 LowAddress; - DWORD64 HighAddress; - UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE]; -} UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE; - typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) ( @@ -1224,7 +1193,7 @@ typedef struct _DISPATCHER_CONTEXT { PCONTEXT ContextRecord; PEXCEPTION_ROUTINE LanguageHandler; PVOID HandlerData; - PUNWIND_HISTORY_TABLE HistoryTable; + PVOID HistoryTable; DWORD ScopeIndex; BOOLEAN ControlPcIsUnwound; PBYTE NonVolatileRegisters; @@ -1242,7 +1211,7 @@ typedef struct _DISPATCHER_CONTEXT { PCONTEXT ContextRecord; PEXCEPTION_ROUTINE LanguageHandler; PVOID HandlerData; - PUNWIND_HISTORY_TABLE HistoryTable; + PVOID HistoryTable; ULONG64 ScopeIndex; BOOLEAN ControlPcIsUnwound; PBYTE NonVolatileRegisters; @@ -1260,7 +1229,7 @@ typedef struct _DISPATCHER_CONTEXT { PCONTEXT ContextRecord; PEXCEPTION_ROUTINE LanguageHandler; PVOID HandlerData; - PUNWIND_HISTORY_TABLE HistoryTable; + PVOID HistoryTable; } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; #elif defined(HOST_X86) @@ -1275,7 +1244,7 @@ typedef struct _DISPATCHER_CONTEXT { PCONTEXT ContextRecord; PEXCEPTION_ROUTINE LanguageHandler; PVOID HandlerData; - PUNWIND_HISTORY_TABLE HistoryTable; + PVOID HistoryTable; BOOLEAN ControlPcIsUnwound; } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; diff --git a/src/coreclr/src/pal/src/arch/amd64/signalhandlerhelper.cpp b/src/coreclr/src/pal/src/arch/amd64/signalhandlerhelper.cpp index 28232251b13187..61eba90008d959 100644 --- a/src/coreclr/src/pal/src/arch/amd64/signalhandlerhelper.cpp +++ b/src/coreclr/src/pal/src/arch/amd64/signalhandlerhelper.cpp @@ -13,10 +13,11 @@ SET_DEFAULT_DEBUG_CHANNEL(EXCEPT); // some headers have code with asserts, so do /*++ Function : - signal_handler_worker + ExecuteHandlerOnCustomStack - Handles signal on the original stack where the signal occured. - Invoked via setcontext. + Execute signal handler on a custom stack, the current stack pointer is specified by the customSp + If the customSp is 0, then the handler is executed on the original stack where the signal was fired. + It installs a fake stack frame to enable stack unwinding to the signal source location. Parameters : POSIX signal handler parameter list ("man sigaction" for details) @@ -24,13 +25,19 @@ Parameters : (no return value) --*/ -void ExecuteHandlerOnOriginalStack(int code, siginfo_t *siginfo, void *context, SignalHandlerWorkerReturnPoint* returnPoint) +void ExecuteHandlerOnCustomStack(int code, siginfo_t *siginfo, void *context, size_t customSp, SignalHandlerWorkerReturnPoint* returnPoint) { ucontext_t *ucontext = (ucontext_t *)context; size_t faultSp = (size_t)MCREG_Rsp(ucontext->uc_mcontext); _ASSERTE(IS_ALIGNED(faultSp, 8)); + if (customSp == 0) + { + // preserve 128 bytes long red zone and align stack pointer + customSp = ALIGN_DOWN(faultSp - 128, 16); + } + size_t fakeFrameReturnAddress; if (IS_ALIGNED(faultSp, 16)) @@ -42,8 +49,7 @@ void ExecuteHandlerOnOriginalStack(int code, siginfo_t *siginfo, void *context, fakeFrameReturnAddress = (size_t)SignalHandlerWorkerReturnOffset8 + (size_t)CallSignalHandlerWrapper8; } - // preserve 128 bytes long red zone and align stack pointer - size_t* sp = (size_t*)ALIGN_DOWN(faultSp - 128, 16); + size_t* sp = (size_t*)customSp; // Build fake stack frame to enable the stack unwinder to unwind from signal_handler_worker to the faulting instruction *--sp = (size_t)MCREG_Rip(ucontext->uc_mcontext); @@ -51,7 +57,7 @@ void ExecuteHandlerOnOriginalStack(int code, siginfo_t *siginfo, void *context, size_t fp = (size_t)sp; *--sp = fakeFrameReturnAddress; - // Switch the current context to the signal_handler_worker and the original stack + // Switch the current context to the signal_handler_worker and the custom stack CONTEXT context2; RtlCaptureContext(&context2); diff --git a/src/coreclr/src/pal/src/arch/arm/signalhandlerhelper.cpp b/src/coreclr/src/pal/src/arch/arm/signalhandlerhelper.cpp index eac3b29b81df8b..9c6dda1f2fb7b5 100644 --- a/src/coreclr/src/pal/src/arch/arm/signalhandlerhelper.cpp +++ b/src/coreclr/src/pal/src/arch/arm/signalhandlerhelper.cpp @@ -13,10 +13,11 @@ SET_DEFAULT_DEBUG_CHANNEL(EXCEPT); // some headers have code with asserts, so do /*++ Function : - signal_handler_worker + ExecuteHandlerOnCustomStack - Handles signal on the original stack where the signal occured. - Invoked via setcontext. + Execute signal handler on a custom stack, the current stack pointer is specified by the customSp + If the customSp is 0, then the handler is executed on the original stack where the signal was fired. + It installs a fake stack frame to enable stack unwinding to the signal source location. Parameters : POSIX signal handler parameter list ("man sigaction" for details) @@ -24,13 +25,19 @@ Parameters : (no return value) --*/ -void ExecuteHandlerOnOriginalStack(int code, siginfo_t *siginfo, void *context, SignalHandlerWorkerReturnPoint* returnPoint) +void ExecuteHandlerOnCustomStack(int code, siginfo_t *siginfo, void *context, size_t customSp, SignalHandlerWorkerReturnPoint* returnPoint) { ucontext_t *ucontext = (ucontext_t *)context; size_t faultSp = (size_t)MCREG_Sp(ucontext->uc_mcontext); _ASSERTE(IS_ALIGNED(faultSp, 4)); + if (customSp == 0) + { + // preserve 8 bytes long red zone and align stack pointer + customSp = ALIGN_DOWN(faultSp - 8, 8); + } + size_t fakeFrameReturnAddress; if (IS_ALIGNED(faultSp, 8)) @@ -42,8 +49,7 @@ void ExecuteHandlerOnOriginalStack(int code, siginfo_t *siginfo, void *context, fakeFrameReturnAddress = (size_t)SignalHandlerWorkerReturnOffset4 + (size_t)CallSignalHandlerWrapper4; } - // preserve 8 bytes long red zone and align stack pointer - size_t* sp = (size_t*)ALIGN_DOWN(faultSp - 8, 8); + size_t* sp = (size_t*)customSp; #ifndef __linux__ size_t cpsr = (size_t)MCREG_Cpsr(ucontext->uc_mcontext); diff --git a/src/coreclr/src/pal/src/arch/arm64/signalhandlerhelper.cpp b/src/coreclr/src/pal/src/arch/arm64/signalhandlerhelper.cpp index b52e8a64d19af1..524bd11b364f8d 100644 --- a/src/coreclr/src/pal/src/arch/arm64/signalhandlerhelper.cpp +++ b/src/coreclr/src/pal/src/arch/arm64/signalhandlerhelper.cpp @@ -13,10 +13,11 @@ SET_DEFAULT_DEBUG_CHANNEL(EXCEPT); // some headers have code with asserts, so do /*++ Function : - signal_handler_worker + ExecuteHandlerOnCustomStack - Handles signal on the original stack where the signal occured. - Invoked via setcontext. + Execute signal handler on a custom stack, the current stack pointer is specified by the customSp + If the customSp is 0, then the handler is executed on the original stack where the signal was fired. + It installs a fake stack frame to enable stack unwinding to the signal source location. Parameters : POSIX signal handler parameter list ("man sigaction" for details) @@ -24,12 +25,18 @@ Parameters : (no return value) --*/ -void ExecuteHandlerOnOriginalStack(int code, siginfo_t *siginfo, void *context, SignalHandlerWorkerReturnPoint* returnPoint) +void ExecuteHandlerOnCustomStack(int code, siginfo_t *siginfo, void *context, size_t customSp, SignalHandlerWorkerReturnPoint* returnPoint) { ucontext_t *ucontext = (ucontext_t *)context; size_t faultSp = (size_t)MCREG_Sp(ucontext->uc_mcontext); _ASSERTE(IS_ALIGNED(faultSp, 8)); + if (customSp == 0) + { + // preserve 128 bytes long red zone and align stack pointer + customSp = ALIGN_DOWN(faultSp - 128, 16); + } + size_t fakeFrameReturnAddress; if (IS_ALIGNED(faultSp, 16)) @@ -42,7 +49,7 @@ void ExecuteHandlerOnOriginalStack(int code, siginfo_t *siginfo, void *context, } // preserve 128 bytes long red zone and align stack pointer - size_t* sp = (size_t*)ALIGN_DOWN(faultSp - 128, 16); + size_t* sp = (size_t*)customSp; // Build fake stack frame to enable the stack unwinder to unwind from signal_handler_worker to the faulting instruction // pushed LR diff --git a/src/coreclr/src/pal/src/arch/i386/signalhandlerhelper.cpp b/src/coreclr/src/pal/src/arch/i386/signalhandlerhelper.cpp index 8e23099193028b..16e527a1ebcb83 100644 --- a/src/coreclr/src/pal/src/arch/i386/signalhandlerhelper.cpp +++ b/src/coreclr/src/pal/src/arch/i386/signalhandlerhelper.cpp @@ -13,10 +13,11 @@ SET_DEFAULT_DEBUG_CHANNEL(EXCEPT); // some headers have code with asserts, so do /*++ Function : - signal_handler_worker + ExecuteHandlerOnCustomStack - Handles signal on the original stack where the signal occured. - Invoked via setcontext. + Execute signal handler on a custom stack, the current stack pointer is specified by the customSp + If the customSp is 0, then the handler is executed on the original stack where the signal was fired. + It installs a fake stack frame to enable stack unwinding to the signal source location. Parameters : POSIX signal handler parameter list ("man sigaction" for details) @@ -24,13 +25,18 @@ Parameters : (no return value) --*/ -void ExecuteHandlerOnOriginalStack(int code, siginfo_t *siginfo, void *context, SignalHandlerWorkerReturnPoint* returnPoint) +void ExecuteHandlerOnCustomStack(int code, siginfo_t *siginfo, void *context, size_t customSp, SignalHandlerWorkerReturnPoint* returnPoint) { ucontext_t *ucontext = (ucontext_t *)context; size_t faultSp = (size_t)MCREG_Esp(ucontext->uc_mcontext); _ASSERTE(IS_ALIGNED(faultSp, 4)); + if (customSp == 0) + { + customSp = ALIGN_DOWN(faultSp, 16); + } + size_t fakeFrameReturnAddress; switch (faultSp & 0xc) @@ -49,7 +55,7 @@ void ExecuteHandlerOnOriginalStack(int code, siginfo_t *siginfo, void *context, break; } - size_t* sp = (size_t*)ALIGN_DOWN(faultSp, 16); + size_t* sp = (size_t*)customSp; // Build fake stack frame to enable the stack unwinder to unwind from signal_handler_worker to the faulting instruction *--sp = (size_t)MCREG_Eip(ucontext->uc_mcontext); diff --git a/src/coreclr/src/pal/src/configure.cmake b/src/coreclr/src/pal/src/configure.cmake index f426d0764118ee..46d88b0915492e 100644 --- a/src/coreclr/src/pal/src/configure.cmake +++ b/src/coreclr/src/pal/src/configure.cmake @@ -126,7 +126,6 @@ check_function_exists(semget HAS_SYSV_SEMAPHORES) check_function_exists(pthread_mutex_init HAS_PTHREAD_MUTEXES) check_function_exists(ttrace HAVE_TTRACE) check_function_exists(pipe2 HAVE_PIPE2) -check_function_exists(process_vm_readv HAVE_PROCESS_VM_READV) check_cxx_source_compiles(" #include diff --git a/src/coreclr/src/pal/src/exception/seh.cpp b/src/coreclr/src/pal/src/exception/seh.cpp index ef95f5e354a3d1..e0ebff145b893d 100644 --- a/src/coreclr/src/pal/src/exception/seh.cpp +++ b/src/coreclr/src/pal/src/exception/seh.cpp @@ -28,6 +28,7 @@ Module Name: #include "pal/process.h" #include "pal/malloc.hpp" #include "pal/signal.hpp" +#include "pal/virtual.h" #if HAVE_MACH_EXCEPTIONS #include "machexception.h" @@ -268,14 +269,16 @@ SEHProcessException(PAL_SEHException* exception) // Check if the failed access has hit a stack guard page. In such case, it // was a stack probe that detected that there is not enough stack left. void* stackLimit = CPalThread::GetStackLimit(); - void* stackGuard = (void*)((size_t)stackLimit - getpagesize()); + void* stackOverflowBottom = (void*)((size_t)stackLimit - GetVirtualPageSize()); + // On some versions of glibc / platforms the stackLimit is an address of the guard page, on some + // it is right above the guard page. + // So consider SIGSEGV in one page above and below stack limit to be stack overflow. + void* stackOverflowTop = (void*)((size_t)stackLimit + GetVirtualPageSize()); void* violationAddr = (void*)exceptionRecord->ExceptionInformation[1]; - if ((violationAddr >= stackGuard) && (violationAddr < stackLimit)) + + if ((violationAddr >= stackOverflowBottom) && (violationAddr < stackOverflowTop)) { - // The exception happened in the page right below the stack limit, - // so it is a stack overflow - (void)write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1); - PROCAbort(); + exceptionRecord->ExceptionCode = EXCEPTION_STACK_OVERFLOW; } } diff --git a/src/coreclr/src/pal/src/exception/signal.cpp b/src/coreclr/src/pal/src/exception/signal.cpp index 49fdec8db89e40..d6d8256610e5c2 100644 --- a/src/coreclr/src/pal/src/exception/signal.cpp +++ b/src/coreclr/src/pal/src/exception/signal.cpp @@ -113,6 +113,9 @@ struct sigaction g_previous_activation; // Offset of the local variable containing pointer to windows style context in the common_signal_handler function. // This offset is relative to the frame pointer. int g_common_signal_handler_context_locvar_offset = 0; + +// TOP of special stack for handling stack overflow +volatile void* g_stackOverflowHandlerStack = NULL; #endif // !HAVE_MACH_EXCEPTIONS /* public function definitions ************************************************/ @@ -175,6 +178,26 @@ BOOL SEHInitializeSignals(CorUnix::CPalThread *pthrCurrent, DWORD flags) { return FALSE; } + + // Allocate the minimal stack necessary for handling stack overflow + int stackOverflowStackSize = ALIGN_UP(sizeof(SignalHandlerWorkerReturnPoint), 16) + 7 * 4096; + // Align the size to virtual page size and add one virtual page as a stack guard + stackOverflowStackSize = ALIGN_UP(stackOverflowStackSize, GetVirtualPageSize()) + GetVirtualPageSize(); + g_stackOverflowHandlerStack = mmap(NULL, stackOverflowStackSize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_STACK | MAP_PRIVATE, -1, 0); + if (g_stackOverflowHandlerStack == MAP_FAILED) + { + return FALSE; + } + + // create a guard page for the alternate stack + int st = mprotect((void*)g_stackOverflowHandlerStack, GetVirtualPageSize(), PROT_NONE); + if (st != 0) + { + munmap((void*)g_stackOverflowHandlerStack, stackOverflowStackSize); + return FALSE; + } + + g_stackOverflowHandlerStack = (void*)((size_t)g_stackOverflowHandlerStack + stackOverflowStackSize); } /* The default action for SIGPIPE is process termination. @@ -430,6 +453,41 @@ bool IsRunningOnAlternateStack(void *context) return isRunningOnAlternateStack; } +/*++ +Function : + SwitchStackAndExecuteHandler + + Switch to the stack specified by the sp argument + +Parameters : + POSIX signal handler parameter list ("man sigaction" for details) + sp - stack pointer of the stack to execute the handler on. + If sp == 0, execute it on the original stack where the signal has occured. +Return : + The return value from the signal handler +--*/ +static bool SwitchStackAndExecuteHandler(int code, siginfo_t *siginfo, void *context, size_t sp) +{ + // Establish a return point in case the common_signal_handler returns + + volatile bool contextInitialization = true; + + void *ptr = alloca(sizeof(SignalHandlerWorkerReturnPoint) + alignof(SignalHandlerWorkerReturnPoint) - 1); + SignalHandlerWorkerReturnPoint *pReturnPoint = (SignalHandlerWorkerReturnPoint *)ALIGN_UP(ptr, alignof(SignalHandlerWorkerReturnPoint)); + RtlCaptureContext(&pReturnPoint->context); + + // When the signal handler worker completes, it uses setcontext to return to this point + + if (contextInitialization) + { + contextInitialization = false; + ExecuteHandlerOnCustomStack(code, siginfo, context, sp, pReturnPoint); + _ASSERTE(FALSE); // The ExecuteHandlerOnCustomStack should never return + } + + return pReturnPoint->returnFromHandler; +} + /*++ Function : sigsegv_handler @@ -453,8 +511,30 @@ static void sigsegv_handler(int code, siginfo_t *siginfo, void *context) // we have a stack overflow. if ((failureAddress - (sp - GetVirtualPageSize())) < 2 * GetVirtualPageSize()) { - (void)write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1); - PROCAbort(); + if (GetCurrentPalThread()) + { + size_t handlerStackTop = __sync_val_compare_and_swap((size_t*)&g_stackOverflowHandlerStack, (size_t)g_stackOverflowHandlerStack, 0); + if (handlerStackTop == 0) + { + // We have only one stack for handling stack overflow preallocated. We let only the first thread that hits stack overflow to + // run the exception handling code on that stack (which ends up just dumping the stack trace and aborting the process). + // Other threads are held spinning and sleeping here until the process exits. + while (true) + { + sleep(1); + } + } + + if (SwitchStackAndExecuteHandler(code, siginfo, context, (size_t)handlerStackTop)) + { + PROCAbort(); + } + } + else + { + (void)write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1); + PROCAbort(); + } } // Now that we know the SIGSEGV didn't happen due to a stack overflow, execute the common @@ -462,24 +542,7 @@ static void sigsegv_handler(int code, siginfo_t *siginfo, void *context) if (GetCurrentPalThread() && IsRunningOnAlternateStack(context)) { - // Establish a return point in case the common_signal_handler returns - - volatile bool contextInitialization = true; - - void *ptr = alloca(sizeof(SignalHandlerWorkerReturnPoint) + alignof(SignalHandlerWorkerReturnPoint) - 1); - SignalHandlerWorkerReturnPoint *pReturnPoint = (SignalHandlerWorkerReturnPoint *)ALIGN_UP(ptr, alignof(SignalHandlerWorkerReturnPoint)); - RtlCaptureContext(&pReturnPoint->context); - - // When the signal handler worker completes, it uses setcontext to return to this point - - if (contextInitialization) - { - contextInitialization = false; - ExecuteHandlerOnOriginalStack(code, siginfo, context, pReturnPoint); - _ASSERTE(FALSE); // The ExecuteHandlerOnOriginalStack should never return - } - - if (pReturnPoint->returnFromHandler) + if (SwitchStackAndExecuteHandler(code, siginfo, context, 0 /* sp */)) // sp == 0 indicates execution on the original stack { return; } @@ -692,7 +755,10 @@ PAL_ERROR InjectActivationInternal(CorUnix::CPalThread* pThread) { #ifdef INJECT_ACTIVATION_SIGNAL int status = pthread_kill(pThread->GetPThreadSelf(), INJECT_ACTIVATION_SIGNAL); - if (status != 0) + // We can get EAGAIN when printing stack overflow stack trace and when other threads hit + // stack overflow too. Those are held in the sigsegv_handler with blocked signals until + // the process exits. + if ((status != 0) && (status != EAGAIN)) { // Failure to send the signal is fatal. There are only two cases when sending // the signal can fail. First, if the signal ID is invalid and second, diff --git a/src/coreclr/src/pal/src/include/pal/signal.hpp b/src/coreclr/src/pal/src/include/pal/signal.hpp index 51b098809447a0..7b5e1d71407b1c 100644 --- a/src/coreclr/src/pal/src/include/pal/signal.hpp +++ b/src/coreclr/src/pal/src/include/pal/signal.hpp @@ -78,10 +78,11 @@ extern "C" void signal_handler_worker(int code, siginfo_t *siginfo, void *contex /*++ Function : - ExecuteHandlerOnOriginalStack + ExecuteHandlerOnCustomStack - Executes signal_handler_worker on the original stack where the signal occured. - It installs fake stack frame to enable stack unwinding to the signal source location. + Execute signal handler on a custom stack, the current stack pointer is specified by the customSp + If the customSp is 0, then the handler is executed on the original stack where the signal was fired. + It installs a fake stack frame to enable stack unwinding to the signal source location. Parameters : POSIX signal handler parameter list ("man sigaction" for details) @@ -89,7 +90,7 @@ Parameters : (no return value) --*/ -void ExecuteHandlerOnOriginalStack(int code, siginfo_t *siginfo, void *context, SignalHandlerWorkerReturnPoint* returnPoint); +void ExecuteHandlerOnCustomStack(int code, siginfo_t *siginfo, void *context, size_t sp, SignalHandlerWorkerReturnPoint* returnPoint); #endif // !HAVE_MACH_EXCEPTIONS diff --git a/src/coreclr/src/pal/src/locale/utf8.cpp b/src/coreclr/src/pal/src/locale/utf8.cpp index f34df4fe992b2e..d263248bdf310d 100644 --- a/src/coreclr/src/pal/src/locale/utf8.cpp +++ b/src/coreclr/src/pal/src/locale/utf8.cpp @@ -335,7 +335,7 @@ class DecoderFallbackBuffer else { // Low surrogate - if (bHighSurrogate == false) + if (!bHighSurrogate) throw ArgumentException("String 'chars' contains invalid Unicode code points."); bHighSurrogate = false; } @@ -391,7 +391,7 @@ class DecoderFallbackBuffer else { // Low surrogate - if (bHighSurrogate == false) + if (!bHighSurrogate) throw ArgumentException("String 'chars' contains invalid Unicode code points."); bHighSurrogate = false; } diff --git a/src/coreclr/src/pal/src/misc/environ.cpp b/src/coreclr/src/pal/src/misc/environ.cpp index f2538752f6456d..9fec8a33a2b41b 100644 --- a/src/coreclr/src/pal/src/misc/environ.cpp +++ b/src/coreclr/src/pal/src/misc/environ.cpp @@ -893,6 +893,55 @@ BOOL EnvironPutenv(const char* entry, BOOL deleteIfEmpty) return result; } + +/*++ +Function: + FindEnvVarValue + +Get the value of environment variable with the given name. +Caller should take care of locking and releasing palEnvironment. + +Parameters + + name + [in] The name of the environment variable to get. + +Return Value + + A pointer to the value of the environment variable if it exists, + or nullptr otherwise. + +--*/ +char* FindEnvVarValue(const char* name) +{ + if (*name == '\0') + return nullptr; + + for (int i = 0; palEnvironment[i] != nullptr; ++i) + { + const char* pch = name; + char* p = palEnvironment[i]; + + do + { + if (*pch == '\0') + { + if (*p == '=') + return p + 1; + + if (*p == '\0') // no = sign -> empty value + return p; + + break; + } + } + while (*pch++ == *p++); + } + + return nullptr; +} + + /*++ Function: EnvironGetenv @@ -919,33 +968,11 @@ Return Value --*/ char* EnvironGetenv(const char* name, BOOL copyValue) { - char *retValue = nullptr; - CPalThread * pthrCurrent = InternalGetCurrentThread(); InternalEnterCriticalSection(pthrCurrent, &gcsEnvironment); - - size_t nameLength = strlen(name); - for (int i = 0; palEnvironment[i] != nullptr; ++i) - { - if (strncmp(palEnvironment[i], name, nameLength) == 0) - { - char *equalsSignPosition = palEnvironment[i] + nameLength; - - // If this is one of the variables which has no equals sign, we - // treat the whole thing as name, so the value is an empty string. - if (*equalsSignPosition == '\0') - { - retValue = (char *)""; - break; - } - else if (*equalsSignPosition == '=') - { - retValue = equalsSignPosition + 1; - break; - } - } - } - + + char* retValue = FindEnvVarValue(name); + if ((retValue != nullptr) && copyValue) { retValue = strdup(retValue); @@ -955,6 +982,7 @@ char* EnvironGetenv(const char* name, BOOL copyValue) return retValue; } + /*++ Function: EnvironGetSystemEnvironment diff --git a/src/coreclr/src/pal/src/misc/sysinfo.cpp b/src/coreclr/src/pal/src/misc/sysinfo.cpp index dffcc63f32962f..7e9bf4b3b6e6fc 100644 --- a/src/coreclr/src/pal/src/misc/sysinfo.cpp +++ b/src/coreclr/src/pal/src/misc/sysinfo.cpp @@ -37,6 +37,10 @@ Revision History: #error Either sysctl or sysconf is required for GetSystemInfo. #endif +#if HAVE_SYSCTLBYNAME +#include +#endif + #if HAVE_SYSINFO #include #endif diff --git a/src/coreclr/src/pal/src/sync/cs.cpp b/src/coreclr/src/pal/src/sync/cs.cpp index 138f971b0b3522..354550063c6449 100644 --- a/src/coreclr/src/pal/src/sync/cs.cpp +++ b/src/coreclr/src/pal/src/sync/cs.cpp @@ -158,10 +158,11 @@ typedef struct _PAL_CRITICAL_SECTION { Volatile LockCount; LONG RecursionCount; SIZE_T OwningThread; - HANDLE LockSemaphore; ULONG_PTR SpinCount; // Private Unix part +#ifdef PAL_TRACK_CRITICAL_SECTIONS_DATA BOOL fInternal; +#endif // PAL_TRACK_CRITICAL_SECTIONS_DATA Volatile cisInitState; PAL_CRITICAL_SECTION_NATIVE_DATA csndNativeData; } PAL_CRITICAL_SECTION, *PPAL_CRITICAL_SECTION, *LPPAL_CRITICAL_SECTION; @@ -628,8 +629,6 @@ namespace CorUnix pPalCriticalSection->RecursionCount = 0; pPalCriticalSection->SpinCount = dwSpinCount; pPalCriticalSection->OwningThread = 0; - pPalCriticalSection->LockSemaphore = NULL; - pPalCriticalSection->fInternal = fInternal; #ifdef _DEBUG CPalThread * pThread = @@ -660,6 +659,7 @@ namespace CorUnix } #ifdef PAL_TRACK_CRITICAL_SECTIONS_DATA + pPalCriticalSection->fInternal = fInternal; InterlockedIncrement(fInternal ? &g_lPALCSInternalInitializeCount : &g_lPALCSInitializeCount); #endif // PAL_TRACK_CRITICAL_SECTIONS_DATA @@ -1444,13 +1444,17 @@ namespace CorUnix printf("\tLockCount \t= %#x\n" "\tRecursionCount \t= %d\n" "\tOwningThread \t= %p\n" - "\tLockSemaphore \t= %p\n" "\tSpinCount \t= %u\n" "\tfInternal \t= %d\n" "\teInitState \t= %u\n" "\tpNativeData \t= %p ->\n", pCS->LockCount.Load(), pCS->RecursionCount, (void *)pCS->OwningThread, - pCS->LockSemaphore, (unsigned)pCS->SpinCount, (int)pCS->fInternal, + (unsigned)pCS->SpinCount, +#ifdef PAL_TRACK_CRITICAL_SECTIONS_DATA + (int)pCS->fInternal, +#else + (int)0, +#endif // PAL_TRACK_CRITICAL_SECTIONS_DATA pCS->cisInitState.Load(), &pCS->csndNativeData); printf("\t{\n\t\t[mutex]\n\t\t[condition]\n" diff --git a/src/coreclr/src/pal/src/thread/thread.cpp b/src/coreclr/src/pal/src/thread/thread.cpp index c8dcc43d06f561..1473601c512523 100644 --- a/src/coreclr/src/pal/src/thread/thread.cpp +++ b/src/coreclr/src/pal/src/thread/thread.cpp @@ -2808,7 +2808,7 @@ PAL_InjectActivation( palError = InjectActivationInternal(pTargetThread); } - if (palError == NO_ERROR) + if (palError != NO_ERROR) { pCurrentThread->SetLastError(palError); } diff --git a/src/coreclr/src/pal/tools/gen-dactable-rva.sh b/src/coreclr/src/pal/tools/gen-dactable-rva.sh index dd200068e5f398..fd4fa76c6eaab4 100644 --- a/src/coreclr/src/pal/tools/gen-dactable-rva.sh +++ b/src/coreclr/src/pal/tools/gen-dactable-rva.sh @@ -1 +1 @@ -nm $1 | grep g_dacTable | cut -f 1 -d' ' | head -n 1 | awk '{ print "#define DAC_TABLE_RVA 0x" $1}' > $2 +${NM:-nm} $1 | grep g_dacTable | cut -f 1 -d' ' | head -n 1 | awk '{ print "#define DAC_TABLE_RVA 0x" $1}' > $2 diff --git a/src/coreclr/src/scripts/genEventPipe.py b/src/coreclr/src/scripts/genEventPipe.py index 35586385e7f704..54a9db415706d3 100644 --- a/src/coreclr/src/scripts/genEventPipe.py +++ b/src/coreclr/src/scripts/genEventPipe.py @@ -1,4 +1,4 @@ -from __future__ import print_function +from __future__ import print_function from genEventing import * from genLttngProvider import * import os diff --git a/src/coreclr/src/scripts/genEventing.py b/src/coreclr/src/scripts/genEventing.py index 5bbbbec5c20227..e7626cc69275d9 100644 --- a/src/coreclr/src/scripts/genEventing.py +++ b/src/coreclr/src/scripts/genEventing.py @@ -1,4 +1,4 @@ -# +# ## Licensed to the .NET Foundation under one or more agreements. ## The .NET Foundation licenses this file to you under the MIT license. ## See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/scripts/genLttngProvider.py b/src/coreclr/src/scripts/genLttngProvider.py index 393ca3f4c022a7..1ed1d2a839a2fa 100644 --- a/src/coreclr/src/scripts/genLttngProvider.py +++ b/src/coreclr/src/scripts/genLttngProvider.py @@ -1,4 +1,4 @@ -## +## ## Licensed to the .NET Foundation under one or more agreements. ## The .NET Foundation licenses this file to you under the MIT license. ## See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/scripts/scripts.pyproj b/src/coreclr/src/scripts/scripts.pyproj index c0b7bef6415e5f..a36591d2834b02 100644 --- a/src/coreclr/src/scripts/scripts.pyproj +++ b/src/coreclr/src/scripts/scripts.pyproj @@ -1,4 +1,4 @@ - + Debug diff --git a/src/coreclr/src/scripts/utilities.py b/src/coreclr/src/scripts/utilities.py index c4767a43b7c40f..46442eed5b8aac 100644 --- a/src/coreclr/src/scripts/utilities.py +++ b/src/coreclr/src/scripts/utilities.py @@ -1,4 +1,4 @@ -## +## ## Licensed to the .NET Foundation under one or more agreements. ## The .NET Foundation licenses this file to you under the MIT license. ## See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/CodeGenerationFailedException.cs b/src/coreclr/src/tools/Common/Compiler/CodeGenerationFailedException.cs index ab4a47be4002fb..b27be3de26e265 100644 --- a/src/coreclr/src/tools/Common/Compiler/CodeGenerationFailedException.cs +++ b/src/coreclr/src/tools/Common/Compiler/CodeGenerationFailedException.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/CompilationBuilder.cs b/src/coreclr/src/tools/Common/Compiler/CompilationBuilder.cs index e115ecbd47f150..fa97ad503df2d5 100644 --- a/src/coreclr/src/tools/Common/Compiler/CompilationBuilder.cs +++ b/src/coreclr/src/tools/Common/Compiler/CompilationBuilder.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/CompilationModuleGroup.cs b/src/coreclr/src/tools/Common/Compiler/CompilationModuleGroup.cs index 1feb14c46c08ff..0182fc21b47ab9 100644 --- a/src/coreclr/src/tools/Common/Compiler/CompilationModuleGroup.cs +++ b/src/coreclr/src/tools/Common/Compiler/CompilationModuleGroup.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs b/src/coreclr/src/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs index 6b9e863e5b0d8c..5373708e823a46 100644 --- a/src/coreclr/src/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs +++ b/src/coreclr/src/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/CompilerTypeSystemContext.cs b/src/coreclr/src/tools/Common/Compiler/CompilerTypeSystemContext.cs index 7463ec7cc86152..1c103df45b7f3c 100644 --- a/src/coreclr/src/tools/Common/Compiler/CompilerTypeSystemContext.cs +++ b/src/coreclr/src/tools/Common/Compiler/CompilerTypeSystemContext.cs @@ -106,31 +106,22 @@ public override ModuleDesc ResolveAssembly(System.Reflection.AssemblyName name, return GetModuleForSimpleName(name.Name, throwIfNotFound); } - public ModuleDesc GetModuleForSimpleName(string simpleName, bool throwIfNotFound = true) + public EcmaModule GetModuleForSimpleName(string simpleName, bool throwIfNotFound = true) { - ModuleData existing; - if (_simpleNameHashtable.TryGetValue(simpleName, out existing)) + if (_simpleNameHashtable.TryGetValue(simpleName, out ModuleData existing)) return existing.Module; - string filePath; - if (!InputFilePaths.TryGetValue(simpleName, out filePath)) - { - if (!ReferenceFilePaths.TryGetValue(simpleName, out filePath)) - { - // We allow the CanonTypesModule to not be an EcmaModule. - if (((IAssemblyDesc)CanonTypesModule).GetName().Name == simpleName) - return CanonTypesModule; - - // TODO: the exception is wrong for two reasons: for one, this should be assembly full name, not simple name. - // The other reason is that on CoreCLR, the exception also captures the reason. We should be passing two - // string IDs. This makes this rather annoying. - if (throwIfNotFound) - ThrowHelper.ThrowFileNotFoundException(ExceptionStringID.FileLoadErrorGeneric, simpleName); - return null; - } - } + if (InputFilePaths.TryGetValue(simpleName, out string filePath) + || ReferenceFilePaths.TryGetValue(simpleName, out filePath)) + return AddModule(filePath, simpleName, true); + + // TODO: the exception is wrong for two reasons: for one, this should be assembly full name, not simple name. + // The other reason is that on CoreCLR, the exception also captures the reason. We should be passing two + // string IDs. This makes this rather annoying. + if (throwIfNotFound) + ThrowHelper.ThrowFileNotFoundException(ExceptionStringID.FileLoadErrorGeneric, simpleName); - return AddModule(filePath, simpleName, true); + return null; } public EcmaModule GetModuleFromPath(string filePath) diff --git a/src/coreclr/src/tools/Common/Compiler/CoreRTNameMangler.cs b/src/coreclr/src/tools/Common/Compiler/CoreRTNameMangler.cs index b479912f34000e..ec4e90965c962e 100644 --- a/src/coreclr/src/tools/Common/Compiler/CoreRTNameMangler.cs +++ b/src/coreclr/src/tools/Common/Compiler/CoreRTNameMangler.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/CompilerComparer.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/CompilerComparer.cs index 250b327077e9a6..b02ab632a5ac26 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/CompilerComparer.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/CompilerComparer.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/EmbeddedDataContainerNode.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/EmbeddedDataContainerNode.cs index 0cffffac19bfc1..e219528e8ffaf1 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/EmbeddedDataContainerNode.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/EmbeddedDataContainerNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/IMethodBodyNode.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/IMethodBodyNode.cs index b862f59b49fdac..75d7314c9c0e48 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/IMethodBodyNode.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/IMethodBodyNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/IMethodNode.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/IMethodNode.cs index 393ee4adf54c10..3c148c8acc3d75 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/IMethodNode.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/IMethodNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/INodeWithRuntimeDeterminedDependencies.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/INodeWithRuntimeDeterminedDependencies.cs index 9969bba84a9f0a..3397f798159d9d 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/INodeWithRuntimeDeterminedDependencies.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/INodeWithRuntimeDeterminedDependencies.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ISortableNode.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ISortableNode.cs index ac62439b0725d4..bde728a7493a31 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ISortableNode.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ISortableNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ObjectNodeSection.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ObjectNodeSection.cs index 98829e5f30c15f..b89b9482403b7c 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ObjectNodeSection.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ObjectNodeSection.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs index 657e1100719c32..a489d68cd28846 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/SortableDependencyNode.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/SortableDependencyNode.cs index 81aa110c9d4fb9..cda380e171f15e 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/SortableDependencyNode.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/SortableDependencyNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -59,6 +59,7 @@ protected enum ObjectNodeOrder // CorHeaderNode, ReadyToRunHeaderNode, + ReadyToRunAssemblyHeaderNode, ImportSectionsTableNode, ImportSectionNode, MethodEntrypointTableNode, diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyTrackingLevel.cs b/src/coreclr/src/tools/Common/Compiler/DependencyTrackingLevel.cs index 9322b9d3026838..8a2eb211fda05b 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyTrackingLevel.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyTrackingLevel.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/DevirtualizationManager.cs b/src/coreclr/src/tools/Common/Compiler/DevirtualizationManager.cs index 6191ebd11ac6d6..d07b6a84f186cc 100644 --- a/src/coreclr/src/tools/Common/Compiler/DevirtualizationManager.cs +++ b/src/coreclr/src/tools/Common/Compiler/DevirtualizationManager.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/HardwareIntrinsicHelpers.cs b/src/coreclr/src/tools/Common/Compiler/HardwareIntrinsicHelpers.cs index 99b3400617c2e7..5ead0f7640d9c4 100644 --- a/src/coreclr/src/tools/Common/Compiler/HardwareIntrinsicHelpers.cs +++ b/src/coreclr/src/tools/Common/Compiler/HardwareIntrinsicHelpers.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/ICompilationRootProvider.cs b/src/coreclr/src/tools/Common/Compiler/ICompilationRootProvider.cs index 8434ad8a8acbf4..76eeec6cabeb44 100644 --- a/src/coreclr/src/tools/Common/Compiler/ICompilationRootProvider.cs +++ b/src/coreclr/src/tools/Common/Compiler/ICompilationRootProvider.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/InternalCompilerErrorException.cs b/src/coreclr/src/tools/Common/Compiler/InternalCompilerErrorException.cs index 06d0cf3e5dfa30..164a5f0981ecee 100644 --- a/src/coreclr/src/tools/Common/Compiler/InternalCompilerErrorException.cs +++ b/src/coreclr/src/tools/Common/Compiler/InternalCompilerErrorException.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/Logger.cs b/src/coreclr/src/tools/Common/Compiler/Logger.cs index 5fa09a1c420d69..7861bde9464c50 100644 --- a/src/coreclr/src/tools/Common/Compiler/Logger.cs +++ b/src/coreclr/src/tools/Common/Compiler/Logger.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/SingleMethodRootProvider.cs b/src/coreclr/src/tools/Common/Compiler/SingleMethodRootProvider.cs index c1d9f484e0be16..769747d13ed251 100644 --- a/src/coreclr/src/tools/Common/Compiler/SingleMethodRootProvider.cs +++ b/src/coreclr/src/tools/Common/Compiler/SingleMethodRootProvider.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Compiler/TypeExtensions.cs b/src/coreclr/src/tools/Common/Compiler/TypeExtensions.cs index 0514b24488c5dc..03fe6874ba595b 100644 --- a/src/coreclr/src/tools/Common/Compiler/TypeExtensions.cs +++ b/src/coreclr/src/tools/Common/Compiler/TypeExtensions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/CorConstants.cs b/src/coreclr/src/tools/Common/Internal/Runtime/CorConstants.cs index 9cf2c6960e7738..ef9305c315f416 100644 --- a/src/coreclr/src/tools/Common/Internal/Runtime/CorConstants.cs +++ b/src/coreclr/src/tools/Common/Internal/Runtime/CorConstants.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ModuleHeaders.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ModuleHeaders.cs index 07bc53d2ae0561..57722b4f3d7b47 100644 --- a/src/coreclr/src/tools/Common/Internal/Runtime/ModuleHeaders.cs +++ b/src/coreclr/src/tools/Common/Internal/Runtime/ModuleHeaders.cs @@ -64,6 +64,8 @@ public enum ReadyToRunSectionType ManifestMetadata = 112, // Added in v2.3 AttributePresence = 113, // Added in V3.1 InliningInfo2 = 114, // Added in 4.1 + ComponentAssemblies = 115, // Added in 4.1 + OwnerCompositeExecutable = 116, // Added in 4.1 // // CoreRT ReadyToRun sections diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs index 35a9e34969cd6f..ade24391dc5a64 100644 --- a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs +++ b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -12,7 +12,9 @@ public enum ReadyToRunFlags READYTORUN_FLAG_PlatformNeutralSource = 0x00000001, // Set if the original IL assembly was platform-neutral READYTORUN_FLAG_SkipTypeValidation = 0x00000002, // Set of methods with native code was determined using profile data READYTORUN_FLAG_Partial = 0x00000004, - READYTORUN_FLAG_NonSharedPInvokeStubs = 0x00000008 // PInvoke stubs compiled into image are non-shareable (no secret parameter) + READYTORUN_FLAG_NonSharedPInvokeStubs = 0x00000008, // PInvoke stubs compiled into image are non-shareable (no secret parameter) + READYTORUN_FLAG_EmbeddedMSIL = 0x00000010, // MSIL is embedded in the composite R2R executable + READYTORUN_FLAG_Component = 0x00000020, // This is the header describing a component assembly of composite R2R } /// diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs index 1aa42f323d6afd..5e64833b92487a 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs @@ -84,6 +84,8 @@ unsafe partial class CorInfoImpl [UnmanagedFunctionPointerAttribute(default(CallingConvention))] [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isValidStringRef(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] + delegate char* __getStringLiteral(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, ref int length); + [UnmanagedFunctionPointerAttribute(default(CallingConvention))] [return: MarshalAs(UnmanagedType.Bool)]delegate bool __shouldEnforceCallvirtRestriction(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* scope); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate CorInfoType __asCorInfoType(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); @@ -94,7 +96,7 @@ unsafe partial class CorInfoImpl [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate CORINFO_CLASS_STRUCT_* __getTypeInstantiationArgument(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, uint index); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate int __appendClassName(IntPtr _this, IntPtr* ppException, short** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fNamespace, [MarshalAs(UnmanagedType.Bool)]bool fFullInst, [MarshalAs(UnmanagedType.Bool)]bool fAssembly); + delegate int __appendClassName(IntPtr _this, IntPtr* ppException, char** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fNamespace, [MarshalAs(UnmanagedType.Bool)]bool fFullInst, [MarshalAs(UnmanagedType.Bool)]bool fAssembly); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isValueClass(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] @@ -228,7 +230,7 @@ unsafe partial class CorInfoImpl [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate HRESULT __GetErrorHRESULT(IntPtr _this, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __GetErrorMessage(IntPtr _this, IntPtr* ppException, short* buffer, uint bufferLength); + delegate uint __GetErrorMessage(IntPtr _this, IntPtr* ppException, char* buffer, uint bufferLength); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate int __FilterException(IntPtr _this, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] @@ -242,7 +244,7 @@ unsafe partial class CorInfoImpl [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate void __getEEInfo(IntPtr _this, IntPtr* ppException, ref CORINFO_EE_INFO pEEInfoOut); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.LPWStr)]delegate string __getJitTimeLogFilename(IntPtr _this, IntPtr* ppException); + delegate char* __getJitTimeLogFilename(IntPtr _this, IntPtr* ppException); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate mdToken __getMethodDefFromMethod(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] @@ -860,6 +862,20 @@ static CorInfoCanSkipVerificationResult _canSkipVerification(IntPtr thisHandle, } } + static char* _getStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, ref int length) + { + var _this = GetThis(thisHandle); + try + { + return _this.getStringLiteral(module, metaTOK, ref length); + } + catch (Exception ex) + { + *ppException = _this.AllocException(ex); + return default(char*); + } + } + [return: MarshalAs(UnmanagedType.Bool)]static bool _shouldEnforceCallvirtRestriction(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* scope) { var _this = GetThis(thisHandle); @@ -930,7 +946,7 @@ static CorInfoType _asCorInfoType(IntPtr thisHandle, IntPtr* ppException, CORINF } } - static int _appendClassName(IntPtr thisHandle, IntPtr* ppException, short** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fNamespace, [MarshalAs(UnmanagedType.Bool)]bool fFullInst, [MarshalAs(UnmanagedType.Bool)]bool fAssembly) + static int _appendClassName(IntPtr thisHandle, IntPtr* ppException, char** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fNamespace, [MarshalAs(UnmanagedType.Bool)]bool fFullInst, [MarshalAs(UnmanagedType.Bool)]bool fAssembly) { var _this = GetThis(thisHandle); try @@ -1859,7 +1875,7 @@ static HRESULT _GetErrorHRESULT(IntPtr thisHandle, IntPtr* ppException, _EXCEPTI } } - static uint _GetErrorMessage(IntPtr thisHandle, IntPtr* ppException, short* buffer, uint bufferLength) + static uint _GetErrorMessage(IntPtr thisHandle, IntPtr* ppException, char* buffer, uint bufferLength) { var _this = GetThis(thisHandle); try @@ -1953,7 +1969,7 @@ static void _getEEInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_EE_IN } } - [return: MarshalAs(UnmanagedType.LPWStr)]static string _getJitTimeLogFilename(IntPtr thisHandle, IntPtr* ppException) + static char* _getJitTimeLogFilename(IntPtr thisHandle, IntPtr* ppException) { var _this = GetThis(thisHandle); try @@ -1963,7 +1979,7 @@ static void _getEEInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_EE_IN catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(string); + return default(char*); } } @@ -2833,8 +2849,8 @@ static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, ref CORJIT_FLAG static IntPtr GetUnmanagedCallbacks(out Object keepAlive) { - IntPtr * callbacks = (IntPtr *)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 179); - Object[] delegates = new Object[179]; + IntPtr * callbacks = (IntPtr *)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 180); + Object[] delegates = new Object[180]; var d0 = new __getMethodAttribs(_getMethodAttribs); callbacks[0] = Marshal.GetFunctionPointerForDelegate(d0); @@ -2944,435 +2960,438 @@ static IntPtr GetUnmanagedCallbacks(out Object keepAlive) var d35 = new __isValidStringRef(_isValidStringRef); callbacks[35] = Marshal.GetFunctionPointerForDelegate(d35); delegates[35] = d35; - var d36 = new __shouldEnforceCallvirtRestriction(_shouldEnforceCallvirtRestriction); + var d36 = new __getStringLiteral(_getStringLiteral); callbacks[36] = Marshal.GetFunctionPointerForDelegate(d36); delegates[36] = d36; - var d37 = new __asCorInfoType(_asCorInfoType); + var d37 = new __shouldEnforceCallvirtRestriction(_shouldEnforceCallvirtRestriction); callbacks[37] = Marshal.GetFunctionPointerForDelegate(d37); delegates[37] = d37; - var d38 = new __getClassName(_getClassName); + var d38 = new __asCorInfoType(_asCorInfoType); callbacks[38] = Marshal.GetFunctionPointerForDelegate(d38); delegates[38] = d38; - var d39 = new __getClassNameFromMetadata(_getClassNameFromMetadata); + var d39 = new __getClassName(_getClassName); callbacks[39] = Marshal.GetFunctionPointerForDelegate(d39); delegates[39] = d39; - var d40 = new __getTypeInstantiationArgument(_getTypeInstantiationArgument); + var d40 = new __getClassNameFromMetadata(_getClassNameFromMetadata); callbacks[40] = Marshal.GetFunctionPointerForDelegate(d40); delegates[40] = d40; - var d41 = new __appendClassName(_appendClassName); + var d41 = new __getTypeInstantiationArgument(_getTypeInstantiationArgument); callbacks[41] = Marshal.GetFunctionPointerForDelegate(d41); delegates[41] = d41; - var d42 = new __isValueClass(_isValueClass); + var d42 = new __appendClassName(_appendClassName); callbacks[42] = Marshal.GetFunctionPointerForDelegate(d42); delegates[42] = d42; - var d43 = new __canInlineTypeCheck(_canInlineTypeCheck); + var d43 = new __isValueClass(_isValueClass); callbacks[43] = Marshal.GetFunctionPointerForDelegate(d43); delegates[43] = d43; - var d44 = new __canInlineTypeCheckWithObjectVTable(_canInlineTypeCheckWithObjectVTable); + var d44 = new __canInlineTypeCheck(_canInlineTypeCheck); callbacks[44] = Marshal.GetFunctionPointerForDelegate(d44); delegates[44] = d44; - var d45 = new __getClassAttribs(_getClassAttribs); + var d45 = new __canInlineTypeCheckWithObjectVTable(_canInlineTypeCheckWithObjectVTable); callbacks[45] = Marshal.GetFunctionPointerForDelegate(d45); delegates[45] = d45; - var d46 = new __isStructRequiringStackAllocRetBuf(_isStructRequiringStackAllocRetBuf); + var d46 = new __getClassAttribs(_getClassAttribs); callbacks[46] = Marshal.GetFunctionPointerForDelegate(d46); delegates[46] = d46; - var d47 = new __getClassModule(_getClassModule); + var d47 = new __isStructRequiringStackAllocRetBuf(_isStructRequiringStackAllocRetBuf); callbacks[47] = Marshal.GetFunctionPointerForDelegate(d47); delegates[47] = d47; - var d48 = new __getModuleAssembly(_getModuleAssembly); + var d48 = new __getClassModule(_getClassModule); callbacks[48] = Marshal.GetFunctionPointerForDelegate(d48); delegates[48] = d48; - var d49 = new __getAssemblyName(_getAssemblyName); + var d49 = new __getModuleAssembly(_getModuleAssembly); callbacks[49] = Marshal.GetFunctionPointerForDelegate(d49); delegates[49] = d49; - var d50 = new __LongLifetimeMalloc(_LongLifetimeMalloc); + var d50 = new __getAssemblyName(_getAssemblyName); callbacks[50] = Marshal.GetFunctionPointerForDelegate(d50); delegates[50] = d50; - var d51 = new __LongLifetimeFree(_LongLifetimeFree); + var d51 = new __LongLifetimeMalloc(_LongLifetimeMalloc); callbacks[51] = Marshal.GetFunctionPointerForDelegate(d51); delegates[51] = d51; - var d52 = new __getClassModuleIdForStatics(_getClassModuleIdForStatics); + var d52 = new __LongLifetimeFree(_LongLifetimeFree); callbacks[52] = Marshal.GetFunctionPointerForDelegate(d52); delegates[52] = d52; - var d53 = new __getClassSize(_getClassSize); + var d53 = new __getClassModuleIdForStatics(_getClassModuleIdForStatics); callbacks[53] = Marshal.GetFunctionPointerForDelegate(d53); delegates[53] = d53; - var d54 = new __getHeapClassSize(_getHeapClassSize); + var d54 = new __getClassSize(_getClassSize); callbacks[54] = Marshal.GetFunctionPointerForDelegate(d54); delegates[54] = d54; - var d55 = new __canAllocateOnStack(_canAllocateOnStack); + var d55 = new __getHeapClassSize(_getHeapClassSize); callbacks[55] = Marshal.GetFunctionPointerForDelegate(d55); delegates[55] = d55; - var d56 = new __getClassAlignmentRequirement(_getClassAlignmentRequirement); + var d56 = new __canAllocateOnStack(_canAllocateOnStack); callbacks[56] = Marshal.GetFunctionPointerForDelegate(d56); delegates[56] = d56; - var d57 = new __getClassGClayout(_getClassGClayout); + var d57 = new __getClassAlignmentRequirement(_getClassAlignmentRequirement); callbacks[57] = Marshal.GetFunctionPointerForDelegate(d57); delegates[57] = d57; - var d58 = new __getClassNumInstanceFields(_getClassNumInstanceFields); + var d58 = new __getClassGClayout(_getClassGClayout); callbacks[58] = Marshal.GetFunctionPointerForDelegate(d58); delegates[58] = d58; - var d59 = new __getFieldInClass(_getFieldInClass); + var d59 = new __getClassNumInstanceFields(_getClassNumInstanceFields); callbacks[59] = Marshal.GetFunctionPointerForDelegate(d59); delegates[59] = d59; - var d60 = new __checkMethodModifier(_checkMethodModifier); + var d60 = new __getFieldInClass(_getFieldInClass); callbacks[60] = Marshal.GetFunctionPointerForDelegate(d60); delegates[60] = d60; - var d61 = new __getNewHelper(_getNewHelper); + var d61 = new __checkMethodModifier(_checkMethodModifier); callbacks[61] = Marshal.GetFunctionPointerForDelegate(d61); delegates[61] = d61; - var d62 = new __getNewArrHelper(_getNewArrHelper); + var d62 = new __getNewHelper(_getNewHelper); callbacks[62] = Marshal.GetFunctionPointerForDelegate(d62); delegates[62] = d62; - var d63 = new __getCastingHelper(_getCastingHelper); + var d63 = new __getNewArrHelper(_getNewArrHelper); callbacks[63] = Marshal.GetFunctionPointerForDelegate(d63); delegates[63] = d63; - var d64 = new __getSharedCCtorHelper(_getSharedCCtorHelper); + var d64 = new __getCastingHelper(_getCastingHelper); callbacks[64] = Marshal.GetFunctionPointerForDelegate(d64); delegates[64] = d64; - var d65 = new __getSecurityPrologHelper(_getSecurityPrologHelper); + var d65 = new __getSharedCCtorHelper(_getSharedCCtorHelper); callbacks[65] = Marshal.GetFunctionPointerForDelegate(d65); delegates[65] = d65; - var d66 = new __getTypeForBox(_getTypeForBox); + var d66 = new __getSecurityPrologHelper(_getSecurityPrologHelper); callbacks[66] = Marshal.GetFunctionPointerForDelegate(d66); delegates[66] = d66; - var d67 = new __getBoxHelper(_getBoxHelper); + var d67 = new __getTypeForBox(_getTypeForBox); callbacks[67] = Marshal.GetFunctionPointerForDelegate(d67); delegates[67] = d67; - var d68 = new __getUnBoxHelper(_getUnBoxHelper); + var d68 = new __getBoxHelper(_getBoxHelper); callbacks[68] = Marshal.GetFunctionPointerForDelegate(d68); delegates[68] = d68; - var d69 = new __getReadyToRunHelper(_getReadyToRunHelper); + var d69 = new __getUnBoxHelper(_getUnBoxHelper); callbacks[69] = Marshal.GetFunctionPointerForDelegate(d69); delegates[69] = d69; - var d70 = new __getReadyToRunDelegateCtorHelper(_getReadyToRunDelegateCtorHelper); + var d70 = new __getReadyToRunHelper(_getReadyToRunHelper); callbacks[70] = Marshal.GetFunctionPointerForDelegate(d70); delegates[70] = d70; - var d71 = new __getHelperName(_getHelperName); + var d71 = new __getReadyToRunDelegateCtorHelper(_getReadyToRunDelegateCtorHelper); callbacks[71] = Marshal.GetFunctionPointerForDelegate(d71); delegates[71] = d71; - var d72 = new __initClass(_initClass); + var d72 = new __getHelperName(_getHelperName); callbacks[72] = Marshal.GetFunctionPointerForDelegate(d72); delegates[72] = d72; - var d73 = new __classMustBeLoadedBeforeCodeIsRun(_classMustBeLoadedBeforeCodeIsRun); + var d73 = new __initClass(_initClass); callbacks[73] = Marshal.GetFunctionPointerForDelegate(d73); delegates[73] = d73; - var d74 = new __getBuiltinClass(_getBuiltinClass); + var d74 = new __classMustBeLoadedBeforeCodeIsRun(_classMustBeLoadedBeforeCodeIsRun); callbacks[74] = Marshal.GetFunctionPointerForDelegate(d74); delegates[74] = d74; - var d75 = new __getTypeForPrimitiveValueClass(_getTypeForPrimitiveValueClass); + var d75 = new __getBuiltinClass(_getBuiltinClass); callbacks[75] = Marshal.GetFunctionPointerForDelegate(d75); delegates[75] = d75; - var d76 = new __getTypeForPrimitiveNumericClass(_getTypeForPrimitiveNumericClass); + var d76 = new __getTypeForPrimitiveValueClass(_getTypeForPrimitiveValueClass); callbacks[76] = Marshal.GetFunctionPointerForDelegate(d76); delegates[76] = d76; - var d77 = new __canCast(_canCast); + var d77 = new __getTypeForPrimitiveNumericClass(_getTypeForPrimitiveNumericClass); callbacks[77] = Marshal.GetFunctionPointerForDelegate(d77); delegates[77] = d77; - var d78 = new __areTypesEquivalent(_areTypesEquivalent); + var d78 = new __canCast(_canCast); callbacks[78] = Marshal.GetFunctionPointerForDelegate(d78); delegates[78] = d78; - var d79 = new __compareTypesForCast(_compareTypesForCast); + var d79 = new __areTypesEquivalent(_areTypesEquivalent); callbacks[79] = Marshal.GetFunctionPointerForDelegate(d79); delegates[79] = d79; - var d80 = new __compareTypesForEquality(_compareTypesForEquality); + var d80 = new __compareTypesForCast(_compareTypesForCast); callbacks[80] = Marshal.GetFunctionPointerForDelegate(d80); delegates[80] = d80; - var d81 = new __mergeClasses(_mergeClasses); + var d81 = new __compareTypesForEquality(_compareTypesForEquality); callbacks[81] = Marshal.GetFunctionPointerForDelegate(d81); delegates[81] = d81; - var d82 = new __isMoreSpecificType(_isMoreSpecificType); + var d82 = new __mergeClasses(_mergeClasses); callbacks[82] = Marshal.GetFunctionPointerForDelegate(d82); delegates[82] = d82; - var d83 = new __getParentType(_getParentType); + var d83 = new __isMoreSpecificType(_isMoreSpecificType); callbacks[83] = Marshal.GetFunctionPointerForDelegate(d83); delegates[83] = d83; - var d84 = new __getChildType(_getChildType); + var d84 = new __getParentType(_getParentType); callbacks[84] = Marshal.GetFunctionPointerForDelegate(d84); delegates[84] = d84; - var d85 = new __satisfiesClassConstraints(_satisfiesClassConstraints); + var d85 = new __getChildType(_getChildType); callbacks[85] = Marshal.GetFunctionPointerForDelegate(d85); delegates[85] = d85; - var d86 = new __isSDArray(_isSDArray); + var d86 = new __satisfiesClassConstraints(_satisfiesClassConstraints); callbacks[86] = Marshal.GetFunctionPointerForDelegate(d86); delegates[86] = d86; - var d87 = new __getArrayRank(_getArrayRank); + var d87 = new __isSDArray(_isSDArray); callbacks[87] = Marshal.GetFunctionPointerForDelegate(d87); delegates[87] = d87; - var d88 = new __getArrayInitializationData(_getArrayInitializationData); + var d88 = new __getArrayRank(_getArrayRank); callbacks[88] = Marshal.GetFunctionPointerForDelegate(d88); delegates[88] = d88; - var d89 = new __canAccessClass(_canAccessClass); + var d89 = new __getArrayInitializationData(_getArrayInitializationData); callbacks[89] = Marshal.GetFunctionPointerForDelegate(d89); delegates[89] = d89; - var d90 = new __getFieldName(_getFieldName); + var d90 = new __canAccessClass(_canAccessClass); callbacks[90] = Marshal.GetFunctionPointerForDelegate(d90); delegates[90] = d90; - var d91 = new __getFieldClass(_getFieldClass); + var d91 = new __getFieldName(_getFieldName); callbacks[91] = Marshal.GetFunctionPointerForDelegate(d91); delegates[91] = d91; - var d92 = new __getFieldType(_getFieldType); + var d92 = new __getFieldClass(_getFieldClass); callbacks[92] = Marshal.GetFunctionPointerForDelegate(d92); delegates[92] = d92; - var d93 = new __getFieldOffset(_getFieldOffset); + var d93 = new __getFieldType(_getFieldType); callbacks[93] = Marshal.GetFunctionPointerForDelegate(d93); delegates[93] = d93; - var d94 = new __isWriteBarrierHelperRequired(_isWriteBarrierHelperRequired); + var d94 = new __getFieldOffset(_getFieldOffset); callbacks[94] = Marshal.GetFunctionPointerForDelegate(d94); delegates[94] = d94; - var d95 = new __getFieldInfo(_getFieldInfo); + var d95 = new __isWriteBarrierHelperRequired(_isWriteBarrierHelperRequired); callbacks[95] = Marshal.GetFunctionPointerForDelegate(d95); delegates[95] = d95; - var d96 = new __isFieldStatic(_isFieldStatic); + var d96 = new __getFieldInfo(_getFieldInfo); callbacks[96] = Marshal.GetFunctionPointerForDelegate(d96); delegates[96] = d96; - var d97 = new __getBoundaries(_getBoundaries); + var d97 = new __isFieldStatic(_isFieldStatic); callbacks[97] = Marshal.GetFunctionPointerForDelegate(d97); delegates[97] = d97; - var d98 = new __setBoundaries(_setBoundaries); + var d98 = new __getBoundaries(_getBoundaries); callbacks[98] = Marshal.GetFunctionPointerForDelegate(d98); delegates[98] = d98; - var d99 = new __getVars(_getVars); + var d99 = new __setBoundaries(_setBoundaries); callbacks[99] = Marshal.GetFunctionPointerForDelegate(d99); delegates[99] = d99; - var d100 = new __setVars(_setVars); + var d100 = new __getVars(_getVars); callbacks[100] = Marshal.GetFunctionPointerForDelegate(d100); delegates[100] = d100; - var d101 = new __allocateArray(_allocateArray); + var d101 = new __setVars(_setVars); callbacks[101] = Marshal.GetFunctionPointerForDelegate(d101); delegates[101] = d101; - var d102 = new __freeArray(_freeArray); + var d102 = new __allocateArray(_allocateArray); callbacks[102] = Marshal.GetFunctionPointerForDelegate(d102); delegates[102] = d102; - var d103 = new __getArgNext(_getArgNext); + var d103 = new __freeArray(_freeArray); callbacks[103] = Marshal.GetFunctionPointerForDelegate(d103); delegates[103] = d103; - var d104 = new __getArgType(_getArgType); + var d104 = new __getArgNext(_getArgNext); callbacks[104] = Marshal.GetFunctionPointerForDelegate(d104); delegates[104] = d104; - var d105 = new __getArgClass(_getArgClass); + var d105 = new __getArgType(_getArgType); callbacks[105] = Marshal.GetFunctionPointerForDelegate(d105); delegates[105] = d105; - var d106 = new __getHFAType(_getHFAType); + var d106 = new __getArgClass(_getArgClass); callbacks[106] = Marshal.GetFunctionPointerForDelegate(d106); delegates[106] = d106; - var d107 = new __GetErrorHRESULT(_GetErrorHRESULT); + var d107 = new __getHFAType(_getHFAType); callbacks[107] = Marshal.GetFunctionPointerForDelegate(d107); delegates[107] = d107; - var d108 = new __GetErrorMessage(_GetErrorMessage); + var d108 = new __GetErrorHRESULT(_GetErrorHRESULT); callbacks[108] = Marshal.GetFunctionPointerForDelegate(d108); delegates[108] = d108; - var d109 = new __FilterException(_FilterException); + var d109 = new __GetErrorMessage(_GetErrorMessage); callbacks[109] = Marshal.GetFunctionPointerForDelegate(d109); delegates[109] = d109; - var d110 = new __HandleException(_HandleException); + var d110 = new __FilterException(_FilterException); callbacks[110] = Marshal.GetFunctionPointerForDelegate(d110); delegates[110] = d110; - var d111 = new __ThrowExceptionForJitResult(_ThrowExceptionForJitResult); + var d111 = new __HandleException(_HandleException); callbacks[111] = Marshal.GetFunctionPointerForDelegate(d111); delegates[111] = d111; - var d112 = new __ThrowExceptionForHelper(_ThrowExceptionForHelper); + var d112 = new __ThrowExceptionForJitResult(_ThrowExceptionForJitResult); callbacks[112] = Marshal.GetFunctionPointerForDelegate(d112); delegates[112] = d112; - var d113 = new __runWithErrorTrap(_runWithErrorTrap); + var d113 = new __ThrowExceptionForHelper(_ThrowExceptionForHelper); callbacks[113] = Marshal.GetFunctionPointerForDelegate(d113); delegates[113] = d113; - var d114 = new __getEEInfo(_getEEInfo); + var d114 = new __runWithErrorTrap(_runWithErrorTrap); callbacks[114] = Marshal.GetFunctionPointerForDelegate(d114); delegates[114] = d114; - var d115 = new __getJitTimeLogFilename(_getJitTimeLogFilename); + var d115 = new __getEEInfo(_getEEInfo); callbacks[115] = Marshal.GetFunctionPointerForDelegate(d115); delegates[115] = d115; - var d116 = new __getMethodDefFromMethod(_getMethodDefFromMethod); + var d116 = new __getJitTimeLogFilename(_getJitTimeLogFilename); callbacks[116] = Marshal.GetFunctionPointerForDelegate(d116); delegates[116] = d116; - var d117 = new __getMethodName(_getMethodName); + var d117 = new __getMethodDefFromMethod(_getMethodDefFromMethod); callbacks[117] = Marshal.GetFunctionPointerForDelegate(d117); delegates[117] = d117; - var d118 = new __getMethodNameFromMetadata(_getMethodNameFromMetadata); + var d118 = new __getMethodName(_getMethodName); callbacks[118] = Marshal.GetFunctionPointerForDelegate(d118); delegates[118] = d118; - var d119 = new __getMethodHash(_getMethodHash); + var d119 = new __getMethodNameFromMetadata(_getMethodNameFromMetadata); callbacks[119] = Marshal.GetFunctionPointerForDelegate(d119); delegates[119] = d119; - var d120 = new __findNameOfToken(_findNameOfToken); + var d120 = new __getMethodHash(_getMethodHash); callbacks[120] = Marshal.GetFunctionPointerForDelegate(d120); delegates[120] = d120; - var d121 = new __getSystemVAmd64PassStructInRegisterDescriptor(_getSystemVAmd64PassStructInRegisterDescriptor); + var d121 = new __findNameOfToken(_findNameOfToken); callbacks[121] = Marshal.GetFunctionPointerForDelegate(d121); delegates[121] = d121; - var d122 = new __getThreadTLSIndex(_getThreadTLSIndex); + var d122 = new __getSystemVAmd64PassStructInRegisterDescriptor(_getSystemVAmd64PassStructInRegisterDescriptor); callbacks[122] = Marshal.GetFunctionPointerForDelegate(d122); delegates[122] = d122; - var d123 = new __getInlinedCallFrameVptr(_getInlinedCallFrameVptr); + var d123 = new __getThreadTLSIndex(_getThreadTLSIndex); callbacks[123] = Marshal.GetFunctionPointerForDelegate(d123); delegates[123] = d123; - var d124 = new __getAddrOfCaptureThreadGlobal(_getAddrOfCaptureThreadGlobal); + var d124 = new __getInlinedCallFrameVptr(_getInlinedCallFrameVptr); callbacks[124] = Marshal.GetFunctionPointerForDelegate(d124); delegates[124] = d124; - var d125 = new __getHelperFtn(_getHelperFtn); + var d125 = new __getAddrOfCaptureThreadGlobal(_getAddrOfCaptureThreadGlobal); callbacks[125] = Marshal.GetFunctionPointerForDelegate(d125); delegates[125] = d125; - var d126 = new __getFunctionEntryPoint(_getFunctionEntryPoint); + var d126 = new __getHelperFtn(_getHelperFtn); callbacks[126] = Marshal.GetFunctionPointerForDelegate(d126); delegates[126] = d126; - var d127 = new __getFunctionFixedEntryPoint(_getFunctionFixedEntryPoint); + var d127 = new __getFunctionEntryPoint(_getFunctionEntryPoint); callbacks[127] = Marshal.GetFunctionPointerForDelegate(d127); delegates[127] = d127; - var d128 = new __getMethodSync(_getMethodSync); + var d128 = new __getFunctionFixedEntryPoint(_getFunctionFixedEntryPoint); callbacks[128] = Marshal.GetFunctionPointerForDelegate(d128); delegates[128] = d128; - var d129 = new __getLazyStringLiteralHelper(_getLazyStringLiteralHelper); + var d129 = new __getMethodSync(_getMethodSync); callbacks[129] = Marshal.GetFunctionPointerForDelegate(d129); delegates[129] = d129; - var d130 = new __embedModuleHandle(_embedModuleHandle); + var d130 = new __getLazyStringLiteralHelper(_getLazyStringLiteralHelper); callbacks[130] = Marshal.GetFunctionPointerForDelegate(d130); delegates[130] = d130; - var d131 = new __embedClassHandle(_embedClassHandle); + var d131 = new __embedModuleHandle(_embedModuleHandle); callbacks[131] = Marshal.GetFunctionPointerForDelegate(d131); delegates[131] = d131; - var d132 = new __embedMethodHandle(_embedMethodHandle); + var d132 = new __embedClassHandle(_embedClassHandle); callbacks[132] = Marshal.GetFunctionPointerForDelegate(d132); delegates[132] = d132; - var d133 = new __embedFieldHandle(_embedFieldHandle); + var d133 = new __embedMethodHandle(_embedMethodHandle); callbacks[133] = Marshal.GetFunctionPointerForDelegate(d133); delegates[133] = d133; - var d134 = new __embedGenericHandle(_embedGenericHandle); + var d134 = new __embedFieldHandle(_embedFieldHandle); callbacks[134] = Marshal.GetFunctionPointerForDelegate(d134); delegates[134] = d134; - var d135 = new __getLocationOfThisType(_getLocationOfThisType); + var d135 = new __embedGenericHandle(_embedGenericHandle); callbacks[135] = Marshal.GetFunctionPointerForDelegate(d135); delegates[135] = d135; - var d136 = new __getPInvokeUnmanagedTarget(_getPInvokeUnmanagedTarget); + var d136 = new __getLocationOfThisType(_getLocationOfThisType); callbacks[136] = Marshal.GetFunctionPointerForDelegate(d136); delegates[136] = d136; - var d137 = new __getAddressOfPInvokeFixup(_getAddressOfPInvokeFixup); + var d137 = new __getPInvokeUnmanagedTarget(_getPInvokeUnmanagedTarget); callbacks[137] = Marshal.GetFunctionPointerForDelegate(d137); delegates[137] = d137; - var d138 = new __getAddressOfPInvokeTarget(_getAddressOfPInvokeTarget); + var d138 = new __getAddressOfPInvokeFixup(_getAddressOfPInvokeFixup); callbacks[138] = Marshal.GetFunctionPointerForDelegate(d138); delegates[138] = d138; - var d139 = new __GetCookieForPInvokeCalliSig(_GetCookieForPInvokeCalliSig); + var d139 = new __getAddressOfPInvokeTarget(_getAddressOfPInvokeTarget); callbacks[139] = Marshal.GetFunctionPointerForDelegate(d139); delegates[139] = d139; - var d140 = new __canGetCookieForPInvokeCalliSig(_canGetCookieForPInvokeCalliSig); + var d140 = new __GetCookieForPInvokeCalliSig(_GetCookieForPInvokeCalliSig); callbacks[140] = Marshal.GetFunctionPointerForDelegate(d140); delegates[140] = d140; - var d141 = new __getJustMyCodeHandle(_getJustMyCodeHandle); + var d141 = new __canGetCookieForPInvokeCalliSig(_canGetCookieForPInvokeCalliSig); callbacks[141] = Marshal.GetFunctionPointerForDelegate(d141); delegates[141] = d141; - var d142 = new __GetProfilingHandle(_GetProfilingHandle); + var d142 = new __getJustMyCodeHandle(_getJustMyCodeHandle); callbacks[142] = Marshal.GetFunctionPointerForDelegate(d142); delegates[142] = d142; - var d143 = new __getCallInfo(_getCallInfo); + var d143 = new __GetProfilingHandle(_GetProfilingHandle); callbacks[143] = Marshal.GetFunctionPointerForDelegate(d143); delegates[143] = d143; - var d144 = new __canAccessFamily(_canAccessFamily); + var d144 = new __getCallInfo(_getCallInfo); callbacks[144] = Marshal.GetFunctionPointerForDelegate(d144); delegates[144] = d144; - var d145 = new __isRIDClassDomainID(_isRIDClassDomainID); + var d145 = new __canAccessFamily(_canAccessFamily); callbacks[145] = Marshal.GetFunctionPointerForDelegate(d145); delegates[145] = d145; - var d146 = new __getClassDomainID(_getClassDomainID); + var d146 = new __isRIDClassDomainID(_isRIDClassDomainID); callbacks[146] = Marshal.GetFunctionPointerForDelegate(d146); delegates[146] = d146; - var d147 = new __getFieldAddress(_getFieldAddress); + var d147 = new __getClassDomainID(_getClassDomainID); callbacks[147] = Marshal.GetFunctionPointerForDelegate(d147); delegates[147] = d147; - var d148 = new __getStaticFieldCurrentClass(_getStaticFieldCurrentClass); + var d148 = new __getFieldAddress(_getFieldAddress); callbacks[148] = Marshal.GetFunctionPointerForDelegate(d148); delegates[148] = d148; - var d149 = new __getVarArgsHandle(_getVarArgsHandle); + var d149 = new __getStaticFieldCurrentClass(_getStaticFieldCurrentClass); callbacks[149] = Marshal.GetFunctionPointerForDelegate(d149); delegates[149] = d149; - var d150 = new __canGetVarArgsHandle(_canGetVarArgsHandle); + var d150 = new __getVarArgsHandle(_getVarArgsHandle); callbacks[150] = Marshal.GetFunctionPointerForDelegate(d150); delegates[150] = d150; - var d151 = new __constructStringLiteral(_constructStringLiteral); + var d151 = new __canGetVarArgsHandle(_canGetVarArgsHandle); callbacks[151] = Marshal.GetFunctionPointerForDelegate(d151); delegates[151] = d151; - var d152 = new __emptyStringLiteral(_emptyStringLiteral); + var d152 = new __constructStringLiteral(_constructStringLiteral); callbacks[152] = Marshal.GetFunctionPointerForDelegate(d152); delegates[152] = d152; - var d153 = new __getFieldThreadLocalStoreID(_getFieldThreadLocalStoreID); + var d153 = new __emptyStringLiteral(_emptyStringLiteral); callbacks[153] = Marshal.GetFunctionPointerForDelegate(d153); delegates[153] = d153; - var d154 = new __setOverride(_setOverride); + var d154 = new __getFieldThreadLocalStoreID(_getFieldThreadLocalStoreID); callbacks[154] = Marshal.GetFunctionPointerForDelegate(d154); delegates[154] = d154; - var d155 = new __addActiveDependency(_addActiveDependency); + var d155 = new __setOverride(_setOverride); callbacks[155] = Marshal.GetFunctionPointerForDelegate(d155); delegates[155] = d155; - var d156 = new __GetDelegateCtor(_GetDelegateCtor); + var d156 = new __addActiveDependency(_addActiveDependency); callbacks[156] = Marshal.GetFunctionPointerForDelegate(d156); delegates[156] = d156; - var d157 = new __MethodCompileComplete(_MethodCompileComplete); + var d157 = new __GetDelegateCtor(_GetDelegateCtor); callbacks[157] = Marshal.GetFunctionPointerForDelegate(d157); delegates[157] = d157; - var d158 = new __getTailCallCopyArgsThunk(_getTailCallCopyArgsThunk); + var d158 = new __MethodCompileComplete(_MethodCompileComplete); callbacks[158] = Marshal.GetFunctionPointerForDelegate(d158); delegates[158] = d158; - var d159 = new __convertPInvokeCalliToCall(_convertPInvokeCalliToCall); + var d159 = new __getTailCallCopyArgsThunk(_getTailCallCopyArgsThunk); callbacks[159] = Marshal.GetFunctionPointerForDelegate(d159); delegates[159] = d159; - var d160 = new __getMemoryManager(_getMemoryManager); + var d160 = new __convertPInvokeCalliToCall(_convertPInvokeCalliToCall); callbacks[160] = Marshal.GetFunctionPointerForDelegate(d160); delegates[160] = d160; - var d161 = new __allocMem(_allocMem); + var d161 = new __getMemoryManager(_getMemoryManager); callbacks[161] = Marshal.GetFunctionPointerForDelegate(d161); delegates[161] = d161; - var d162 = new __reserveUnwindInfo(_reserveUnwindInfo); + var d162 = new __allocMem(_allocMem); callbacks[162] = Marshal.GetFunctionPointerForDelegate(d162); delegates[162] = d162; - var d163 = new __allocUnwindInfo(_allocUnwindInfo); + var d163 = new __reserveUnwindInfo(_reserveUnwindInfo); callbacks[163] = Marshal.GetFunctionPointerForDelegate(d163); delegates[163] = d163; - var d164 = new __allocGCInfo(_allocGCInfo); + var d164 = new __allocUnwindInfo(_allocUnwindInfo); callbacks[164] = Marshal.GetFunctionPointerForDelegate(d164); delegates[164] = d164; - var d165 = new __yieldExecution(_yieldExecution); + var d165 = new __allocGCInfo(_allocGCInfo); callbacks[165] = Marshal.GetFunctionPointerForDelegate(d165); delegates[165] = d165; - var d166 = new __setEHcount(_setEHcount); + var d166 = new __yieldExecution(_yieldExecution); callbacks[166] = Marshal.GetFunctionPointerForDelegate(d166); delegates[166] = d166; - var d167 = new __setEHinfo(_setEHinfo); + var d167 = new __setEHcount(_setEHcount); callbacks[167] = Marshal.GetFunctionPointerForDelegate(d167); delegates[167] = d167; - var d168 = new __logMsg(_logMsg); + var d168 = new __setEHinfo(_setEHinfo); callbacks[168] = Marshal.GetFunctionPointerForDelegate(d168); delegates[168] = d168; - var d169 = new __doAssert(_doAssert); + var d169 = new __logMsg(_logMsg); callbacks[169] = Marshal.GetFunctionPointerForDelegate(d169); delegates[169] = d169; - var d170 = new __reportFatalError(_reportFatalError); + var d170 = new __doAssert(_doAssert); callbacks[170] = Marshal.GetFunctionPointerForDelegate(d170); delegates[170] = d170; - var d171 = new __allocMethodBlockCounts(_allocMethodBlockCounts); + var d171 = new __reportFatalError(_reportFatalError); callbacks[171] = Marshal.GetFunctionPointerForDelegate(d171); delegates[171] = d171; - var d172 = new __getMethodBlockCounts(_getMethodBlockCounts); + var d172 = new __allocMethodBlockCounts(_allocMethodBlockCounts); callbacks[172] = Marshal.GetFunctionPointerForDelegate(d172); delegates[172] = d172; - var d173 = new __recordCallSite(_recordCallSite); + var d173 = new __getMethodBlockCounts(_getMethodBlockCounts); callbacks[173] = Marshal.GetFunctionPointerForDelegate(d173); delegates[173] = d173; - var d174 = new __recordRelocation(_recordRelocation); + var d174 = new __recordCallSite(_recordCallSite); callbacks[174] = Marshal.GetFunctionPointerForDelegate(d174); delegates[174] = d174; - var d175 = new __getRelocTypeHint(_getRelocTypeHint); + var d175 = new __recordRelocation(_recordRelocation); callbacks[175] = Marshal.GetFunctionPointerForDelegate(d175); delegates[175] = d175; - var d176 = new __getModuleNativeEntryPointRange(_getModuleNativeEntryPointRange); + var d176 = new __getRelocTypeHint(_getRelocTypeHint); callbacks[176] = Marshal.GetFunctionPointerForDelegate(d176); delegates[176] = d176; - var d177 = new __getExpectedTargetArchitecture(_getExpectedTargetArchitecture); + var d177 = new __getModuleNativeEntryPointRange(_getModuleNativeEntryPointRange); callbacks[177] = Marshal.GetFunctionPointerForDelegate(d177); delegates[177] = d177; - var d178 = new __getJitFlags(_getJitFlags); + var d178 = new __getExpectedTargetArchitecture(_getExpectedTargetArchitecture); callbacks[178] = Marshal.GetFunctionPointerForDelegate(d178); delegates[178] = d178; + var d179 = new __getJitFlags(_getJitFlags); + callbacks[179] = Marshal.GetFunctionPointerForDelegate(d179); + delegates[179] = d179; keepAlive = delegates; return (IntPtr)callbacks; diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs index 63f817fba56314..4903aec134730a 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs @@ -1153,6 +1153,14 @@ private bool isValidStringRef(CORINFO_MODULE_STRUCT_* module, uint metaTOK) private bool shouldEnforceCallvirtRestriction(CORINFO_MODULE_STRUCT_* scope) { throw new NotImplementedException("shouldEnforceCallvirtRestriction"); } + private char* getStringLiteral(CORINFO_MODULE_STRUCT_* module, uint metaTOK, ref int length) + { + MethodIL methodIL = (MethodIL)HandleToObject((IntPtr)module); + string s = (string)methodIL.GetObject((int)metaTOK); + length = (int)s.Length; + return (char*)GetPin(s); + } + private CorInfoType asCorInfoType(CORINFO_CLASS_STRUCT_* cls) { var type = HandleToObject(cls); @@ -1189,7 +1197,7 @@ private CorInfoType asCorInfoType(CORINFO_CLASS_STRUCT_* cls) } - private int appendClassName(short** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, bool fNamespace, bool fFullInst, bool fAssembly) + private int appendClassName(char** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, bool fNamespace, bool fFullInst, bool fAssembly) { // We support enough of this to make SIMD work, but not much else. @@ -1201,13 +1209,13 @@ private int appendClassName(short** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUC int length = name.Length; if (pnBufLen > 0) { - short* buffer = *ppBuf; + char* buffer = *ppBuf; for (int i = 0; i < Math.Min(name.Length, pnBufLen); i++) - buffer[i] = (short)name[i]; + buffer[i] = name[i]; if (name.Length < pnBufLen) - buffer[name.Length] = 0; + buffer[name.Length] = (char)0; else - buffer[pnBufLen - 1] = 0; + buffer[pnBufLen - 1] = (char)0; pnBufLen -= length; *ppBuf = buffer + length; } @@ -2061,221 +2069,6 @@ private CORINFO_FIELD_ACCESSOR getFieldIntrinsic(FieldDesc field) return (CORINFO_FIELD_ACCESSOR)(-1); } - private void getFieldInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_ACCESS_FLAGS flags, CORINFO_FIELD_INFO* pResult) - { -#if DEBUG - // In debug, write some bogus data to the struct to ensure we have filled everything - // properly. - MemoryHelper.FillMemory((byte*)pResult, 0xcc, Marshal.SizeOf()); -#endif - - Debug.Assert(((int)flags & ((int)CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_GET | - (int)CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_SET | - (int)CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_ADDRESS | - (int)CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_INIT_ARRAY)) != 0); - - var field = HandleToObject(pResolvedToken.hField); -#if READYTORUN - MethodDesc callerMethod = HandleToObject(callerHandle); - - if (field.Offset.IsIndeterminate) - throw new RequiresRuntimeJitException(field); -#endif - - CORINFO_FIELD_ACCESSOR fieldAccessor; - CORINFO_FIELD_FLAGS fieldFlags = (CORINFO_FIELD_FLAGS)0; - uint fieldOffset = (field.IsStatic && field.HasRva ? 0xBAADF00D : (uint)field.Offset.AsInt); - - if (field.IsStatic) - { - fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_STATIC; - -#if READYTORUN - if (field.FieldType.IsValueType && field.HasGCStaticBase && !field.HasRva) - { - // statics of struct types are stored as implicitly boxed in CoreCLR i.e. - // we need to modify field access flags appropriately - fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_STATIC_IN_HEAP; - } -#endif - - if (field.HasRva) - { - fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_UNMANAGED; - - // TODO: Handle the case when the RVA is in the TLS range - fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_RVA_ADDRESS; - - // We are not going through a helper. The constructor has to be triggered explicitly. -#if READYTORUN - if (!IsClassPreInited(field.OwningType)) -#else - if (_compilation.HasLazyStaticConstructor(field.OwningType)) -#endif - { - fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_INITCLASS; - } - } - else if (field.OwningType.IsCanonicalSubtype(CanonicalFormKind.Any)) - { - // The JIT wants to know how to access a static field on a generic type. We need a runtime lookup. -#if READYTORUN - fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_GENERICS_STATIC_HELPER; - if (field.IsThreadStatic) - { - pResult->helper = (field.HasGCStaticBase ? - CorInfoHelpFunc.CORINFO_HELP_GETGENERICS_GCTHREADSTATIC_BASE: - CorInfoHelpFunc.CORINFO_HELP_GETGENERICS_NONGCTHREADSTATIC_BASE); - } - else - { - pResult->helper = (field.HasGCStaticBase ? - CorInfoHelpFunc.CORINFO_HELP_GETGENERICS_GCSTATIC_BASE: - CorInfoHelpFunc.CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE); - } -#else - fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_READYTORUN_HELPER; - pResult->helper = CorInfoHelpFunc.CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE; - - // Don't try to compute the runtime lookup if we're inlining. The JIT is going to abort the inlining - // attempt anyway. - MethodDesc contextMethod = methodFromContext(pResolvedToken.tokenContext); - if (contextMethod == MethodBeingCompiled) - { - FieldDesc runtimeDeterminedField = (FieldDesc)GetRuntimeDeterminedObjectForToken(ref pResolvedToken); - - ReadyToRunHelperId helperId; - - // Find out what kind of base do we need to look up. - if (field.IsThreadStatic) - { - helperId = ReadyToRunHelperId.GetThreadStaticBase; - } - else if (field.HasGCStaticBase) - { - helperId = ReadyToRunHelperId.GetGCStaticBase; - } - else - { - helperId = ReadyToRunHelperId.GetNonGCStaticBase; - } - - // What generic context do we look up the base from. - ISymbolNode helper; - if (contextMethod.AcquiresInstMethodTableFromThis() || contextMethod.RequiresInstMethodTableArg()) - { - helper = _compilation.NodeFactory.ReadyToRunHelperFromTypeLookup( - helperId, runtimeDeterminedField.OwningType, contextMethod.OwningType); - } - else - { - Debug.Assert(contextMethod.RequiresInstMethodDescArg()); - helper = _compilation.NodeFactory.ReadyToRunHelperFromDictionaryLookup( - helperId, runtimeDeterminedField.OwningType, contextMethod); - } - - pResult->fieldLookup = CreateConstLookupToSymbol(helper); - } -#endif // READYTORUN - } - else - { - fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_SHARED_STATIC_HELPER; - pResult->helper = CorInfoHelpFunc.CORINFO_HELP_READYTORUN_STATIC_BASE; - - ReadyToRunHelperId helperId = ReadyToRunHelperId.Invalid; - CORINFO_FIELD_ACCESSOR intrinsicAccessor; - if (field.IsIntrinsic && - (flags & CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_GET) != 0 && - (intrinsicAccessor = getFieldIntrinsic(field)) != (CORINFO_FIELD_ACCESSOR)(-1)) - { - fieldAccessor = intrinsicAccessor; - } - else if (field.IsThreadStatic) - { -#if READYTORUN - if (field.HasGCStaticBase) - { - helperId = ReadyToRunHelperId.GetThreadStaticBase; - } - else - { - helperId = ReadyToRunHelperId.GetThreadNonGcStaticBase; - } -#else - helperId = ReadyToRunHelperId.GetThreadStaticBase; -#endif - } - else - { - helperId = field.HasGCStaticBase ? - ReadyToRunHelperId.GetGCStaticBase : - ReadyToRunHelperId.GetNonGCStaticBase; - - // - // Currently, we only do this optimization for regular statics, but it - // looks like it may be permissible to do this optimization for - // thread statics as well. - // - if ((flags & CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_ADDRESS) != 0 && - (fieldAccessor != CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_TLS)) - { - fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_SAFESTATIC_BYREF_RETURN; - } - } - -#if READYTORUN - if (!_compilation.NodeFactory.CompilationModuleGroup.VersionsWithType(field.OwningType) && - fieldAccessor == CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_SHARED_STATIC_HELPER) - { - PreventRecursiveFieldInlinesOutsideVersionBubble(field, callerMethod); - - // Static fields outside of the version bubble need to be accessed using the ENCODE_FIELD_ADDRESS - // helper in accordance with ZapInfo::getFieldInfo in CoreCLR. - pResult->fieldLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.FieldAddress(field, GetSignatureContext())); - - pResult->helper = CorInfoHelpFunc.CORINFO_HELP_READYTORUN_STATIC_BASE; - - fieldFlags &= ~CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_STATIC_IN_HEAP; // The dynamic helper takes care of the unboxing - fieldOffset = 0; - } - else -#endif - - if (helperId != ReadyToRunHelperId.Invalid) - { - pResult->fieldLookup = CreateConstLookupToSymbol( -#if READYTORUN - _compilation.SymbolNodeFactory.CreateReadyToRunHelper(helperId, field.OwningType, GetSignatureContext()) -#else - _compilation.NodeFactory.ReadyToRunHelper(helperId, field.OwningType) -#endif - ); - } - } - } - else - { - fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_INSTANCE; - } - - if (field.IsInitOnly) - fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_FINAL; - - pResult->fieldAccessor = fieldAccessor; - pResult->fieldFlags = fieldFlags; - pResult->fieldType = getFieldType(pResolvedToken.hField, &pResult->structType, pResolvedToken.hClass); - pResult->accessAllowed = CorInfoIsAccessAllowedResult.CORINFO_ACCESS_ALLOWED; - pResult->offset = fieldOffset; - -#if READYTORUN - EncodeFieldBaseOffset(field, pResult, callerMethod); -#endif - - // TODO: We need to implement access checks for fields and methods. See JitInterface.cpp in mrtjit - // and STS::AccessCheck::CanAccess. - } - private bool isFieldStatic(CORINFO_FIELD_STRUCT_* fldHnd) { return HandleToObject(fldHnd).IsStatic; @@ -2367,7 +2160,7 @@ private CorInfoType getHFAType(CORINFO_CLASS_STRUCT_* hClass) private HRESULT GetErrorHRESULT(_EXCEPTION_POINTERS* pExceptionPointers) { throw new NotImplementedException("GetErrorHRESULT"); } - private uint GetErrorMessage(short* buffer, uint bufferLength) + private uint GetErrorMessage(char* buffer, uint bufferLength) { throw new NotImplementedException("GetErrorMessage"); } private int FilterException(_EXCEPTION_POINTERS* pExceptionPointers) @@ -2430,7 +2223,7 @@ private void getEEInfo(ref CORINFO_EE_INFO pEEInfoOut) pEEInfoOut.osType = _compilation.NodeFactory.Target.IsWindows ? CORINFO_OS.CORINFO_WINNT : CORINFO_OS.CORINFO_UNIX; } - private string getJitTimeLogFilename() + private char* getJitTimeLogFilename() { return null; } diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs index 9f211d80a50fd4..e249197fd3480a 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs @@ -764,6 +764,8 @@ public enum CorJitAllocMemFlag CORJIT_ALLOCMEM_DEFAULT_CODE_ALIGN = 0x00000000, // The code will be use the normal alignment CORJIT_ALLOCMEM_FLG_16BYTE_ALIGN = 0x00000001, // The code will be 16-byte aligned CORJIT_ALLOCMEM_FLG_RODATA_16BYTE_ALIGN = 0x00000002, // The read-only data will be 16-byte aligned + CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN = 0x00000004, // The code will be 32-byte aligned + CORJIT_ALLOCMEM_FLG_RODATA_32BYTE_ALIGN = 0x00000008, // The read-only data will be 32-byte aligned } public enum CorJitFuncKind diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs index 499014b233790a..78b513211cc4a0 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index fffc0de16cd8e9..a124f01f0e85b2 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -72,11 +72,11 @@ ULONG32*,ref uint,unsigned int* LONG*,int*,long* char*,byte* const char**,byte** -WCHAR**,short**,wchar_t** +WCHAR**,char**,wchar_t** LPCSTR,byte*,const char* -LPWSTR,short*,wchar_t* -LPCWSTR,short*,const wchar_t* -wchar_t*,short* +LPWSTR,char*,wchar_t* +LPCWSTR,char*,const wchar_t* +wchar_t*,char* const wchar_t*,String DWORD**,ref uint*,unsigned int** @@ -158,7 +158,6 @@ struct _EXCEPTION_POINTERS*,_EXCEPTION_POINTERS*,void* RETURNTYPES BOOL,[return: MarshalAs(UnmanagedType.Bool)]bool,int bool,[return: MarshalAs(UnmanagedType.I1)]bool -LPCWSTR,[return: MarshalAs(UnmanagedType.LPWStr)]string,const wchar_t* ; NOTE in managed SIZE_T is an enum that is 64bits in size, and returning one of those causing mcg to do the wrong thing. size_t,byte*,size_t @@ -199,6 +198,7 @@ FUNCTIONS CorInfoCanSkipVerificationResult canSkipVerification(CORINFO_MODULE_HANDLE module) BOOL isValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK) BOOL isValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK) + LPCWSTR getStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int* length) BOOL shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) CorInfoType asCorInfoType(CORINFO_CLASS_HANDLE cls) const char* getClassName(CORINFO_CLASS_HANDLE cls) diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat index 2fec5117581829..46328b52d08baf 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat @@ -1,2 +1,2 @@ cd /d %~dp0 -dotnet run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\jitinterface\jitinterface.h \ No newline at end of file +dotnet run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\crossgen2\jitinterface\jitinterface.h \ No newline at end of file diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh index 3eb458d6200b33..59672c72d4156b 100755 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash cd "$(dirname ${BASH_SOURCE[0]})" -dotnet run -- ThunkInput.txt ../CorInfoBase.cs ../../../jitinterface/jitinterface.h +dotnet run -- ThunkInput.txt ../CorInfoBase.cs ../../../crossgen2/jitinterface/jitinterface.h diff --git a/src/coreclr/src/tools/Common/System/FormattingHelpers.cs b/src/coreclr/src/tools/Common/System/FormattingHelpers.cs index de7a6370a0a3d4..62ff1152e76a2b 100644 --- a/src/coreclr/src/tools/Common/System/FormattingHelpers.cs +++ b/src/coreclr/src/tools/Common/System/FormattingHelpers.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/ArrayType.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/ArrayType.Canon.cs index 04bd817fa7d5b9..20e92e0ae1f208 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/ArrayType.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/ArrayType.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/ByRefType.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/ByRefType.Canon.cs index 921eb901487e69..a0629e6c85669d 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/ByRefType.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/ByRefType.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.Diagnostic.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.Diagnostic.cs index 3c4098cb4d04c8..ea8ab87af27b68 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.Diagnostic.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.Diagnostic.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.cs index d84341b154063a..943452f96b378a 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -71,7 +71,7 @@ protected override MethodImplRecord[] ComputeVirtualMethodImplsForType() public override bool IsExplicitLayout => false; - public override ModuleDesc Module => _context.CanonTypesModule; + public override ModuleDesc Module => _context.SystemModule; public override bool IsModuleType => false; diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/DefType.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/DefType.Canon.cs index 75c03bb4601066..7e782f33717e29 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/DefType.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/DefType.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs index 4e3e0204e77ed9..f77f5039ee4c2a 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedType.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedType.Canon.cs index 8ed86f39c2ee5f..4049a265dc124b 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedType.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedType.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/MetadataType.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/MetadataType.Canon.cs index 97d2dba198580e..a8a9d97ab5c3d0 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/MetadataType.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/MetadataType.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/MethodDesc.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/MethodDesc.Canon.cs index ad9e3d6b7fcfca..3714346d73f603 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/MethodDesc.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/MethodDesc.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/ParameterizedType.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/ParameterizedType.Canon.cs index 471022fc070f23..ad386bb04d1333 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/ParameterizedType.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/ParameterizedType.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/PointerType.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/PointerType.Canon.cs index ae189951217b30..ce4c96d5d0064d 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/PointerType.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/PointerType.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/SignatureVariable.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/SignatureVariable.Canon.cs index a7da04a857cc94..381d92db189ee6 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/SignatureVariable.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/SignatureVariable.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/StandardCanonicalizationAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/StandardCanonicalizationAlgorithm.cs index 8cac891b311b27..04579bc1aef11e 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/StandardCanonicalizationAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/StandardCanonicalizationAlgorithm.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs index c4c141c42a3092..690369ab27ae0a 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeSystemContext.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeSystemContext.Canon.cs index 444f24b67a664b..268bf73b7f60f0 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeSystemContext.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeSystemContext.Canon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -44,11 +44,6 @@ public CanonBaseType UniversalCanonType } } - protected internal virtual ModuleDesc CanonTypesModule - { - get { return SystemModule; } - } - /// /// Returns true if and only if the '' is __Canon or __UniversalCanon /// that matches the parameter. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/ExplicitLayoutValidator.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/ExplicitLayoutValidator.cs index b1c4ae54a09a00..9e7c4c6f908da7 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/ExplicitLayoutValidator.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/ExplicitLayoutValidator.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/IModuleResolver.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/IModuleResolver.cs index 92c01abe9ee351..eccacb2a2d5772 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/IModuleResolver.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/IModuleResolver.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs index b0be4b8430bac9..596bca577b510e 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs @@ -425,7 +425,7 @@ protected static ComputedInstanceFieldLayout ComputeSequentialFieldLayout(Metada return computedLayout; } - protected virtual void AlignBaseOffsetIfNecessary(MetadataType type, ref LayoutInt baseOffset) + protected virtual void AlignBaseOffsetIfNecessary(MetadataType type, ref LayoutInt baseOffset, bool requiresAlign8) { } @@ -434,8 +434,6 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, // For types inheriting from another type, field offsets continue on from where they left off LayoutInt cumulativeInstanceFieldPos = ComputeBytesUsedInParentType(type); - AlignBaseOffsetIfNecessary(type, ref cumulativeInstanceFieldPos); - var layoutMetadata = type.GetClassLayout(); int packingSize = ComputePackingSize(type, layoutMetadata); @@ -459,6 +457,7 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, continue; TypeDesc fieldType = field.FieldType; + if (IsByValueClass(fieldType)) { instanceValueClassFieldCount++; @@ -495,6 +494,7 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, // Reset the counters to be used later as the index to insert into the array instanceGCPointerFieldsCount = 0; instanceValueClassFieldCount = 0; + LayoutInt largestAlignmentRequired = LayoutInt.One; // Iterate over all fields and do the following // - Add instance fields to the appropriate array (while maintaining the enumerated order) @@ -506,6 +506,9 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, TypeDesc fieldType = field.FieldType; + var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(fieldType, packingSize); + largestAlignmentRequired = LayoutInt.Max(fieldSizeAndAlignment.Alignment, largestAlignmentRequired); + if (IsByValueClass(fieldType)) { instanceValueClassFieldsArr[instanceValueClassFieldCount++] = field; @@ -516,12 +519,14 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, } else { - var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(fieldType, packingSize); int log2size = CalculateLog2(fieldSizeAndAlignment.Size.AsInt); instanceNonGCPointerFieldsArr[log2size][instanceNonGCPointerFieldsCount[log2size]++] = field; } } + largestAlignmentRequired = type.Context.Target.GetObjectAlignment(largestAlignmentRequired); + AlignBaseOffsetIfNecessary(type, ref cumulativeInstanceFieldPos, largestAlignmentRequired.AsInt > 4); + // We've finished placing the fields into their appropriate arrays // The next optimization may place non-GC Pointers, so repurpose our // counter to keep track of the next non-GC Pointer that must be placed diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs index b41133e36fa910..74ec106694eb29 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs index fd81aad4755a8f..8f910dd00636ee 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs @@ -323,7 +323,7 @@ public int MaximumHfaElementCount get { // There is a hard limit of 4 elements on an HFA type, see - // http://blogs.msdn.com/b/vcblog/archive/2013/07/12/introducing-vector-calling-convention.aspx + // https://devblogs.microsoft.com/cppblog/introducing-vector-calling-convention/ Debug.Assert(Architecture == TargetArchitecture.ARM || Architecture == TargetArchitecture.ARM64 || Architecture == TargetArchitecture.X64 || diff --git a/src/coreclr/src/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs b/src/coreclr/src/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs index 87c9bf41f4e6cf..5b6d1ea8b81912 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Interop/InteropTypes.cs b/src/coreclr/src/tools/Common/TypeSystem/Interop/InteropTypes.cs index 2530f1b24e1336..4231594e612da7 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Interop/InteropTypes.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Interop/InteropTypes.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/DefType.RuntimeDetermined.cs b/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/DefType.RuntimeDetermined.cs index 02d1b252339b84..b2f669b228d8e1 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/DefType.RuntimeDetermined.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/DefType.RuntimeDetermined.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/ParameterizedType.RuntimeDetermined.cs b/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/ParameterizedType.RuntimeDetermined.cs index f48325c7ebdb90..df1723270778f5 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/ParameterizedType.RuntimeDetermined.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/ParameterizedType.RuntimeDetermined.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedCanonicalizationAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedCanonicalizationAlgorithm.cs index f1ea5fc96b0b1f..6ba17638ee0ef1 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedCanonicalizationAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedCanonicalizationAlgorithm.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs index 75039d735b2334..91c3d9e1f1149b 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/GCLogParser/App.config b/src/coreclr/src/tools/GCLogParser/App.config index ffaf5407a91075..c8f375802e873d 100644 --- a/src/coreclr/src/tools/GCLogParser/App.config +++ b/src/coreclr/src/tools/GCLogParser/App.config @@ -1,4 +1,4 @@ - + diff --git a/src/coreclr/src/tools/GCLogParser/parse-hb-log.csproj b/src/coreclr/src/tools/GCLogParser/parse-hb-log.csproj index 940cb96f0ea3bc..f30e869f4b2d2f 100644 --- a/src/coreclr/src/tools/GCLogParser/parse-hb-log.csproj +++ b/src/coreclr/src/tools/GCLogParser/parse-hb-log.csproj @@ -1,4 +1,4 @@ - + diff --git a/src/coreclr/src/tools/GCLogParser/parse-hb-log.sln b/src/coreclr/src/tools/GCLogParser/parse-hb-log.sln index 5ae5dcb65cd257..71aa126764ceec 100644 --- a/src/coreclr/src/tools/GCLogParser/parse-hb-log.sln +++ b/src/coreclr/src/tools/GCLogParser/parse-hb-log.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.28803.452 diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Buckets.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Buckets.cs index 43e602aee47ce6..04052349244d87 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Buckets.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Buckets.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/BuildFolder.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/BuildFolder.cs index d5f10808764b0e..567242b4a2db45 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/BuildFolder.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/BuildFolder.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -46,16 +46,31 @@ public BuildFolder( _compilations = new List(); _executions = new List(); - foreach (string file in _compilationInputFiles) + if (options.Composite) { ProcessInfo[] fileCompilations = new ProcessInfo[(int)CompilerIndex.Count]; foreach (CompilerRunner runner in compilerRunners) { - ProcessInfo compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, _outputFolder, file)); + string outputFile = runner.GetOutputFileName(_outputFolder, "composite-r2r.dll"); + ProcessInfo compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, outputFile, _compilationInputFiles)); fileCompilations[(int)runner.Index] = compilationProcess; } _compilations.Add(fileCompilations); } + else + { + foreach (string file in _compilationInputFiles) + { + ProcessInfo[] fileCompilations = new ProcessInfo[(int)CompilerIndex.Count]; + foreach (CompilerRunner runner in compilerRunners) + { + string outputFile = runner.GetOutputFileName(_outputFolder, file); + ProcessInfo compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, outputFile, new string[] { file })); + fileCompilations[(int)runner.Index] = compilationProcess; + } + _compilations.Add(fileCompilations); + } + } if (!options.NoExe) { @@ -98,7 +113,8 @@ public static BuildFolder FromDirectory(string inputDirectory, IEnumerable>[] allMethodsPerModulePerCompiler = new Dictionary>[(int)CompilerIndex.Count]; + var allMethodsPerModulePerCompiler = new Dictionary>[(int)CompilerIndex.Count]; foreach (CompilerRunner runner in _compilerRunners) { @@ -108,7 +108,7 @@ private void WriteJittedMethodSummary(StreamWriter logWriter) { for (int exeIndex = 0; exeIndex < folder.Executions.Count; exeIndex++) { - Dictionary>[] appMethodsPerModulePerCompiler = new Dictionary>[(int)CompilerIndex.Count]; + var appMethodsPerModulePerCompiler = new Dictionary>[(int)CompilerIndex.Count]; foreach (CompilerRunner runner in _compilerRunners) { appMethodsPerModulePerCompiler[(int)runner.Index] = new Dictionary>(); @@ -129,12 +129,11 @@ public bool Compile() return false; } - Stopwatch stopwatch = new Stopwatch(); - stopwatch.Start(); + Stopwatch stopwatch = Stopwatch.StartNew(); ResolveTestExclusions(); - List compilationsToRun = new List(); + var compilationsToRun = new List(); foreach (BuildFolder folder in FoldersToBuild) { @@ -154,16 +153,16 @@ public bool Compile() ParallelRunner.Run(compilationsToRun, _options.DegreeOfParallelism, _options.MeasurePerf); bool success = true; - List> failedCompilationsPerBuilder = new List>(); + var failedCompilationsPerBuilder = new List>(); int successfulCompileCount = 0; - List r2rDumpExecutionsToRun = new List(); + var r2rDumpExecutionsToRun = new List(); foreach (BuildFolder folder in FoldersToBuild) { foreach (ProcessInfo[] compilation in folder.Compilations) { - string file = null; + HashSet failedFiles = new HashSet(); string failedBuilders = null; foreach (CompilerRunner runner in _compilerRunners) { @@ -184,17 +183,9 @@ public bool Compile() else // runner process failed { _compilationFailureBuckets.AddCompilation(runnerProcess); - try + failedFiles.UnionWith(runnerProcess.Parameters.InputFileNames); + if (failedBuilders == null) { - File.Copy(runnerProcess.Parameters.InputFileName, runnerProcess.Parameters.OutputFileName); - } - catch (Exception ex) - { - Console.Error.WriteLine("Error copying {0} to {1}: {2}", runnerProcess.Parameters.InputFileName, runnerProcess.Parameters.OutputFileName, ex.Message); - } - if (file == null) - { - file = runnerProcess.Parameters.InputFileName; failedBuilders = runner.CompilerName; } else @@ -203,9 +194,12 @@ public bool Compile() } } } - if (file != null) + if (failedFiles.Count > 0) { - failedCompilationsPerBuilder.Add(new KeyValuePair(file, failedBuilders)); + foreach (string file in failedFiles) + { + failedCompilationsPerBuilder.Add(new KeyValuePair(file, failedBuilders)); + } success = false; } else @@ -235,7 +229,7 @@ public bool Compile() causeOfFailure = "Unknown cause of failure"; } - Console.Error.WriteLine("Error running R2R dump on {0}: {1}", r2rDumpExecution.Parameters.InputFileName, causeOfFailure); + Console.Error.WriteLine("Error running R2R dump on {0}: {1}", string.Join(", ", r2rDumpExecution.Parameters.InputFileNames), causeOfFailure); success = false; } } @@ -252,8 +246,7 @@ public bool CompileFramework() return true; } - Stopwatch stopwatch = new Stopwatch(); - stopwatch.Start(); + Stopwatch stopwatch = Stopwatch.StartNew(); string coreRoot = _options.CoreRootDirectory.FullName; string[] frameworkFolderFiles = Directory.GetFiles(coreRoot); @@ -268,37 +261,71 @@ public bool CompileFramework() outputPath.RecreateDirectory(); } - List compilationsToRun = new List(); - List> compilationsPerRunner = new List>(); - List excludedAssemblies = new List(); - foreach (string frameworkDll in ComputeManagedAssemblies.GetManagedAssembliesInFolder(_options.CoreRootDirectory.FullName)) - { - string simpleName = Path.GetFileNameWithoutExtension(frameworkDll); - FrameworkExclusion exclusion = s_frameworkExclusions.FirstOrDefault(asm => asm.SimpleName.Equals(simpleName, StringComparison.OrdinalIgnoreCase)); + var compilationsToRun = new List(); + var compilationsPerRunner = new List>(); + var excludedAssemblies = new List(); - ProcessInfo[] processes = new ProcessInfo[(int)CompilerIndex.Count]; - compilationsPerRunner.Add(new KeyValuePair(frameworkDll, processes)); + if (_options.Composite) + { + var processes = new ProcessInfo[(int)CompilerIndex.Count]; foreach (CompilerRunner runner in frameworkRunners) { - if (exclusion != null && (!exclusion.Crossgen2Only || runner.Index == CompilerIndex.CPAOT)) + List inputFrameworkDlls = new List(); + foreach (string frameworkDll in ComputeManagedAssemblies.GetManagedAssembliesInFolder(_options.CoreRootDirectory.FullName)) { - _frameworkExclusions[exclusion.SimpleName] = exclusion.Reason; - continue; + string simpleName = Path.GetFileNameWithoutExtension(frameworkDll); + FrameworkExclusion exclusion = s_frameworkExclusions.FirstOrDefault(asm => asm.SimpleName.Equals(simpleName, StringComparison.OrdinalIgnoreCase)); + if (exclusion != null && (!exclusion.Crossgen2Only || runner.Index == CompilerIndex.CPAOT)) + { + _frameworkExclusions[exclusion.SimpleName] = exclusion.Reason; + } + else + { + inputFrameworkDlls.Add(frameworkDll); + compilationsPerRunner.Add(new KeyValuePair(frameworkDll, processes)); + } + } + + if (inputFrameworkDlls.Count > 0) + { + string outputFileName = runner.GetOutputFileName(_options.CoreRootDirectory.FullName, "framework"); + ProcessInfo compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, outputFileName, inputFrameworkDlls)); + compilationsToRun.Add(compilationProcess); + processes[(int)runner.Index] = compilationProcess; + } + } + } + else + { + foreach (string frameworkDll in ComputeManagedAssemblies.GetManagedAssembliesInFolder(_options.CoreRootDirectory.FullName)) + { + string simpleName = Path.GetFileNameWithoutExtension(frameworkDll); + FrameworkExclusion exclusion = s_frameworkExclusions.FirstOrDefault(asm => asm.SimpleName.Equals(simpleName, StringComparison.OrdinalIgnoreCase)); + + ProcessInfo[] processes = new ProcessInfo[(int)CompilerIndex.Count]; + compilationsPerRunner.Add(new KeyValuePair(frameworkDll, processes)); + foreach (CompilerRunner runner in frameworkRunners) + { + if (exclusion != null && (!exclusion.Crossgen2Only || runner.Index == CompilerIndex.CPAOT)) + { + _frameworkExclusions[exclusion.SimpleName] = exclusion.Reason; + continue; + } + var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, _options.CoreRootDirectory.FullName, new string[] { frameworkDll })); + compilationsToRun.Add(compilationProcess); + processes[(int)runner.Index] = compilationProcess; } - ProcessInfo compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, _options.CoreRootDirectory.FullName, frameworkDll)); - compilationsToRun.Add(compilationProcess); - processes[(int)runner.Index] = compilationProcess; } } ParallelRunner.Run(compilationsToRun, _options.DegreeOfParallelism); - HashSet[] skipCopying = new HashSet[(int)CompilerIndex.Count]; + var skipCopying = new HashSet[(int)CompilerIndex.Count]; foreach (CompilerRunner runner in frameworkRunners) { skipCopying[(int)runner.Index] = new HashSet(StringComparer.OrdinalIgnoreCase); } - int[] failedCompilationsPerBuilder = new int[(int)CompilerIndex.Count]; + var failedCompilationsPerBuilder = new int[(int)CompilerIndex.Count]; int successfulCompileCount = 0; int failedCompileCount = 0; foreach (KeyValuePair kvp in compilationsPerRunner) @@ -313,7 +340,7 @@ public bool CompileFramework() } else if (compilationProcess.Succeeded) { - skipCopying[(int)runner.Index].Add(compilationProcess.Parameters.InputFileName); + skipCopying[(int)runner.Index].UnionWith(compilationProcess.Parameters.InputFileNames); AnalyzeCompilationLog(compilationProcess, runner.Index); } else @@ -432,9 +459,8 @@ private void AnalyzeMarker(string line, string marker, Dictionary public bool Execute() { - Stopwatch stopwatch = new Stopwatch(); - stopwatch.Start(); - List executionsToRun = new List(); + Stopwatch stopwatch = Stopwatch.StartNew(); + var executionsToRun = new List(); foreach (BuildFolder folder in FoldersToBuild) { @@ -450,7 +476,7 @@ public bool Execute() { foreach (ProcessInfo[] execution in folder.Executions) { - string file = null; + HashSet failedFiles = new HashSet(); string failedBuilders = null; foreach (CompilerRunner runner in _compilerRunners) { @@ -459,9 +485,9 @@ public bool Execute() { _executionFailureBuckets.AddExecution(runnerProcess); - if (file == null) + failedFiles.UnionWith(runnerProcess.Parameters.InputFileNames); + if (failedBuilders == null) { - file = runnerProcess.Parameters.InputFileName; failedBuilders = runner.CompilerName; } else @@ -470,7 +496,7 @@ public bool Execute() } } } - if (file != null) + if (failedFiles.Count > 0) { success = false; } @@ -488,8 +514,7 @@ public bool Execute() public bool Build() { - Stopwatch stopwatch = new Stopwatch(); - stopwatch.Start(); + Stopwatch stopwatch = Stopwatch.StartNew(); bool success = _options.Exe || Compile(); @@ -572,7 +597,7 @@ private void WriteTopRankingProcesses(StreamWriter logWriter, string metric, IEn foreach (ProcessInfo processInfo in selection) { - logWriter.WriteLine($"{processInfo.DurationMilliseconds,10} | {processInfo.Parameters.InputFileName}"); + logWriter.WriteLine($"{processInfo.DurationMilliseconds,10} | {processInfo.Parameters.OutputFileName}"); } } @@ -616,14 +641,14 @@ private ExecutionOutcome GetExecutionOutcome(ProcessInfo execution) private void WriteBuildStatistics(StreamWriter logWriter) { // The Count'th element corresponds to totals over all compiler runners used in the run - int[,] compilationOutcomes = new int[(int)CompilationOutcome.Count, (int)CompilerIndex.Count + 1]; - int[,] executionOutcomes = new int[(int)ExecutionOutcome.Count, (int)CompilerIndex.Count + 1]; + var compilationOutcomes = new int[(int)CompilationOutcome.Count, (int)CompilerIndex.Count + 1]; + var executionOutcomes = new int[(int)ExecutionOutcome.Count, (int)CompilerIndex.Count + 1]; int totalCompilations = 0; int totalExecutions = 0; foreach (BuildFolder folder in FoldersToBuild) { - bool[] compilationFailedPerRunner = new bool[(int)CompilerIndex.Count]; + var compilationFailedPerRunner = new bool[(int)CompilerIndex.Count]; if (!_options.Exe) { foreach (ProcessInfo[] compilation in folder.Compilations) @@ -734,7 +759,7 @@ private void WriteBuildStatistics(StreamWriter logWriter) if (foldersToBuild != 0) { int lineSize = 10 * _compilerRunners.Count() + 13 + 8; - string separator = new string('-', lineSize); + var separator = new string('-', lineSize); if (!_options.Exe) { @@ -833,7 +858,7 @@ private void WriteFrameworkExclusions(StreamWriter logWriter) int keyLength = _frameworkExclusions.Keys.Max(key => key.Length); const string SimpleNameTitle = "SIMPLE_NAME"; keyLength = Math.Max(keyLength, SimpleNameTitle.Length); - StringBuilder title = new StringBuilder(); + var title = new StringBuilder(); title.Append(SimpleNameTitle); title.Append(' ', keyLength - SimpleNameTitle.Length); title.Append(" | REASON"); @@ -841,7 +866,7 @@ private void WriteFrameworkExclusions(StreamWriter logWriter) logWriter.WriteLine(new string('-', title.Length)); foreach (KeyValuePair exclusion in _frameworkExclusions.OrderBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase)) { - StringBuilder line = new StringBuilder(); + var line = new StringBuilder(); line.Append(exclusion.Key); line.Append(' ', keyLength - exclusion.Key.Length); line.Append(" | "); @@ -854,7 +879,7 @@ private void WritePerFolderStatistics(StreamWriter logWriter) { string baseFolder = _options.InputDirectory.FullName; int baseOffset = baseFolder.Length + (baseFolder.Length > 0 && baseFolder[baseFolder.Length - 1] == Path.DirectorySeparatorChar ? 0 : 1); - HashSet folders = new HashSet(StringComparer.OrdinalIgnoreCase); + var folders = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (BuildFolder folder in FoldersToBuild) { string relativeFolder = ""; @@ -875,7 +900,7 @@ private void WritePerFolderStatistics(StreamWriter logWriter) return; } - List folderList = new List(folders); + var folderList = new List(folders); folderList.Sort(StringComparer.OrdinalIgnoreCase); logWriter.WriteLine(); logWriter.WriteLine("Folder statistics:"); @@ -980,8 +1005,8 @@ public ExeSizeInfo(string cpaotPath, long cpaotSize, string crossgenPath, long c private void WriteExecutableSizeStatistics(StreamWriter logWriter) { - List sizeStats = new List(); - HashSet libraryHashes = new HashSet(StringComparer.OrdinalIgnoreCase); + var sizeStats = new List(); + var libraryHashes = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (BuildFolder folder in FoldersToBuild) { @@ -1176,7 +1201,7 @@ private IEnumerable EnumerateExecutions() public void WriteBuildLog(string buildLogPath) { - using (StreamWriter buildLogWriter = new StreamWriter(buildLogPath)) + using (var buildLogWriter = new StreamWriter(buildLogPath)) { WriteBuildStatistics(buildLogWriter); } @@ -1184,9 +1209,9 @@ public void WriteBuildLog(string buildLogPath) public void WriteCombinedLog(string outputFile) { - using (StreamWriter combinedLog = new StreamWriter(outputFile)) + using (var combinedLog = new StreamWriter(outputFile)) { - StreamWriter[] perRunnerLog = new StreamWriter[(int)CompilerIndex.Count]; + var perRunnerLog = new StreamWriter[(int)CompilerIndex.Count]; foreach (CompilerRunner runner in _compilerRunners) { string runnerLogPath = Path.ChangeExtension(outputFile, "-" + runner.CompilerName + ".log"); @@ -1195,7 +1220,7 @@ public void WriteCombinedLog(string outputFile) foreach (BuildFolder folder in FoldersToBuild) { - bool[] compilationErrorPerRunner = new bool[(int)CompilerIndex.Count]; + var compilationErrorPerRunner = new bool[(int)CompilerIndex.Count]; if (!_options.Exe) { foreach (ProcessInfo[] compilation in folder.Compilations) @@ -1205,7 +1230,7 @@ public void WriteCombinedLog(string outputFile) ProcessInfo compilationProcess = compilation[(int)runner.Index]; if (compilationProcess != null && !compilationProcess.IsEmpty) { - string log = $"\nCOMPILE {runner.CompilerName}:{compilationProcess.Parameters.InputFileName}"; + string log = $"\nCOMPILE {runner.CompilerName}:{compilationProcess.Parameters.OutputFileName}"; StreamWriter runnerLog = perRunnerLog[(int)runner.Index]; runnerLog.WriteLine(log); combinedLog.WriteLine(log); @@ -1242,7 +1267,7 @@ public void WriteCombinedLog(string outputFile) ProcessInfo executionProcess = execution[(int)runner.Index]; if (executionProcess != null) { - string header = $"\nEXECUTE {runner.CompilerName}:{executionProcess.Parameters.InputFileName}"; + string header = $"\nEXECUTE {runner.CompilerName}:{executionProcess.Parameters.OutputFileName}"; combinedLog.WriteLine(header); runnerLog.WriteLine(header); try @@ -1303,7 +1328,7 @@ public void WriteLogs() if (_options.Framework) { string frameworkExclusionsFile = Path.Combine(_options.OutputDirectory.FullName, "framework-exclusions-" + suffix); - using (StreamWriter writer = new StreamWriter(frameworkExclusionsFile)) + using (var writer = new StreamWriter(frameworkExclusionsFile)) { WriteFrameworkExclusions(writer); } @@ -1381,7 +1406,7 @@ private static void WriterMarkerLog(string fileName, Dictionary ma return; } - using (StreamWriter logWriter = new StreamWriter(fileName)) + using (var logWriter = new StreamWriter(fileName)) { foreach (KeyValuePair kvp in markerResults.OrderBy((kvp) => kvp.Key)) { @@ -1398,7 +1423,7 @@ private static void WriterMarkerDiff(string fileName, Dictionary c return; } - using (StreamWriter logWriter = new StreamWriter(fileName)) + using (var logWriter = new StreamWriter(fileName)) { int cpaotCount = cpaot.Count(); logWriter.WriteLine("Objects queried by CPAOT: {0}", cpaotCount); @@ -1464,7 +1489,7 @@ private static void WriterMarkerDiffSection(StreamWriter logWriter, string title private void WriteFileListPerCompilationOutcome(string outputFileName, CompilationOutcome outcome) { - List filteredTestList = new List(); + var filteredTestList = new List(); foreach (BuildFolder folder in _buildFolders) { foreach (ProcessInfo[] compilation in folder.Compilations) @@ -1488,7 +1513,7 @@ private void WriteFileListPerCompilationOutcome(string outputFileName, Compilati private void WriteFileListPerExecutionOutcome(string outputFileName, ExecutionOutcome outcome) { - List filteredTestList = new List(); + var filteredTestList = new List(); foreach (BuildFolder folder in _buildFolders) { foreach (ProcessInfo[] execution in folder.Executions) @@ -1500,7 +1525,7 @@ private void WriteFileListPerExecutionOutcome(string outputFileName, ExecutionOu GetExecutionOutcome(executionPerRunner) == outcome && executionPerRunner.Parameters != null) { - filteredTestList.Add(executionPerRunner.Parameters.InputFileName); + filteredTestList.Add(executionPerRunner.Parameters.OutputFileName); } } } diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/BuildOptions.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/BuildOptions.cs index 684d18ac25b79d..08abd1dda42980 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/BuildOptions.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/BuildOptions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -29,6 +29,7 @@ public class BuildOptions public bool UseFramework { get; set; } public bool Release { get; set; } public bool LargeBubble { get; set; } + public bool Composite { get; set; } public int Crossgen2Parallelism { get; set; } public int CompilationTimeoutMinutes { get; set; } public int ExecutionTimeoutMinutes { get; set; } diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/CommandLineOptions.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/CommandLineOptions.cs index 8ec905cf162aad..26b4cc3cc4fbc6 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/CommandLineOptions.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/CommandLineOptions.cs @@ -45,6 +45,7 @@ Command CompileFolder() => UseFramework(), Release(), LargeBubble(), + Composite(), Crossgen2Parallelism(), ReferencePath(), IssuesPath(), @@ -78,6 +79,7 @@ Command CompileSubtree() => UseFramework(), Release(), LargeBubble(), + Composite(), Crossgen2Parallelism(), ReferencePath(), IssuesPath(), @@ -101,6 +103,7 @@ Command CompileFramework() => Sequential(), Release(), LargeBubble(), + Composite(), ReferencePath(), IssuesPath(), CompilationTimeoutMinutes(), @@ -203,6 +206,9 @@ Option Release() => Option LargeBubble() => new Option(new[] { "--large-bubble" }, "Assume all input files as part of one version bubble", new Argument()); + Option Composite() => + new Option(new[] { "--composite" }, "Compile tests in composite R2R mode", new Argument()); + Option Crossgen2Parallelism() => new Option(new[] { "--crossgen2-parallelism" }, "Max number of threads to use in Crossgen2 (default = logical processor count)", new Argument()); diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileFrameworkCommand.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileFrameworkCommand.cs index 96a6baaaa67a17..f52f54a6d6790c 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileFrameworkCommand.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileFrameworkCommand.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileFromCrossgenRspCommand.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileFromCrossgenRspCommand.cs index 1bf0cb8351440b..5c42e3e9aaff67 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileFromCrossgenRspCommand.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileFromCrossgenRspCommand.cs @@ -107,7 +107,7 @@ public static int CompileFromCrossgenRsp(BuildOptions options) List fileCompilations = new List(); foreach (CompilerRunner runner in compilerRunners) { - var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, responseFileOuputPath, crossgenArguments.InputFile)); + var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, responseFileOuputPath, new string[] { crossgenArguments.InputFile })); fileCompilations.Add(compilationProcess); } @@ -121,7 +121,7 @@ public static int CompileFromCrossgenRsp(BuildOptions options) success = false; compilationFailures++; - Console.WriteLine($"Failed compiling {compilationProcess.Parameters.InputFileName}"); + Console.WriteLine($"Failed compiling {compilationProcess.Parameters.OutputFileName}"); } } } diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileSubtreeCommand.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileSubtreeCommand.cs index 089bbf9460c5fb..40297da9b9522e 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileSubtreeCommand.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Commands/CompileSubtreeCommand.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/CompilerRunner.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/CompilerRunner.cs index 24320af9c90a6a..1ff43da0335de7 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/CompilerRunner.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/CompilerRunner.cs @@ -4,11 +4,9 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; using System.Text; -using Microsoft.Build.Logging; namespace ReadyToRun.SuperIlc { @@ -48,15 +46,14 @@ public CompilerRunner(BuildOptions options, IEnumerable referenceFolders protected virtual string CompilerPath => Path.Combine(_options.CoreRootDirectory.FullName, CompilerRelativePath, CompilerFileName); - protected abstract IEnumerable BuildCommandLineArguments(string assemblyFileName, string outputFileName); + protected abstract IEnumerable BuildCommandLineArguments(IEnumerable assemblyFileNames, string outputFileName); - public virtual ProcessParameters CompilationProcess(string outputRoot, string assemblyFileName) + public virtual ProcessParameters CompilationProcess(string outputFileName, IEnumerable inputAssemblyFileNames) { - CreateOutputFolder(outputRoot); + Directory.CreateDirectory(Path.GetDirectoryName(outputFileName)); - string outputFileName = GetOutputFileName(outputRoot, assemblyFileName); - string responseFile = GetResponseFileName(outputRoot, assemblyFileName); - var commandLineArgs = BuildCommandLineArguments(assemblyFileName, outputFileName); + string responseFile = outputFileName + ".rsp"; + var commandLineArgs = BuildCommandLineArguments(inputAssemblyFileNames, outputFileName); CreateResponseFile(responseFile, commandLineArgs); ProcessParameters processParameters = new ProcessParameters(); @@ -71,9 +68,13 @@ public virtual ProcessParameters CompilationProcess(string outputRoot, string as processParameters.TimeoutMilliseconds = ProcessParameters.DefaultIlcTimeout; } processParameters.LogPath = outputFileName + ".ilc.log"; - processParameters.InputFileName = assemblyFileName; + processParameters.InputFileNames = inputAssemblyFileNames; processParameters.OutputFileName = outputFileName; - processParameters.CompilationCostHeuristic = new FileInfo(assemblyFileName).Length; + + foreach (string inputAssembly in inputAssemblyFileNames) + { + processParameters.CompilationCostHeuristic += new FileInfo(inputAssembly).Length; + } return processParameters; } @@ -119,7 +120,7 @@ public ProcessParameters CompilationR2RDumpProcess(string compiledExecutable, bo param.Arguments = builder.ToString(); param.TimeoutMilliseconds = R2RDumpTimeoutMilliseconds; param.LogPath = compiledExecutable + (naked ? ".naked.r2r.log" : ".raw.r2r.log"); - param.InputFileName = compiledExecutable; + param.InputFileNames = new string[] { compiledExecutable }; param.OutputFileName = outputFileName; try { @@ -186,7 +187,7 @@ public virtual ProcessParameters ScriptExecutionProcess(string outputRoot, strin processParameters.Arguments = "-c " + scriptToRun; } - processParameters.InputFileName = scriptToRun; + processParameters.InputFileNames = new string[] { scriptToRun }; processParameters.OutputFileName = scriptToRun; processParameters.LogPath = scriptToRun + ".log"; processParameters.EnvironmentOverrides["CORE_ROOT"] = _options.CoreRootOutputPath(Index, isFramework: false); @@ -199,7 +200,7 @@ public virtual ProcessParameters AppExecutionProcess(string outputRoot, string a ProcessParameters processParameters = ExecutionProcess(modules, folders, _options.NoEtw); processParameters.ProcessPath = _options.CoreRunPath(Index, isFramework: false); processParameters.Arguments = exeToRun; - processParameters.InputFileName = exeToRun; + processParameters.InputFileNames = new string[] { exeToRun }; processParameters.OutputFileName = exeToRun; processParameters.LogPath = exeToRun + ".log"; processParameters.ExpectedExitCode = 100; @@ -248,19 +249,19 @@ public CompilerRunnerProcessConstructor(CompilerRunner runner) public class CompilationProcessConstructor : CompilerRunnerProcessConstructor { - private readonly string _outputRoot; - private readonly string _assemblyFileName; + private readonly string _outputFileName; + private readonly IEnumerable _inputAssemblyFileNames; - public CompilationProcessConstructor(CompilerRunner runner, string outputRoot, string assemblyFileName) + public CompilationProcessConstructor(CompilerRunner runner, string outputFileName, IEnumerable inputAssemblyFileNames) : base(runner) { - _outputRoot = outputRoot; - _assemblyFileName = assemblyFileName; + _outputFileName = outputFileName; + _inputAssemblyFileNames = inputAssemblyFileNames; } public override ProcessParameters Construct() { - return _runner.CompilationProcess(_outputRoot, _assemblyFileName); + return _runner.CompilationProcess(_outputFileName, _inputAssemblyFileNames); } } diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/CpaotRunner.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/CpaotRunner.cs index b65dd628a7f65b..f30e6217e3a81d 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/CpaotRunner.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/CpaotRunner.cs @@ -38,10 +38,13 @@ protected override ProcessParameters ExecutionProcess(IEnumerable module return processParameters; } - protected override IEnumerable BuildCommandLineArguments(string assemblyFileName, string outputFileName) + protected override IEnumerable BuildCommandLineArguments(IEnumerable assemblyFileNames, string outputFileName) { // The file to compile - yield return assemblyFileName; + foreach (string inputAssembly in assemblyFileNames) + { + yield return inputAssembly; + } // Output yield return $"-o:{outputFileName}"; @@ -59,19 +62,33 @@ protected override IEnumerable BuildCommandLineArguments(string assembly yield return "-O"; } - if (_options.LargeBubble) + if (_options.LargeBubble || _options.Composite) { yield return "--inputbubble"; } + if (_options.Composite) + { + yield return "--composite"; + } + if (_options.Crossgen2Parallelism != 0) { yield return $"--parallelism={_options.Crossgen2Parallelism}"; } - foreach (var reference in ComputeManagedAssemblies.GetManagedAssembliesInFolder(Path.GetDirectoryName(assemblyFileName))) + char referenceOption = (_options.Composite ? 'u' : 'r'); + HashSet uniqueFolders = new HashSet(); + foreach (string assemblyFileName in assemblyFileNames) { - yield return $"-r:{reference}"; + uniqueFolders.Add(Path.GetDirectoryName(assemblyFileName)); + } + foreach (string folder in uniqueFolders) + { + foreach (var reference in ComputeManagedAssemblies.GetManagedAssembliesInFolder(folder)) + { + yield return $"-{referenceOption}:{reference}"; + } } if (_resolvedReferences == null) @@ -87,12 +104,13 @@ protected override IEnumerable BuildCommandLineArguments(string assembly private List ResolveReferences() { + char referenceOption = (_options.Composite ? 'u' : 'r'); List references = new List(); foreach (var referenceFolder in _referenceFolders) { foreach (var reference in ComputeManagedAssemblies.GetManagedAssembliesInFolder(referenceFolder)) { - references.Add($"-r:{reference}"); + references.Add($"-{referenceOption}:{reference}"); } } return references; diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/CrossgenRunner.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/CrossgenRunner.cs index 610414637f307b..c483c472129b01 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/CrossgenRunner.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/CrossgenRunner.cs @@ -40,17 +40,22 @@ protected override ProcessParameters ExecutionProcess(IEnumerable module return processParameters; } - protected override IEnumerable BuildCommandLineArguments(string assemblyFileName, string outputFileName) + protected override IEnumerable BuildCommandLineArguments(IEnumerable assemblyFileNames, string outputFileName) { + if (assemblyFileNames.Count() > 1) + { + throw new NotImplementedException($@"Crossgen1 doesn't support composite build mode for compiling multiple input assemblies: {string.Join("; ", assemblyFileNames)}"); + } + // The file to compile yield return "/in"; - yield return assemblyFileName; + yield return assemblyFileNames.First(); // Output yield return "/out"; yield return outputFileName; - if (_options.LargeBubble && Path.GetFileNameWithoutExtension(assemblyFileName) != "System.Private.CoreLib") + if (_options.LargeBubble && Path.GetFileNameWithoutExtension(assemblyFileNames.First()) != "System.Private.CoreLib") { // There seems to be a bug in Crossgen on Linux we don't intend to fix - // it crashes when trying to compile S.P.C in large version bubble mode. @@ -59,7 +64,12 @@ protected override IEnumerable BuildCommandLineArguments(string assembly yield return "/platform_assemblies_paths"; - IEnumerable paths = new string[] { Path.GetDirectoryName(assemblyFileName) }.Concat(_referenceFolders); + HashSet paths = new HashSet(); + foreach (string assemblyFileName in assemblyFileNames) + { + paths.Add(Path.GetDirectoryName(assemblyFileName)); + } + paths.UnionWith(_referenceFolders); yield return paths.ConcatenatePaths(); } diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/JitRunner.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/JitRunner.cs index b1b2fd87ca6fa5..863c506925d92c 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/JitRunner.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/JitRunner.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -27,9 +27,14 @@ public JitRunner(BuildOptions options) /// JIT runner has no compilation process as it doesn't transform the source IL code in any manner. /// /// - public override ProcessParameters CompilationProcess(string outputRoot, string assemblyFileName) + public override ProcessParameters CompilationProcess(string outputFileName, IEnumerable inputAssemblyFileNames) { - File.Copy(assemblyFileName, GetOutputFileName(outputRoot, assemblyFileName), overwrite: true); + if (inputAssemblyFileNames.Count() != 1) + { + throw new Exception($@"JIT builder doesn't support composite mode for building input assemblies: {string.Join("; ", inputAssemblyFileNames)}"); + } + + File.Copy(inputAssemblyFileNames.First(), outputFileName, overwrite: true); return null; } @@ -40,7 +45,7 @@ protected override ProcessParameters ExecutionProcess(IEnumerable module return processParameters; } - protected override IEnumerable BuildCommandLineArguments(string assemblyFileName, string outputFileName) + protected override IEnumerable BuildCommandLineArguments(IEnumerable assemblyFileNames, string outputFileName) { // This should never get called as the overridden CompilationProcess returns null throw new NotImplementedException(); diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Linux.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Linux.cs index 595e85d5f6f772..4eee0c21656cbb 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Linux.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Linux.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/ParallelRunner.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/ParallelRunner.cs index cd23ade43c2f31..95b70bd174069c 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/ParallelRunner.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/ParallelRunner.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/PerfEventSourceListener.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/PerfEventSourceListener.cs index b952714c662d1b..e6113599731863 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/PerfEventSourceListener.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/PerfEventSourceListener.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/ProcessRunner.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/ProcessRunner.cs index bfe504b104dfd8..efa1533ae55e2c 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/ProcessRunner.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/ProcessRunner.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -32,7 +32,7 @@ public class ProcessParameters public string LogPath; public int TimeoutMilliseconds; public int ExpectedExitCode; - public string InputFileName; + public IEnumerable InputFileNames; public string OutputFileName; public long CompilationCostHeuristic; public bool CollectJittedMethods; diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Program.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Program.cs index 1bdbaa2cdf8441..6549fe49dd6d3d 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/Program.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/Program.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/ReadyToRun.SuperIlc.csproj b/src/coreclr/src/tools/ReadyToRun.SuperIlc/ReadyToRun.SuperIlc.csproj index 3cf0cbfe0848ee..f50925530593b1 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/ReadyToRun.SuperIlc.csproj +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/ReadyToRun.SuperIlc.csproj @@ -1,9 +1,10 @@ - + ReadyToRun.SuperIlc true Exe $(NetCoreAppCurrent) + netcoreapp3.0 8002,NU1701 AnyCPU $(BinDir)\ReadyToRun.SuperIlc diff --git a/src/coreclr/src/tools/ReadyToRun.SuperIlc/TestExclusion.cs b/src/coreclr/src/tools/ReadyToRun.SuperIlc/TestExclusion.cs index 3afcdc5ce66461..81c34704f44986 100644 --- a/src/coreclr/src/tools/ReadyToRun.SuperIlc/TestExclusion.cs +++ b/src/coreclr/src/tools/ReadyToRun.SuperIlc/TestExclusion.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen/CMakeLists.txt b/src/coreclr/src/tools/crossgen/CMakeLists.txt index 5e1a662f621d22..b4207f0d661a39 100644 --- a/src/coreclr/src/tools/crossgen/CMakeLists.txt +++ b/src/coreclr/src/tools/crossgen/CMakeLists.txt @@ -30,19 +30,28 @@ if(FEATURE_MERGE_JIT_AND_ENGINE) set(CLRJIT_CROSSGEN clrjit_crossgen) endif(FEATURE_MERGE_JIT_AND_ENGINE) +if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD) + # The following linked options can be inserted into the linker libraries list to + # ensure proper resolving of circular references between a subset of the libraries. + set(START_LIBRARY_GROUP -Wl,--start-group) + set(END_LIBRARY_GROUP -Wl,--end-group) +endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD) + target_link_libraries(crossgen + ${START_LIBRARY_GROUP} # Start group of libraries that have circular references cee_crossgen + v3binder_crossgen mdcompiler_crossgen mdruntime_crossgen mdruntimerw_crossgen mdhotdata_crossgen + ${END_LIBRARY_GROUP} # End group of libraries that have circular references corguids ${CLRJIT_CROSSGEN} gcinfo_crossgen corzap_crossgen mscorlib_crossgen utilcode_crossgen - v3binder_crossgen ) if(CLR_CMAKE_HOST_UNIX) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/IDependencyNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/IDependencyNode.cs index d67fbd504ecc84..71f07f3fb8e0b9 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/IDependencyNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/IDependencyNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj b/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj index 81f4d5d5fb6331..643455201ebbb7 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj @@ -1,4 +1,4 @@ - + Library ILCompiler.DependencyAnalysisFramework diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/PerfEventSource.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/PerfEventSource.cs index 604855dd0ac237..bfd79e1ecbc537 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/PerfEventSource.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/PerfEventSource.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs index a344bb261ccf6d..2da9f2400985cf 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Reflection.PortableExecutable; using ILCompiler.DependencyAnalysis.ReadyToRun; @@ -14,6 +15,7 @@ using ObjectData = ILCompiler.DependencyAnalysis.ObjectNode.ObjectData; using Internal.TypeSystem; +using Internal.TypeSystem.Ecma; using System.Security.Cryptography; namespace ILCompiler.DependencyAnalysis @@ -23,11 +25,33 @@ namespace ILCompiler.DependencyAnalysis /// internal class ReadyToRunObjectWriter { - // Nodefactory for which ObjectWriter is instantiated for. + /// + /// Nodefactory for which ObjectWriter is instantiated for. + /// private readonly NodeFactory _nodeFactory; + + /// + /// Output executable path. + /// private readonly string _objectFilePath; + + /// + /// Set to non-null when rewriting MSIL assemblies during composite R2R build; + /// we basically publish the input assemblies into the composite build output folder + /// using the same ReadyToRunObjectWriter as we're using for emitting the "actual" + /// R2R executable, just in this special mode in which we emit a minimal R2R header + /// with forwarding information pointing at the composite module with native code. + /// + private readonly EcmaModule _componentModule; + + /// + /// Nodes to emit into the output executable as collected by the dependency analysis. + /// private readonly IEnumerable _nodes; - private readonly PEReader _inputPeReader; + + /// + /// True when the executable generator should output a map file. + /// private readonly bool _generateMapFile; #if DEBUG @@ -48,12 +72,12 @@ public NodeInfo(ISymbolNode node, int nodeIndex, int symbolIndex) Dictionary _previouslyWrittenNodeNames = new Dictionary(); #endif - public ReadyToRunObjectWriter(PEReader inputPeReader, string objectFilePath, IEnumerable nodes, NodeFactory factory, bool generateMapFile) + public ReadyToRunObjectWriter(string objectFilePath, EcmaModule componentModule, IEnumerable nodes, NodeFactory factory, bool generateMapFile) { _objectFilePath = objectFilePath; + _componentModule = componentModule; _nodes = nodes; _nodeFactory = factory; - _inputPeReader = inputPeReader; _generateMapFile = generateMapFile; } @@ -79,10 +103,40 @@ public void EmitPortableExecutable() if (mapFile != null) mapFile.WriteLine($@"R2R object emission started: {DateTime.Now}"); + PEHeaderBuilder headerBuilder; + int timeDateStamp; + ISymbolNode r2rHeaderExportSymbol; + + if (_nodeFactory.CompilationModuleGroup.IsCompositeBuildMode && _componentModule == null) + { + headerBuilder = PEHeaderProvider.Create( + imageCharacteristics: Characteristics.ExecutableImage | Characteristics.Dll, + dllCharacteristics: default(DllCharacteristics), + Subsystem.Unknown, + _nodeFactory.Target); + // TODO: generate a non-zero timestamp: https://github.com/dotnet/runtime/issues/32507 + timeDateStamp = 0; + r2rHeaderExportSymbol = _nodeFactory.Header; + } + else + { + PEReader inputPeReader = (_componentModule != null ? _componentModule.PEReader : _nodeFactory.CompilationModuleGroup.CompilationModuleSet.First().PEReader); + headerBuilder = PEHeaderProvider.Copy(inputPeReader.PEHeaders, _nodeFactory.Target); + timeDateStamp = inputPeReader.PEHeaders.CoffHeader.TimeDateStamp; + r2rHeaderExportSymbol = null; + } + + Func getRuntimeFunctionsTable = null; + if (_componentModule == null) + { + getRuntimeFunctionsTable = GetRuntimeFunctionsTable; + } R2RPEBuilder r2rPeBuilder = new R2RPEBuilder( _nodeFactory.Target, - _inputPeReader, - GetRuntimeFunctionsTable); + headerBuilder, + r2rHeaderExportSymbol, + Path.GetFileName(_objectFilePath), + getRuntimeFunctionsTable); NativeDebugDirectoryEntryNode nativeDebugDirectoryEntryNode = null; @@ -131,8 +185,11 @@ public void EmitPortableExecutable() EmitObjectData(r2rPeBuilder, nodeContents, nodeIndex, name, node.Section, mapFile); } - r2rPeBuilder.SetCorHeader(_nodeFactory.CopiedCorHeaderNode, _nodeFactory.CopiedCorHeaderNode.Size); - r2rPeBuilder.SetDebugDirectory(_nodeFactory.DebugDirectoryNode, _nodeFactory.DebugDirectoryNode.Size); + if (!_nodeFactory.CompilationModuleGroup.IsCompositeBuildMode || _componentModule != null) + { + r2rPeBuilder.SetCorHeader(_nodeFactory.CopiedCorHeaderNode, _nodeFactory.CopiedCorHeaderNode.Size); + r2rPeBuilder.SetDebugDirectory(_nodeFactory.DebugDirectoryNode, _nodeFactory.DebugDirectoryNode.Size); + } if (_nodeFactory.Win32ResourcesNode != null) { @@ -142,7 +199,7 @@ public void EmitPortableExecutable() using (var peStream = File.Create(_objectFilePath)) { - r2rPeBuilder.Write(peStream); + r2rPeBuilder.Write(peStream, timeDateStamp); // Compute MD5 hash of the output image and store that in the native DebugDirectory entry using (var md5Hash = MD5.Create()) @@ -229,10 +286,10 @@ private void EmitObjectData(R2RPEBuilder r2rPeBuilder, ObjectData data, int node r2rPeBuilder.AddObjectData(data, section, name, mapFile); } - public static void EmitObject(PEReader inputPeReader, string objectFilePath, IEnumerable nodes, NodeFactory factory, bool generateMapFile) + public static void EmitObject(string objectFilePath, EcmaModule componentModule, IEnumerable nodes, NodeFactory factory, bool generateMapFile) { Console.WriteLine($@"Emitting R2R PE file: {objectFilePath}"); - ReadyToRunObjectWriter objectWriter = new ReadyToRunObjectWriter(inputPeReader, objectFilePath, nodes, factory, generateMapFile); + ReadyToRunObjectWriter objectWriter = new ReadyToRunObjectWriter(objectFilePath, componentModule, nodes, factory, generateMapFile); objectWriter.EmitPortableExecutable(); } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/CompilationModuleGroup.ReadyToRun.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/CompilationModuleGroup.ReadyToRun.cs index ec9e47e49a83e5..83fc679d826e5b 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/CompilationModuleGroup.ReadyToRun.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/CompilationModuleGroup.ReadyToRun.cs @@ -1,10 +1,13 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Internal.TypeSystem; using ILCompiler.DependencyAnalysis.ReadyToRun; using Internal.ReadyToRunConstants; +using Internal.TypeSystem.Ecma; +using System.Collections.Generic; +using System.Linq; namespace ILCompiler { @@ -58,5 +61,25 @@ partial class CompilationModuleGroup /// Gets the flags to be stored in the generated ReadyToRun module header. /// public abstract ReadyToRunFlags GetReadyToRunFlags(); + + /// + /// When set to true, unconditionally add module overrides to all signatures. This is needed in composite + /// build mode so that import cells and instance entry point table are caller module-agnostic. + /// + public bool EnforceOwningType(EcmaModule module) + { + return IsCompositeBuildMode || module != CompilationModuleSet.Single(); + } + + /// + /// Returns true when the compiler is running in composite build mode i.e. building an arbitrary number of + /// input MSIL assemblies into a single output R2R binary. + /// + public abstract bool IsCompositeBuildMode { get; } + + /// + /// List of input modules to use for the compilation. + /// + public abstract IEnumerable CompilationModuleSet { get; } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ArrayOfEmbeddedPointersNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ArrayOfEmbeddedPointersNode.cs index ed4ce4a7281a62..b70ed3378277c7 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ArrayOfEmbeddedPointersNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ArrayOfEmbeddedPointersNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/EmbeddedPointerIndirectionNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/EmbeddedPointerIndirectionNode.cs index 5488801a39f537..0b12be37e7bf04 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/EmbeddedPointerIndirectionNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/EmbeddedPointerIndirectionNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs index dae97d5d591781..abc90394c1ab07 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/AssemblyTableNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/AssemblyTableNode.cs new file mode 100644 index 00000000000000..9a0bdb248e114b --- /dev/null +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/AssemblyTableNode.cs @@ -0,0 +1,59 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Reflection.Metadata.Ecma335; + +using Internal.JitInterface; +using Internal.NativeFormat; +using Internal.Runtime; +using Internal.Text; +using Internal.TypeSystem; +using Internal.TypeSystem.Ecma; + +namespace ILCompiler.DependencyAnalysis.ReadyToRun +{ + public class AssemblyTableNode : HeaderTableNode + { + private readonly List _assemblyHeaders; + + public AssemblyTableNode(TargetDetails target) + : base(target) + { + _assemblyHeaders = new List(); + } + + public void Add(AssemblyHeaderNode componentAssemblyHeader) + { + _assemblyHeaders.Add(componentAssemblyHeader); + } + + public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) + { + sb.Append(nameMangler.CompilationUnitPrefix); + sb.Append("__ReadyToRunAssemblyTable"); + } + + public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) + { + ObjectDataBuilder builder = new ObjectDataBuilder(factory, relocsOnly); + builder.AddSymbol(this); + foreach (AssemblyHeaderNode assemblyHeader in _assemblyHeaders) + { + // TODO: IMAGE_DATA_DIRECTORY CorHeader - no support for embedded MSIL yet + builder.EmitInt(0); + builder.EmitInt(0); + // IMAGE_DATA_DIRECTORY ReadyToRunHeader + builder.EmitReloc(assemblyHeader, RelocType.IMAGE_REL_BASED_ADDR32NB); + builder.EmitReloc(assemblyHeader, RelocType.IMAGE_REL_SYMBOL_SIZE); + } + return builder.ToObjectData(); + } + + public override int ClassCode => 513314416; + } +} diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/AttributePresenceFilterNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/AttributePresenceFilterNode.cs index b7dc1a09ab167b..eef7490513a059 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/AttributePresenceFilterNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/AttributePresenceFilterNode.cs @@ -29,7 +29,8 @@ public AttributePresenceFilterNode(EcmaModule module) public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { sb.Append(nameMangler.CompilationUnitPrefix); - sb.Append("__ReadyToRunAttributePresenceFilter"); + sb.Append("__ReadyToRunAttributePresenceFilter__"); + sb.Append(_module.Assembly.GetName().Name); } private struct CustomAttributeEntry diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CompilerIdentifierNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CompilerIdentifierNode.cs index 834eb3d68eaa47..f97c5f29870738 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CompilerIdentifierNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CompilerIdentifierNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedCorHeaderNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedCorHeaderNode.cs index 9f1d4df20d5e5f..5e7a96afa4c716 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedCorHeaderNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedCorHeaderNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedFieldRvaNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedFieldRvaNode.cs index 25448fc1c8463b..ca3ca21435d0e3 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedFieldRvaNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedFieldRvaNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedManagedResourcesNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedManagedResourcesNode.cs index bbb19eb5c19f23..840cb8e5927c25 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedManagedResourcesNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedManagedResourcesNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMetadataBlobNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMetadataBlobNode.cs index 6f4f4207fd7aa6..4160a9e5e3f3cb 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMetadataBlobNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMetadataBlobNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMethodILNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMethodILNode.cs index 2e1056bbbdc39d..a13d18f125ae41 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMethodILNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMethodILNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedStrongNameSignatureNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedStrongNameSignatureNode.cs index 8452b859267039..ee6067260adaa0 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedStrongNameSignatureNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedStrongNameSignatureNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryEntryNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryEntryNode.cs index 2dc71bde928c19..e88b2805d73694 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryEntryNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryEntryNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryNode.cs index 017428edceabe0..52e49afe79828f 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugInfoTableNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugInfoTableNode.cs index 88318348932074..68f04436441446 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugInfoTableNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugInfoTableNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadHelperImport.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadHelperImport.cs index 75a7bf527e8a27..df834649fdc5fd 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadHelperImport.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadHelperImport.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadHelperMethodImport.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadHelperMethodImport.cs index 82af06eee32500..dbf106844ed7d3 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadHelperMethodImport.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadHelperMethodImport.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -22,8 +22,6 @@ public class DelayLoadHelperMethodImport : DelayLoadHelperImport, IMethodNode private readonly bool _useInstantiatingStub; - private readonly SignatureContext _signatureContext; - public DelayLoadHelperMethodImport( NodeFactory factory, ImportSectionNode importSectionNode, @@ -32,13 +30,11 @@ public DelayLoadHelperMethodImport( bool useVirtualCall, bool useInstantiatingStub, Signature instanceSignature, - SignatureContext signatureContext, string callSite = null) : base(factory, importSectionNode, helper, instanceSignature, useVirtualCall, callSite) { _method = method; _useInstantiatingStub = useInstantiatingStub; - _signatureContext = signatureContext; } public override IEnumerable GetStaticDependencies(NodeFactory factory) @@ -55,8 +51,7 @@ public override IEnumerable GetStaticDependencies(NodeFacto new MethodWithToken(canonMethod, _method.Token, constrainedType: null), isUnboxingStub: false, isInstantiatingStub: false, - isPrecodeImportRequired: false, - signatureContext: _signatureContext); + isPrecodeImportRequired: false); yield return new DependencyListEntry(canonMethodNode, "Canonical method for instantiating stub"); } } @@ -72,10 +67,6 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer if (result != 0) return result; - result = _signatureContext.CompareTo(otherNode._signatureContext, comparer); - if (result != 0) - return result; - result = _method.CompareTo(otherNode._method, comparer); if (result != 0) return result; diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelegateCtorSignature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelegateCtorSignature.cs index f81d55920f5768..4a3566fbdcab88 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelegateCtorSignature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelegateCtorSignature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -17,22 +17,19 @@ public class DelegateCtorSignature : Signature private readonly ModuleToken _methodToken; - private readonly SignatureContext _signatureContext; - public DelegateCtorSignature( TypeDesc delegateType, IMethodNode targetMethod, - ModuleToken methodToken, - SignatureContext signatureContext) + ModuleToken methodToken) { _delegateType = delegateType; _targetMethod = targetMethod; _methodToken = methodToken; - _signatureContext = signatureContext; // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature - signatureContext.Resolver.CompilerContext.EnsureLoadableType(delegateType); - signatureContext.Resolver.CompilerContext.EnsureLoadableMethod(targetMethod.Method); + CompilerTypeSystemContext compilerContext = (CompilerTypeSystemContext)delegateType.Context; + compilerContext.EnsureLoadableType(delegateType); + compilerContext.EnsureLoadableMethod(targetMethod.Method); } public override int ClassCode => 99885741; @@ -44,7 +41,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) if (!relocsOnly) { - SignatureContext innerContext = builder.EmitFixup(factory, ReadyToRunFixupKind.DelegateCtor, _methodToken.Module, _signatureContext); + SignatureContext innerContext = builder.EmitFixup(factory, ReadyToRunFixupKind.DelegateCtor, _methodToken.Module, factory.SignatureContext); builder.EmitMethodSignature( new MethodWithToken(_targetMethod.Method, _methodToken, constrainedType: null), @@ -93,11 +90,7 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer if (result != 0) return result; - result = _methodToken.CompareTo(otherNode._methodToken); - if (result != 0) - return result; - - return _signatureContext.CompareTo(otherNode._signatureContext, comparer); + return _methodToken.CompareTo(otherNode._methodToken); } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DevirtualizationManager.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DevirtualizationManager.cs index 793406c46bcb07..ed34d69a27ed52 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DevirtualizationManager.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DevirtualizationManager.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExceptionInfoLookupTableNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExceptionInfoLookupTableNode.cs index 702b668cd14cb6..ecef116e6a0817 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExceptionInfoLookupTableNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExceptionInfoLookupTableNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExternalMethodImport.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExternalMethodImport.cs index a1e6ff1132af8e..1e57fe0312dd0d 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExternalMethodImport.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExternalMethodImport.cs @@ -1,4 +1,4 @@ - + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -18,8 +18,7 @@ public ExternalMethodImport( ReadyToRunFixupKind fixupKind, MethodWithToken method, bool isUnboxingStub, - bool isInstantiatingStub, - SignatureContext signatureContext) + bool isInstantiatingStub) : base( factory, factory.MethodImports, @@ -28,8 +27,7 @@ public ExternalMethodImport( fixupKind, method, isUnboxingStub, - isInstantiatingStub, - signatureContext)) + isInstantiatingStub)) { _method = method; } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/FieldFixupSignature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/FieldFixupSignature.cs index 0d09d4c54e735e..32cae03ba4016c 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/FieldFixupSignature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/FieldFixupSignature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -18,16 +18,13 @@ public class FieldFixupSignature : Signature private readonly FieldDesc _fieldDesc; - private readonly SignatureContext _signatureContext; - - public FieldFixupSignature(ReadyToRunFixupKind fixupKind, FieldDesc fieldDesc, SignatureContext signatureContext) + public FieldFixupSignature(ReadyToRunFixupKind fixupKind, FieldDesc fieldDesc) { _fixupKind = fixupKind; _fieldDesc = fieldDesc; - _signatureContext = signatureContext; // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature - signatureContext.Resolver.CompilerContext.EnsureLoadableType(fieldDesc.OwningType); + ((CompilerTypeSystemContext)fieldDesc.Context).EnsureLoadableType(fieldDesc.OwningType); } public override int ClassCode => 271828182; @@ -40,8 +37,8 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { dataBuilder.AddSymbol(this); - EcmaModule targetModule = _signatureContext.GetTargetModule(_fieldDesc); - SignatureContext innerContext = dataBuilder.EmitFixup(factory, _fixupKind, targetModule, _signatureContext); + EcmaModule targetModule = factory.SignatureContext.GetTargetModule(_fieldDesc); + SignatureContext innerContext = dataBuilder.EmitFixup(factory, _fixupKind, targetModule, factory.SignatureContext); dataBuilder.EmitFieldSignature(_fieldDesc, innerContext); } @@ -62,11 +59,7 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer if (result != 0) return result; - result = comparer.Compare(_fieldDesc, otherNode._fieldDesc); - if (result != 0) - return result; - - return _signatureContext.CompareTo(otherNode._signatureContext, comparer); + return comparer.Compare(_fieldDesc, otherNode._fieldDesc); } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs index fb434dea4b417b..5f2767c51a63b5 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapNode.cs index 5a4147fb56c716..1a7c9ccbb3d8ee 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GenericLookupSignature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GenericLookupSignature.cs index 04c12f8845b68f..a0aa10fe80c5ce 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GenericLookupSignature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GenericLookupSignature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -27,16 +27,13 @@ public class GenericLookupSignature : Signature private readonly GenericContext _methodContext; - private readonly SignatureContext _signatureContext; - public GenericLookupSignature( CORINFO_RUNTIME_LOOKUP_KIND runtimeLookupKind, ReadyToRunFixupKind fixupKind, TypeDesc typeArgument, MethodWithToken methodArgument, FieldDesc fieldArgument, - GenericContext methodContext, - SignatureContext signatureContext) + GenericContext methodContext) { Debug.Assert(typeArgument != null || methodArgument != null || fieldArgument != null); _runtimeLookupKind = runtimeLookupKind; @@ -45,7 +42,6 @@ public GenericLookupSignature( _methodArgument = methodArgument; _fieldArgument = fieldArgument; _methodContext = methodContext; - _signatureContext = signatureContext; } public override int ClassCode => 258608008; @@ -65,11 +61,11 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) } else if (_typeArgument != null) { - targetModule = _signatureContext.GetTargetModule(_typeArgument); + targetModule = factory.SignatureContext.GetTargetModule(_typeArgument); } else if (_fieldArgument != null) { - targetModule = _signatureContext.GetTargetModule(_fieldArgument); + targetModule = factory.SignatureContext.GetTargetModule(_fieldArgument); } else { @@ -101,7 +97,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) ObjectDataSignatureBuilder dataBuilder = new ObjectDataSignatureBuilder(); dataBuilder.AddSymbol(this); - SignatureContext innerContext = dataBuilder.EmitFixup(factory, fixupToEmit, targetModule, _signatureContext); + SignatureContext innerContext = dataBuilder.EmitFixup(factory, fixupToEmit, targetModule, factory.SignatureContext); if (contextTypeToEmit != null) { dataBuilder.EmitTypeSignature(contextTypeToEmit, innerContext); @@ -214,11 +210,7 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer return result; } - result = comparer.Compare(_methodContext.ContextMethod, otherNode._methodContext.ContextMethod); - if (result != 0) - return result; - - return _signatureContext.CompareTo(otherNode._signatureContext, comparer); + return comparer.Compare(_methodContext.ContextMethod, otherNode._methodContext.ContextMethod); } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs index 54ba55dd927c4c..f157900c9665f9 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs @@ -42,7 +42,7 @@ public override ObjectNodeSection Section } } - public class HeaderNode : ObjectNode, ISymbolDefinitionNode + public abstract class HeaderNode : ObjectNode, ISymbolDefinitionNode { struct HeaderItem { @@ -73,16 +73,15 @@ public void Add(ReadyToRunSectionType id, ObjectNode node, ISymbolNode startSymb _items.Add(new HeaderItem(id, node, startSymbol)); } - public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) - { - sb.Append(nameMangler.CompilationUnitPrefix); - sb.Append("__ReadyToRunHeader"); - } public int Offset => 0; public override bool IsShareable => false; protected override string GetName(NodeFactory factory) => this.GetMangledName(factory.NameMangler); + protected abstract void AppendMangledHeaderName(NameMangler nameMangler, Utf8StringBuilder sb); + + public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) => AppendMangledHeaderName(nameMangler, sb); + public override bool StaticDependenciesAreComputed => true; public override ObjectNodeSection Section @@ -102,23 +101,18 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) builder.RequireInitialPointerAlignment(); builder.AddSymbol(this); + EmitHeaderPrefix(ref builder); + // Don't bother sorting if we're not emitting the contents if (!relocsOnly) _items.Sort((x, y) => Comparer.Default.Compare((int)x.Id, (int)y.Id)); - // ReadyToRunHeader.Magic - builder.EmitInt((int)(ReadyToRunHeaderConstants.Signature)); - - // ReadyToRunHeader.MajorVersion - builder.EmitShort((short)(ReadyToRunHeaderConstants.CurrentMajorVersion)); - builder.EmitShort((short)(ReadyToRunHeaderConstants.CurrentMinorVersion)); - // ReadyToRunHeader.Flags builder.EmitInt((int)_flags); // ReadyToRunHeader.NumberOfSections ObjectDataBuilder.Reservation sectionCountReservation = builder.ReserveInt(); - + int count = 0; foreach (var item in _items) { @@ -127,20 +121,75 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) continue; builder.EmitInt((int)item.Id); - + builder.EmitReloc(item.StartSymbol, RelocType.IMAGE_REL_BASED_ADDR32NB); builder.EmitReloc(item.StartSymbol, RelocType.IMAGE_REL_SYMBOL_SIZE); - + count++; } builder.EmitInt(sectionCountReservation, count); - + return builder.ToObjectData(); } + protected abstract void EmitHeaderPrefix(ref ObjectDataBuilder builder); + protected internal override int Phase => (int)ObjectNodePhase.Ordered; + } + + public class GlobalHeaderNode : HeaderNode + { + public GlobalHeaderNode(TargetDetails target, ReadyToRunFlags flags) + : base(target, flags) + { + } + + protected override void AppendMangledHeaderName(NameMangler nameMangler, Utf8StringBuilder sb) + { + sb.Append(nameMangler.CompilationUnitPrefix); + sb.Append("__ReadyToRunHeader"); + } + + protected override void EmitHeaderPrefix(ref ObjectDataBuilder builder) + { + // ReadyToRunHeader.Magic + builder.EmitInt((int)(ReadyToRunHeaderConstants.Signature)); + + // ReadyToRunHeader.MajorVersion + builder.EmitShort((short)(ReadyToRunHeaderConstants.CurrentMajorVersion)); + builder.EmitShort((short)(ReadyToRunHeaderConstants.CurrentMinorVersion)); + } public override int ClassCode => (int)ObjectNodeOrder.ReadyToRunHeaderNode; } + + public class AssemblyHeaderNode : HeaderNode + { + private readonly int _index; + + public AssemblyHeaderNode(TargetDetails target, ReadyToRunFlags flags, int index) + : base(target, flags) + { + _index = index; + } + + protected override void EmitHeaderPrefix(ref ObjectDataBuilder builder) + { + } + + public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) + { + return _index - ((AssemblyHeaderNode)other)._index; + } + + protected override void AppendMangledHeaderName(NameMangler nameMangler, Utf8StringBuilder sb) + { + sb.Append(nameMangler.CompilationUnitPrefix); + sb.Append("__ReadyToRunAssemblyHeader__"); + sb.Append(_index.ToString()); + } + + public override int ClassCode => (int)ObjectNodeOrder.ReadyToRunAssemblyHeaderNode; + } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/IReadyToRunMethodCodeNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/IReadyToRunMethodCodeNode.cs index 277d416c6ef77c..2241f09659447b 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/IReadyToRunMethodCodeNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/IReadyToRunMethodCodeNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Import.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Import.cs index 666cd93ef77088..e276c75fa77185 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Import.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Import.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportSectionNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportSectionNode.cs index 22e6231a00ed2a..8f929b2b30e1a4 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportSectionNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportSectionNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportThunk.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportThunk.cs index 33779ba227c7a8..d54472dc122e9a 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportThunk.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportThunk.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InliningInfoNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InliningInfoNode.cs index ce57611186494c..89eb57a871e069 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InliningInfoNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InliningInfoNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -20,18 +20,19 @@ namespace ILCompiler.DependencyAnalysis.ReadyToRun /// public class InliningInfoNode : HeaderTableNode { - private readonly EcmaModule _globalContext; + private readonly EcmaModule _module; - public InliningInfoNode(TargetDetails target, EcmaModule globalContext) + public InliningInfoNode(TargetDetails target, EcmaModule module) : base(target) { - _globalContext = globalContext; + _module = module; } public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { sb.Append(nameMangler.CompilationUnitPrefix); - sb.Append("__ReadyToRunInliningInfoTable"); + sb.Append("__ReadyToRunInliningInfoTable__"); + sb.Append(_module.Assembly.GetName().Name); } public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) @@ -48,7 +49,12 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { MethodDesc[] inlinees = methodNode.InlinedMethods; MethodDesc inliner = methodNode.Method; - MethodDesc inlinerDefinition = inliner.GetTypicalMethodDefinition(); + EcmaMethod inlinerDefinition = (EcmaMethod)inliner.GetTypicalMethodDefinition(); + if (inlinerDefinition.Module != _module) + { + // Only encode inlining info for inliners within the active module + continue; + } foreach (MethodDesc inlinee in inlinees) { @@ -91,7 +97,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) var sig = new VertexSequence(); - bool isForeignInlinee = inlinee.Module != _globalContext; + bool isForeignInlinee = inlinee.Module != _module; sig.Append(new UnsignedConstant((uint)(inlineeRid << 1 | (isForeignInlinee ? 1 : 0)))); if (isForeignInlinee) { @@ -123,7 +129,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) int ridDelta = inlinerRid - baseRid; baseRid = inlinerRid; Debug.Assert(ridDelta >= 0); - bool isForeignInliner = inliner.Module != _globalContext; + bool isForeignInliner = inliner.Module != _module; sig.Append(new UnsignedConstant((uint)(ridDelta << 1 | (isForeignInliner ? 1 : 0)))); if (isForeignInliner) { @@ -144,6 +150,12 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) definedSymbols: new ISymbolDefinitionNode[] { this }); } + public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) + { + InliningInfoNode otherInliningInfo = (InliningInfoNode)other; + return _module.Assembly.GetName().Name.CompareTo(otherInliningInfo._module.Assembly.GetName().Name); + } + public override int ClassCode => -87382891; } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InstanceEntryPointTableNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InstanceEntryPointTableNode.cs index 148853d802d2e6..6bb6ade90cebee 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InstanceEntryPointTableNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InstanceEntryPointTableNode.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Reflection.Metadata.Ecma335; using Internal.JitInterface; @@ -19,9 +20,12 @@ namespace ILCompiler.DependencyAnalysis.ReadyToRun { public class InstanceEntryPointTableNode : HeaderTableNode { - public InstanceEntryPointTableNode(TargetDetails target) - : base(target) + private readonly NodeFactory _factory; + + public InstanceEntryPointTableNode(NodeFactory factory) + : base(factory.Target) { + _factory = factory; } public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) @@ -52,20 +56,17 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { int methodIndex = factory.RuntimeFunctionsTable.GetIndex(method); - bool enforceOwningType = false; - ModuleToken moduleToken = method.SignatureContext.GetModuleTokenForMethod(method.Method.GetTypicalMethodDefinition()); - if (moduleToken.Module != factory.InputModuleContext.GlobalContext) - { - enforceOwningType = true; - } + // In composite R2R format, always enforce owning type to let us share generic instantiations among modules + EcmaMethod typicalMethod = (EcmaMethod)method.Method.GetTypicalMethodDefinition(); + ModuleToken moduleToken = new ModuleToken(typicalMethod.Module, typicalMethod.Handle); ArraySignatureBuilder signatureBuilder = new ArraySignatureBuilder(); signatureBuilder.EmitMethodSignature( new MethodWithToken(method.Method, moduleToken, constrainedType: null), enforceDefEncoding: true, - enforceOwningType, - method.SignatureContext, - isUnboxingStub: false, + enforceOwningType: _factory.CompilationModuleGroup.EnforceOwningType(moduleToken.Module), + factory.SignatureContext, + isUnboxingStub: false, isInstantiatingStub: false); byte[] signature = signatureBuilder.ToArray(); BlobVertex signatureBlob; diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/LocalMethodImport.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/LocalMethodImport.cs index aa0a8b60344493..cfc5b3075cabea 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/LocalMethodImport.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/LocalMethodImport.cs @@ -1,4 +1,4 @@ - + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -21,8 +21,7 @@ public LocalMethodImport( MethodWithToken method, MethodWithGCInfo localMethod, bool isUnboxingStub, - bool isInstantiatingStub, - SignatureContext signatureContext) + bool isInstantiatingStub) : base( factory, factory.MethodImports, @@ -31,8 +30,7 @@ public LocalMethodImport( fixupKind, method, isUnboxingStub, - isInstantiatingStub, - signatureContext)) + isInstantiatingStub)) { _localMethod = localMethod; } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ManifestMetadataTableNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ManifestMetadataTableNode.cs index 899b58ad23cc58..73ce2bfe03fcb4 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ManifestMetadataTableNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ManifestMetadataTableNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -10,6 +10,7 @@ using System.Reflection.Metadata.Ecma335; using Internal.Text; +using Internal.TypeSystem; using Internal.TypeSystem.Ecma; using Debug = System.Diagnostics.Debug; @@ -41,7 +42,6 @@ public class ManifestMetadataTableNode : HeaderTableNode /// private readonly Dictionary _moduleIdToAssemblyNameMap; - /// /// Registered signature emitters. /// @@ -62,37 +62,49 @@ public class ManifestMetadataTableNode : HeaderTableNode /// private bool _emissionCompleted; - /// - /// Name of the input assembly. - /// - private string _inputModuleName; - /// /// Node factory for the compilation /// private readonly NodeFactory _nodeFactory; - public ManifestMetadataTableNode(EcmaModule inputModule, NodeFactory nodeFactory) - : base(inputModule.Context.Target) + public ManifestMetadataTableNode(NodeFactory nodeFactory) + : base(nodeFactory.Target) { _assemblyRefToModuleIdMap = new Dictionary(); _moduleIdToAssemblyNameMap = new Dictionary(); _signatureEmitters = new List(); _nodeFactory = nodeFactory; - _inputModuleName = inputModule.Assembly.GetName().Name; - - _assemblyRefCount = inputModule.MetadataReader.GetTableRowCount(TableIndex.AssemblyRef); - for (int assemblyRefIndex = 1; assemblyRefIndex <= _assemblyRefCount; assemblyRefIndex++) + if (!_nodeFactory.CompilationModuleGroup.IsCompositeBuildMode) { - AssemblyReferenceHandle assemblyRefHandle = MetadataTokens.AssemblyReferenceHandle(assemblyRefIndex); - AssemblyReference assemblyRef = inputModule.MetadataReader.GetAssemblyReference(assemblyRefHandle); - string assemblyName = inputModule.MetadataReader.GetString(assemblyRef.Name); - _assemblyRefToModuleIdMap[assemblyName] = assemblyRefIndex; + MetadataReader mdReader = _nodeFactory.CompilationModuleGroup.CompilationModuleSet.Single().MetadataReader; + _assemblyRefCount = mdReader.GetTableRowCount(TableIndex.AssemblyRef); + for (int assemblyRefIndex = 1; assemblyRefIndex <= _assemblyRefCount; assemblyRefIndex++) + { + AssemblyReferenceHandle assemblyRefHandle = MetadataTokens.AssemblyReferenceHandle(assemblyRefIndex); + AssemblyReference assemblyRef = mdReader.GetAssemblyReference(assemblyRefHandle); + string assemblyName = mdReader.GetString(assemblyRef.Name); + _assemblyRefToModuleIdMap[assemblyName] = assemblyRefIndex; + } } // AssemblyRefCount + 1 corresponds to ROWID 0 in the manifest metadata _nextModuleId = _assemblyRefCount + 2; + + if (_nodeFactory.CompilationModuleGroup.IsCompositeBuildMode) + { + // Fill in entries for all input modules right away to make sure they have parallel indices + int nextExpectedId = 2; + foreach (EcmaModule inputModule in _nodeFactory.CompilationModuleGroup.CompilationModuleSet) + { + int acquiredId = ModuleToIndexInternal(inputModule); + if (acquiredId != nextExpectedId) + { + throw new InternalCompilerErrorException($"Manifest metadata consistency error - acquired ID {acquiredId}, expected {nextExpectedId}"); + } + nextExpectedId++; + } + } } public void RegisterEmitter(ISignatureEmitter emitter) @@ -109,6 +121,11 @@ public int ModuleToIndex(EcmaModule module) throw new InvalidOperationException("Cannot get ModuleToIndex mapping until marking is complete."); } + return ModuleToIndexInternal(module); + } + + private int ModuleToIndexInternal(EcmaModule module) + { AssemblyName assemblyName = module.Assembly.GetName(); int assemblyRefIndex; if (!_assemblyRefToModuleIdMap.TryGetValue(assemblyName.Name, out assemblyRefIndex)) @@ -159,8 +176,9 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) MetadataBuilder metadataBuilder = new MetadataBuilder(); + string manifestMetadataAssemblyName = "ManifestMetadata"; metadataBuilder.AddAssembly( - metadataBuilder.GetOrAddString(_inputModuleName), + metadataBuilder.GetOrAddString(manifestMetadataAssemblyName), new Version(0, 0, 0, 0), culture: default(StringHandle), publicKey: default(BlobHandle), @@ -169,17 +187,17 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) metadataBuilder.AddModule( 0, - metadataBuilder.GetOrAddString(_inputModuleName), + metadataBuilder.GetOrAddString(manifestMetadataAssemblyName), default(GuidHandle), default(GuidHandle), default(GuidHandle)); // Module type metadataBuilder.AddTypeDefinition( - default(TypeAttributes), - default(StringHandle), - metadataBuilder.GetOrAddString(""), - baseType: default(EntityHandle), - fieldList: MetadataTokens.FieldDefinitionHandle(1), - methodList: MetadataTokens.MethodDefinitionHandle(1)); + default(TypeAttributes), + default(StringHandle), + metadataBuilder.GetOrAddString(""), + baseType: default(EntityHandle), + fieldList: MetadataTokens.FieldDefinitionHandle(1), + methodList: MetadataTokens.MethodDefinitionHandle(1)); foreach (var idAndAssemblyName in _moduleIdToAssemblyNameMap.OrderBy(x => x.Key)) { diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodEntryPointTableNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodEntryPointTableNode.cs index 6bbfc6324f3771..0df4157babc596 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodEntryPointTableNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodEntryPointTableNode.cs @@ -18,6 +18,8 @@ namespace ILCompiler.DependencyAnalysis.ReadyToRun { public class MethodEntryPointTableNode : HeaderTableNode { + private readonly EcmaModule _module; + private struct EntryPoint { public static EntryPoint Null = new EntryPoint(-1, null); @@ -34,15 +36,17 @@ public EntryPoint(int methodIndex, MethodWithGCInfo method) } } - public MethodEntryPointTableNode(TargetDetails target) + public MethodEntryPointTableNode(EcmaModule module, TargetDetails target) : base(target) { + _module = module; } public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { sb.Append(nameMangler.CompilationUnitPrefix); - sb.Append("__ReadyToRunMethodEntryPointTable"); + sb.Append("__ReadyToRunMethodEntryPointTable__"); + sb.Append(_module.Assembly.GetName().Name); } public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) @@ -56,7 +60,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) foreach (MethodWithGCInfo method in factory.EnumerateCompiledMethods()) { - if (method.Method is EcmaMethod ecmaMethod) + if (method.Method is EcmaMethod ecmaMethod && ecmaMethod.Module == _module) { // Strip away the token type bits, keep just the low 24 bits RID uint rid = SignatureBuilder.RidFromToken((mdToken)MetadataTokens.GetToken(ecmaMethod.Handle)); @@ -112,6 +116,13 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) alignment: 8, definedSymbols: new ISymbolDefinitionNode[] { this }); } + + public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) + { + MethodEntryPointTableNode otherMethodEntryPointTable = (MethodEntryPointTableNode)other; + return _module.Assembly.GetName().Name.CompareTo(otherMethodEntryPointTable._module.Assembly.GetName().Name); + } + protected internal override int Phase => (int)ObjectNodePhase.Ordered; public override int ClassCode => (int)ObjectNodeOrder.MethodEntrypointTableNode; } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodFixupSignature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodFixupSignature.cs index 9db96bd3281a66..7461e662a291cb 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodFixupSignature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodFixupSignature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -19,8 +19,6 @@ public class MethodFixupSignature : Signature private readonly MethodWithToken _method; - private readonly SignatureContext _signatureContext; - private readonly bool _isUnboxingStub; private readonly bool _isInstantiatingStub; @@ -28,20 +26,19 @@ public class MethodFixupSignature : Signature public MethodFixupSignature( ReadyToRunFixupKind fixupKind, MethodWithToken method, - SignatureContext signatureContext, bool isUnboxingStub, bool isInstantiatingStub) { _fixupKind = fixupKind; _method = method; - _signatureContext = signatureContext; _isUnboxingStub = isUnboxingStub; _isInstantiatingStub = isInstantiatingStub; // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature - signatureContext.Resolver.CompilerContext.EnsureLoadableMethod(method.Method); + CompilerTypeSystemContext compilerContext = (CompilerTypeSystemContext)method.Method.Context; + compilerContext.EnsureLoadableMethod(method.Method); if (method.ConstrainedType != null) - signatureContext.Resolver.CompilerContext.EnsureLoadableType(method.ConstrainedType); + compilerContext.EnsureLoadableType(method.ConstrainedType); } public MethodDesc Method => _method.Method; @@ -88,18 +85,18 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { if (method.Token.TokenType == CorTokenType.mdtMethodSpec) { - method = new MethodWithToken(method.Method, _signatureContext.GetModuleTokenForMethod(method.Method, throwIfNotFound: false), method.ConstrainedType); + method = new MethodWithToken(method.Method, factory.SignatureContext.GetModuleTokenForMethod(method.Method, throwIfNotFound: false), method.ConstrainedType); } else if (!optimized && (method.Token.TokenType == CorTokenType.mdtMemberRef)) { if (method.Method.OwningType.GetTypeDefinition() is EcmaType) { - method = new MethodWithToken(method.Method, _signatureContext.GetModuleTokenForMethod(method.Method, throwIfNotFound: false), method.ConstrainedType); + method = new MethodWithToken(method.Method, factory.SignatureContext.GetModuleTokenForMethod(method.Method, throwIfNotFound: false), method.ConstrainedType); } } } - SignatureContext innerContext = dataBuilder.EmitFixup(factory, fixupKind, method.Token.Module, _signatureContext); + SignatureContext innerContext = dataBuilder.EmitFixup(factory, fixupKind, method.Token.Module, factory.SignatureContext); if (optimized && method.Token.TokenType == CorTokenType.mdtMethodDef) { @@ -149,11 +146,7 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer if (result != 0) return result; - result = _method.CompareTo(otherNode._method, comparer); - if (result != 0) - return result; - - return _signatureContext.CompareTo(otherNode._signatureContext, comparer); + return _method.CompareTo(otherNode._method, comparer); } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodGCInfoNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodGCInfoNode.cs index bf6b60ab7ff23f..e9c63096d16895 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodGCInfoNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodGCInfoNode.cs @@ -1,10 +1,10 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Collections.Generic; using Internal.Text; +using Internal.TypeSystem; namespace ILCompiler.DependencyAnalysis.ReadyToRun { @@ -41,7 +41,7 @@ public int[] CalculateFuncletOffsets(NodeFactory factory) offsets[frameInfoIndex] = offset; offset += _methodNode.FrameInfos[frameInfoIndex].BlobData.Length; offset += (-offset & 3); // 4-alignment for the personality routine - if (factory.Target.Architecture != Internal.TypeSystem.TargetArchitecture.X86) + if (factory.Target.Architecture != TargetArchitecture.X86) { offset += sizeof(uint); // personality routine } @@ -60,11 +60,14 @@ public override void EncodeData(ref ObjectDataBuilder dataBuilder, NodeFactory f { return; } + + TargetArchitecture targetArch = factory.Target.Architecture; + for (int frameInfoIndex = 0; frameInfoIndex < _methodNode.FrameInfos.Length; frameInfoIndex++) { byte[] unwindInfo = _methodNode.FrameInfos[frameInfoIndex].BlobData; - if (factory.Target.Architecture == Internal.TypeSystem.TargetArchitecture.X64) + if (targetArch == TargetArchitecture.X64) { // On Amd64, patch the first byte of the unwind info by setting the flags to EHANDLER | UHANDLER // as that's what CoreCLR does (zapcode.cpp, ZapUnwindData::Save). @@ -74,12 +77,17 @@ public override void EncodeData(ref ObjectDataBuilder dataBuilder, NodeFactory f unwindInfo[0] |= (byte)((UNW_FLAG_EHANDLER | UNW_FLAG_UHANDLER) << FlagsShift); } + else if ((targetArch == TargetArchitecture.ARM) || (targetArch == TargetArchitecture.ARM64)) + { + // Set the 'X' bit to indicate that there is a personality routine associated with this method + unwindInfo[2] |= 1 << 4; + } dataBuilder.EmitBytes(unwindInfo); // 4-align after emitting the unwind info dataBuilder.EmitZeros(-unwindInfo.Length & 3); - if (factory.Target.Architecture != Internal.TypeSystem.TargetArchitecture.X86) + if (targetArch != TargetArchitecture.X86) { bool isFilterFunclet = (_methodNode.FrameInfos[frameInfoIndex].Flags & FrameInfoFlags.Filter) != 0; ISymbolNode personalityRoutine = (isFilterFunclet ? factory.FilterFuncletPersonalityRoutine : factory.PersonalityRoutine); diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodWithGCInfo.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodWithGCInfo.cs index c1a25d32fec918..b82737e07152e2 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodWithGCInfo.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodWithGCInfo.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -17,7 +17,6 @@ public class MethodWithGCInfo : ObjectNode, IReadyToRunMethodCodeNode, IMethodBo public readonly MethodGCInfoNode GCInfoNode; private readonly MethodDesc _method; - public SignatureContext SignatureContext { get; } private ObjectData _methodCode; private FrameInfo[] _frameInfos; @@ -29,12 +28,11 @@ public class MethodWithGCInfo : ObjectNode, IReadyToRunMethodCodeNode, IMethodBo private List _fixups; private MethodDesc[] _inlinedMethods; - public MethodWithGCInfo(MethodDesc methodDesc, SignatureContext signatureContext) + public MethodWithGCInfo(MethodDesc methodDesc) { GCInfoNode = new MethodGCInfoNode(this); _fixups = new List(); _method = methodDesc; - SignatureContext = signatureContext; } public void SetCode(ObjectData data) @@ -294,11 +292,7 @@ public void InitializeDebugEHClauseInfos(DebugEHClauseInfo[] debugEHClauseInfos) public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) { MethodWithGCInfo otherNode = (MethodWithGCInfo)other; - int result = comparer.Compare(_method, otherNode._method); - if (result != 0) - return result; - - return SignatureContext.CompareTo(otherNode.SignatureContext, comparer); + return comparer.Compare(_method, otherNode._method); } public void InitializeInliningInfo(MethodDesc[] inlinedMethods) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ModuleToken.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ModuleToken.cs index af2ea0b022c2ae..71b52cdc0efd68 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ModuleToken.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ModuleToken.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ModuleTokenResolver.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ModuleTokenResolver.cs index af040078dcedbe..0bb2af7f3d1a2d 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ModuleTokenResolver.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ModuleTokenResolver.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NewArrayFixupSignature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NewArrayFixupSignature.cs index 752191eae875a9..7372d0235de3dd 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NewArrayFixupSignature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NewArrayFixupSignature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -12,15 +12,13 @@ namespace ILCompiler.DependencyAnalysis.ReadyToRun public class NewArrayFixupSignature : Signature { private readonly ArrayType _arrayType; - private readonly SignatureContext _signatureContext; - public NewArrayFixupSignature(ArrayType arrayType, SignatureContext signatureContext) + public NewArrayFixupSignature(ArrayType arrayType) { _arrayType = arrayType; - _signatureContext = signatureContext; // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature - signatureContext.Resolver.CompilerContext.EnsureLoadableType(arrayType); + ((CompilerTypeSystemContext)arrayType.Context).EnsureLoadableType(arrayType); } public override int ClassCode => 815543321; @@ -33,8 +31,8 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { dataBuilder.AddSymbol(this); - EcmaModule targetModule = _signatureContext.GetTargetModule(_arrayType); - SignatureContext innerContext = dataBuilder.EmitFixup(factory, ReadyToRunFixupKind.NewArray, targetModule, _signatureContext); + EcmaModule targetModule = factory.SignatureContext.GetTargetModule(_arrayType); + SignatureContext innerContext = dataBuilder.EmitFixup(factory, ReadyToRunFixupKind.NewArray, targetModule, factory.SignatureContext); dataBuilder.EmitTypeSignature(_arrayType, innerContext); } @@ -51,11 +49,7 @@ public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilde public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) { NewArrayFixupSignature otherNode = (NewArrayFixupSignature)other; - int result = comparer.Compare(_arrayType, otherNode._arrayType); - if (result != 0) - return result; - - return _signatureContext.CompareTo(otherNode._signatureContext, comparer); + return comparer.Compare(_arrayType, otherNode._arrayType); } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NewObjectFixupSignature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NewObjectFixupSignature.cs index 1a63f79a1ff6d9..acfeb03b34fd95 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NewObjectFixupSignature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NewObjectFixupSignature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -12,15 +12,13 @@ namespace ILCompiler.DependencyAnalysis.ReadyToRun public class NewObjectFixupSignature : Signature { private readonly TypeDesc _typeDesc; - private readonly SignatureContext _signatureContext; - public NewObjectFixupSignature(TypeDesc typeDesc, SignatureContext signatureContext) + public NewObjectFixupSignature(TypeDesc typeDesc) { _typeDesc = typeDesc; - _signatureContext = signatureContext; // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature - signatureContext.Resolver.CompilerContext.EnsureLoadableType(typeDesc); + ((CompilerTypeSystemContext)typeDesc.Context).EnsureLoadableType(typeDesc); } public override int ClassCode => 551247760; @@ -33,8 +31,8 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { dataBuilder.AddSymbol(this); - EcmaModule targetModule = _signatureContext.GetTargetModule(_typeDesc); - SignatureContext innerContext = dataBuilder.EmitFixup(factory, ReadyToRunFixupKind.NewObject, targetModule, _signatureContext); + EcmaModule targetModule = factory.SignatureContext.GetTargetModule(_typeDesc); + SignatureContext innerContext = dataBuilder.EmitFixup(factory, ReadyToRunFixupKind.NewObject, targetModule, factory.SignatureContext); dataBuilder.EmitTypeSignature(_typeDesc, innerContext); } @@ -51,11 +49,7 @@ public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilde public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) { NewObjectFixupSignature otherNode = (NewObjectFixupSignature)other; - int result = comparer.Compare(_typeDesc, otherNode._typeDesc); - if (result != 0) - return result; - - return _signatureContext.CompareTo(otherNode._signatureContext, comparer); + return comparer.Compare(_typeDesc, otherNode._typeDesc); } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NibbleWriter.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NibbleWriter.cs index b0f7e3858cec55..edb123e9b02159 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NibbleWriter.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NibbleWriter.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/OwnerCompositeExecutableNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/OwnerCompositeExecutableNode.cs new file mode 100644 index 00000000000000..bc79b4402f4919 --- /dev/null +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/OwnerCompositeExecutableNode.cs @@ -0,0 +1,46 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Text; +using Internal.Text; +using Internal.TypeSystem; + +namespace ILCompiler.DependencyAnalysis.ReadyToRun +{ + /// + /// R2R header section holding the name of the composite R2R executable with native code + /// for this component module. This section gets put into R2R headers emitted when + /// rewriting input MSIL into standalone MSIL components of a composite R2R image. + /// It is used by the runtime as forwarding information to locate the composite R2R image + /// with the native code for a given MSIL assembly. + /// + internal class OwnerCompositeExecutableNode : HeaderTableNode + { + public override ObjectNodeSection Section => ObjectNodeSection.ReadOnlyDataSection; + + public override int ClassCode => 240420333; + + private readonly string _ownerExecutableName; + + public OwnerCompositeExecutableNode(TargetDetails target, string ownerExecutableName) + : base(target) + { + _ownerExecutableName = ownerExecutableName; + } + + public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) + { + sb.Append("__ReadyToRunHeader_OwnerCompositeExecutable"); + } + + public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) + { + ObjectDataBuilder builder = new ObjectDataBuilder(factory, relocsOnly); + builder.RequireInitialPointerAlignment(); + builder.AddSymbol(this); + builder.EmitBytes(Encoding.UTF8.GetBytes(_ownerExecutableName)); + return builder.ToObjectData(); + } + } +} diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/PrecodeHelperImport.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/PrecodeHelperImport.cs index f3b22c06a901d3..c9f685256fad91 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/PrecodeHelperImport.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/PrecodeHelperImport.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/PrecodeMethodImport.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/PrecodeMethodImport.cs index cf6442294c9d08..7b691c4e308263 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/PrecodeMethodImport.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/PrecodeMethodImport.cs @@ -22,16 +22,14 @@ public PrecodeMethodImport( MethodWithToken method, MethodWithGCInfo localMethod, bool isUnboxingStub, - bool isInstantiatingStub, - SignatureContext signatureContext) : + bool isInstantiatingStub) : base ( factory, factory.MethodSignature( fixupKind, method, isUnboxingStub, - isInstantiatingStub, - signatureContext) + isInstantiatingStub) ) { _localMethod = localMethod; diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ProfileDataNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ProfileDataNode.cs index 6c2308d3bffd0a..16832b6cd05819 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ProfileDataNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ProfileDataNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ProfileDataSectionNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ProfileDataSectionNode.cs index 5bddb460918ba0..44d6282410c12b 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ProfileDataSectionNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ProfileDataSectionNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ReadyToRunHelperSignature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ReadyToRunHelperSignature.cs index 5f037bc91503f1..8d05e925e5f20f 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ReadyToRunHelperSignature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ReadyToRunHelperSignature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsGCInfoNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsGCInfoNode.cs index cb1bf6396bc02e..0d6c9dcac648bb 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsGCInfoNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsGCInfoNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Signature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Signature.cs index 8b50e939495d87..4e3eaa390ab7ab 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Signature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Signature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureBuilder.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureBuilder.cs index 651a6902f04cba..4d76fb7cb89887 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureBuilder.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureBuilder.cs @@ -1,4 +1,4 @@ -// The .NET Foundation licenses this file to you under the MIT license. +// The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureContext.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureContext.cs index c52f7156687a90..901cc90a282350 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureContext.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureContext.cs @@ -1,4 +1,4 @@ -// The .NET Foundation licenses this file to you under the MIT license. +// The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; @@ -97,17 +97,31 @@ public override bool Equals(object obj) public override int GetHashCode() { - return GlobalContext.GetHashCode() - ^ (LocalContext.GetHashCode() * 31); + return (GlobalContext?.GetHashCode() ?? 0) ^ ((LocalContext?.GetHashCode() ?? 0) * 31); } public int CompareTo(SignatureContext other, TypeSystemComparer comparer) { + if (GlobalContext == null || other.GlobalContext == null) + { + return (GlobalContext != null ? 1 : other.GlobalContext != null ? -1 : 0); + } + int result = GlobalContext.CompareTo(other.GlobalContext); if (result != 0) return result; + if (LocalContext == null || other.LocalContext == null) + { + return (LocalContext != null ? 1 : other.LocalContext != null ? -1 : 0); + } + return LocalContext.CompareTo(other.LocalContext); } + + public override string ToString() + { + return (GlobalContext != null ? GlobalContext.Assembly.GetName().Name : ""); + } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureEmbeddedPointerIndirectionNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureEmbeddedPointerIndirectionNode.cs index 3dd600cef34f62..eec93744449fb9 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureEmbeddedPointerIndirectionNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureEmbeddedPointerIndirectionNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/StringImport.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/StringImport.cs index b410ead3f6b763..ef9f5bb378b33c 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/StringImport.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/StringImport.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -10,8 +10,8 @@ public class StringImport : Import { private readonly ModuleToken _token; - public StringImport(ImportSectionNode table, ModuleToken token, SignatureContext signatureContext) - : base(table, new StringImportSignature(token, signatureContext)) + public StringImport(ImportSectionNode table, ModuleToken token) + : base(table, new StringImportSignature(token)) { _token = token; } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/StringImportSignature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/StringImportSignature.cs index 1ce924d999a90d..b44e178738b73a 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/StringImportSignature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/StringImportSignature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -11,12 +11,9 @@ public class StringImportSignature : Signature { private readonly ModuleToken _token; - private readonly SignatureContext _signatureContext; - - public StringImportSignature(ModuleToken token, SignatureContext signatureContext) + public StringImportSignature(ModuleToken token) { _token = token; - _signatureContext = signatureContext; } public override int ClassCode => 324832559; @@ -29,7 +26,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { dataBuilder.AddSymbol(this); - dataBuilder.EmitFixup(factory, ReadyToRunFixupKind.StringHandle, _token.Module, _signatureContext); + dataBuilder.EmitFixup(factory, ReadyToRunFixupKind.StringHandle, _token.Module, factory.SignatureContext); dataBuilder.EmitUInt(_token.TokenRid); } @@ -45,10 +42,6 @@ public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilde public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) { StringImportSignature otherNode = (StringImportSignature)other; - int result = _signatureContext.CompareTo(otherNode._signatureContext, comparer); - if (result != 0) - return result; - return _token.CompareTo(otherNode._token); } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM/ImportThunk.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM/ImportThunk.cs index 52cf31cba21d1f..15576926d06587 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM/ImportThunk.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM/ImportThunk.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM64/ImportThunk.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM64/ImportThunk.cs index 354b0609b8a5a0..b8d18bdff1575f 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM64/ImportThunk.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM64/ImportThunk.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_X64/ImportThunk.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_X64/ImportThunk.cs index 2305345aa7f8d1..554953a27f1414 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_X64/ImportThunk.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_X64/ImportThunk.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_X86/ImportThunk.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_X86/ImportThunk.cs index 906beed7d2309a..28966aaf743a29 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_X86/ImportThunk.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_X86/ImportThunk.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs index 7571cbd7d939c8..70f7c4a908e3b5 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -471,6 +471,9 @@ private sealed class Arm32TransitionBlock : TransitionBlock public override int OffsetOfFloatArgumentRegisters => 8 * sizeof(double) + PointerSize; public override int EnregisteredParamTypeMaxSize => 0; public override int EnregisteredReturnTypeIntegerMaxSize => 4; + + public override bool IsArgPassedByRef(TypeHandle th) => false; + public override int GetRetBuffArgOffset(bool hasThis) => OffsetOfArgumentRegisters + (hasThis ? PointerSize : 0); } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypeFixupSignature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypeFixupSignature.cs index e020564f8c7f58..3ae821d2dbf77d 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypeFixupSignature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypeFixupSignature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -17,16 +17,13 @@ public class TypeFixupSignature : Signature private readonly TypeDesc _typeDesc; - private readonly SignatureContext _signatureContext; - - public TypeFixupSignature(ReadyToRunFixupKind fixupKind, TypeDesc typeDesc, SignatureContext signatureContext) + public TypeFixupSignature(ReadyToRunFixupKind fixupKind, TypeDesc typeDesc) { _fixupKind = fixupKind; _typeDesc = typeDesc; - _signatureContext = signatureContext; // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature - signatureContext.Resolver.CompilerContext.EnsureLoadableType(typeDesc); + ((CompilerTypeSystemContext)typeDesc.Context).EnsureLoadableType(typeDesc); } public override int ClassCode => 255607008; @@ -39,8 +36,8 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { dataBuilder.AddSymbol(this); - EcmaModule targetModule = _signatureContext.GetTargetModule(_typeDesc); - SignatureContext innerContext = dataBuilder.EmitFixup(factory, _fixupKind, targetModule, _signatureContext); + EcmaModule targetModule = factory.SignatureContext.GetTargetModule(_typeDesc); + SignatureContext innerContext = dataBuilder.EmitFixup(factory, _fixupKind, targetModule, factory.SignatureContext); dataBuilder.EmitTypeSignature(_typeDesc, innerContext); } @@ -61,11 +58,7 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer if (result != 0) return result; - result = comparer.Compare(_typeDesc, otherNode._typeDesc); - if (result != 0) - return result; - - return _signatureContext.CompareTo(otherNode._signatureContext, comparer); + return comparer.Compare(_typeDesc, otherNode._typeDesc); } protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFactory factory) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypesTableNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypesTableNode.cs index 26a204e83dfc46..502da243746c77 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypesTableNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypesTableNode.cs @@ -18,13 +18,19 @@ namespace ILCompiler.DependencyAnalysis.ReadyToRun { public class TypesTableNode : HeaderTableNode { - public TypesTableNode(TargetDetails target) - : base(target) {} + private readonly EcmaModule _module; + + public TypesTableNode(TargetDetails target, EcmaModule module) + : base(target) + { + _module = module; + } public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { sb.Append(nameMangler.CompilationUnitPrefix); - sb.Append("__ReadyToRunAvailableTypesTable"); + sb.Append("__ReadyToRunAvailableTypesTable__"); + sb.Append(_module.Assembly.GetName().Name); } public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) @@ -40,8 +46,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) section.Place(typesHashtable); ReadyToRunTableManager r2rManager = (ReadyToRunTableManager)factory.MetadataManager; - - foreach (TypeInfo defTypeInfo in r2rManager.GetDefinedTypes()) + foreach (TypeInfo defTypeInfo in r2rManager.GetDefinedTypes(_module)) { TypeDefinitionHandle defTypeHandle = defTypeInfo.Handle; int hashCode = 0; @@ -60,7 +65,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) typesHashtable.Append(unchecked((uint)hashCode), section.Place(new UnsignedConstant(((uint)MetadataTokens.GetRowNumber(defTypeInfo.Handle) << 1) | 0))); } - foreach (TypeInfo expTypeInfo in r2rManager.GetExportedTypes()) + foreach (TypeInfo expTypeInfo in r2rManager.GetExportedTypes(_module)) { ExportedTypeHandle expTypeHandle = expTypeInfo.Handle; int hashCode = 0; @@ -90,6 +95,12 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) definedSymbols: new ISymbolDefinitionNode[] { this }); } + public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) + { + TypesTableNode otherTypesTable = (TypesTableNode)other; + return _module.Assembly.GetName().Name.CompareTo(otherTypesTable._module.Assembly.GetName().Name); + } + public override int ClassCode => -944318825; } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Win32ResourcesNode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Win32ResourcesNode.cs index 929e762b8c73f7..ea37c34fd1c931 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Win32ResourcesNode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Win32ResourcesNode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -17,6 +17,7 @@ public class Win32ResourcesNode : ObjectNode, ISymbolDefinitionNode public Win32ResourcesNode(ResourceData resourceData) { _resourceData = resourceData; + _size = -1; } public override ObjectNodeSection Section => ObjectNodeSection.TextSection; @@ -35,6 +36,11 @@ public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) } public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) + { + return GetDataInternal(); + } + + private ObjectData GetDataInternal() { ObjectDataBuilder builder = new ObjectDataBuilder(); builder.AddSymbol(this); @@ -48,6 +54,16 @@ protected override string GetName(NodeFactory context) return "____Win32Resources"; } - public int Size => _size; + public int Size + { + get + { + if (_size < 0) + { + GetDataInternal(); + } + return _size; + } + } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs index 0bce3fbbc51523..6a3e4ef56c19bb 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -6,6 +6,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using ILCompiler.DependencyAnalysis.ReadyToRun; using ILCompiler.DependencyAnalysisFramework; @@ -68,13 +69,13 @@ public void SetMarkingComplete() public IMethodNode MethodEntrypoint(MethodDesc method) { + EcmaModule module = ((EcmaMethod)method.GetTypicalMethodDefinition()).Module; ModuleToken moduleToken = Resolver.GetModuleTokenForMethod(method, throwIfNotFound: true); return MethodEntrypoint( new MethodWithToken(method, moduleToken, constrainedType: null), isUnboxingStub: false, isInstantiatingStub: false, - isPrecodeImportRequired: false, - signatureContext: InputModuleContext); + isPrecodeImportRequired: false); } private NodeCache _allMethodsOnType; @@ -175,28 +176,33 @@ public NodeFactory( CompilerTypeSystemContext context, CompilationModuleGroup compilationModuleGroup, NameMangler nameMangler, - ModuleTokenResolver moduleTokenResolver, - SignatureContext signatureContext, CopiedCorHeaderNode corHeaderNode, DebugDirectoryNode debugDirectoryNode, ResourceData win32Resources, - AttributePresenceFilterNode attributePresenceFilterNode, - HeaderNode headerNode) + ReadyToRunFlags flags) { TypeSystemContext = context; CompilationModuleGroup = compilationModuleGroup; Target = context.Target; NameMangler = nameMangler; MetadataManager = new ReadyToRunTableManager(context); - Resolver = moduleTokenResolver; - InputModuleContext = signatureContext; CopiedCorHeaderNode = corHeaderNode; DebugDirectoryNode = debugDirectoryNode; - AttributePresenceFilter = attributePresenceFilterNode; - Header = headerNode; + Resolver = new ModuleTokenResolver(compilationModuleGroup, TypeSystemContext); + Header = new GlobalHeaderNode(Target, flags); if (!win32Resources.IsEmpty) Win32ResourcesNode = new Win32ResourcesNode(win32Resources); + if (CompilationModuleGroup.IsCompositeBuildMode) + { + // Create a null top-level signature context to force producing module overrides for all signaturess + SignatureContext = new SignatureContext(null, Resolver); + } + else + { + SignatureContext = new SignatureContext(CompilationModuleGroup.CompilationModuleSet.Single(), Resolver); + } + CreateNodeCaches(); } @@ -215,8 +221,7 @@ private void CreateNodeCaches() GetGenericStaticHelper(helperKey.HelperId), TypeSignature( ReadyToRunFixupKind.Invalid, - (TypeDesc)helperKey.Target, - InputModuleContext)); + (TypeDesc)helperKey.Target)); }); _genericReadyToRunHelpersFromType = new NodeCache(helperKey => @@ -227,8 +232,7 @@ private void CreateNodeCaches() GetGenericStaticHelper(helperKey.HelperId), TypeSignature( ReadyToRunFixupKind.Invalid, - (TypeDesc)helperKey.Target, - InputModuleContext)); + (TypeDesc)helperKey.Target)); }); _readOnlyDataBlobs = new NodeCache(key => @@ -243,9 +247,9 @@ private void CreateNodeCaches() _importMethods = new NodeCache(CreateMethodEntrypoint); - _localMethodCache = new NodeCache(key => + _localMethodCache = new NodeCache(key => { - return new MethodWithGCInfo(key.Method.Method, key.SignatureContext); + return new MethodWithGCInfo(key); }); _methodSignatures = new NodeCache(key => @@ -253,7 +257,6 @@ private void CreateNodeCaches() return new MethodFixupSignature( key.FixupKind, key.TypeAndMethod.Method, - key.TypeAndMethod.SignatureContext, key.TypeAndMethod.IsUnboxingStub, key.TypeAndMethod.IsInstantiatingStub ); @@ -261,7 +264,7 @@ private void CreateNodeCaches() _typeSignatures = new NodeCache(key => { - return new TypeFixupSignature(key.FixupKind, key.TypeDesc, InputModuleContext); + return new TypeFixupSignature(key.FixupKind, key.TypeDesc); }); _dynamicHelperCellCache = new NodeCache(key => @@ -276,10 +279,8 @@ private void CreateNodeCaches() MethodSignature( ReadyToRunFixupKind.VirtualEntry, key.Method, - signatureContext: key.SignatureContext, isUnboxingStub: key.IsUnboxingStub, - isInstantiatingStub: key.IsInstantiatingStub), - key.SignatureContext); + isInstantiatingStub: key.IsInstantiatingStub)); }); _copiedCorHeaders = new NodeCache(module => @@ -326,7 +327,7 @@ private void CreateNodeCaches() }); } - public SignatureContext InputModuleContext; + public SignatureContext SignatureContext; public ModuleTokenResolver Resolver; @@ -336,7 +337,7 @@ private void CreateNodeCaches() public Win32ResourcesNode Win32ResourcesNode; - public HeaderNode Header; + public GlobalHeaderNode Header; public RuntimeFunctionsTableNode RuntimeFunctionsTable; @@ -344,14 +345,10 @@ private void CreateNodeCaches() public ProfileDataSectionNode ProfileDataSection; - public MethodEntryPointTableNode MethodEntryPointTable; - public InstanceEntryPointTableNode InstanceEntryPointTable; public ManifestMetadataTableNode ManifestMetadataTable; - public TypesTableNode TypesTable; - public ImportSectionsTableNode ImportSectionsTable; public Import ModuleImport; @@ -362,10 +359,6 @@ private void CreateNodeCaches() public DebugInfoTableNode DebugInfoTable; - public InliningInfoNode InliningInfoTable; - - public AttributePresenceFilterNode AttributePresenceFilter; - public ImportSectionNode EagerImports; public ImportSectionNode MethodImports; @@ -393,7 +386,6 @@ private IMethodNode CreateMethodEntrypoint(TypeAndMethod key) bool isUnboxingStub = key.IsUnboxingStub; bool isInstantiatingStub = key.IsInstantiatingStub; bool isPrecodeImportRequired = key.IsPrecodeImportRequired; - SignatureContext signatureContext = key.SignatureContext; if (CompilationModuleGroup.ContainsMethodBody(method.Method, false)) { if (isPrecodeImportRequired) @@ -402,10 +394,9 @@ private IMethodNode CreateMethodEntrypoint(TypeAndMethod key) this, ReadyToRunFixupKind.MethodEntry, method, - CreateMethodEntrypointNodeHelper(method, signatureContext), + CreateMethodEntrypointNodeHelper(method), isUnboxingStub, - isInstantiatingStub, - signatureContext); + isInstantiatingStub); } else { @@ -413,10 +404,9 @@ private IMethodNode CreateMethodEntrypoint(TypeAndMethod key) this, ReadyToRunFixupKind.MethodEntry, method, - CreateMethodEntrypointNodeHelper(method, signatureContext), + CreateMethodEntrypointNodeHelper(method), isUnboxingStub, - isInstantiatingStub, - signatureContext); + isInstantiatingStub); } } else @@ -427,37 +417,24 @@ private IMethodNode CreateMethodEntrypoint(TypeAndMethod key) ReadyToRunFixupKind.MethodEntry, method, isUnboxingStub, - isInstantiatingStub, - signatureContext); + isInstantiatingStub); } } - public IMethodNode MethodEntrypoint( - MethodWithToken method, - bool isUnboxingStub, - bool isInstantiatingStub, - bool isPrecodeImportRequired, - SignatureContext signatureContext) + public IMethodNode MethodEntrypoint(MethodWithToken method, bool isUnboxingStub, bool isInstantiatingStub, bool isPrecodeImportRequired) { - TypeAndMethod key = new TypeAndMethod(method.ConstrainedType, method, isUnboxingStub, isInstantiatingStub, isPrecodeImportRequired, signatureContext); + TypeAndMethod key = new TypeAndMethod(method.ConstrainedType, method, isUnboxingStub, isInstantiatingStub, isPrecodeImportRequired); return _importMethods.GetOrAdd(key); } - private NodeCache _localMethodCache = new NodeCache(); + private NodeCache _localMethodCache; - private MethodWithGCInfo CreateMethodEntrypointNodeHelper(MethodWithToken targetMethod, SignatureContext signatureContext) + private MethodWithGCInfo CreateMethodEntrypointNodeHelper(MethodWithToken targetMethod) { Debug.Assert(CompilationModuleGroup.ContainsMethodBody(targetMethod.Method, false)); MethodDesc localMethod = targetMethod.Method.GetCanonMethodTarget(CanonicalFormKind.Specific); - - TypeAndMethod localMethodKey = new TypeAndMethod(localMethod.OwningType, - new MethodWithToken(localMethod, default(ModuleToken), constrainedType: null), - isUnboxingStub: false, - isInstantiatingStub: false, - isPrecodeImportRequired: false, - signatureContext); - return _localMethodCache.GetOrAdd(localMethodKey); + return _localMethodCache.GetOrAdd(localMethod); } public IEnumerable EnumerateCompiledMethods() @@ -470,9 +447,9 @@ public IEnumerable EnumerateCompiledMethods() { methodCodeNode = localMethodImport.MethodCodeNode; } - if (methodCodeNode == null && methodNode is PrecodeMethodImport PrecodeMethodImport) + if (methodCodeNode == null && methodNode is PrecodeMethodImport precodeMethodImport) { - methodCodeNode = PrecodeMethodImport.MethodCodeNode; + methodCodeNode = precodeMethodImport.MethodCodeNode; } if (methodCodeNode != null && !methodCodeNode.IsEmpty) @@ -515,10 +492,9 @@ public MethodFixupSignature MethodSignature( ReadyToRunFixupKind fixupKind, MethodWithToken method, bool isUnboxingStub, - bool isInstantiatingStub, - SignatureContext signatureContext) + bool isInstantiatingStub) { - TypeAndMethod key = new TypeAndMethod(method.ConstrainedType, method, isUnboxingStub, isInstantiatingStub, false, signatureContext); + TypeAndMethod key = new TypeAndMethod(method.ConstrainedType, method, isUnboxingStub, isInstantiatingStub, false); return _methodSignatures.GetOrAdd(new MethodFixupKey(fixupKind, key)); } @@ -526,19 +502,16 @@ private struct TypeFixupKey : IEquatable { public readonly ReadyToRunFixupKind FixupKind; public readonly TypeDesc TypeDesc; - public readonly SignatureContext SignatureContext; - public TypeFixupKey(ReadyToRunFixupKind fixupKind, TypeDesc typeDesc, SignatureContext signatureContext) + + public TypeFixupKey(ReadyToRunFixupKind fixupKind, TypeDesc typeDesc) { FixupKind = fixupKind; TypeDesc = typeDesc; - SignatureContext = signatureContext; } public bool Equals(TypeFixupKey other) { - return FixupKind == other.FixupKind - && TypeDesc == other.TypeDesc - && SignatureContext.Equals(other.SignatureContext); + return FixupKind == other.FixupKind && TypeDesc == other.TypeDesc; } public override bool Equals(object obj) @@ -548,17 +521,15 @@ public override bool Equals(object obj) public override int GetHashCode() { - return FixupKind.GetHashCode() - ^ (31 * TypeDesc.GetHashCode()) - ^ (23 * SignatureContext.GetHashCode()); + return FixupKind.GetHashCode() ^ (31 * TypeDesc.GetHashCode()); } } private NodeCache _typeSignatures; - public TypeFixupSignature TypeSignature(ReadyToRunFixupKind fixupKind, TypeDesc typeDesc, SignatureContext signatureContext) + public TypeFixupSignature TypeSignature(ReadyToRunFixupKind fixupKind, TypeDesc typeDesc) { - TypeFixupKey fixupKey = new TypeFixupKey(fixupKind, typeDesc, signatureContext); + TypeFixupKey fixupKey = new TypeFixupKey(fixupKind, typeDesc); return _typeSignatures.GetOrAdd(fixupKey); } @@ -580,19 +551,53 @@ public void AttachToDependencyGraph(DependencyAnalyzerBase graph) Header.Add(Internal.Runtime.ReadyToRunSectionType.ExceptionInfo, exceptionInfoLookupTableNode, exceptionInfoLookupTableNode); graph.AddRoot(exceptionInfoLookupTableNode, "ExceptionInfoLookupTable is always generated"); - MethodEntryPointTable = new MethodEntryPointTableNode(Target); - Header.Add(Internal.Runtime.ReadyToRunSectionType.MethodDefEntryPoints, MethodEntryPointTable, MethodEntryPointTable); - - ManifestMetadataTable = new ManifestMetadataTableNode(InputModuleContext.GlobalContext, this); + ManifestMetadataTable = new ManifestMetadataTableNode(this); Header.Add(Internal.Runtime.ReadyToRunSectionType.ManifestMetadata, ManifestMetadataTable, ManifestMetadataTable); - Resolver.SetModuleIndexLookup(ManifestMetadataTable.ModuleToIndex); - InstanceEntryPointTable = new InstanceEntryPointTableNode(Target); - Header.Add(Internal.Runtime.ReadyToRunSectionType.InstanceMethodEntryPoints, InstanceEntryPointTable, InstanceEntryPointTable); + AssemblyTableNode assemblyTable = null; + + if (CompilationModuleGroup.CompilationModuleSet.Skip(1).Any()) + { + assemblyTable = new AssemblyTableNode(Target); + Header.Add(Internal.Runtime.ReadyToRunSectionType.ComponentAssemblies, assemblyTable, assemblyTable); + } + + // Generate per assembly header tables + int assemblyIndex = -1; + foreach (EcmaModule inputModule in CompilationModuleGroup.CompilationModuleSet) + { + assemblyIndex++; + HeaderNode tableHeader = Header; + if (assemblyTable != null) + { + AssemblyHeaderNode perAssemblyHeader = new AssemblyHeaderNode(Target, ReadyToRunFlags.READYTORUN_FLAG_Component, assemblyIndex); + assemblyTable.Add(perAssemblyHeader); + tableHeader = perAssemblyHeader; + } + + MethodEntryPointTableNode methodEntryPointTable = new MethodEntryPointTableNode(inputModule, Target); + tableHeader.Add(Internal.Runtime.ReadyToRunSectionType.MethodDefEntryPoints, methodEntryPointTable, methodEntryPointTable); + + TypesTableNode typesTable = new TypesTableNode(Target, inputModule); + tableHeader.Add(Internal.Runtime.ReadyToRunSectionType.AvailableTypes, typesTable, typesTable); + + InliningInfoNode inliningInfoTable = new InliningInfoNode(Target, inputModule); + tableHeader.Add(Internal.Runtime.ReadyToRunSectionType.InliningInfo2, inliningInfoTable, inliningInfoTable); + + // Core library attributes are checked FAR more often than other dlls + // attributes, so produce a highly efficient table for determining if they are + // present. Other assemblies *MAY* benefit from this feature, but it doesn't show + // as useful at this time. + if (inputModule == TypeSystemContext.SystemModule) + { + AttributePresenceFilterNode attributePresenceTable = new AttributePresenceFilterNode(inputModule); + Header.Add(Internal.Runtime.ReadyToRunSectionType.AttributePresence, attributePresenceTable, attributePresenceTable); + } + } - TypesTable = new TypesTableNode(Target); - Header.Add(Internal.Runtime.ReadyToRunSectionType.AvailableTypes, TypesTable, TypesTable); + InstanceEntryPointTable = new InstanceEntryPointTableNode(this); + Header.Add(Internal.Runtime.ReadyToRunSectionType.InstanceMethodEntryPoints, InstanceEntryPointTable, InstanceEntryPointTable); ImportSectionsTable = new ImportSectionsTableNode(this); Header.Add(Internal.Runtime.ReadyToRunSectionType.ImportSections, ImportSectionsTable, ImportSectionsTable.StartSymbol); @@ -600,18 +605,6 @@ public void AttachToDependencyGraph(DependencyAnalyzerBase graph) DebugInfoTable = new DebugInfoTableNode(Target); Header.Add(Internal.Runtime.ReadyToRunSectionType.DebugInfo, DebugInfoTable, DebugInfoTable); - InliningInfoTable = new InliningInfoNode(Target, InputModuleContext.GlobalContext); - Header.Add(Internal.Runtime.ReadyToRunSectionType.InliningInfo2, InliningInfoTable, InliningInfoTable); - - // Core library attributes are checked FAR more often than other dlls - // attributes, so produce a highly efficient table for determining if they are - // present. Other assemblies *MAY* benefit from this feature, but it doesn't show - // as useful at this time. - if (this.AttributePresenceFilter != null) - { - Header.Add(Internal.Runtime.ReadyToRunSectionType.AttributePresence, AttributePresenceFilter, AttributePresenceFilter); - } - EagerImports = new ImportSectionNode( "EagerImports", CorCompileImportType.CORCOMPILE_IMPORT_TYPE_UNKNOWN, @@ -695,7 +688,10 @@ public void AttachToDependencyGraph(DependencyAnalyzerBase graph) graph.AddRoot(PrecodeImports, "Precode helper imports are always generated"); graph.AddRoot(StringImports, "String imports are always generated"); graph.AddRoot(Header, "ReadyToRunHeader is always generated"); - graph.AddRoot(CopiedCorHeaderNode, "MSIL COR header is always generated"); + if (!CompilationModuleGroup.IsCompositeBuildMode) + { + graph.AddRoot(CopiedCorHeaderNode, "MSIL COR header is always generated for single-file R2R files"); + } graph.AddRoot(DebugDirectoryNode, "Debug Directory will always contain at least one entry"); if (Win32ResourcesNode != null) @@ -738,22 +734,19 @@ struct DynamicHelperCellKey : IEquatable public readonly MethodWithToken Method; public readonly bool IsUnboxingStub; public readonly bool IsInstantiatingStub; - public readonly SignatureContext SignatureContext; - public DynamicHelperCellKey(MethodWithToken method, bool isUnboxingStub, bool isInstantiatingStub, SignatureContext signatureContext) + public DynamicHelperCellKey(MethodWithToken method, bool isUnboxingStub, bool isInstantiatingStub) { Method = method; IsUnboxingStub = isUnboxingStub; IsInstantiatingStub = isInstantiatingStub; - SignatureContext = signatureContext; } public bool Equals(DynamicHelperCellKey other) { return Method.Equals(other.Method) && IsUnboxingStub == other.IsUnboxingStub - && IsInstantiatingStub == other.IsInstantiatingStub - && SignatureContext.Equals(other.SignatureContext); + && IsInstantiatingStub == other.IsInstantiatingStub; } public override bool Equals(object obj) @@ -765,16 +758,15 @@ public override int GetHashCode() { return Method.GetHashCode() ^ (IsUnboxingStub ? -0x80000000 : 0) - ^ (IsInstantiatingStub ? -0x40000000 : 0) - ^ (31 * SignatureContext.GetHashCode()); + ^ (IsInstantiatingStub ? -0x40000000 : 0); } } private NodeCache _dynamicHelperCellCache; - public ISymbolNode DynamicHelperCell(MethodWithToken methodWithToken, bool isInstantiatingStub, SignatureContext signatureContext) + public ISymbolNode DynamicHelperCell(MethodWithToken methodWithToken, bool isInstantiatingStub) { - DynamicHelperCellKey key = new DynamicHelperCellKey(methodWithToken, isUnboxingStub: false, isInstantiatingStub, signatureContext); + DynamicHelperCellKey key = new DynamicHelperCellKey(methodWithToken, isUnboxingStub: false, isInstantiatingStub); return _dynamicHelperCellCache.GetOrAdd(key); } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunSymbolNodeFactory.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunSymbolNodeFactory.cs index 834e65351a8f41..735ada49e61917 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunSymbolNodeFactory.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunSymbolNodeFactory.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -47,36 +47,36 @@ public ReadyToRunSymbolNodeFactory(NodeFactory codegenNodeFactory) private void CreateNodeCaches() { - _importStrings = new NodeCache(key => + _importStrings = new NodeCache(key => { - return new StringImport(_codegenNodeFactory.StringImports, key.ModuleToken, key.SignatureContext); + return new StringImport(_codegenNodeFactory.StringImports, key); }); _r2rHelpers = new NodeCache(CreateReadyToRunHelper); - _fieldAddressCache = new NodeCache(key => + _fieldAddressCache = new NodeCache(key => { return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper, - new FieldFixupSignature(ReadyToRunFixupKind.FieldAddress, key.Field, key.SignatureContext) + new FieldFixupSignature(ReadyToRunFixupKind.FieldAddress, key) ); }); - _fieldOffsetCache = new NodeCache(key => + _fieldOffsetCache = new NodeCache(key => { return new PrecodeHelperImport( _codegenNodeFactory, - new FieldFixupSignature(ReadyToRunFixupKind.FieldOffset, key.Field, key.SignatureContext) + new FieldFixupSignature(ReadyToRunFixupKind.FieldOffset, key) ); }); - _fieldBaseOffsetCache = new NodeCache(key => + _fieldBaseOffsetCache = new NodeCache(key => { return new PrecodeHelperImport( _codegenNodeFactory, - _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.FieldBaseOffset, key.Type, key.SignatureContext) + _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.FieldBaseOffset, key) ); }); @@ -91,26 +91,23 @@ private void CreateNodeCaches() useInstantiatingStub: false, _codegenNodeFactory.MethodSignature(ReadyToRunFixupKind.VirtualEntry, cellKey.Method, - cellKey.IsUnboxingStub, isInstantiatingStub: false, cellKey.SignatureContext), - cellKey.SignatureContext, + cellKey.IsUnboxingStub, isInstantiatingStub: false), cellKey.CallSite); }); _delegateCtors = new NodeCache(ctorKey => { - SignatureContext signatureContext = ctorKey.SignatureContext; IMethodNode targetMethodNode = _codegenNodeFactory.MethodEntrypoint( ctorKey.Method, isUnboxingStub: false, isInstantiatingStub: ctorKey.Method.Method.HasInstantiation, - isPrecodeImportRequired: false, - signatureContext: signatureContext); + isPrecodeImportRequired: false); return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper_ObjObj, - new DelegateCtorSignature(ctorKey.Type, targetMethodNode, ctorKey.Method.Token, signatureContext)); + new DelegateCtorSignature(ctorKey.Type, targetMethodNode, ctorKey.Method.Token)); }); _genericLookupHelpers = new NodeCache(key => @@ -125,8 +122,7 @@ private void CreateNodeCaches() key.TypeArgument, key.MethodArgument, key.FieldArgument, - key.MethodContext, - key.SignatureContext)); + key.MethodContext)); }); _pInvokeTargetNodes = new NodeCache(key => @@ -136,65 +132,32 @@ private void CreateNodeCaches() _codegenNodeFactory.MethodSignature( key.IsIndirect ? ReadyToRunFixupKind.IndirectPInvokeTarget : ReadyToRunFixupKind.PInvokeTarget, key.MethodWithToken, - signatureContext: key.SignatureContext, isUnboxingStub: false, isInstantiatingStub: false)); }); } - private struct ModuleTokenAndSignatureContext : IEquatable - { - public readonly ModuleToken ModuleToken; - public readonly SignatureContext SignatureContext; - - public ModuleTokenAndSignatureContext(ModuleToken moduleToken, SignatureContext signatureContext) - { - ModuleToken = moduleToken; - SignatureContext = signatureContext; - } - - public bool Equals(ModuleTokenAndSignatureContext other) - { - return ModuleToken.Equals(other.ModuleToken) - && SignatureContext.Equals(other.SignatureContext); - } - - public override bool Equals(object obj) - { - return obj is ModuleTokenAndSignatureContext other && Equals(other); - } - - public override int GetHashCode() - { - return ModuleToken.GetHashCode() ^ (SignatureContext.GetHashCode() * 31); - } - } - - private NodeCache _importStrings; + private NodeCache _importStrings; - public ISymbolNode StringLiteral(ModuleToken moduleToken, SignatureContext signatureContext) + public ISymbolNode StringLiteral(ModuleToken moduleToken) { - return _importStrings.GetOrAdd(new ModuleTokenAndSignatureContext(moduleToken, signatureContext)); + return _importStrings.GetOrAdd(moduleToken); } private struct ReadyToRunHelperKey { public readonly ReadyToRunHelperId Id; public readonly object Target; - public readonly SignatureContext SignatureContext; - public ReadyToRunHelperKey(ReadyToRunHelperId id, object target, SignatureContext signatureContext) + public ReadyToRunHelperKey(ReadyToRunHelperId id, object target) { Id = id; Target = target; - SignatureContext = signatureContext; } public bool Equals(ReadyToRunHelperKey other) { - return Id == other.Id - && Target.Equals(other.Target) - && SignatureContext.Equals(other.SignatureContext); + return Id == other.Id && Target.Equals(other.Target); } public override bool Equals(object obj) @@ -204,9 +167,7 @@ public override bool Equals(object obj) public override int GetHashCode() { - return Id.GetHashCode() - ^ (Target.GetHashCode() * 23) - ^ (SignatureContext.GetHashCode() * 31); + return Id.GetHashCode() ^ (Target.GetHashCode() * 23); } } @@ -217,137 +178,137 @@ private ISymbolNode CreateReadyToRunHelper(ReadyToRunHelperKey key) switch (key.Id) { case ReadyToRunHelperId.NewHelper: - return CreateNewHelper((TypeDesc)key.Target, key.SignatureContext); + return CreateNewHelper((TypeDesc)key.Target); case ReadyToRunHelperId.NewArr1: - return CreateNewArrayHelper((ArrayType)key.Target, key.SignatureContext); + return CreateNewArrayHelper((ArrayType)key.Target); case ReadyToRunHelperId.GetGCStaticBase: - return CreateGCStaticBaseHelper((TypeDesc)key.Target, key.SignatureContext); + return CreateGCStaticBaseHelper((TypeDesc)key.Target); case ReadyToRunHelperId.GetNonGCStaticBase: - return CreateNonGCStaticBaseHelper((TypeDesc)key.Target, key.SignatureContext); + return CreateNonGCStaticBaseHelper((TypeDesc)key.Target); case ReadyToRunHelperId.GetThreadStaticBase: - return CreateThreadGcStaticBaseHelper((TypeDesc)key.Target, key.SignatureContext); + return CreateThreadGcStaticBaseHelper((TypeDesc)key.Target); case ReadyToRunHelperId.GetThreadNonGcStaticBase: - return CreateThreadNonGcStaticBaseHelper((TypeDesc)key.Target, key.SignatureContext); + return CreateThreadNonGcStaticBaseHelper((TypeDesc)key.Target); case ReadyToRunHelperId.IsInstanceOf: - return CreateIsInstanceOfHelper((TypeDesc)key.Target, key.SignatureContext); + return CreateIsInstanceOfHelper((TypeDesc)key.Target); case ReadyToRunHelperId.CastClass: - return CreateCastClassHelper((TypeDesc)key.Target, key.SignatureContext); + return CreateCastClassHelper((TypeDesc)key.Target); case ReadyToRunHelperId.TypeHandle: - return CreateTypeHandleHelper((TypeDesc)key.Target, key.SignatureContext); + return CreateTypeHandleHelper((TypeDesc)key.Target); case ReadyToRunHelperId.MethodHandle: - return CreateMethodHandleHelper((MethodWithToken)key.Target, key.SignatureContext); + return CreateMethodHandleHelper((MethodWithToken)key.Target); case ReadyToRunHelperId.FieldHandle: - return CreateFieldHandleHelper((FieldDesc)key.Target, key.SignatureContext); + return CreateFieldHandleHelper((FieldDesc)key.Target); case ReadyToRunHelperId.CctorTrigger: - return CreateCctorTrigger((TypeDesc)key.Target, key.SignatureContext); + return CreateCctorTrigger((TypeDesc)key.Target); case ReadyToRunHelperId.TypeDictionary: - return CreateTypeDictionary((TypeDesc)key.Target, key.SignatureContext); + return CreateTypeDictionary((TypeDesc)key.Target); case ReadyToRunHelperId.MethodDictionary: - return CreateMethodDictionary((MethodWithToken)key.Target, key.SignatureContext); + return CreateMethodDictionary((MethodWithToken)key.Target); default: throw new NotImplementedException(key.Id.ToString()); } } - public ISymbolNode CreateReadyToRunHelper(ReadyToRunHelperId id, object target, SignatureContext signatureContext) + public ISymbolNode CreateReadyToRunHelper(ReadyToRunHelperId id, object target) { - return _r2rHelpers.GetOrAdd(new ReadyToRunHelperKey(id, target, signatureContext)); + return _r2rHelpers.GetOrAdd(new ReadyToRunHelperKey(id, target)); } - private ISymbolNode CreateNewHelper(TypeDesc type, SignatureContext signatureContext) + private ISymbolNode CreateNewHelper(TypeDesc type) { return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper, - new NewObjectFixupSignature(type, signatureContext)); + new NewObjectFixupSignature(type)); } - private ISymbolNode CreateNewArrayHelper(ArrayType type, SignatureContext signatureContext) + private ISymbolNode CreateNewArrayHelper(ArrayType type) { return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper, - new NewArrayFixupSignature(type, signatureContext)); + new NewArrayFixupSignature(type)); } - private ISymbolNode CreateGCStaticBaseHelper(TypeDesc type, SignatureContext signatureContext) + private ISymbolNode CreateGCStaticBaseHelper(TypeDesc type) { return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper, - _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.StaticBaseGC, type, signatureContext)); + _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.StaticBaseGC, type)); } - private ISymbolNode CreateNonGCStaticBaseHelper(TypeDesc type, SignatureContext signatureContext) + private ISymbolNode CreateNonGCStaticBaseHelper(TypeDesc type) { return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper, - _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.StaticBaseNonGC, type, signatureContext)); + _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.StaticBaseNonGC, type)); } - private ISymbolNode CreateThreadGcStaticBaseHelper(TypeDesc type, SignatureContext signatureContext) + private ISymbolNode CreateThreadGcStaticBaseHelper(TypeDesc type) { return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper, - _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.ThreadStaticBaseGC, type, signatureContext)); + _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.ThreadStaticBaseGC, type)); } - private ISymbolNode CreateThreadNonGcStaticBaseHelper(TypeDesc type, SignatureContext signatureContext) + private ISymbolNode CreateThreadNonGcStaticBaseHelper(TypeDesc type) { return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper, - _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.ThreadStaticBaseNonGC, type, signatureContext)); + _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.ThreadStaticBaseNonGC, type)); } - private ISymbolNode CreateIsInstanceOfHelper(TypeDesc type, SignatureContext signatureContext) + private ISymbolNode CreateIsInstanceOfHelper(TypeDesc type) { return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper_Obj, - _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.IsInstanceOf, type, signatureContext)); + _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.IsInstanceOf, type)); } - private ISymbolNode CreateCastClassHelper(TypeDesc type, SignatureContext signatureContext) + private ISymbolNode CreateCastClassHelper(TypeDesc type) { return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper_Obj, - _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.ChkCast, type, signatureContext)); + _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.ChkCast, type)); } - private ISymbolNode CreateTypeHandleHelper(TypeDesc type, SignatureContext signatureContext) + private ISymbolNode CreateTypeHandleHelper(TypeDesc type) { return new PrecodeHelperImport( _codegenNodeFactory, - _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.TypeHandle, type, signatureContext)); + _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.TypeHandle, type)); } - private ISymbolNode CreateMethodHandleHelper(MethodWithToken method, SignatureContext signatureContext) + private ISymbolNode CreateMethodHandleHelper(MethodWithToken method) { bool useUnboxingStub = method.Method.IsUnboxingThunk(); if (useUnboxingStub) @@ -363,35 +324,34 @@ private ISymbolNode CreateMethodHandleHelper(MethodWithToken method, SignatureCo ReadyToRunFixupKind.MethodHandle, method, isUnboxingStub: useUnboxingStub, - isInstantiatingStub: useInstantiatingStub, - signatureContext)); + isInstantiatingStub: useInstantiatingStub)); } - private ISymbolNode CreateFieldHandleHelper(FieldDesc field, SignatureContext signatureContext) + private ISymbolNode CreateFieldHandleHelper(FieldDesc field) { return new PrecodeHelperImport( _codegenNodeFactory, - new FieldFixupSignature(ReadyToRunFixupKind.FieldHandle, field, signatureContext)); + new FieldFixupSignature(ReadyToRunFixupKind.FieldHandle, field)); } - private ISymbolNode CreateCctorTrigger(TypeDesc type, SignatureContext signatureContext) + private ISymbolNode CreateCctorTrigger(TypeDesc type) { return new DelayLoadHelperImport( _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper, - _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.CctorTrigger, type, signatureContext)); + _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.CctorTrigger, type)); } - private ISymbolNode CreateTypeDictionary(TypeDesc type, SignatureContext signatureContext) + private ISymbolNode CreateTypeDictionary(TypeDesc type) { return new PrecodeHelperImport( _codegenNodeFactory, - _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.TypeDictionary, type, signatureContext) + _codegenNodeFactory.TypeSignature(ReadyToRunFixupKind.TypeDictionary, type) ); } - private ISymbolNode CreateMethodDictionary(MethodWithToken method, SignatureContext signatureContext) + private ISymbolNode CreateMethodDictionary(MethodWithToken method) { return new PrecodeHelperImport( _codegenNodeFactory, @@ -399,106 +359,48 @@ private ISymbolNode CreateMethodDictionary(MethodWithToken method, SignatureCont ReadyToRunFixupKind.MethodDictionary, method, isUnboxingStub: false, - isInstantiatingStub: true, - signatureContext)); + isInstantiatingStub: true)); } - private struct FieldAndSignatureContext : IEquatable - { - public readonly FieldDesc Field; - public readonly SignatureContext SignatureContext; + private NodeCache _fieldAddressCache; - public FieldAndSignatureContext(FieldDesc fieldDesc, SignatureContext signatureContext) - { - Field = fieldDesc; - SignatureContext = signatureContext; - } - - public bool Equals(FieldAndSignatureContext other) - { - return Field.Equals(other.Field) && - SignatureContext.Equals(other.SignatureContext); - } - - public override bool Equals(object obj) - { - return obj is FieldAndSignatureContext other && Equals(other); - } - - public override int GetHashCode() - { - return Field.GetHashCode() ^ (SignatureContext.GetHashCode() * 31); - } - } - - private NodeCache _fieldAddressCache; - - public ISymbolNode FieldAddress(FieldDesc fieldDesc, SignatureContext signatureContext) + public ISymbolNode FieldAddress(FieldDesc fieldDesc) { - return _fieldAddressCache.GetOrAdd(new FieldAndSignatureContext(fieldDesc, signatureContext)); + return _fieldAddressCache.GetOrAdd(fieldDesc); } - private NodeCache _fieldOffsetCache; - - public ISymbolNode FieldOffset(FieldDesc fieldDesc, SignatureContext signatureContext) - { - return _fieldOffsetCache.GetOrAdd(new FieldAndSignatureContext(fieldDesc, signatureContext)); - } + private NodeCache _fieldOffsetCache; - private struct TypeAndSignatureContext : IEquatable + public ISymbolNode FieldOffset(FieldDesc fieldDesc) { - public readonly TypeDesc Type; - public readonly SignatureContext SignatureContext; - - public TypeAndSignatureContext(TypeDesc typeDesc, SignatureContext signatureContext) - { - Type = typeDesc; - SignatureContext = signatureContext; - } - - public bool Equals(TypeAndSignatureContext other) - { - return Type.Equals(other.Type) && - SignatureContext.Equals(other.SignatureContext); - } - - public override bool Equals(object obj) - { - return obj is FieldAndSignatureContext other && Equals(other); - } - - public override int GetHashCode() - { - return Type.GetHashCode() ^ (SignatureContext.GetHashCode() * 31); - } + return _fieldOffsetCache.GetOrAdd(fieldDesc); } - private NodeCache _fieldBaseOffsetCache; + private NodeCache _fieldBaseOffsetCache; - public ISymbolNode FieldBaseOffset(TypeDesc typeDesc, SignatureContext signatureContext) + public ISymbolNode FieldBaseOffset(TypeDesc typeDesc) { - return _fieldBaseOffsetCache.GetOrAdd(new TypeAndSignatureContext(typeDesc, signatureContext)); + return _fieldBaseOffsetCache.GetOrAdd(typeDesc); } private NodeCache _interfaceDispatchCells = new NodeCache(); - public ISymbolNode InterfaceDispatchCell(MethodWithToken method, SignatureContext signatureContext, bool isUnboxingStub, string callSite) + public ISymbolNode InterfaceDispatchCell(MethodWithToken method, bool isUnboxingStub, string callSite) { - MethodAndCallSite cellKey = new MethodAndCallSite(method, isUnboxingStub, callSite, signatureContext); + MethodAndCallSite cellKey = new MethodAndCallSite(method, isUnboxingStub, callSite); return _interfaceDispatchCells.GetOrAdd(cellKey); } private NodeCache _delegateCtors = new NodeCache(); - public ISymbolNode DelegateCtor(TypeDesc delegateType, MethodWithToken method, SignatureContext signatureContext) + public ISymbolNode DelegateCtor(TypeDesc delegateType, MethodWithToken method) { TypeAndMethod ctorKey = new TypeAndMethod( delegateType, method, isUnboxingStub: false, isInstantiatingStub: false, - isPrecodeImportRequired: false, - signatureContext); + isPrecodeImportRequired: false); return _delegateCtors.GetOrAdd(ctorKey); } @@ -507,22 +409,17 @@ struct MethodAndCallSite : IEquatable public readonly MethodWithToken Method; public readonly bool IsUnboxingStub; public readonly string CallSite; - public readonly SignatureContext SignatureContext; - public MethodAndCallSite(MethodWithToken method, bool isUnboxingStub, string callSite, SignatureContext signatureContext) + public MethodAndCallSite(MethodWithToken method, bool isUnboxingStub, string callSite) { CallSite = callSite; IsUnboxingStub = isUnboxingStub; Method = method; - SignatureContext = signatureContext; } public bool Equals(MethodAndCallSite other) { - return CallSite == other.CallSite - && Method.Equals(other.Method) - && IsUnboxingStub == other.IsUnboxingStub - && SignatureContext.Equals(other.SignatureContext); + return CallSite == other.CallSite && Method.Equals(other.Method) && IsUnboxingStub == other.IsUnboxingStub; } public override bool Equals(object obj) @@ -532,10 +429,9 @@ public override bool Equals(object obj) public override int GetHashCode() { - return (CallSite != null ? CallSite.GetHashCode() : 0) + return (CallSite != null ? CallSite.GetHashCode() : 0) ^ unchecked(31 * Method.GetHashCode()) - ^ (IsUnboxingStub ? -0x80000000 : 0) - ^ (23 * SignatureContext.GetHashCode()); + ^ (IsUnboxingStub ? -0x80000000 : 0); } } @@ -547,7 +443,6 @@ private struct GenericLookupKey : IEquatable public readonly MethodWithToken MethodArgument; public readonly FieldDesc FieldArgument; public readonly GenericContext MethodContext; - public readonly SignatureContext SignatureContext; public GenericLookupKey( CORINFO_RUNTIME_LOOKUP_KIND lookupKind, @@ -555,8 +450,7 @@ public GenericLookupKey( TypeDesc typeArgument, MethodWithToken methodArgument, FieldDesc fieldArgument, - GenericContext methodContext, - SignatureContext signatureContext) + GenericContext methodContext) { LookupKind = lookupKind; FixupKind = fixupKind; @@ -564,7 +458,6 @@ public GenericLookupKey( MethodArgument = methodArgument; FieldArgument = fieldArgument; MethodContext = methodContext; - SignatureContext = signatureContext; } public bool Equals(GenericLookupKey other) @@ -599,8 +492,7 @@ public ISymbolNode GenericLookupHelper( CORINFO_RUNTIME_LOOKUP_KIND runtimeLookupKind, ReadyToRunHelperId helperId, object helperArgument, - GenericContext methodContext, - SignatureContext signatureContext) + GenericContext methodContext) { switch (helperId) { @@ -609,56 +501,49 @@ public ISymbolNode GenericLookupHelper( runtimeLookupKind, ReadyToRunFixupKind.TypeHandle, helperArgument, - methodContext, - signatureContext); + methodContext); case ReadyToRunHelperId.MethodHandle: return GenericLookupMethodHelper( runtimeLookupKind, ReadyToRunFixupKind.MethodHandle, (MethodWithToken)helperArgument, - methodContext, - signatureContext); + methodContext); case ReadyToRunHelperId.MethodEntry: return GenericLookupMethodHelper( runtimeLookupKind, ReadyToRunFixupKind.MethodEntry, (MethodWithToken)helperArgument, - methodContext, - signatureContext); + methodContext); case ReadyToRunHelperId.MethodDictionary: return GenericLookupMethodHelper( runtimeLookupKind, ReadyToRunFixupKind.MethodHandle, (MethodWithToken)helperArgument, - methodContext, - signatureContext); + methodContext); case ReadyToRunHelperId.TypeDictionary: return GenericLookupTypeHelper( runtimeLookupKind, ReadyToRunFixupKind.TypeDictionary, (TypeDesc)helperArgument, - methodContext, - signatureContext); + methodContext); case ReadyToRunHelperId.VirtualDispatchCell: return GenericLookupMethodHelper( runtimeLookupKind, ReadyToRunFixupKind.VirtualEntry, (MethodWithToken)helperArgument, - methodContext, - signatureContext); + methodContext); case ReadyToRunHelperId.FieldHandle: return GenericLookupFieldHelper( runtimeLookupKind, ReadyToRunFixupKind.FieldHandle, (FieldDesc)helperArgument, - methodContext, - signatureContext); + methodContext); default: throw new NotImplementedException(helperId.ToString()); @@ -669,8 +554,7 @@ private ISymbolNode GenericLookupTypeHelper( CORINFO_RUNTIME_LOOKUP_KIND runtimeLookupKind, ReadyToRunFixupKind fixupKind, object helperArgument, - GenericContext methodContext, - SignatureContext signatureContext) + GenericContext methodContext) { TypeDesc typeArgument; if (helperArgument is MethodWithToken methodWithToken) @@ -686,7 +570,7 @@ private ISymbolNode GenericLookupTypeHelper( typeArgument = (TypeDesc)helperArgument; } - GenericLookupKey key = new GenericLookupKey(runtimeLookupKind, fixupKind, typeArgument, methodArgument: null, fieldArgument: null, methodContext, signatureContext); + GenericLookupKey key = new GenericLookupKey(runtimeLookupKind, fixupKind, typeArgument, methodArgument: null, fieldArgument: null, methodContext); return _genericLookupHelpers.GetOrAdd(key); } @@ -694,10 +578,9 @@ private ISymbolNode GenericLookupFieldHelper( CORINFO_RUNTIME_LOOKUP_KIND runtimeLookupKind, ReadyToRunFixupKind fixupKind, FieldDesc fieldArgument, - GenericContext methodContext, - SignatureContext signatureContext) + GenericContext methodContext) { - GenericLookupKey key = new GenericLookupKey(runtimeLookupKind, fixupKind, typeArgument: null, methodArgument: null, fieldArgument: fieldArgument, methodContext, signatureContext); + GenericLookupKey key = new GenericLookupKey(runtimeLookupKind, fixupKind, typeArgument: null, methodArgument: null, fieldArgument: fieldArgument, methodContext); return _genericLookupHelpers.GetOrAdd(key); } @@ -705,31 +588,26 @@ private ISymbolNode GenericLookupMethodHelper( CORINFO_RUNTIME_LOOKUP_KIND runtimeLookupKind, ReadyToRunFixupKind fixupKind, MethodWithToken methodArgument, - GenericContext methodContext, - SignatureContext signatureContext) + GenericContext methodContext) { - GenericLookupKey key = new GenericLookupKey(runtimeLookupKind, fixupKind, typeArgument: null, methodArgument, fieldArgument: null, methodContext, signatureContext); + GenericLookupKey key = new GenericLookupKey(runtimeLookupKind, fixupKind, typeArgument: null, methodArgument, fieldArgument: null, methodContext); return _genericLookupHelpers.GetOrAdd(key); } private struct PInvokeTargetKey : IEquatable { public readonly MethodWithToken MethodWithToken; - public readonly SignatureContext SignatureContext; public readonly bool IsIndirect; - public PInvokeTargetKey(MethodWithToken methodWithToken, SignatureContext signatureContext, bool isIndirect) + public PInvokeTargetKey(MethodWithToken methodWithToken, bool isIndirect) { MethodWithToken = methodWithToken; - SignatureContext = signatureContext; IsIndirect = isIndirect; } public bool Equals(PInvokeTargetKey other) { - return IsIndirect.Equals(other.IsIndirect) - && MethodWithToken.Equals(other.MethodWithToken) - && SignatureContext.Equals(other.SignatureContext); + return IsIndirect.Equals(other.IsIndirect) && MethodWithToken.Equals(other.MethodWithToken); } public override bool Equals(object obj) @@ -739,22 +617,20 @@ public override bool Equals(object obj) public override int GetHashCode() { - return IsIndirect.GetHashCode() - ^ (MethodWithToken.GetHashCode() * 23) - ^ (SignatureContext.GetHashCode() * 31); + return IsIndirect.GetHashCode() ^ (MethodWithToken.GetHashCode() * 23); } } private NodeCache _pInvokeTargetNodes = new NodeCache(); - public ISymbolNode GetIndirectPInvokeTargetNode(MethodWithToken methodWithToken, SignatureContext signatureContext) + public ISymbolNode GetIndirectPInvokeTargetNode(MethodWithToken methodWithToken) { - return _pInvokeTargetNodes.GetOrAdd(new PInvokeTargetKey(methodWithToken, signatureContext, isIndirect: true)); + return _pInvokeTargetNodes.GetOrAdd(new PInvokeTargetKey(methodWithToken, isIndirect: true)); } - public ISymbolNode GetPInvokeTargetNode(MethodWithToken methodWithToken, SignatureContext signatureContext) + public ISymbolNode GetPInvokeTargetNode(MethodWithToken methodWithToken) { - return _pInvokeTargetNodes.GetOrAdd(new PInvokeTargetKey(methodWithToken, signatureContext, isIndirect: false)); + return _pInvokeTargetNodes.GetOrAdd(new PInvokeTargetKey(methodWithToken, isIndirect: false)); } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/TypeAndMethod.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/TypeAndMethod.cs index b03c7d547773d1..871e5a0ea78bf2 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/TypeAndMethod.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/TypeAndMethod.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -18,16 +18,14 @@ internal struct TypeAndMethod : IEquatable public readonly bool IsUnboxingStub; public readonly bool IsInstantiatingStub; public readonly bool IsPrecodeImportRequired; - public readonly SignatureContext SignatureContext; - public TypeAndMethod(TypeDesc type, MethodWithToken method, bool isUnboxingStub, bool isInstantiatingStub, bool isPrecodeImportRequired, SignatureContext signatureContext) + public TypeAndMethod(TypeDesc type, MethodWithToken method, bool isUnboxingStub, bool isInstantiatingStub, bool isPrecodeImportRequired) { Type = type; Method = method; IsUnboxingStub = isUnboxingStub; IsInstantiatingStub = isInstantiatingStub; IsPrecodeImportRequired = isPrecodeImportRequired; - SignatureContext = signatureContext; } public bool Equals(TypeAndMethod other) @@ -36,8 +34,7 @@ public bool Equals(TypeAndMethod other) Method.Equals(other.Method) && IsUnboxingStub == other.IsUnboxingStub && IsInstantiatingStub == other.IsInstantiatingStub && - IsPrecodeImportRequired == other.IsPrecodeImportRequired && - SignatureContext.Equals(other.SignatureContext); + IsPrecodeImportRequired == other.IsPrecodeImportRequired; } public override bool Equals(object obj) @@ -47,12 +44,11 @@ public override bool Equals(object obj) public override int GetHashCode() { - return (Type?.GetHashCode() ?? 0) ^ - unchecked(Method.GetHashCode() * 31) ^ - (IsUnboxingStub ? -0x80000000 : 0) ^ + return (Type?.GetHashCode() ?? 0) ^ + unchecked(Method.GetHashCode() * 31) ^ + (IsUnboxingStub ? -0x80000000 : 0) ^ (IsInstantiatingStub ? 0x40000000 : 0) ^ - (IsPrecodeImportRequired ? 0x20000000 : 0) ^ - (SignatureContext.GetHashCode() * 23); + (IsPrecodeImportRequired ? 0x20000000 : 0); } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/IRootingServiceProvider.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/IRootingServiceProvider.cs index deb14d0684e485..e6bfd1ff9d6a87 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/IRootingServiceProvider.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/IRootingServiceProvider.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/MethodExtensions.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/MethodExtensions.cs index 340a40b82ad598..e2d4aa7cbfa2b2 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/MethodExtensions.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/MethodExtensions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/PerfEventSource.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/PerfEventSource.cs index fa9ca6c8e0373a..7f981a72cda568 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/PerfEventSource.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/PerfEventSource.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ProfileData.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ProfileData.cs index f0e8cb591fc156..3c41e6b5053d19 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ProfileData.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ProfileData.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs index 663c536d063c12..03be7bab7e8ea0 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -18,6 +18,8 @@ using ILCompiler.DependencyAnalysis; using ILCompiler.DependencyAnalysis.ReadyToRun; using ILCompiler.DependencyAnalysisFramework; +using Internal.TypeSystem.Ecma; +using System.Linq; namespace ILCompiler { @@ -187,9 +189,9 @@ public sealed class ReadyToRunCodegenCompilation : Compilation private readonly ConditionalWeakTable _corInfoImpls; /// - /// Name of the compilation input MSIL file. + /// Input MSIL file names. /// - private readonly string _inputFilePath; + private readonly IEnumerable _inputFiles; private bool _resilient; @@ -206,40 +208,86 @@ internal ReadyToRunCodegenCompilation( ILProvider ilProvider, Logger logger, DevirtualizationManager devirtualizationManager, - string inputFilePath, - IEnumerable modulesBeingInstrumented, + IEnumerable inputFiles, bool resilient, bool generateMapFile, int parallelism) - : base(dependencyGraph, nodeFactory, roots, ilProvider, devirtualizationManager, modulesBeingInstrumented, logger) + : base( + dependencyGraph, + nodeFactory, + roots, + ilProvider, + devirtualizationManager, + modulesBeingInstrumented: nodeFactory.CompilationModuleGroup.CompilationModuleSet, + logger) { _resilient = resilient; _parallelism = parallelism; _generateMapFile = generateMapFile; SymbolNodeFactory = new ReadyToRunSymbolNodeFactory(nodeFactory); - - _inputFilePath = inputFilePath; - _corInfoImpls = new ConditionalWeakTable(); + _inputFiles = inputFiles; } public override void Compile(string outputFile) { - using (FileStream inputFile = File.OpenRead(_inputFilePath)) - { - PEReader inputPeReader = new PEReader(inputFile); + _dependencyGraph.ComputeMarkedNodes(); + var nodes = _dependencyGraph.MarkedNodeList; - _dependencyGraph.ComputeMarkedNodes(); - var nodes = _dependencyGraph.MarkedNodeList; + using (PerfEventSource.StartStopEvents.EmittingEvents()) + { + NodeFactory.SetMarkingComplete(); + ReadyToRunObjectWriter.EmitObject(outputFile, componentModule: null, nodes, NodeFactory, _generateMapFile); + CompilationModuleGroup moduleGroup = _nodeFactory.CompilationModuleGroup; - using (PerfEventSource.StartStopEvents.EmittingEvents()) + if (moduleGroup.IsCompositeBuildMode) { - NodeFactory.SetMarkingComplete(); - ReadyToRunObjectWriter.EmitObject(inputPeReader, outputFile, nodes, NodeFactory, _generateMapFile); + // In composite mode with standalone MSIL we rewrite all input MSIL assemblies to the + // output folder, adding a format R2R header to them with forwarding information to + // the composite executable. + string outputDirectory = Path.GetDirectoryName(outputFile); + string ownerExecutableName = Path.GetFileName(outputFile); + foreach (string inputFile in _inputFiles) + { + string standaloneMsilOutputFile = Path.Combine(outputDirectory, Path.GetFileName(inputFile)); + RewriteComponentFile(inputFile: inputFile, outputFile: standaloneMsilOutputFile, ownerExecutableName: ownerExecutableName); + } } } } + private void RewriteComponentFile(string inputFile, string outputFile, string ownerExecutableName) + { + EcmaModule inputModule = NodeFactory.TypeSystemContext.GetModuleFromPath(inputFile); + + CopiedCorHeaderNode copiedCorHeader = new CopiedCorHeaderNode(inputModule); + DebugDirectoryNode debugDirectory = new DebugDirectoryNode(inputModule); + NodeFactory componentFactory = new NodeFactory( + _nodeFactory.TypeSystemContext, + _nodeFactory.CompilationModuleGroup, + _nodeFactory.NameMangler, + copiedCorHeader, + debugDirectory, + win32Resources: new Win32Resources.ResourceData(inputModule), + Internal.ReadyToRunConstants.ReadyToRunFlags.READYTORUN_FLAG_Component); + + IComparer> comparer = new SortableDependencyNode.ObjectNodeComparer(new CompilerComparer()); + DependencyAnalyzerBase componentGraph = new DependencyAnalyzer, NodeFactory>(componentFactory, comparer); + + componentGraph.AddRoot(componentFactory.Header, "Component module R2R header"); + OwnerCompositeExecutableNode ownerExecutableNode = new OwnerCompositeExecutableNode(_nodeFactory.Target, ownerExecutableName); + componentGraph.AddRoot(ownerExecutableNode, "Owner composite executable name"); + componentGraph.AddRoot(copiedCorHeader, "Copied COR header"); + componentGraph.AddRoot(debugDirectory, "Debug directory"); + if (componentFactory.Win32ResourcesNode != null) + { + componentGraph.AddRoot(componentFactory.Win32ResourcesNode, "Win32 resources"); + } + componentGraph.ComputeMarkedNodes(); + componentFactory.Header.Add(Internal.Runtime.ReadyToRunSectionType.OwnerCompositeExecutable, ownerExecutableNode, ownerExecutableNode); + ReadyToRunObjectWriter.EmitObject(outputFile, componentModule: inputModule, componentGraph.MarkedNodeList, componentFactory, generateMapFile: false); + } + public override void WriteDependencyLog(string outputFileName) { using (FileStream dgmlOutput = new FileStream(outputFileName, FileMode.Create)) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs index bacab9d70ac3a1..1fc68ea130bbfd 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs @@ -1,10 +1,11 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.IO; +using System.Linq; using ILCompiler.DependencyAnalysis; using ILCompiler.DependencyAnalysis.ReadyToRun; using ILCompiler.DependencyAnalysisFramework; @@ -19,12 +20,12 @@ namespace ILCompiler { public sealed class ReadyToRunCodegenCompilationBuilder : CompilationBuilder { - private readonly string _inputFilePath; - private readonly EcmaModule _inputModule; + private readonly IEnumerable _inputFiles; private bool _ibcTuning; private bool _resilient; private bool _generateMapFile; private int _parallelism; + private string _jitPath; // These need to provide reasonable defaults so that the user can optionally skip @@ -32,11 +33,10 @@ public sealed class ReadyToRunCodegenCompilationBuilder : CompilationBuilder private KeyValuePair[] _ryujitOptions = Array.Empty>(); private ILProvider _ilProvider = new ReadyToRunILProvider(); - public ReadyToRunCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group, string inputFilePath) + public ReadyToRunCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group, IEnumerable inputFiles) : base(context, group, new CoreRTNameMangler()) { - _inputFilePath = inputFilePath; - _inputModule = context.GetModuleFromPath(_inputFilePath); + _inputFiles = inputFiles; // R2R field layout needs compilation group information ((ReadyToRunCompilerContext)context).SetCompilationGroup(group); @@ -108,26 +108,17 @@ public ReadyToRunCodegenCompilationBuilder UseParallelism(int parallelism) return this; } - public override ICompilation ToCompilation() { - ModuleTokenResolver moduleTokenResolver = new ModuleTokenResolver(_compilationGroup, _context); - SignatureContext signatureContext = new SignatureContext(_inputModule, moduleTokenResolver); - CopiedCorHeaderNode corHeaderNode = new CopiedCorHeaderNode(_inputModule); - AttributePresenceFilterNode attributePresenceFilterNode = null; - DebugDirectoryNode debugDirectoryNode = new DebugDirectoryNode(_inputModule); - - // Core library attributes are checked FAR more often than other dlls - // attributes, so produce a highly efficient table for determining if they are - // present. Other assemblies *MAY* benefit from this feature, but it doesn't show - // as useful at this time. - if (_inputModule == _inputModule.Context.SystemModule) - { - attributePresenceFilterNode = new AttributePresenceFilterNode(_inputModule); - } + // TODO: only copy COR headers for single-assembly build and for composite build with embedded MSIL + IEnumerable inputModules = _compilationGroup.CompilationModuleSet; + CopiedCorHeaderNode corHeaderNode = (_compilationGroup.IsCompositeBuildMode ? null : new CopiedCorHeaderNode(inputModules.First())); + // TODO: proper support for multiple input files + DebugDirectoryNode debugDirectoryNode = new DebugDirectoryNode(inputModules.First()); // Produce a ResourceData where the IBC PROFILE_DATA entry has been filtered out - ResourceData win32Resources = new ResourceData(_inputModule, (object type, object name, ushort language) => + // TODO: proper support for multiple input files + ResourceData win32Resources = new ResourceData(inputModules.First(), (object type, object name, ushort language) => { if (!(type is string) || !(name is string)) return true; @@ -144,23 +135,20 @@ public override ICompilation ToCompilation() }); ReadyToRunFlags flags = ReadyToRunFlags.READYTORUN_FLAG_NonSharedPInvokeStubs; - if (_inputModule.IsPlatformNeutral) + if (inputModules.All(module => module.IsPlatformNeutral)) + { flags |= ReadyToRunFlags.READYTORUN_FLAG_PlatformNeutralSource; + } flags |= _compilationGroup.GetReadyToRunFlags(); - var header = new HeaderNode(_context.Target, flags); - NodeFactory factory = new NodeFactory( _context, _compilationGroup, _nameMangler, - moduleTokenResolver, - signatureContext, corHeaderNode, debugDirectoryNode, win32Resources, - attributePresenceFilterNode, - header); + flags); IComparer> comparer = new SortableDependencyNode.ObjectNodeComparer(new CompilerComparer()); DependencyAnalyzerBase graph = CreateDependencyGraph(factory, comparer); @@ -199,8 +187,7 @@ public override ICompilation ToCompilation() _ilProvider, _logger, new DependencyAnalysis.ReadyToRun.DevirtualizationManager(_compilationGroup), - _inputFilePath, - new ModuleDesc[] { _inputModule }, + _inputFiles, _resilient, _generateMapFile, _parallelism); diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs index 646bb3fcfefff3..d313f1fa3b6372 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs @@ -1,7 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Collections.Concurrent; using System.Collections.Generic; using Internal.TypeSystem; @@ -9,27 +10,31 @@ using Internal.TypeSystem.Interop; using ILCompiler.DependencyAnalysis.ReadyToRun; using Debug = System.Diagnostics.Debug; -using System; namespace ILCompiler { public abstract class ReadyToRunCompilationModuleGroupBase : CompilationModuleGroup { - protected readonly HashSet _compilationModuleSet; + protected readonly HashSet _compilationModuleSet; private readonly HashSet _versionBubbleModuleSet; private Dictionary _typeRefsInCompilationModuleSet; private readonly bool _compileGenericDependenciesFromVersionBubbleModuleSet; + private readonly bool _isCompositeBuildMode; private readonly ConcurrentDictionary _containsTypeLayoutCache = new ConcurrentDictionary(); private readonly ConcurrentDictionary _versionsWithTypeCache = new ConcurrentDictionary(); private readonly ConcurrentDictionary _versionsWithMethodCache = new ConcurrentDictionary(); public ReadyToRunCompilationModuleGroupBase( TypeSystemContext context, - IEnumerable compilationModuleSet, + bool isCompositeBuildMode, + IEnumerable compilationModuleSet, IEnumerable versionBubbleModuleSet, bool compileGenericDependenciesFromVersionBubbleModuleSet) { - _compilationModuleSet = new HashSet(compilationModuleSet); + _compilationModuleSet = new HashSet(compilationModuleSet); + _isCompositeBuildMode = isCompositeBuildMode; + + Debug.Assert(_isCompositeBuildMode || _compilationModuleSet.Count == 1); _versionBubbleModuleSet = new HashSet(versionBubbleModuleSet); _versionBubbleModuleSet.UnionWith(_compilationModuleSet); @@ -213,6 +218,10 @@ public sealed override bool TryGetModuleTokenForExternalType(TypeDesc type, out return _typeRefsInCompilationModuleSet.TryGetValue(type, out token); } + public sealed override bool IsCompositeBuildMode => _isCompositeBuildMode; + + public sealed override IEnumerable CompilationModuleSet => _compilationModuleSet; + private bool ComputeTypeVersionsWithCode(TypeDesc type) { if (type.IsCanonicalDefinitionType(CanonicalFormKind.Any)) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs index 869dd552f8a4ae..a5871e473ee1e9 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunHashCode.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunHashCode.cs index 5abc694cfd74ad..dce784b8b42637 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunHashCode.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunHashCode.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs index 4adcbf615cbac6..1870e823746876 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs index b6244393c9d6e8..5079e20cd04560 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs @@ -810,7 +810,7 @@ protected override ComputedInstanceFieldLayout ComputeInstanceFieldLayout(Metada /// This method decides whether the type needs aligned base offset in order to have layout resilient to /// base class layout changes. /// - protected override void AlignBaseOffsetIfNecessary(MetadataType type, ref LayoutInt baseOffset) + protected override void AlignBaseOffsetIfNecessary(MetadataType type, ref LayoutInt baseOffset, bool requiresAlign8) { if (type.IsValueType) { @@ -837,7 +837,8 @@ protected override void AlignBaseOffsetIfNecessary(MetadataType type, ref Layout } LayoutInt alignment = new LayoutInt(type.Context.Target.PointerSize); - if (type.RequiresAlign8()) + + if (requiresAlign8) { alignment = new LayoutInt(8); } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunSingleAssemblyCompilationModuleGroup.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunSingleAssemblyCompilationModuleGroup.cs index 5e38edec52ac62..f4e85d18aa270c 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunSingleAssemblyCompilationModuleGroup.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunSingleAssemblyCompilationModuleGroup.cs @@ -1,10 +1,12 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; -using Internal.TypeSystem; + using Internal.ReadyToRunConstants; +using Internal.TypeSystem; +using Internal.TypeSystem.Ecma; using Debug = System.Diagnostics.Debug; @@ -16,11 +18,13 @@ public class ReadyToRunSingleAssemblyCompilationModuleGroup : ReadyToRunCompilat private bool _profileGuidedCompileRestrictionSet; public ReadyToRunSingleAssemblyCompilationModuleGroup( - TypeSystemContext context, - IEnumerable compilationModuleSet, + TypeSystemContext context, + bool isCompositeBuildMode, + IEnumerable compilationModuleSet, IEnumerable versionBubbleModuleSet, bool compileGenericDependenciesFromVersionBubbleModuleSet) : base(context, + isCompositeBuildMode, compilationModuleSet, versionBubbleModuleSet, compileGenericDependenciesFromVersionBubbleModuleSet) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunTableManager.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunTableManager.cs index 44d38a26608791..aac7899051ce11 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunTableManager.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunTableManager.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -78,27 +78,19 @@ public class ReadyToRunTableManager : MetadataManager public ReadyToRunTableManager(CompilerTypeSystemContext typeSystemContext) : base(typeSystemContext) {} - public IEnumerable> GetDefinedTypes() + public IEnumerable> GetDefinedTypes(EcmaModule module) { - foreach (string inputFile in _typeSystemContext.InputFilePaths.Values) + foreach (TypeDefinitionHandle typeDefHandle in module.MetadataReader.TypeDefinitions) { - EcmaModule module = _typeSystemContext.GetModuleFromPath(inputFile); - foreach (TypeDefinitionHandle typeDefHandle in module.MetadataReader.TypeDefinitions) - { - yield return new TypeInfo(module.MetadataReader, typeDefHandle); - } + yield return new TypeInfo(module.MetadataReader, typeDefHandle); } } - public IEnumerable> GetExportedTypes() + public IEnumerable> GetExportedTypes(EcmaModule module) { - foreach (string inputFile in _typeSystemContext.InputFilePaths.Values) + foreach (ExportedTypeHandle exportedTypeHandle in module.MetadataReader.ExportedTypes) { - EcmaModule module = _typeSystemContext.GetModuleFromPath(inputFile); - foreach (ExportedTypeHandle exportedTypeHandle in module.MetadataReader.ExportedTypes) - { - yield return new TypeInfo(module.MetadataReader, exportedTypeHandle); - } + yield return new TypeInfo(module.MetadataReader, exportedTypeHandle); } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/RuntimeDeterminedTypeHelper.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/RuntimeDeterminedTypeHelper.cs index a52d7dc818ba86..fdd74ef3b6519d 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/RuntimeDeterminedTypeHelper.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/RuntimeDeterminedTypeHelper.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/SingleMethodCompilationModuleGroup.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/SingleMethodCompilationModuleGroup.cs index cb1653ca6f1edb..11c0b2ea288d7c 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/SingleMethodCompilationModuleGroup.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/SingleMethodCompilationModuleGroup.cs @@ -1,10 +1,11 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using Internal.ReadyToRunConstants; using Internal.TypeSystem; +using Internal.TypeSystem.Ecma; namespace ILCompiler { @@ -18,11 +19,13 @@ public class SingleMethodCompilationModuleGroup : ReadyToRunCompilationModuleGro public SingleMethodCompilationModuleGroup( TypeSystemContext context, - IEnumerable compilationModuleSet, + bool isCompositeBuildMode, + IEnumerable compilationModuleSet, IEnumerable versionBubbleModuleSet, bool compileGenericDependenciesFromVersionBubbleModuleSet, MethodDesc method) : base(context, + isCompositeBuildMode, compilationModuleSet, versionBubbleModuleSet, compileGenericDependenciesFromVersionBubbleModuleSet) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/SystemObjectFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/SystemObjectFieldLayoutAlgorithm.cs index 9a57a3170dfd2b..769ed2d09bb9b5 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/SystemObjectFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/SystemObjectFieldLayoutAlgorithm.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/IBCProfileData.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/IBCProfileData.cs index 7f819a07d5c761..eaf1673f94178e 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/IBCProfileData.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/IBCProfileData.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -15,10 +15,10 @@ public IBCProfileData(bool partialNGen, IEnumerable methodDat { foreach (MethodProfileData data in methodData) { - if (_methodData.ContainsKey(data.Method)) - throw new Exception("Multiple copies of data for the same method"); - - _methodData.Add(data.Method, data); + if (!_methodData.ContainsKey(data.Method)) + { + _methodData.Add(data.Method, data); + } } _partialNGen = partialNGen; } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/IBCProfileParser.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/IBCProfileParser.cs index 937d732bdf7d19..f4388674941e87 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/IBCProfileParser.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/IBCProfileParser.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/MIbcProfileParser.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/MIbcProfileParser.cs index fdb32e54bcb1e0..39b1a4ba10c942 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/MIbcProfileParser.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/IBC/MIbcProfileParser.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj index e1bddaaf0e4a4e..65d5ccb5f460a8 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj @@ -1,4 +1,4 @@ - + Library ILCompiler.ReadyToRun @@ -99,6 +99,7 @@ + @@ -130,6 +131,7 @@ + diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs index 23d43df454bd80..0b07c472f6cbda 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs @@ -227,12 +227,6 @@ public void CompileMethod(IReadyToRunMethodCodeNode methodCodeNodeNeedingCode) } } - private SignatureContext GetSignatureContext() - { - // TODO: this will need changing when compiling multiple input MSIL modules into a single PE executable - return _compilation.NodeFactory.InputModuleContext; - } - private bool getReadyToRunHelper(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_LOOKUP_KIND pGenericLookupKind, CorInfoHelpFunc id, ref CORINFO_CONST_LOOKUP pLookup) { switch (id) @@ -244,7 +238,7 @@ private bool getReadyToRunHelper(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref if (type.IsCanonicalSubtype(CanonicalFormKind.Any)) return false; - pLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.NewHelper, type, GetSignatureContext())); + pLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.NewHelper, type)); } break; case CorInfoHelpFunc.CORINFO_HELP_READYTORUN_NEWARR_1: @@ -254,7 +248,7 @@ private bool getReadyToRunHelper(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref if (type.IsCanonicalSubtype(CanonicalFormKind.Any)) return false; - pLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.NewArr1, type, GetSignatureContext())); + pLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.NewArr1, type)); } break; case CorInfoHelpFunc.CORINFO_HELP_READYTORUN_ISINSTANCEOF: @@ -267,7 +261,7 @@ private bool getReadyToRunHelper(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref if (type.IsNullable) type = type.Instantiation[0]; - pLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.IsInstanceOf, type, GetSignatureContext())); + pLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.IsInstanceOf, type)); } break; case CorInfoHelpFunc.CORINFO_HELP_READYTORUN_CHKCAST: @@ -280,7 +274,7 @@ private bool getReadyToRunHelper(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref if (type.IsNullable) type = type.Instantiation[0]; - pLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.CastClass, type, GetSignatureContext())); + pLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.CastClass, type)); } break; case CorInfoHelpFunc.CORINFO_HELP_READYTORUN_STATIC_BASE: @@ -289,7 +283,7 @@ private bool getReadyToRunHelper(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref if (type.IsCanonicalSubtype(CanonicalFormKind.Any)) return false; - pLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.CctorTrigger, type, GetSignatureContext())); + pLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.CctorTrigger, type)); } break; case CorInfoHelpFunc.CORINFO_HELP_READYTORUN_GENERIC_HANDLE: @@ -313,8 +307,7 @@ private bool getReadyToRunHelper(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref pGenericLookupKind.runtimeLookupKind, helperId, helperArg, - methodContext, - GetSignatureContext()); + methodContext); pLookup = CreateConstLookupToSymbol(helper); } break; @@ -337,8 +330,7 @@ private void getReadyToRunDelegateCtorHelper(ref CORINFO_RESOLVED_TOKEN pTargetM MethodWithToken targetMethod = new MethodWithToken(HandleToObject(pTargetMethod.hMethod), HandleToModuleToken(ref pTargetMethod), constrainedType: null); pLookup.lookupKind.needsRuntimeLookup = false; - pLookup.constLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.DelegateCtor( - delegateTypeDesc, targetMethod, GetSignatureContext())); + pLookup.constLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.DelegateCtor(delegateTypeDesc, targetMethod)); } private ISymbolNode GetHelperFtnUncached(CorInfoHelpFunc ftnNum) @@ -749,7 +741,7 @@ private InfoAccessType constructStringLiteral(CORINFO_MODULE_STRUCT_* module, md EcmaMethod method = (EcmaMethod)methodIL.OwningMethod.GetTypicalMethodDefinition(); ISymbolNode stringObject = _compilation.SymbolNodeFactory.StringLiteral( - new ModuleToken(method.Module, metaTok), GetSignatureContext()); + new ModuleToken(method.Module, metaTok)); ppValue = (void*)ObjectToHandle(stringObject); return InfoAccessType.IAT_PPVALUE; } @@ -929,6 +921,155 @@ private bool IsGenericTooDeeplyNested(Instantiation instantiation) return IsGenericTooDeeplyNested(instantiation, 0); } + private void getFieldInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_ACCESS_FLAGS flags, CORINFO_FIELD_INFO* pResult) + { +#if DEBUG + // In debug, write some bogus data to the struct to ensure we have filled everything + // properly. + MemoryHelper.FillMemory((byte*)pResult, 0xcc, Marshal.SizeOf()); +#endif + + Debug.Assert(((int)flags & ((int)CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_GET | + (int)CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_SET | + (int)CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_ADDRESS | + (int)CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_INIT_ARRAY)) != 0); + + var field = HandleToObject(pResolvedToken.hField); + MethodDesc callerMethod = HandleToObject(callerHandle); + + if (field.Offset.IsIndeterminate) + throw new RequiresRuntimeJitException(field); + + CORINFO_FIELD_ACCESSOR fieldAccessor; + CORINFO_FIELD_FLAGS fieldFlags = (CORINFO_FIELD_FLAGS)0; + uint fieldOffset = (field.IsStatic && field.HasRva ? 0xBAADF00D : (uint)field.Offset.AsInt); + + if (field.IsStatic) + { + fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_STATIC; + + if (field.FieldType.IsValueType && field.HasGCStaticBase && !field.HasRva) + { + // statics of struct types are stored as implicitly boxed in CoreCLR i.e. + // we need to modify field access flags appropriately + fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_STATIC_IN_HEAP; + } + + if (field.HasRva) + { + fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_UNMANAGED; + + // TODO: Handle the case when the RVA is in the TLS range + fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_RVA_ADDRESS; + + // We are not going through a helper. The constructor has to be triggered explicitly. + if (!IsClassPreInited(field.OwningType)) + { + fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_INITCLASS; + } + } + else if (field.OwningType.IsCanonicalSubtype(CanonicalFormKind.Any)) + { + // The JIT wants to know how to access a static field on a generic type. We need a runtime lookup. + fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_GENERICS_STATIC_HELPER; + if (field.IsThreadStatic) + { + pResult->helper = (field.HasGCStaticBase ? + CorInfoHelpFunc.CORINFO_HELP_GETGENERICS_GCTHREADSTATIC_BASE : + CorInfoHelpFunc.CORINFO_HELP_GETGENERICS_NONGCTHREADSTATIC_BASE); + } + else + { + pResult->helper = (field.HasGCStaticBase ? + CorInfoHelpFunc.CORINFO_HELP_GETGENERICS_GCSTATIC_BASE : + CorInfoHelpFunc.CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE); + } + } + else + { + fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_SHARED_STATIC_HELPER; + pResult->helper = CorInfoHelpFunc.CORINFO_HELP_READYTORUN_STATIC_BASE; + + ReadyToRunHelperId helperId = ReadyToRunHelperId.Invalid; + CORINFO_FIELD_ACCESSOR intrinsicAccessor; + if (field.IsIntrinsic && + (flags & CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_GET) != 0 && + (intrinsicAccessor = getFieldIntrinsic(field)) != (CORINFO_FIELD_ACCESSOR)(-1)) + { + fieldAccessor = intrinsicAccessor; + } + else if (field.IsThreadStatic) + { + if (field.HasGCStaticBase) + { + helperId = ReadyToRunHelperId.GetThreadStaticBase; + } + else + { + helperId = ReadyToRunHelperId.GetThreadNonGcStaticBase; + } + } + else + { + helperId = field.HasGCStaticBase ? + ReadyToRunHelperId.GetGCStaticBase : + ReadyToRunHelperId.GetNonGCStaticBase; + + // + // Currently, we only do this optimization for regular statics, but it + // looks like it may be permissible to do this optimization for + // thread statics as well. + // + if ((flags & CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_ADDRESS) != 0 && + (fieldAccessor != CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_TLS)) + { + fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_SAFESTATIC_BYREF_RETURN; + } + } + + if (!_compilation.NodeFactory.CompilationModuleGroup.VersionsWithType(field.OwningType) && + fieldAccessor == CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_SHARED_STATIC_HELPER) + { + PreventRecursiveFieldInlinesOutsideVersionBubble(field, callerMethod); + + // Static fields outside of the version bubble need to be accessed using the ENCODE_FIELD_ADDRESS + // helper in accordance with ZapInfo::getFieldInfo in CoreCLR. + pResult->fieldLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.FieldAddress(field)); + + pResult->helper = CorInfoHelpFunc.CORINFO_HELP_READYTORUN_STATIC_BASE; + + fieldFlags &= ~CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_STATIC_IN_HEAP; // The dynamic helper takes care of the unboxing + fieldOffset = 0; + } + else + if (helperId != ReadyToRunHelperId.Invalid) + { + pResult->fieldLookup = CreateConstLookupToSymbol( + _compilation.SymbolNodeFactory.CreateReadyToRunHelper(helperId, field.OwningType) + ); + } + } + } + else + { + fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_INSTANCE; + } + + if (field.IsInitOnly) + fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_FINAL; + + pResult->fieldAccessor = fieldAccessor; + pResult->fieldFlags = fieldFlags; + pResult->fieldType = getFieldType(pResolvedToken.hField, &pResult->structType, pResolvedToken.hClass); + pResult->accessAllowed = CorInfoIsAccessAllowedResult.CORINFO_ACCESS_ALLOWED; + pResult->offset = fieldOffset; + + EncodeFieldBaseOffset(field, pResult, callerMethod); + + // TODO: We need to implement access checks for fields and methods. See JitInterface.cpp in mrtjit + // and STS::AccessCheck::CanAccess. + } + private void ceeInfoGetCallInfo( ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, @@ -1308,6 +1449,8 @@ private void ceeInfoGetCallInfo( pResult->methodFlags = getMethodAttribsInternal(methodToCall); + pResult->wrapperDelegateInvoke = false; + Get_CORINFO_SIG_INFO(methodToCall, &pResult->sig, useInstantiatingStub); } @@ -1422,7 +1565,7 @@ private void classMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_STRUCT_* cls) private void classMustBeLoadedBeforeCodeIsRun(TypeDesc type) { - ISymbolNode node = _compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.TypeHandle, type, GetSignatureContext()); + ISymbolNode node = _compilation.SymbolNodeFactory.CreateReadyToRunHelper(ReadyToRunHelperId.TypeHandle, type); ((MethodWithGCInfo)_methodCodeNode).Fixups.Add(node); } @@ -1481,7 +1624,6 @@ private void getCallInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESO pResult->codePointerOrStubLookup.constLookup = CreateConstLookupToSymbol( _compilation.SymbolNodeFactory.InterfaceDispatchCell( new MethodWithToken(targetMethod, HandleToModuleToken(ref pResolvedToken, targetMethod), constrainedType: null), - GetSignatureContext(), isUnboxingStub: false, _compilation.NameMangler.GetMangledMethodName(MethodBeingCompiled).ToString())); } @@ -1519,8 +1661,7 @@ private void getCallInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESO new MethodWithToken(nonUnboxingMethod, HandleToModuleToken(ref pResolvedToken, nonUnboxingMethod), constrainedType), isUnboxingStub, isInstantiatingStub: useInstantiatingStub, - isPrecodeImportRequired: (flags & CORINFO_CALLINFO_FLAGS.CORINFO_CALLINFO_LDFTN) != 0, - GetSignatureContext())); + isPrecodeImportRequired: (flags & CORINFO_CALLINFO_FLAGS.CORINFO_CALLINFO_LDFTN) != 0)); } break; @@ -1536,8 +1677,7 @@ private void getCallInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESO pResult->codePointerOrStubLookup.constLookup = CreateConstLookupToSymbol( _compilation.NodeFactory.DynamicHelperCell( new MethodWithToken(targetMethod, HandleToModuleToken(ref pResolvedToken, targetMethod), constrainedType: null), - useInstantiatingStub, - GetSignatureContext())); + useInstantiatingStub)); Debug.Assert(!pResult->sig.hasTypeArg()); } @@ -1564,15 +1704,13 @@ private void getCallInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESO { pResult->instParamLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper( ReadyToRunHelperId.MethodDictionary, - new MethodWithToken(targetMethod, HandleToModuleToken(ref pResolvedToken, targetMethod), constrainedType), - signatureContext: GetSignatureContext())); + new MethodWithToken(targetMethod, HandleToModuleToken(ref pResolvedToken, targetMethod), constrainedType))); } else { pResult->instParamLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper( ReadyToRunHelperId.TypeDictionary, - exactType, - signatureContext: GetSignatureContext())); + exactType)); } } } @@ -1794,8 +1932,7 @@ private void embedGenericHandle(ref CORINFO_RESOLVED_TOKEN pResolvedToken, bool case CorInfoGenericHandleType.CORINFO_HANDLETYPE_CLASS: symbolNode = _compilation.SymbolNodeFactory.CreateReadyToRunHelper( ReadyToRunHelperId.TypeHandle, - HandleToObject(pResolvedToken.hClass), - GetSignatureContext()); + HandleToObject(pResolvedToken.hClass)); break; case CorInfoGenericHandleType.CORINFO_HANDLETYPE_METHOD: @@ -1810,16 +1947,14 @@ private void embedGenericHandle(ref CORINFO_RESOLVED_TOKEN pResolvedToken, bool symbolNode = _compilation.SymbolNodeFactory.CreateReadyToRunHelper( ReadyToRunHelperId.MethodHandle, - new MethodWithToken(md, HandleToModuleToken(ref pResolvedToken), constrainedType: null), - GetSignatureContext()); + new MethodWithToken(md, HandleToModuleToken(ref pResolvedToken), constrainedType: null)); } break; case CorInfoGenericHandleType.CORINFO_HANDLETYPE_FIELD: symbolNode = _compilation.SymbolNodeFactory.CreateReadyToRunHelper( ReadyToRunHelperId.FieldHandle, - HandleToObject(pResolvedToken.hField), - GetSignatureContext()); + HandleToObject(pResolvedToken.hField)); break; default: @@ -1928,7 +2063,7 @@ private void EncodeFieldBaseOffset(FieldDesc field, CORINFO_FIELD_INFO* pResult, // ENCODE_FIELD_OFFSET pResult->offset = 0; pResult->fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_INSTANCE_WITH_BASE; - pResult->fieldLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.FieldOffset(field, GetSignatureContext())); + pResult->fieldLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.FieldOffset(field)); } } else if (pMT.IsValueType) @@ -1948,7 +2083,7 @@ private void EncodeFieldBaseOffset(FieldDesc field, CORINFO_FIELD_INFO* pResult, // ENCODE_FIELD_OFFSET pResult->offset = 0; pResult->fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_INSTANCE_WITH_BASE; - pResult->fieldLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.FieldOffset(field, GetSignatureContext())); + pResult->fieldLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.FieldOffset(field)); } else { @@ -1957,7 +2092,7 @@ private void EncodeFieldBaseOffset(FieldDesc field, CORINFO_FIELD_INFO* pResult, // ENCODE_FIELD_BASE_OFFSET pResult->offset -= (uint)pMT.BaseType.InstanceByteCount.AsInt; pResult->fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_INSTANCE_WITH_BASE; - pResult->fieldLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.FieldBaseOffset(field.OwningType, GetSignatureContext())); + pResult->fieldLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.FieldBaseOffset(field.OwningType)); } } @@ -2054,12 +2189,12 @@ private void getAddressOfPInvokeTarget(CORINFO_METHOD_STRUCT_* method, ref CORIN if (ecmaMethod.IsSuppressGCTransition()) { - pLookup.addr = (void*)ObjectToHandle(_compilation.SymbolNodeFactory.GetPInvokeTargetNode(methodWithToken, GetSignatureContext())); + pLookup.addr = (void*)ObjectToHandle(_compilation.SymbolNodeFactory.GetPInvokeTargetNode(methodWithToken)); pLookup.accessType = InfoAccessType.IAT_PVALUE; } else { - pLookup.addr = (void*)ObjectToHandle(_compilation.SymbolNodeFactory.GetIndirectPInvokeTargetNode(methodWithToken, GetSignatureContext())); + pLookup.addr = (void*)ObjectToHandle(_compilation.SymbolNodeFactory.GetIndirectPInvokeTargetNode(methodWithToken)); pLookup.accessType = InfoAccessType.IAT_PPVALUE; } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs index 5815af9deec8cc..944f8b288329bc 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs @@ -96,19 +96,7 @@ public SectionRVADelta(int startRVA, int endRVA, int deltaRVA) private TargetDetails _target; /// - /// PE reader representing the input MSIL PE file we're copying to the output composite PE file. - /// - private PEReader _peReader; - - /// - /// Custom sections explicitly injected by the caller. - /// - private HashSet _customSections; - - /// - /// Complete list of section names includes the sections present in the input MSIL file - /// (.text, optionally .rsrc and .reloc) and extra questions injected during the R2R PE - /// creation. + /// Complete list of sections to emit into the output R2R executable. /// private ImmutableArray
_sections; @@ -164,16 +152,17 @@ public SectionRVADelta(int startRVA, int endRVA, int deltaRVA) /// Constructor initializes the various control structures and combines the section list. /// /// Target environment specifier - /// Input MSIL PE file reader + /// PE file header builder /// Callback to retrieve the runtime functions table public R2RPEBuilder( TargetDetails target, - PEReader peReader, + PEHeaderBuilder peHeaderBuilder, + ISymbolNode r2rHeaderExportSymbol, + string outputFileSimpleName, Func getRuntimeFunctionsTable) - : base(PEHeaderCopier.Copy(peReader.PEHeaders, target), deterministicIdProvider: null) + : base(peHeaderBuilder, deterministicIdProvider: null) { _target = target; - _peReader = peReader; _getRuntimeFunctionsTable = getRuntimeFunctionsTable; _sectionRvaDeltas = new List(); @@ -182,10 +171,11 @@ public R2RPEBuilder( _textSectionIndex = _sectionBuilder.AddSection(TextSectionName, SectionCharacteristics.ContainsCode | SectionCharacteristics.MemExecute | SectionCharacteristics.MemRead, 512); _dataSectionIndex = _sectionBuilder.AddSection(DataSectionName, SectionCharacteristics.ContainsInitializedData | SectionCharacteristics.MemWrite | SectionCharacteristics.MemRead, 512); - _customSections = new HashSet(); - foreach (SectionInfo section in _sectionBuilder.GetSections()) + if (r2rHeaderExportSymbol != null) { - _customSections.Add(section.SectionName); + _sectionBuilder.AddSection(R2RPEBuilder.ExportDataSectionName, SectionCharacteristics.ContainsInitializedData | SectionCharacteristics.MemRead, 512); + _sectionBuilder.AddExportSymbol("RTR_HEADER", 1, r2rHeaderExportSymbol); + _sectionBuilder.SetDllNameForExportDirectoryTable(outputFileSimpleName); } if (_sectionBuilder.FindSection(R2RPEBuilder.RelocSectionName) == null) @@ -196,7 +186,7 @@ public R2RPEBuilder( SectionCharacteristics.ContainsInitializedData | SectionCharacteristics.MemRead | SectionCharacteristics.MemDiscardable, - peReader.PEHeaders.PEHeader.SectionAlignment); + PEHeaderConstants.SectionAlignment); } ImmutableArray
.Builder sectionListBuilder = ImmutableArray.CreateBuilder
(); @@ -270,21 +260,18 @@ public int GetSymbolFilePosition(ISymbolNode symbol) /// Emit built sections into the R2R PE file. /// /// Output stream for the final R2R PE file - public void Write(Stream outputStream) + /// Timestamp to set in the PE header of the output R2R executable + public void Write(Stream outputStream, int timeDateStamp) { BlobBuilder outputPeFile = new BlobBuilder(); Serialize(outputPeFile); - _sectionBuilder.RelocateOutputFile( - outputPeFile, - _peReader.PEHeaders.PEHeader.ImageBase, - outputStream); + _sectionBuilder.RelocateOutputFile(outputPeFile, Header.ImageBase, outputStream); UpdateSectionRVAs(outputStream); - ApplyMachineOSOverride(outputStream); - CopyTimeStampFromInputImage(outputStream); + SetPEHeaderTimeStamp(outputStream, timeDateStamp); _written = true; } @@ -403,12 +390,13 @@ private void ApplyMachineOSOverride(Stream outputStream) } /// - /// Copy over the timestamp from IL image for determinism. + /// Set PE header timestamp in the output R2R image to a given value. /// /// Output stream representing the R2R PE executable - private void CopyTimeStampFromInputImage(Stream outputStream) + /// Timestamp to set in the R2R PE header + private void SetPEHeaderTimeStamp(Stream outputStream, int timeDateStamp) { - byte[] patchedTimestamp = BitConverter.GetBytes(_peReader.PEHeaders.CoffHeader.TimeDateStamp); + byte[] patchedTimestamp = BitConverter.GetBytes(timeDateStamp); int seekSize = DosHeaderSize + PESignatureSize + @@ -428,10 +416,13 @@ protected override PEDirectoriesBuilder GetDirectories() _sectionBuilder.UpdateDirectories(builder); - RuntimeFunctionsTableNode runtimeFunctionsTable = _getRuntimeFunctionsTable(); - builder.ExceptionTable = new DirectoryEntry( - relativeVirtualAddress: _sectionBuilder.GetSymbolRVA(runtimeFunctionsTable), - size: runtimeFunctionsTable.TableSize); + if (_getRuntimeFunctionsTable != null) + { + RuntimeFunctionsTableNode runtimeFunctionsTable = _getRuntimeFunctionsTable(); + builder.ExceptionTable = new DirectoryEntry( + relativeVirtualAddress: _sectionBuilder.GetSymbolRVA(runtimeFunctionsTable), + size: runtimeFunctionsTable.TableSize); + } return builder; } @@ -554,9 +545,11 @@ protected override BlobBuilder SerializeSection(string name, SectionLocation loc } /// - /// Simple helper for copying the various global values in the PE header. + /// Simple helper for filling in PE header information by either copying over + /// data from a pre-existing input PE header (used for single-assembly R2R files) + /// or by explicitly specifying the image characteristics (for composite R2R). /// - static class PEHeaderCopier + static class PEHeaderProvider { /// /// Copy PE headers into a PEHeaderBuilder used by PEBuilder. @@ -564,14 +557,34 @@ static class PEHeaderCopier /// Headers to copy /// Target architecture to set in the header public static PEHeaderBuilder Copy(PEHeaders peHeaders, TargetDetails target) + { + return Create( + peHeaders.CoffHeader.Characteristics, + peHeaders.PEHeader.DllCharacteristics, + peHeaders.PEHeader.Subsystem, + target); + } + + /// + /// Fill in PE header information into a PEHeaderBuilder used by PEBuilder. + /// + /// Relocs are not present in the PE executable + /// Extra DLL characteristics to apply + /// Targeting subsystem + /// Target architecture to set in the header + public static PEHeaderBuilder Create(Characteristics imageCharacteristics, DllCharacteristics dllCharacteristics, Subsystem subsystem, TargetDetails target) { bool is64BitTarget = target.PointerSize == sizeof(long); - Characteristics imageCharacteristics = peHeaders.CoffHeader.Characteristics; - if (is64BitTarget) + imageCharacteristics &= ~(Characteristics.Bit32Machine | Characteristics.LargeAddressAware); + imageCharacteristics |= (is64BitTarget ? Characteristics.LargeAddressAware : Characteristics.Bit32Machine); + + ulong imageBase = PE32HeaderConstants.ImageBase; + if (target.IsWindows && is64BitTarget && (imageBase <= uint.MaxValue)) { - imageCharacteristics &= ~Characteristics.Bit32Machine; - imageCharacteristics |= Characteristics.LargeAddressAware; + // Base addresses below 4 GiB are reserved for WoW on x64 and disallowed on ARM64. + // If the input assembly was compiled for anycpu, its base address is 32-bit and we need to fix it. + imageBase = (imageCharacteristics & Characteristics.Dll) != 0 ? PE64HeaderConstants.DllImageBase : PE64HeaderConstants.ExeImageBase; } int fileAlignment = 0x200; @@ -589,43 +602,39 @@ public static PEHeaderBuilder Copy(PEHeaders peHeaders, TargetDetails target) sectionAlignment = fileAlignment; } - DllCharacteristics dllCharacteristics = DllCharacteristics.DynamicBase | DllCharacteristics.NxCompatible; - - if (!is64BitTarget) - { - dllCharacteristics |= DllCharacteristics.NoSeh; - } + dllCharacteristics &= (DllCharacteristics.NxCompatible | DllCharacteristics.TerminalServerAware | DllCharacteristics.AppContainer); - // Copy over selected DLL characteristics bits from IL image - dllCharacteristics |= peHeaders.PEHeader.DllCharacteristics & - (DllCharacteristics.TerminalServerAware | DllCharacteristics.AppContainer); + // In Crossgen1, this is under a debug-specific condition 'if (0 == CLRConfig::GetConfigValue(CLRConfig::INTERNAL_NoASLRForNgen))' + dllCharacteristics |= DllCharacteristics.DynamicBase; if (is64BitTarget) { dllCharacteristics |= DllCharacteristics.HighEntropyVirtualAddressSpace; } + else + { + dllCharacteristics |= DllCharacteristics.NoSeh; + } return new PEHeaderBuilder( machine: target.MachineFromTarget(), sectionAlignment: sectionAlignment, fileAlignment: fileAlignment, - imageBase: peHeaders.PEHeader.ImageBase, - majorLinkerVersion: 11, - minorLinkerVersion: 0, - majorOperatingSystemVersion: 5, - // Win2k = 5.0 for 32-bit images, Win2003 = 5.2 for 64-bit images - minorOperatingSystemVersion: is64BitTarget ? (ushort)2 : (ushort)0, - majorImageVersion: peHeaders.PEHeader.MajorImageVersion, - minorImageVersion: peHeaders.PEHeader.MinorImageVersion, - majorSubsystemVersion: peHeaders.PEHeader.MajorSubsystemVersion, - minorSubsystemVersion: peHeaders.PEHeader.MinorSubsystemVersion, - subsystem: peHeaders.PEHeader.Subsystem, + majorLinkerVersion: PEHeaderConstants.MajorLinkerVersion, + minorLinkerVersion: PEHeaderConstants.MinorLinkerVersion, + majorOperatingSystemVersion: PEHeaderConstants.MajorOperatingSystemVersion, + minorOperatingSystemVersion: PEHeaderConstants.MinorOperatingSystemVersion, + majorImageVersion: PEHeaderConstants.MajorImageVersion, + minorImageVersion: PEHeaderConstants.MinorImageVersion, + majorSubsystemVersion: PEHeaderConstants.MajorSubsystemVersion, + minorSubsystemVersion: PEHeaderConstants.MinorSubsystemVersion, + subsystem: subsystem, dllCharacteristics: dllCharacteristics, imageCharacteristics: imageCharacteristics, - sizeOfStackReserve: peHeaders.PEHeader.SizeOfStackReserve, - sizeOfStackCommit: peHeaders.PEHeader.SizeOfStackCommit, - sizeOfHeapReserve: 0, - sizeOfHeapCommit: 0); + sizeOfStackReserve: (is64BitTarget ? PE64HeaderConstants.SizeOfStackReserve : PE32HeaderConstants.SizeOfStackReserve), + sizeOfStackCommit: (is64BitTarget ? PE64HeaderConstants.SizeOfStackCommit : PE32HeaderConstants.SizeOfStackCommit), + sizeOfHeapReserve: (is64BitTarget ? PE64HeaderConstants.SizeOfHeapReserve : PE32HeaderConstants.SizeOfHeapReserve), + sizeOfHeapCommit: (is64BitTarget ? PE64HeaderConstants.SizeOfHeapCommit : PE32HeaderConstants.SizeOfHeapCommit)); } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/RelocationHelper.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/RelocationHelper.cs index 5bff2d3374f6a5..819888a1a87c75 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/RelocationHelper.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/RelocationHelper.cs @@ -193,7 +193,9 @@ public void ProcessRelocation(RelocType relocationType, int sourceRVA, int targe case RelocType.IMAGE_REL_BASED_ARM64_PAGEBASE_REL21: { relocationLength = 4; - delta = (targetRVA - sourceRVA) >> 12; + int sourcePageRVA = sourceRVA & ~0xfff; + // Page delta always fits in 21 bits as long as we use 4-byte RVAs + delta = ((targetRVA - sourcePageRVA) >> 12) & 0x1ffff; break; } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs index 4a8bb8dc3a1dba..904bea5ec0397c 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs @@ -245,7 +245,10 @@ public class SectionBuilder DirectoryEntry _relocationDirectoryEntry; /// - /// Symbol representing the ready-to-run header table. + /// Symbol representing the ready-to-run COR (MSIL) header table. + /// Only present in single-file R2R executables. Composite R2R + /// executables don't have a COR header and locate the ReadyToRun + /// header directly using the well-known export symbol RTR_HEADER. /// ISymbolNode _corHeaderSymbol; @@ -524,11 +527,6 @@ public IEnumerable GetSections() } } - if (_exportSymbols.Count != 0 && FindSection(R2RPEBuilder.ExportDataSectionName) == null) - { - sectionList.Add(new SectionInfo(R2RPEBuilder.ExportDataSectionName, SectionCharacteristics.ContainsInitializedData | SectionCharacteristics.MemRead)); - } - return sectionList; } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs index 5c3fce29c01b91..d4ba4683609c2e 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -22,6 +22,48 @@ public enum MachineOSOverride : ushort NetBSD = 0x1993, } + /// + /// Constants for emission of Windows PE file mostly copied from CoreCLR pewriter.cpp. + /// + public static class PEHeaderConstants + { + public const int SectionAlignment = 0x1000; + + public const byte MajorLinkerVersion = 11; + public const byte MinorLinkerVersion = 0; + + public const byte MajorOperatingSystemVersion = 4; + public const byte MinorOperatingSystemVersion = 0; + + public const ushort MajorImageVersion = 0; + public const ushort MinorImageVersion = 0; + + public const ushort MajorSubsystemVersion = 4; + public const ushort MinorSubsystemVersion = 0; + } + + public static class PE32HeaderConstants + { + public const uint ImageBase = 0x0040_0000; + + public const uint SizeOfStackReserve = 0x100000; + public const uint SizeOfStackCommit = 0x1000; + public const uint SizeOfHeapReserve = 0x100000; + public const uint SizeOfHeapCommit = 0x1000; + } + + public static class PE64HeaderConstants + { + // Default base addresses used by Roslyn + public const ulong ExeImageBase = 0x1_4000_0000; + public const ulong DllImageBase = 0x1_8000_0000; + + public const ulong SizeOfStackReserve = 0x400000; + public const ulong SizeOfStackCommit = 0x4000; + public const ulong SizeOfHeapReserve = 0x100000; + public const ulong SizeOfHeapCommit = 0x2000; + } + public static class TargetExtensions { /// diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.Reader.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.Reader.cs index b9b33530477e83..3f7a9eac51a6ec 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.Reader.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.Reader.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.ResourcesDataModel.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.ResourcesDataModel.cs index 266e4e2c46c02e..ebd5f4318ac204 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.ResourcesDataModel.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.ResourcesDataModel.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.UpdateResourceDataModel.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.UpdateResourceDataModel.cs index 37f80abebc2193..45c9a2ede79d7a 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.UpdateResourceDataModel.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.UpdateResourceDataModel.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.Win32Structs.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.Win32Structs.cs index 74aa6d1d2685f9..c03d317abec9e1 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.Win32Structs.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.Win32Structs.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.cs index daa10dd464f7c8..11bf1091a5ae1a 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Win32Resources/ResourceData.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs index 2cf9145d617257..c3e3633dbfe833 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcSlotTable.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcSlotTable.cs index 5e7ed645304428..ef2516636eacb0 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcSlotTable.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcSlotTable.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcTransition.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcTransition.cs index 5aa188045f511b..a1c2e7834daacf 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcTransition.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcTransition.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/Registers.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/Registers.cs index d6b105dade8985..440a7e0c14f9d1 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/Registers.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/Registers.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/UnwindInfo.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/UnwindInfo.cs index 097aa8ad95d9a7..2c03e78445659f 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/UnwindInfo.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/UnwindInfo.cs @@ -1,7 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Collections.Generic; using System.Text; @@ -236,8 +237,7 @@ private void ParseUnwindCode(ref int i) code.NextFrameOffset = (int)offset * 16; if ((UnwindCodeArray[i].FrameOffset & 0xF0000000) != 0) { - // TODO (refactoring) - what should we do? - // R2RDump.WriteWarning("Illegal unwindInfo unscaled offset: too large"); + throw new BadImageFormatException("Warning: Illegal unwindInfo unscaled offset: too large"); } } break; diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm/Registers.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm/Registers.cs index fa6906345eb734..9db472d49dfa19 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm/Registers.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm/Registers.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm/UnwindInfo.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm/UnwindInfo.cs index 4c7f3c408a35cd..303eedafe59bdd 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm/UnwindInfo.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm/UnwindInfo.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm64/Registers.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm64/Registers.cs index c4e545b0acaa7d..003c630d676c7d 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm64/Registers.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm64/Registers.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm64/UnwindInfo.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm64/UnwindInfo.cs index d74cd636cd8e4e..bae1f904434102 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm64/UnwindInfo.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm64/UnwindInfo.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/DisassemblingTypeProvider.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/DisassemblingTypeProvider.cs index 03514296306ba3..308764a2b4c58c 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/DisassemblingTypeProvider.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/DisassemblingTypeProvider.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/EHInfo.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/EHInfo.cs index 660d47a2001e9f..9eee53cf43a3ad 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/EHInfo.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/EHInfo.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -95,7 +95,15 @@ public EHClause(ReadyToRunReader reader, int offset) if ((Flags & CorExceptionFlag.COR_ILEXCEPTION_CLAUSE_KIND_MASK) == CorExceptionFlag.COR_ILEXCEPTION_CLAUSE_NONE) { - ClassName = MetadataNameFormatter.FormatHandle(reader.MetadataReader, MetadataTokens.Handle((int)ClassTokenOrFilterOffset)); + if (reader.Composite) + { + // TODO: EH clauses in composite mode + ClassName = "TODO-composite module in EH clause"; + } + else + { + ClassName = MetadataNameFormatter.FormatHandle(reader.GetGlobalMetadataReader(), MetadataTokens.Handle((int)ClassTokenOrFilterOffset)); + } } } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/GCInfoTypes.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/GCInfoTypes.cs index fa2c8d1a475c36..c3fcfd192a8a41 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/GCInfoTypes.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/GCInfoTypes.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/GCRefMap.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/GCRefMap.cs index 2dd598aedfb91d..a65bfe2628e3ed 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/GCRefMap.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/GCRefMap.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/IAssemblyResolver.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/IAssemblyResolver.cs index 1b859c23df0165..3c3535b372eb93 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/IAssemblyResolver.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/IAssemblyResolver.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -9,6 +9,7 @@ namespace ILCompiler.Reflection.ReadyToRun public interface IAssemblyResolver { MetadataReader FindAssembly(MetadataReader metadataReader, AssemblyReferenceHandle assemblyReferenceHandle, string parentFile); + MetadataReader FindAssembly(string simpleName, string parentFile); // TODO (refactoring) - signature formatting options should be independent of assembly resolver bool Naked { get; } bool SignatureBinary { get; } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj index ec4c0094d4b018..f9448cc1bce201 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj @@ -1,4 +1,4 @@ - + ILCompiler.Reflection.ReadyToRun 1.0.0.0 @@ -22,6 +22,7 @@ + diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/InliningInfoSection.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/InliningInfoSection.cs index 0fc4f7f89daf87..957ec7a20cc367 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/InliningInfoSection.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/InliningInfoSection.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/InliningInfoSection2.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/InliningInfoSection2.cs index 13726adbf8ff79..7271d7aa4f5f1f 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/InliningInfoSection2.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/InliningInfoSection2.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeArray.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeArray.cs index a7d03d47b7d895..511cd30664f450 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeArray.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeArray.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeHashtable.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeHashtable.cs index abfd966cde6085..027fd51b7ea2e0 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeHashtable.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeHashtable.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeReader.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeReader.cs index 8e60b42a537985..50f36fe805d199 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeReader.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/NativeReader.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/PEReaderExtensions.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/PEReaderExtensions.cs new file mode 100644 index 00000000000000..0e5dafe0f51c8d --- /dev/null +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/PEReaderExtensions.cs @@ -0,0 +1,126 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.IO; +using System.Reflection.Metadata; +using System.Reflection.PortableExecutable; +using System.Text; + +namespace ILCompiler.Reflection.ReadyToRun +{ + public class PEExportTable + { + private readonly Dictionary _namedExportRva; + private readonly Dictionary _ordinalRva; + + private PEExportTable(PEReader peReader) + { + _namedExportRva = new Dictionary(); + _ordinalRva = new Dictionary(); + + DirectoryEntry exportTable = peReader.PEHeaders.PEHeader.ExportTableDirectory; + PEMemoryBlock peImage = peReader.GetEntireImage(); + BlobReader exportTableHeader = peImage.GetReader(peReader.GetOffset(exportTable.RelativeVirtualAddress), exportTable.Size); + if (exportTableHeader.Length == 0) + { + return; + } + + // +0x00: reserved + exportTableHeader.ReadUInt32(); + // +0x04: TODO: time/date stamp + exportTableHeader.ReadUInt32(); + // +0x08: major version + exportTableHeader.ReadUInt16(); + // +0x0A: minor version + exportTableHeader.ReadUInt16(); + // +0x0C: DLL name RVA + exportTableHeader.ReadUInt32(); + // +0x10: ordinal base + int minOrdinal = exportTableHeader.ReadInt32(); + // +0x14: number of entries in the address table + int addressEntryCount = exportTableHeader.ReadInt32(); + // +0x18: number of name pointers + int namePointerCount = exportTableHeader.ReadInt32(); + // +0x1C: export address table RVA + int addressTableRVA = exportTableHeader.ReadInt32(); + // +0x20: name pointer RVA + int namePointerRVA = exportTableHeader.ReadInt32(); + // +0x24: ordinal table RVA + int ordinalTableRVA = exportTableHeader.ReadInt32(); + + int[] addressTable = new int[addressEntryCount]; + BlobReader addressTableReader = peImage.GetReader(peReader.GetOffset(addressTableRVA), sizeof(int) * addressEntryCount); + for (int entryIndex = 0; entryIndex < addressEntryCount; entryIndex++) + { + addressTable[entryIndex] = addressTableReader.ReadInt32(); + } + + ushort[] ordinalTable = new ushort[namePointerCount]; + BlobReader ordinalTableReader = peImage.GetReader(peReader.GetOffset(ordinalTableRVA), sizeof(ushort) * namePointerCount); + for (int entryIndex = 0; entryIndex < namePointerCount; entryIndex++) + { + ushort ordinalIndex = ordinalTableReader.ReadUInt16(); + ordinalTable[entryIndex] = ordinalIndex; + _ordinalRva.Add(entryIndex + minOrdinal, addressTable[ordinalIndex]); + } + + BlobReader namePointerReader = peImage.GetReader(peReader.GetOffset(namePointerRVA), sizeof(int) * namePointerCount); + for (int entryIndex = 0; entryIndex < namePointerCount; entryIndex++) + { + int nameRVA = namePointerReader.ReadInt32(); + if (nameRVA != 0) + { + int nameOffset = peReader.GetOffset(nameRVA); + BlobReader nameReader = peImage.GetReader(nameOffset, peImage.Length - nameOffset); + StringBuilder nameBuilder = new StringBuilder(); + for (byte ascii; (ascii = nameReader.ReadByte()) != 0;) + { + nameBuilder.Append((char)ascii); + } + _namedExportRva.Add(nameBuilder.ToString(), addressTable[ordinalTable[entryIndex]]); + } + } + } + + public static PEExportTable Parse(PEReader peReader) + { + return new PEExportTable(peReader); + } + + public bool TryGetValue(string exportName, out int rva) => _namedExportRva.TryGetValue(exportName, out rva); + public bool TryGetValue(int ordinal, out int rva) => _ordinalRva.TryGetValue(ordinal, out rva); + } + + public static class PEReaderExtensions + { + /// + /// Get the index in the image byte array corresponding to the RVA + /// + /// PE reader representing the executable image to parse + /// The relative virtual address + public static int GetOffset(this PEReader reader, int rva) + { + int index = reader.PEHeaders.GetContainingSectionIndex(rva); + if (index == -1) + { + throw new BadImageFormatException("Failed to convert invalid RVA to offset: " + rva); + } + SectionHeader containingSection = reader.PEHeaders.SectionHeaders[index]; + return rva - containingSection.VirtualAddress + containingSection.PointerToRawData; + } + + /// + /// Parse export table directory for a given PE reader. + /// + /// PE reader representing the executable image to parse + public static PEExportTable GetExportTable(this PEReader reader) + { + return PEExportTable.Parse(reader); + } + } +} diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunHeader.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunHeader.cs index 49805d3af60d1c..1cf5af44481b9d 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunHeader.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunHeader.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -7,13 +7,91 @@ using System.Text; using Internal.ReadyToRunConstants; +using Internal.Runtime; namespace ILCompiler.Reflection.ReadyToRun { + /// + /// Structure representing an element of the assembly table in composite R2R images. + /// + public class ComponentAssembly + { + public const int Size = 4 * sizeof(int); + + public readonly int CorHeaderRVA; + public readonly int CorHeaderSize; + public readonly int AssemblyHeaderRVA; + public readonly int AssemblyHeaderSize; + + public ComponentAssembly(byte[] image, ref int curOffset) + { + CorHeaderRVA = BitConverter.ToInt32(image, curOffset); + curOffset += sizeof(int); + CorHeaderSize = BitConverter.ToInt32(image, curOffset); + curOffset += sizeof(int); + AssemblyHeaderRVA = BitConverter.ToInt32(image, curOffset); + curOffset += sizeof(int); + AssemblyHeaderSize = BitConverter.ToInt32(image, curOffset); + curOffset += sizeof(int); + } + } + + /// + /// Fields common to the global R2R header and per assembly headers in composite R2R images. + /// + public class ReadyToRunCoreHeader + { + /// + /// Flags in the header + /// eg. PLATFORM_NEUTRAL_SOURCE, SKIP_TYPE_VALIDATION + /// + public uint Flags { get; set; } + + /// + /// The ReadyToRun section RVAs and sizes + /// + public IDictionary Sections { get; private set; } + + public ReadyToRunCoreHeader() + { + } + + public ReadyToRunCoreHeader(byte[] image, ref int curOffset) + { + ParseCoreHeader(image, ref curOffset); + } + + /// + /// Parse core header fields common to global R2R file header and per assembly headers in composite R2R images. + /// + /// PE image + /// Index in the image byte array to the start of the ReadyToRun core header + public void ParseCoreHeader(byte[] image, ref int curOffset) + { + Flags = NativeReader.ReadUInt32(image, ref curOffset); + int nSections = NativeReader.ReadInt32(image, ref curOffset); + Sections = new Dictionary(); + + for (int i = 0; i < nSections; i++) + { + int type = NativeReader.ReadInt32(image, ref curOffset); + var sectionType = (ReadyToRunSectionType)type; + if (!Enum.IsDefined(typeof(ReadyToRunSectionType), type)) + { + throw new BadImageFormatException("Warning: Invalid ReadyToRun section type"); + } + int sectionStartRva = NativeReader.ReadInt32(image, ref curOffset); + int sectionLength = NativeReader.ReadInt32(image, ref curOffset); + Sections[sectionType] = new ReadyToRunSection(sectionType, sectionStartRva, sectionLength); + } + } + } + + /// /// based on src/inc/readytorun.h READYTORUN_HEADER /// - public class ReadyToRunHeader + public class ReadyToRunHeader : ReadyToRunCoreHeader { /// /// The expected signature of a ReadyToRun header @@ -42,17 +120,6 @@ public class ReadyToRunHeader public ushort MajorVersion { get; set; } public ushort MinorVersion { get; set; } - /// - /// Flags in the header - /// eg. PLATFORM_NEUTRAL_SOURCE, SKIP_TYPE_VALIDATION - /// - public uint Flags { get; set; } - - /// - /// The ReadyToRun section RVAs and sizes - /// - public IDictionary Sections { get; } - public ReadyToRunHeader() { } /// @@ -78,23 +145,8 @@ public ReadyToRunHeader(byte[] image, int rva, int curOffset) MajorVersion = NativeReader.ReadUInt16(image, ref curOffset); MinorVersion = NativeReader.ReadUInt16(image, ref curOffset); - Flags = NativeReader.ReadUInt32(image, ref curOffset); - int nSections = NativeReader.ReadInt32(image, ref curOffset); - Sections = new Dictionary(); - for (int i = 0; i < nSections; i++) - { - int type = NativeReader.ReadInt32(image, ref curOffset); - var sectionType = (ReadyToRunSection.SectionType)type; - if (!Enum.IsDefined(typeof(ReadyToRunSection.SectionType), type)) - { - // TODO (refactoring) - what should we do? - // R2RDump.WriteWarning("Invalid ReadyToRun section type"); - } - Sections[sectionType] = new ReadyToRunSection(sectionType, - NativeReader.ReadInt32(image, ref curOffset), - NativeReader.ReadInt32(image, ref curOffset)); - } + ParseCoreHeader(image, ref curOffset); Size = curOffset - startOffset; } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunImportSection.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunImportSection.cs index 7bdd3dd748d633..ae8a8a239ec92b 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunImportSection.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunImportSection.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs index ef72d9b17328ec..2f143b1911483c 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -81,10 +81,11 @@ public abstract class BaseGcInfo } /// - /// based on src/pal/inc/pal.h _RUNTIME_FUNCTION + /// A runtime function corresponds to a contiguous fragment of code that implements a method. /// public class RuntimeFunction { + // based on src / pal / inc / pal.h _RUNTIME_FUNCTION private ReadyToRunReader _readyToRunReader; private EHInfo _ehInfo; private DebugInfo _debugInfo; diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs index c02fe2986d26ed..d02ed92eac462f 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs @@ -1,10 +1,11 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.ComponentModel; using System.IO; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; @@ -14,6 +15,7 @@ using System.Text; using Internal.CorConstants; +using Internal.Runtime; using Internal.ReadyToRunConstants; using Debug = System.Diagnostics.Debug; @@ -47,15 +49,34 @@ public InstanceMethod(byte bucket, ReadyToRunMethod method) public sealed class ReadyToRunReader { + private const string SystemModuleName = "System.Private.CoreLib"; + + /// + /// MetadataReader for the system module (normally System.Private.CoreLib) + /// + private MetadataReader _systemModuleReader; + private readonly IAssemblyResolver _assemblyResolver; - private Dictionary _assemblyCache; + + /// + /// Reference assembly cache indexed by module indices as used in signatures + /// + private List _assemblyCache; + + /// + /// Assembly headers for composite R2R images + /// + private List _assemblyHeaders; // Header private OperatingSystem _operatingSystem; private Machine _machine; private Architecture _architecture; + private bool _composite; private ulong _imageBase; + private int _readyToRunHeaderRVA; private ReadyToRunHeader _readyToRunHeader; + private List _readyToRunAssemblyHeaders; // DebugInfo private Dictionary _runtimeFunctionToDebugInfo; @@ -73,11 +94,6 @@ public sealed class ReadyToRunReader /// public PEReader PEReader { get; private set; } - /// - /// MetadataReader is used to access the MSIL metadata in the R2R file. - /// - public MetadataReader MetadataReader { get; private set; } - /// /// Byte array containing the ReadyToRun image /// @@ -146,6 +162,18 @@ public Architecture Architecture } } + /// + /// Return true when the executable is a composite R2R image. + /// + public bool Composite + { + get + { + EnsureHeader(); + return _composite; + } + } + /// /// The preferred address of the first byte of image when loaded into memory; /// must be a multiple of 64K. @@ -171,6 +199,15 @@ public ReadyToRunHeader ReadyToRunHeader } } + public IList ReaderToRunAssemblyHeaders + { + get + { + EnsureHeader(); + return _readyToRunAssemblyHeaders; + } + } + /// /// The runtime functions and method signatures of each method /// @@ -245,10 +282,9 @@ internal MetadataReader ManifestReader public ReadyToRunReader(IAssemblyResolver assemblyResolver, MetadataReader metadata, PEReader peReader, string filename) { _assemblyResolver = assemblyResolver; - MetadataReader = metadata; PEReader = peReader; Filename = filename; - Initialize(); + Initialize(metadata); } /// @@ -260,37 +296,50 @@ public unsafe ReadyToRunReader(IAssemblyResolver assemblyResolver, string filena { _assemblyResolver = assemblyResolver; Filename = filename; - Initialize(); + Initialize(metadata: null); } - private unsafe void Initialize() + private unsafe void Initialize(MetadataReader metadata) { - _assemblyCache = new Dictionary(); + _assemblyCache = new List(); + _assemblyHeaders = new List(); - if (MetadataReader == null) + if (PEReader == null) { byte[] image = File.ReadAllBytes(Filename); Image = image; PEReader = new PEReader(Unsafe.As>(ref image)); + } - if (!PEReader.HasMetadata) + if (metadata == null && PEReader.HasMetadata) + { + metadata = PEReader.GetMetadataReader(); + } + + if (metadata != null) + { + if ((PEReader.PEHeaders.CorHeader.Flags & CorFlags.ILLibrary) == 0) { - throw new Exception($"ECMA metadata not found in file '{Filename}'"); + throw new BadImageFormatException("The file is not a ReadyToRun image"); } - MetadataReader = PEReader.GetMetadataReader(); + _assemblyCache.Add(metadata); + DirectoryEntry r2rHeaderDirectory = PEReader.PEHeaders.CorHeader.ManagedNativeHeaderDirectory; + _readyToRunHeaderRVA = r2rHeaderDirectory.RelativeVirtualAddress; } - else + else if (!TryLocateNativeReadyToRunHeader()) { - ImmutableArray content = PEReader.GetEntireImage().GetContent(); - Image = Unsafe.As, byte[]>(ref content); + throw new BadImageFormatException($"ECMA metadata / RTR_HEADER not found in file '{Filename}'"); } - if ((PEReader.PEHeaders.CorHeader.Flags & CorFlags.ILLibrary) == 0) + ImmutableArray content = PEReader.GetEntireImage().GetContent(); + Image = Unsafe.As, byte[]>(ref content); + + if (_composite) { - throw new BadImageFormatException("The file is not a ReadyToRun image"); + ParseComponentAssemblies(); } // This is a work in progress toward lazy initialization. @@ -303,13 +352,11 @@ private unsafe void Initialize() Methods = new List(); InstanceMethods = new List(); - if (ReadyToRunHeader.Sections.ContainsKey(ReadyToRunSection.SectionType.READYTORUN_SECTION_RUNTIME_FUNCTIONS)) + if (ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.RuntimeFunctions, out ReadyToRunSection runtimeFunctionSection)) { int runtimeFunctionSize = CalculateRuntimeFunctionSize(); - ReadyToRunSection runtimeFunctionSection = ReadyToRunHeader.Sections[ReadyToRunSection.SectionType.READYTORUN_SECTION_RUNTIME_FUNCTIONS]; - uint nRuntimeFunctions = (uint)(runtimeFunctionSection.Size / runtimeFunctionSize); - int runtimeFunctionOffset = GetOffset(runtimeFunctionSection.RelativeVirtualAddress); + int runtimeFunctionOffset = PEReader.GetOffset(runtimeFunctionSection.RelativeVirtualAddress); bool[] isEntryPoint = new bool[nRuntimeFunctions]; // initialize R2RMethods @@ -324,6 +371,35 @@ private unsafe void Initialize() CompilerIdentifier = ParseCompilerIdentifier(); } + private bool TryLocateNativeReadyToRunHeader() + { + PEExportTable exportTable = PEReader.GetExportTable(); + if (exportTable.TryGetValue("RTR_HEADER", out _readyToRunHeaderRVA)) + { + _composite = true; + return true; + } + return false; + } + + private MetadataReader GetSystemModuleMetadataReader() + { + if (_systemModuleReader == null) + { + if (_assemblyResolver != null) + { + _systemModuleReader = _assemblyResolver.FindAssembly(SystemModuleName, Filename); + } + } + return _systemModuleReader; + } + + public MetadataReader GetGlobalMetadataReader() + { + EnsureHeader(); + return (_composite ? null : _assemblyCache[0]); + } + private unsafe void EnsureHeader() { if (_readyToRunHeader != null) @@ -374,13 +450,9 @@ private unsafe void EnsureHeader() _imageBase = PEReader.PEHeaders.PEHeader.ImageBase; // Initialize R2RHeader - DirectoryEntry r2rHeaderDirectory = PEReader.PEHeaders.CorHeader.ManagedNativeHeaderDirectory; - int r2rHeaderOffset = GetOffset(r2rHeaderDirectory.RelativeVirtualAddress); - _readyToRunHeader = new ReadyToRunHeader(Image, r2rHeaderDirectory.RelativeVirtualAddress, r2rHeaderOffset); - if (r2rHeaderDirectory.Size != ReadyToRunHeader.Size) - { - throw new BadImageFormatException("The calculated size of the R2RHeader doesn't match the size saved in the ManagedNativeHeaderDirectory"); - } + Debug.Assert(_readyToRunHeaderRVA != 0); + int r2rHeaderOffset = GetOffset(_readyToRunHeaderRVA); + _readyToRunHeader = new ReadyToRunHeader(Image, _readyToRunHeaderRVA, r2rHeaderOffset); } private void EnsureDebugInfo() @@ -390,12 +462,11 @@ private void EnsureDebugInfo() return; } _runtimeFunctionToDebugInfo = new Dictionary(); - if (!ReadyToRunHeader.Sections.ContainsKey(ReadyToRunSection.SectionType.READYTORUN_SECTION_DEBUG_INFO)) + if (!ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.DebugInfo, out ReadyToRunSection debugInfoSection)) { return; } - ReadyToRunSection debugInfoSection = ReadyToRunHeader.Sections[ReadyToRunSection.SectionType.READYTORUN_SECTION_DEBUG_INFO]; int debugInfoSectionOffset = GetOffset(debugInfoSection.RelativeVirtualAddress); NativeArray debugInfoArray = new NativeArray(Image, (uint)debugInfoSectionOffset); @@ -419,9 +490,8 @@ private unsafe void EnsureManifestReferences() return; } _manifestReferences = new List(); - if (ReadyToRunHeader.Sections.ContainsKey(ReadyToRunSection.SectionType.READYTORUN_SECTION_MANIFEST_METADATA)) + if (ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.ManifestMetadata, out ReadyToRunSection manifestMetadata)) { - ReadyToRunSection manifestMetadata = ReadyToRunHeader.Sections[ReadyToRunSection.SectionType.READYTORUN_SECTION_MANIFEST_METADATA]; fixed (byte* image = Image) { _manifestReader = new MetadataReader(image + GetOffset(manifestMetadata.RelativeVirtualAddress), manifestMetadata.Size); @@ -442,9 +512,8 @@ private unsafe void EnsureExceptionInfo() return; } _runtimeFunctionToEHInfo = new Dictionary(); - if (ReadyToRunHeader.Sections.ContainsKey(ReadyToRunSection.SectionType.READYTORUN_SECTION_EXCEPTION_INFO)) + if (ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.ExceptionInfo, out ReadyToRunSection exceptionInfoSection)) { - ReadyToRunSection exceptionInfoSection = ReadyToRunHeader.Sections[ReadyToRunSection.SectionType.READYTORUN_SECTION_EXCEPTION_INFO]; int offset = GetOffset(exceptionInfoSection.RelativeVirtualAddress); int length = exceptionInfoSection.Size; int methodRva = BitConverter.ToInt32(Image, offset); @@ -492,12 +561,33 @@ private int CalculateRuntimeFunctionSize() /// private void ParseMethodDefEntrypoints(bool[] isEntryPoint) { - if (!ReadyToRunHeader.Sections.ContainsKey(ReadyToRunSection.SectionType.READYTORUN_SECTION_METHODDEF_ENTRYPOINTS)) + ReadyToRunSection methodEntryPointSection; + if (ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.MethodDefEntryPoints, out methodEntryPointSection)) { - return; + ParseMethodDefEntrypointsSection(methodEntryPointSection, GetGlobalMetadataReader(), isEntryPoint); } - int methodDefEntryPointsRVA = ReadyToRunHeader.Sections[ReadyToRunSection.SectionType.READYTORUN_SECTION_METHODDEF_ENTRYPOINTS].RelativeVirtualAddress; - int methodDefEntryPointsOffset = GetOffset(methodDefEntryPointsRVA); + else if (_readyToRunAssemblyHeaders != null) + { + for (int assemblyIndex = 0; assemblyIndex < _readyToRunAssemblyHeaders.Count; assemblyIndex++) + { + if (_readyToRunAssemblyHeaders[assemblyIndex].Sections.TryGetValue(ReadyToRunSectionType.MethodDefEntryPoints, out methodEntryPointSection)) + { + ParseMethodDefEntrypointsSection(methodEntryPointSection, OpenReferenceAssembly(assemblyIndex + 2), isEntryPoint); + } + } + } + } + + /// + /// Parse a single method def entrypoint section. For composite R2R images, this method is called multiple times + /// are method entrypoints are stored separately for each component assembly of the composite R2R executable. + /// + /// Method entrypoint section to parse + /// ECMA metadata reader representing this method entrypoint section + /// Set to true for each runtime function index representing a method entrypoint + private void ParseMethodDefEntrypointsSection(ReadyToRunSection section, MetadataReader metadataReader, bool[] isEntryPoint) + { + int methodDefEntryPointsOffset = GetOffset(section.RelativeVirtualAddress); NativeArray methodEntryPoints = new NativeArray(Image, (uint)methodDefEntryPointsOffset); uint nMethodEntryPoints = methodEntryPoints.GetCount(); @@ -510,7 +600,7 @@ private void ParseMethodDefEntrypoints(bool[] isEntryPoint) int runtimeFunctionId; int? fixupOffset; GetRuntimeFunctionIndexFromOffset(offset, out runtimeFunctionId, out fixupOffset); - ReadyToRunMethod method = new ReadyToRunMethod(this, Methods.Count, this.MetadataReader, methodHandle, runtimeFunctionId, owningType: null, constrainedType: null, instanceArgs: null, fixupOffset: fixupOffset); + ReadyToRunMethod method = new ReadyToRunMethod(this, Methods.Count, metadataReader, methodHandle, runtimeFunctionId, owningType: null, constrainedType: null, instanceArgs: null, fixupOffset: fixupOffset); if (method.EntryPointRuntimeFunctionId < 0 || method.EntryPointRuntimeFunctionId >= isEntryPoint.Length) { @@ -527,11 +617,10 @@ private void ParseMethodDefEntrypoints(bool[] isEntryPoint) /// private void ParseInstanceMethodEntrypoints(bool[] isEntryPoint) { - if (!ReadyToRunHeader.Sections.ContainsKey(ReadyToRunSection.SectionType.READYTORUN_SECTION_INSTANCE_METHOD_ENTRYPOINTS)) + if (!ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.InstanceMethodEntryPoints, out ReadyToRunSection instMethodEntryPointSection)) { return; } - ReadyToRunSection instMethodEntryPointSection = ReadyToRunHeader.Sections[ReadyToRunSection.SectionType.READYTORUN_SECTION_INSTANCE_METHOD_ENTRYPOINTS]; int instMethodEntryPointsOffset = GetOffset(instMethodEntryPointSection.RelativeVirtualAddress); NativeParser parser = new NativeParser(Image, (uint)instMethodEntryPointsOffset); NativeHashtable instMethodEntryPoints = new NativeHashtable(Image, parser, (uint)(instMethodEntryPointsOffset + instMethodEntryPointSection.Size)); @@ -540,14 +629,19 @@ private void ParseInstanceMethodEntrypoints(bool[] isEntryPoint) while (!curParser.IsNull()) { SignatureDecoder decoder = new SignatureDecoder(_assemblyResolver, this, (int)curParser.Offset); - MetadataReader mdReader = MetadataReader; + MetadataReader mdReader = _composite ? null : _assemblyCache[0]; string owningType = null; uint methodFlags = decoder.ReadUInt(); if ((methodFlags & (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_OwnerType) != 0) { - mdReader = decoder.GetMetadataReaderFromModuleOverride(); + mdReader = decoder.GetMetadataReaderFromModuleOverride() ?? mdReader; + if (_composite) + { + // The only types that don't have module overrides on them in composite images are primitive types within the system module + mdReader = GetSystemModuleMetadataReader(); + } owningType = decoder.ReadTypeSignatureNoEmit(); } if ((methodFlags & (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_SlotInsteadOfToken) != 0) @@ -587,7 +681,7 @@ private void ParseInstanceMethodEntrypoints(bool[] isEntryPoint) ReadyToRunMethod method = new ReadyToRunMethod( this, Methods.Count, - mdReader == null ? MetadataReader : mdReader, + mdReader, methodHandle, runtimeFunctionId, owningType, @@ -692,12 +786,31 @@ private void ParseRuntimeFunctionsForMethod(bool[] isEntryPoint, int curOffset, /// private void ParseAvailableTypes() { - if (!ReadyToRunHeader.Sections.ContainsKey(ReadyToRunSection.SectionType.READYTORUN_SECTION_AVAILABLE_TYPES)) + ReadyToRunSection availableTypesSection; + if (ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.AvailableTypes, out availableTypesSection)) { - return; + ParseAvailableTypesSection(availableTypesSection, GetGlobalMetadataReader()); + } + else if (_readyToRunAssemblyHeaders != null) + { + for (int assemblyIndex = 0; assemblyIndex < _readyToRunAssemblyHeaders.Count; assemblyIndex++) + { + if (_readyToRunAssemblyHeaders[assemblyIndex].Sections.TryGetValue( + ReadyToRunSectionType.AvailableTypes, out availableTypesSection)) + { + ParseAvailableTypesSection(availableTypesSection, OpenReferenceAssembly(assemblyIndex + 2)); + } + } } + } - ReadyToRunSection availableTypesSection = ReadyToRunHeader.Sections[ReadyToRunSection.SectionType.READYTORUN_SECTION_AVAILABLE_TYPES]; + /// + /// Parse a single available types section. For composite R2R images this method is called multiple times + /// as available types are stored separately for each component assembly of the composite R2R executable. + /// + /// + private void ParseAvailableTypesSection(ReadyToRunSection availableTypesSection, MetadataReader metadataReader) + { int availableTypesOffset = GetOffset(availableTypesSection.RelativeVirtualAddress); NativeParser parser = new NativeParser(Image, (uint)availableTypesOffset); NativeHashtable availableTypes = new NativeHashtable(Image, parser, (uint)(availableTypesOffset + availableTypesSection.Size)); @@ -713,13 +826,13 @@ private void ParseAvailableTypes() if (isExportedType) { ExportedTypeHandle exportedTypeHandle = MetadataTokens.ExportedTypeHandle((int)rid); - string exportedTypeName = GetExportedTypeFullName(MetadataReader, exportedTypeHandle); + string exportedTypeName = GetExportedTypeFullName(metadataReader, exportedTypeHandle); AvailableTypes.Add("exported " + exportedTypeName); } else { TypeDefinitionHandle typeDefHandle = MetadataTokens.TypeDefinitionHandle((int)rid); - string typeDefName = MetadataNameFormatter.FormatHandle(MetadataReader, typeDefHandle); + string typeDefName = MetadataNameFormatter.FormatHandle(metadataReader, typeDefHandle); AvailableTypes.Add(typeDefName); } @@ -732,27 +845,52 @@ private void ParseAvailableTypes() /// private string ParseCompilerIdentifier() { - if (!ReadyToRunHeader.Sections.ContainsKey(ReadyToRunSection.SectionType.READYTORUN_SECTION_COMPILER_IDENTIFIER)) + if (!ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.CompilerIdentifier, out ReadyToRunSection compilerIdentifierSection)) { return ""; } - ReadyToRunSection compilerIdentifierSection = ReadyToRunHeader.Sections[ReadyToRunSection.SectionType.READYTORUN_SECTION_COMPILER_IDENTIFIER]; byte[] identifier = new byte[compilerIdentifierSection.Size - 1]; int identifierOffset = GetOffset(compilerIdentifierSection.RelativeVirtualAddress); Array.Copy(Image, identifierOffset, identifier, 0, compilerIdentifierSection.Size - 1); return Encoding.UTF8.GetString(identifier); } + /// + /// Decode the ReadyToRun section READYTORUN_SECTION_ASSEMBLIES containing a list of per assembly R2R core headers + /// for each assembly comprising the composite R2R executable. + /// + private void ParseComponentAssemblies() + { + ReadyToRunSection componentAssembliesSection; + if (!ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.ComponentAssemblies, out componentAssembliesSection)) + { + return; + } + + _readyToRunAssemblyHeaders = new List(); + + int offset = GetOffset(componentAssembliesSection.RelativeVirtualAddress); + int numberOfAssemblyHeaderRVAs = componentAssembliesSection.Size / ComponentAssembly.Size; + + for (int assemblyIndex = 0; assemblyIndex < numberOfAssemblyHeaderRVAs; assemblyIndex++) + { + ComponentAssembly assembly = new ComponentAssembly(Image, ref offset); + int headerOffset = GetOffset(assembly.AssemblyHeaderRVA); + + ReadyToRunCoreHeader assemblyHeader = new ReadyToRunCoreHeader(Image, ref headerOffset); + _readyToRunAssemblyHeaders.Add(assemblyHeader); + } + } + /// /// based on ZapImportSectionsTable::Save /// private void ParseImportSections() { - if (!ReadyToRunHeader.Sections.ContainsKey(ReadyToRunSection.SectionType.READYTORUN_SECTION_IMPORT_SECTIONS)) + if (!ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.ImportSections, out ReadyToRunSection importSectionsSection)) { return; } - ReadyToRunSection importSectionsSection = ReadyToRunHeader.Sections[ReadyToRunSection.SectionType.READYTORUN_SECTION_IMPORT_SECTIONS]; int offset = GetOffset(importSectionsSection.RelativeVirtualAddress); int endOffset = offset + importSectionsSection.Size; while (offset < endOffset) @@ -822,13 +960,7 @@ private void ParseImportSections() /// The relative virtual address public int GetOffset(int rva) { - int index = PEReader.PEHeaders.GetContainingSectionIndex(rva); - if (index == -1) - { - throw new BadImageFormatException("Failed to convert invalid RVA to offset: " + rva); - } - SectionHeader containingSection = PEReader.PEHeaders.SectionHeaders[index]; - return rva - containingSection.VirtualAddress + containingSection.PointerToRawData; + return PEReader.GetOffset(rva); } /// @@ -887,11 +1019,11 @@ private AssemblyReferenceHandle GetAssemblyAtIndex(int refAsmIndex, out Metadata { Debug.Assert(refAsmIndex != 0); - int assemblyRefCount = MetadataReader.GetTableRowCount(TableIndex.AssemblyRef); + int assemblyRefCount = (_composite ? 0 : _assemblyCache[0].GetTableRowCount(TableIndex.AssemblyRef)); AssemblyReferenceHandle assemblyReferenceHandle; if (refAsmIndex <= assemblyRefCount) { - metadataReader = MetadataReader; + metadataReader = _assemblyCache[0]; assemblyReferenceHandle = MetadataTokens.AssemblyReferenceHandle(refAsmIndex); } else @@ -916,13 +1048,8 @@ internal string GetReferenceAssemblyName(int refAsmIndex) /// MetadataReader instance representing the reference assembly internal MetadataReader OpenReferenceAssembly(int refAsmIndex) { - if (refAsmIndex == 0) - { - return this.MetadataReader; - } - - MetadataReader result; - if (!_assemblyCache.TryGetValue(refAsmIndex, out result)) + MetadataReader result = (refAsmIndex < _assemblyCache.Count ? _assemblyCache[refAsmIndex] : null); + if (result == null) { AssemblyReferenceHandle assemblyReferenceHandle = GetAssemblyAtIndex(refAsmIndex, out MetadataReader metadataReader); @@ -932,7 +1059,11 @@ internal MetadataReader OpenReferenceAssembly(int refAsmIndex) string name = metadataReader.GetString(metadataReader.GetAssemblyReference(assemblyReferenceHandle).Name); throw new Exception($"Missing reference assembly: {name}"); } - _assemblyCache.Add(refAsmIndex, result); + while (_assemblyCache.Count <= refAsmIndex) + { + _assemblyCache.Add(null); + } + _assemblyCache[refAsmIndex] = result; } return result; } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunSection.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunSection.cs index 8f0b781aa0ebb3..6f6bcb902ea3a6 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunSection.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunSection.cs @@ -1,41 +1,19 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; -using System.Collections.Generic; -using System.IO; -using System.Text; + +using Internal.Runtime; namespace ILCompiler.Reflection.ReadyToRun { public struct ReadyToRunSection { - /// - /// based on src/inc/readytorun.h ReadyToRunSectionType - /// - public enum SectionType - { - READYTORUN_SECTION_COMPILER_IDENTIFIER = 100, - READYTORUN_SECTION_IMPORT_SECTIONS = 101, - READYTORUN_SECTION_RUNTIME_FUNCTIONS = 102, - READYTORUN_SECTION_METHODDEF_ENTRYPOINTS = 103, - READYTORUN_SECTION_EXCEPTION_INFO = 104, - READYTORUN_SECTION_DEBUG_INFO = 105, - READYTORUN_SECTION_DELAYLOAD_METHODCALL_THUNKS = 106, - READYTORUN_SECTION_AVAILABLE_TYPES = 108, - READYTORUN_SECTION_INSTANCE_METHOD_ENTRYPOINTS = 109, - READYTORUN_SECTION_INLINING_INFO = 110, - READYTORUN_SECTION_PROFILEDATA_INFO = 111, - READYTORUN_SECTION_MANIFEST_METADATA = 112, // Added in v2.3 - READYTORUN_SECTION_ATTRIBUTEPRESENCE = 113, // Added in V3.1 - READYTORUN_SECTION_INLINING_INFO2 = 114, // Added in 4.1 - } - /// /// The ReadyToRun section type /// - public SectionType Type { get; set; } + public ReadyToRunSectionType Type { get; set; } /// /// The RVA to the section @@ -47,7 +25,7 @@ public enum SectionType /// public int Size { get; set; } - public ReadyToRunSection(SectionType type, int rva, int size) + public ReadyToRunSection(ReadyToRunSectionType type, int rva, int size) { Type = type; RelativeVirtualAddress = rva; diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs index 93097c0ea765d9..e5f5ec7795f405 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -383,7 +383,7 @@ public class SignatureDecoder /// Signature offset within the PE file byte array public SignatureDecoder(IAssemblyResolver options, ReadyToRunReader r2rReader, int offset) { - _metadataReader = r2rReader.MetadataReader; + _metadataReader = r2rReader.GetGlobalMetadataReader(); _options = options; _image = r2rReader.Image; _offset = offset; diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/TransitionBlock.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/TransitionBlock.cs index 2b8892d518a224..6cebfa78494b7c 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/TransitionBlock.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/TransitionBlock.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/CallPattern.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/CallPattern.cs index 982095f474c07a..402c80a9ffe9da 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/CallPattern.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/CallPattern.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text; diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcInfo.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcInfo.cs index 9ef38de5720399..67e7d7b36aae67 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcInfo.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcInfo.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcSlotTable.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcSlotTable.cs index 95835dc4621541..736679e4b3bbc6 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcSlotTable.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcSlotTable.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcTransition.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcTransition.cs index 2b2137058bb3f5..a2bab1e36f10ab 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcTransition.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcTransition.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs index 4ea69796a2754f..03ad31c7b7182e 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/Registers.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/Registers.cs index b38f653271963c..4699cc4861be66 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/Registers.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/Registers.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/UnwindInfo.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/UnwindInfo.cs index 8333a69e98ae13..a62164ff7dc0ae 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/UnwindInfo.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/UnwindInfo.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj b/src/coreclr/src/tools/crossgen2/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj index 76ade86adefb4c..b91aed5979a6e4 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj @@ -1,4 +1,4 @@ - + Library Internal.TypeSystem diff --git a/src/coreclr/src/tools/crossgen2/crossgen2.sln b/src/coreclr/src/tools/crossgen2/crossgen2.sln index c8f660baa6803c..d5ab286dfddddc 100644 --- a/src/coreclr/src/tools/crossgen2/crossgen2.sln +++ b/src/coreclr/src/tools/crossgen2/crossgen2.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29123.88 diff --git a/src/coreclr/src/tools/crossgen2/crossgen2/CommandLineOptions.cs b/src/coreclr/src/tools/crossgen2/crossgen2/CommandLineOptions.cs index 9240f6e04df78f..93791b1c0d3653 100644 --- a/src/coreclr/src/tools/crossgen2/crossgen2/CommandLineOptions.cs +++ b/src/coreclr/src/tools/crossgen2/crossgen2/CommandLineOptions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -11,6 +11,7 @@ namespace ILCompiler public class CommandLineOptions { public FileInfo[] InputFilePaths { get; set; } + public FileInfo[] UnrootedInputFilePaths { get; set; } public FileInfo[] Mibc { get; set; } public string[] Reference { get; set; } public FileInfo OutputFilePath { get; set; } @@ -20,6 +21,7 @@ public class CommandLineOptions public bool InputBubble { get; set; } public bool CompileBubbleGenerics { get; set; } public bool Verbose { get; set; } + public bool Composite { get; set; } public FileInfo DgmlLogFileName { get; set; } public bool GenerateFullDgmlLog { get; set; } @@ -52,110 +54,118 @@ public static Command RootCommand() new Argument() { Name = "input-file-paths", - Description = "Input file(s) to compile", + Description = SR.InputFilesToCompile, Arity = arbitraryArity, }, - new Option(new[] { "--reference", "-r" }, "Reference file(s) for compilation") - { + new Option(new[] { "--unrooted-input-file-paths", "-u" }, SR.UnrootedInputFilesToCompile) + { + Argument = new Argument() + { + Arity = arbitraryArity + } + }, + new Option(new[] { "--reference", "-r" }, SR.ReferenceFiles) + { Argument = new Argument() { Arity = arbitraryArity } }, - new Option(new[] { "--mibc", "-m" }, "Mibc file(s) for profile guided optimization") + new Option(new[] { "--mibc", "-m" }, SR.MibcFiles) { Argument = new Argument() { Arity = arbitraryArity } }, - new Option(new[] { "--outputfilepath", "--out", "-o" }, "Output file path") + new Option(new[] { "--outputfilepath", "--out", "-o" }, SR.OutputFilePath) { Argument = new Argument() }, - new Option(new[] { "--optimize", "-O" }, "Enable optimizations") + new Option(new[] { "--optimize", "-O" }, SR.EnableOptimizationsOption) { Argument = new Argument() }, - new Option(new[] { "--optimize-space", "--Os" }, "Enable optimizations, favor code space") + new Option(new[] { "--optimize-space", "--Os" }, SR.OptimizeSpaceOption) { Argument = new Argument() }, - new Option(new[] { "--optimize-time", "--Ot" }, "Enable optimizations, favor code speed"), - new Option(new[] { "--inputbubble" }, "True when the entire input forms a version bubble (default = per-assembly bubble)"), - new Option(new[] { "--tuning" }, "Generate IBC tuning image") + new Option(new[] { "--optimize-time", "--Ot" }, SR.OptimizeSpeedOption), + new Option(new[] { "--inputbubble" }, SR.InputBubbleOption), + new Option(new[] { "--composite" }, SR.CompositeBuildMode), + new Option(new[] { "--tuning" }, SR.TuningImageOption) { Argument = new Argument() }, - new Option(new[] { "--partial" }, "Generate partial image driven by profile") + new Option(new[] { "--partial" }, SR.PartialImageOption) { Argument = new Argument() }, - new Option(new[] { "--compilebubblegenerics" }, "Compile instantiations from reference modules used in the current module") + new Option(new[] { "--compilebubblegenerics" }, SR.BubbleGenericsOption) { Argument = new Argument() }, - new Option(new[] { "--dgml-log-file-name", "--dmgllog" }, "Save result of dependency analysis as DGML") + new Option(new[] { "--dgml-log-file-name", "--dmgllog" }, SR.SaveDependencyLogOption) { Argument = new Argument() }, - new Option(new[] { "--generate-full-dmgl-log", "--fulllog" }, "Save detailed log of dependency analysis") + new Option(new[] { "--generate-full-dmgl-log", "--fulllog" }, SR.SaveDetailedLogOption) { Argument = new Argument() }, - new Option(new[] { "--verbose" }, "Enable verbose logging") + new Option(new[] { "--verbose" }, SR.VerboseLoggingOption) { Argument = new Argument() }, - new Option(new[] { "--systemmodule" }, "System module name (default: System.Private.CoreLib)") + new Option(new[] { "--systemmodule" }, SR.SystemModuleOverrideOption) { Argument = new Argument() }, - new Option(new[] { "--waitfordebugger" }, "Pause to give opportunity to attach debugger") + new Option(new[] { "--waitfordebugger" }, SR.WaitForDebuggerOption) { Argument = new Argument() }, - new Option(new[] { "--codegen-options", "--codegenopt" }, "Define a codegen option") + new Option(new[] { "--codegen-options", "--codegenopt" }, SR.CodeGenOptions) { Argument = new Argument() { Arity = arbitraryArity } }, - new Option(new[] { "--resilient" }, "Disable behavior where unexpected compilation failures cause overall compilation failure") + new Option(new[] { "--resilient" }, SR.ResilientOption) { Argument = new Argument() }, - new Option(new[] { "--targetarch" }, "Target architecture for cross compilation") + new Option(new[] { "--targetarch" }, SR.TargetArchOption) { Argument = new Argument() }, - new Option(new[] { "--targetos" }, "Target OS for cross compilation") + new Option(new[] { "--targetos" }, SR.TargetOSOption) { Argument = new Argument() }, - new Option(new[] { "--jitpath" }, "Path to JIT compiler library") + new Option(new[] { "--jitpath" }, SR.JitPathOption) { Argument = new Argument() }, - new Option(new[] { "--singlemethodtypename" }, "Single method compilation: name of the owning type") + new Option(new[] { "--singlemethodtypename" }, SR.SingleMethodTypeName) { Argument = new Argument() }, - new Option(new[] { "--singlemethodname" }, "Single method compilation: generic arguments to the method") + new Option(new[] { "--singlemethodname" }, SR.SingleMethodMethodName) { Argument = new Argument() }, - new Option(new[] { "--singlemethodgenericarg" }, "Single method compilation: generic arguments to the method") + new Option(new[] { "--singlemethodgenericarg" }, SR.SingleMethodGenericArgs) { // We don't need to override arity here as 255 is the maximum number of generic arguments Argument = new Argument() }, - new Option(new[] { "--parallelism" }, "Maximum number of threads to use during compilation") + new Option(new[] { "--parallelism" }, SR.ParalellismOption) { Argument = new Argument(() => Environment.ProcessorCount) }, - new Option(new[] { "--map" }, "Generate the map file") + new Option(new[] { "--map" }, SR.MapFileOption) { Argument = new Argument() }, diff --git a/src/coreclr/src/tools/crossgen2/crossgen2/Program.cs b/src/coreclr/src/tools/crossgen2/crossgen2/Program.cs index 04f704c6845a59..6f98ee6677b0b0 100644 --- a/src/coreclr/src/tools/crossgen2/crossgen2/Program.cs +++ b/src/coreclr/src/tools/crossgen2/crossgen2/Program.cs @@ -29,6 +29,7 @@ internal class Program public TargetArchitecture _targetArchitecture; public OptimizationMode _optimizationMode; private Dictionary _inputFilePaths = new Dictionary(StringComparer.OrdinalIgnoreCase); + private Dictionary _unrootedInputFilePaths = new Dictionary(StringComparer.OrdinalIgnoreCase); private Dictionary _referenceFilePaths = new Dictionary(StringComparer.OrdinalIgnoreCase); private Program(CommandLineOptions commandLineOptions) @@ -36,17 +37,6 @@ private Program(CommandLineOptions commandLineOptions) _commandLineOptions = commandLineOptions; } - private void Help(string helpText) - { - Console.WriteLine(); - Console.Write("Microsoft (R) CoreCLR Native Image Generator"); - Console.Write(" "); - Console.Write(typeof(Program).GetTypeInfo().Assembly.GetName().Version); - Console.WriteLine(); - Console.WriteLine(); - Console.WriteLine(helpText); - } - private void InitializeDefaultOptions() { // We could offer this as a command line option, but then we also need to @@ -85,7 +75,7 @@ private void ProcessCommandLine() if (_commandLineOptions.WaitForDebugger) { - Console.WriteLine("Waiting for debugger to attach. Press ENTER to continue"); + Console.WriteLine(SR.WaitingForDebuggerAttach); Console.ReadLine(); } @@ -93,7 +83,7 @@ private void ProcessCommandLine() { if (!_commandLineOptions.InputBubble) { - Console.WriteLine("Warning: ignoring --compilebubblegenerics because --inputbubble was not specified"); + Console.WriteLine(SR.WarningIgnoringBubbleGenerics); _commandLineOptions.CompileBubbleGenerics = false; } } @@ -102,7 +92,7 @@ private void ProcessCommandLine() if (_commandLineOptions.OptimizeSpace) { if (_commandLineOptions.OptimizeTime) - Console.WriteLine("Warning: overriding -Ot with -Os"); + Console.WriteLine(SR.WarningOverridingOptimizeSpace); _optimizationMode = OptimizationMode.PreferSize; } else if (_commandLineOptions.OptimizeTime) @@ -113,6 +103,9 @@ private void ProcessCommandLine() foreach (var input in _commandLineOptions.InputFilePaths ?? Enumerable.Empty()) Helpers.AppendExpandedPaths(_inputFilePaths, input.FullName, true); + foreach (var input in _commandLineOptions.UnrootedInputFilePaths ?? Enumerable.Empty()) + Helpers.AppendExpandedPaths(_unrootedInputFilePaths, input.FullName, true); + foreach (var reference in _commandLineOptions.Reference ?? Enumerable.Empty()) Helpers.AppendExpandedPaths(_referenceFilePaths, reference, false); } @@ -124,7 +117,7 @@ private int Run() ProcessCommandLine(); if (_commandLineOptions.OutputFilePath == null) - throw new CommandLineException("Output filename must be specified (/out )"); + throw new CommandLineException(SR.MissingOutputFile); // // Set target Architecture and OS @@ -142,7 +135,7 @@ private int Run() else if (_commandLineOptions.TargetArch.Equals("arm64", StringComparison.OrdinalIgnoreCase)) _targetArchitecture = TargetArchitecture.ARM64; else - throw new CommandLineException("Target architecture is not supported"); + throw new CommandLineException(SR.TargetArchitectureUnsupported); } if (_commandLineOptions.TargetOS != null) { @@ -153,7 +146,7 @@ private int Run() else if (_commandLineOptions.TargetOS.Equals("osx", StringComparison.OrdinalIgnoreCase)) _targetOS = TargetOS.OSX; else - throw new CommandLineException("Target OS is not supported"); + throw new CommandLineException(SR.TargetOSUnsupported); } using (PerfEventSource.StartStopEvents.CompilationEvents()) @@ -179,6 +172,7 @@ private int Run() // When we undo this this hack, replace this foreach with // typeSystemContext.InputFilePaths = _inputFilePaths; // + Dictionary allInputFilePaths = new Dictionary(); Dictionary inputFilePaths = new Dictionary(); List referenceableModules = new List(); foreach (var inputFile in _inputFilePaths) @@ -186,6 +180,7 @@ private int Run() try { var module = typeSystemContext.GetModuleFromPath(inputFile.Value); + allInputFilePaths.Add(inputFile.Key, inputFile.Value); inputFilePaths.Add(inputFile.Key, inputFile.Value); referenceableModules.Add(module); } @@ -195,16 +190,37 @@ private int Run() } } - typeSystemContext.InputFilePaths = inputFilePaths; + Dictionary unrootedInputFilePaths = new Dictionary(); + foreach (var unrootedInputFile in _unrootedInputFilePaths) + { + try + { + var module = typeSystemContext.GetModuleFromPath(unrootedInputFile.Value); + if (!allInputFilePaths.ContainsKey(unrootedInputFile.Key)) + { + allInputFilePaths.Add(unrootedInputFile.Key, unrootedInputFile.Value); + unrootedInputFilePaths.Add(unrootedInputFile.Key, unrootedInputFile.Value); + referenceableModules.Add(module); + } + } + catch (TypeSystemException.BadImageFormatException) + { + // Keep calm and carry on. + } + } + + typeSystemContext.InputFilePaths = allInputFilePaths; typeSystemContext.ReferenceFilePaths = _referenceFilePaths; List inputModules = new List(); + List rootingModules = new List(); HashSet versionBubbleModulesHash = new HashSet(); - foreach (var inputFile in typeSystemContext.InputFilePaths) + foreach (var inputFile in inputFilePaths) { EcmaModule module = typeSystemContext.GetModuleFromPath(inputFile.Value); inputModules.Add(module); + rootingModules.Add(module); versionBubbleModulesHash.Add(module); if (!_commandLineOptions.InputBubble) @@ -213,11 +229,18 @@ private int Run() } } + foreach (var unrootedInputFile in unrootedInputFilePaths) + { + EcmaModule module = typeSystemContext.GetModuleFromPath(unrootedInputFile.Value); + inputModules.Add(module); + versionBubbleModulesHash.Add(module); + } + string systemModuleName = _commandLineOptions.SystemModule ?? DefaultSystemModule; - typeSystemContext.SetSystemModule(typeSystemContext.GetModuleForSimpleName(systemModuleName)); + typeSystemContext.SetSystemModule((EcmaModule)typeSystemContext.GetModuleForSimpleName(systemModuleName)); if (typeSystemContext.InputFilePaths.Count == 0) - throw new CommandLineException("No input files specified"); + throw new CommandLineException(SR.NoInputFiles); // // Initialize compilation group and compilation roots @@ -242,6 +265,11 @@ private int Run() try { EcmaModule module = typeSystemContext.GetModuleFromPath(referenceFile); + if (versionBubbleModulesHash.Contains(module)) + { + // Ignore reference assemblies that have also been passed as inputs + continue; + } referenceableModules.Add(module); if (_commandLineOptions.InputBubble) { @@ -254,19 +282,34 @@ private int Run() List versionBubbleModules = new List(versionBubbleModulesHash); + if (!_commandLineOptions.Composite && inputModules.Count != 1) + { + throw new Exception(string.Format(SR.ErrorMultipleInputFilesCompositeModeOnly, string.Join("; ", inputModules))); + } + ReadyToRunCompilationModuleGroupBase compilationGroup; List compilationRoots = new List(); if (singleMethod != null) { // Compiling just a single method - compilationGroup = new SingleMethodCompilationModuleGroup(typeSystemContext, inputModules, versionBubbleModules, _commandLineOptions.CompileBubbleGenerics, singleMethod); + compilationGroup = new SingleMethodCompilationModuleGroup( + typeSystemContext, + _commandLineOptions.Composite, + inputModules, + versionBubbleModules, + _commandLineOptions.CompileBubbleGenerics, + singleMethod); compilationRoots.Add(new SingleMethodRootProvider(singleMethod)); } else { // Single assembly compilation. compilationGroup = new ReadyToRunSingleAssemblyCompilationModuleGroup( - typeSystemContext, inputModules, versionBubbleModules, _commandLineOptions.CompileBubbleGenerics); + typeSystemContext, + _commandLineOptions.Composite, + inputModules, + versionBubbleModules, + _commandLineOptions.CompileBubbleGenerics); } // Examine profile guided information as appropriate @@ -288,7 +331,7 @@ private int Run() if (singleMethod == null) { // For non-single-method compilations add compilation roots. - foreach (var module in inputModules) + foreach (var module in rootingModules) { compilationRoots.Add(new ReadyToRunRootProvider(module, profileDataManager, _commandLineOptions.Partial)); @@ -303,13 +346,8 @@ private int Run() // Compile // - string inputFilePath = ""; - foreach (var input in typeSystemContext.InputFilePaths) - { - inputFilePath = input.Value; - break; - } - ReadyToRunCodegenCompilationBuilder builder = new ReadyToRunCodegenCompilationBuilder(typeSystemContext, compilationGroup, inputFilePath); + ReadyToRunCodegenCompilationBuilder builder = new ReadyToRunCodegenCompilationBuilder( + typeSystemContext, compilationGroup, allInputFilePaths.Values); string compilationUnitPrefix = ""; builder.UseCompilationUnitPrefix(compilationUnitPrefix); @@ -353,7 +391,7 @@ private TypeDesc FindType(CompilerTypeSystemContext context, string typeName) ?? CustomAttributeTypeNameParser.ResolveCustomAttributeTypeDefinitionName(typeDefName, module, throwIfNotFound); }); if (foundType == null) - throw new CommandLineException($"Type '{typeName}' not found"); + throw new CommandLineException(string.Format(SR.TypeNotFound, typeName)); return foundType; } @@ -364,20 +402,20 @@ private MethodDesc CheckAndParseSingleMethodModeArguments(CompilerTypeSystemCont return null; if (_commandLineOptions.SingleMethodName == null || _commandLineOptions.SingleMethodTypeName == null) - throw new CommandLineException("Both method name and type name are required parameters for single method mode"); + throw new CommandLineException(SR.TypeAndMethodNameNeeded); TypeDesc owningType = FindType(context, _commandLineOptions.SingleMethodTypeName); // TODO: allow specifying signature to distinguish overloads MethodDesc method = owningType.GetMethod(_commandLineOptions.SingleMethodName, null); if (method == null) - throw new CommandLineException($"Method '{_commandLineOptions.SingleMethodName}' not found in '{_commandLineOptions.SingleMethodTypeName}'"); + throw new CommandLineException(string.Format(SR.MethodNotFoundOnType, _commandLineOptions.SingleMethodName, _commandLineOptions.SingleMethodTypeName)); if (method.HasInstantiation != (_commandLineOptions.SingleMethodGenericArgs != null) || (method.HasInstantiation && (method.Instantiation.Length != _commandLineOptions.SingleMethodGenericArgs.Length))) { throw new CommandLineException( - $"Expected {method.Instantiation.Length} generic arguments for method '{_commandLineOptions.SingleMethodName}' on type '{_commandLineOptions.SingleMethodTypeName}'"); + string.Format(SR.GenericArgCountMismatch, method.Instantiation.Length, _commandLineOptions.SingleMethodName, _commandLineOptions.SingleMethodTypeName)); } if (method.HasInstantiation) @@ -393,7 +431,7 @@ private MethodDesc CheckAndParseSingleMethodModeArguments(CompilerTypeSystemCont private static bool DumpReproArguments(CodeGenerationFailedException ex) { - Console.WriteLine("To repro, add following arguments to the command line:"); + Console.WriteLine(SR.DumpReproInstructions); MethodDesc failingMethod = ex.Method; @@ -434,7 +472,7 @@ private static int InnerMain(CommandLineOptions buildOptions) } catch (Exception e) { - Console.Error.WriteLine("Error: " + e.Message); + Console.Error.WriteLine(string.Format(SR.ProgramError, e.Message)); Console.Error.WriteLine(e.ToString()); return 1; } diff --git a/src/coreclr/src/tools/crossgen2/crossgen2/Properties/Resources.resx b/src/coreclr/src/tools/crossgen2/crossgen2/Properties/Resources.resx new file mode 100644 index 00000000000000..d270a30bd14343 --- /dev/null +++ b/src/coreclr/src/tools/crossgen2/crossgen2/Properties/Resources.resx @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Compile instantiations from reference modules used in the current module + + + Define a codegen option + + + To repro, add following arguments to the command line: + + + Emitting R2R PE file: {0} + + + Enable optimizations + + + Expected {0} generic arguments for method '{1}' on type '{2}' + + + True when the entire input forms a version bubble (default = per-assembly bubble) + + + Emit a composite R2R image comprising a number of input assemblies + + + Input file(s) to compile + + + "Input files without automatic rooting of all methods + + + Path to JIT compiler library + + + Generate the map file + + + Method '{0}' not found in '{1}' + + + Mibc file(s) for profile guided optimization + + + Output filename must be specified (/out <file>) + + + No input files specified + + + Enable optimizations, favor code space + + + Enable optimizations, favor code speed + + + Output file path + + + Maximum number of threads to use during compilation + + + Generate partial image driven by profile + + + Error: {0} + + + Reference file(s) for compilation + + + Disable behavior where unexpected compilation failures cause overall compilation failure + + + Save result of dependency analysis as DGML + + + Save detailed log of dependency analysis + + + Single method compilation: generic arguments to the method + + + Single method compilation: generic arguments to the method + + + Single method compilation: name of the owning type + + + System module name (default: System.Private.CoreLib) + + + Target architecture is not supported + + + Target architecture for cross compilation + + + Target OS for cross compilation + + + Target OS is not supported + + + Generate IBC tuning image + + + Both method name and type name are required parameters for single method mode + + + Type '{0}' not found + + + Enable verbose logging + + + Pause to give opportunity to attach debugger + + + Waiting for debugger to attach. Press ENTER to continue + + + Warning: ignoring --compilebubblegenerics because --inputbubble was not specified + + + Warning: overriding -Ot with -Os + + + Error: multiple input files are only supported in composite build mode: {0} + + \ No newline at end of file diff --git a/src/coreclr/src/tools/crossgen2/crossgen2/crossgen2.csproj b/src/coreclr/src/tools/crossgen2/crossgen2/crossgen2.csproj index a443761a89408f..0f8ac1b9e7523a 100644 --- a/src/coreclr/src/tools/crossgen2/crossgen2/crossgen2.csproj +++ b/src/coreclr/src/tools/crossgen2/crossgen2/crossgen2.csproj @@ -1,4 +1,4 @@ - + crossgen2 true @@ -14,10 +14,18 @@ the same bits tests expect to see in artifacts/crossgen2. That way we never need to wonder which binaries are up to date and which are stale. --> $(BinDir)/crossgen2 - false + false false + false + + + true + System.SR + + + diff --git a/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h b/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h index 96ea0747092ee5..64ce8fcf69a227 100644 --- a/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h +++ b/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h @@ -46,6 +46,7 @@ struct JitInterfaceCallbacks int (* canSkipVerification)(void * thisHandle, CorInfoException** ppException, void* module); int (* isValidToken)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK); int (* isValidStringRef)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK); + const wchar_t* (* getStringLiteral)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK, int* length); int (* shouldEnforceCallvirtRestriction)(void * thisHandle, CorInfoException** ppException, void* scope); int (* asCorInfoType)(void * thisHandle, CorInfoException** ppException, void* cls); const char* (* getClassName)(void * thisHandle, CorInfoException** ppException, void* cls); @@ -513,6 +514,15 @@ class JitInterfaceWrapper return _ret; } + virtual const wchar_t* getStringLiteral(void* module, unsigned metaTOK, int* length) + { + CorInfoException* pException = nullptr; + const wchar_t* _ret = _callbacks->getStringLiteral(_thisHandle, &pException, module, metaTOK, length); + if (pException != nullptr) + throw pException; + return _ret; + } + virtual int shouldEnforceCallvirtRestriction(void* scope) { CorInfoException* pException = nullptr; diff --git a/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp b/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp index 0da621980ae893..44ef2b69d49c09 100644 --- a/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp +++ b/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp @@ -27,11 +27,11 @@ class CORJIT_FLAGS uint64_t corJitFlags; }; -static const GUID JITEEVersionIdentifier = { /* abcf830c-56d1-4b33-a8ec-5063bb5495f1 */ - 0xabcf830c, - 0x56d1, - 0x4b33, - {0xa8, 0xec, 0x50, 0x63, 0xbb, 0x54, 0x95, 0xf1} +static const GUID JITEEVersionIdentifier = { /* 96fc0c0a-9f77-450d-9663-ee33ae0fcae8 */ + 0x96fc0c0a, + 0x9f77, + 0x450d, + {0x96, 0x63, 0xee, 0x33, 0xae, 0x0f, 0xca, 0xe8} }; class Jit diff --git a/src/coreclr/src/tools/r2rdump/CommandLineOptions.cs b/src/coreclr/src/tools/r2rdump/CommandLineOptions.cs index 6afa48ebe8b35b..5ddfd1dbeb6b35 100644 --- a/src/coreclr/src/tools/r2rdump/CommandLineOptions.cs +++ b/src/coreclr/src/tools/r2rdump/CommandLineOptions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -28,6 +28,7 @@ public static RootCommand RootCommand() command.AddOption(new Option(new[] { "--sectionContents", "--sc" }, "Dump section contents", new Argument())); command.AddOption(new Option(new[] { "--entrypoints", "-e" }, "Dump list of method / instance entrypoints in the R2R file", new Argument())); command.AddOption(new Option(new[] { "--normalize", "-n" }, "Normalize dump by sorting the various tables and methods (default = unsorted i.e. file order)", new Argument())); + command.AddOption(new Option(new[] { "--hide-transitions", "--ht" }, "Don't include GC transitions in disassembly output", new Argument())); command.AddOption(new Option(new[] { "--verbose", "-v" }, "Dump disassembly, unwindInfo, gcInfo and sectionContents", new Argument())); command.AddOption(new Option(new[] { "--diff" }, "Compare two R2R images", new Argument())); command.AddOption(new Option(new[] { "--diff-hide-same-disasm" }, "In matching method diff dump, hide functions with identical disassembly", new Argument())); diff --git a/src/coreclr/src/tools/r2rdump/CoreDisTools.cs b/src/coreclr/src/tools/r2rdump/CoreDisTools.cs index 95524ff53d57cc..bbaf801ad3cb64 100644 --- a/src/coreclr/src/tools/r2rdump/CoreDisTools.cs +++ b/src/coreclr/src/tools/r2rdump/CoreDisTools.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/tools/r2rdump/Extensions.cs b/src/coreclr/src/tools/r2rdump/Extensions.cs index a4c65a578731ff..911f7dd9f697b4 100644 --- a/src/coreclr/src/tools/r2rdump/Extensions.cs +++ b/src/coreclr/src/tools/r2rdump/Extensions.cs @@ -1,14 +1,15 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using ILCompiler.Reflection.ReadyToRun; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection.Metadata.Ecma335; -using System.Text; + +using ILCompiler.Reflection.ReadyToRun; +using Internal.Runtime; namespace R2RDump { @@ -112,7 +113,7 @@ public static void WriteTo(this ReadyToRunImportSection.ImportSectionEntry theTh public static void WriteTo(this ReadyToRunSection theThis, TextWriter writer, DumpOptions options) { - writer.WriteLine($"Type: {Enum.GetName(typeof(ReadyToRunSection.SectionType), theThis.Type)} ({theThis.Type:D})"); + writer.WriteLine($"Type: {Enum.GetName(typeof(ReadyToRunSectionType), theThis.Type)} ({theThis.Type:D})"); if (!options.Naked) { writer.WriteLine($"RelativeVirtualAddress: 0x{theThis.RelativeVirtualAddress:X8}"); diff --git a/src/coreclr/src/tools/r2rdump/R2RDiff.cs b/src/coreclr/src/tools/r2rdump/R2RDiff.cs index ab5d270ee1fd04..8a7021bc59ce4c 100644 --- a/src/coreclr/src/tools/r2rdump/R2RDiff.cs +++ b/src/coreclr/src/tools/r2rdump/R2RDiff.cs @@ -1,8 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using ILCompiler.Reflection.ReadyToRun; using System; using System.Collections.Generic; using System.IO; @@ -10,6 +9,9 @@ using System.Reflection.PortableExecutable; using System.Text; +using ILCompiler.Reflection.ReadyToRun; +using Internal.Runtime; + namespace R2RDump { /// @@ -193,7 +195,7 @@ private Dictionary GetR2RSectionMap(ReadyToRunReader reader) { Dictionary sectionMap = new Dictionary(); - foreach (KeyValuePair typeAndSection in reader.ReadyToRunHeader.Sections) + foreach (KeyValuePair typeAndSection in reader.ReadyToRunHeader.Sections) { string name = typeAndSection.Key.ToString(); sectionMap.Add(name, typeAndSection.Value.Size); diff --git a/src/coreclr/src/tools/r2rdump/R2RDump.cs b/src/coreclr/src/tools/r2rdump/R2RDump.cs index 60cd01f0a0fbbe..ce459a54b59d5c 100644 --- a/src/coreclr/src/tools/r2rdump/R2RDump.cs +++ b/src/coreclr/src/tools/r2rdump/R2RDump.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -12,10 +12,11 @@ using System.Reflection.Metadata.Ecma335; using System.Reflection.PortableExecutable; using System.Runtime.CompilerServices; -using System.Text; using System.Threading.Tasks; using ILCompiler.Reflection.ReadyToRun; +using Internal.Runtime; + namespace R2RDump { public class DumpOptions : IAssemblyResolver @@ -38,6 +39,7 @@ public class DumpOptions : IAssemblyResolver public bool SectionContents { get; set; } public bool EntryPoints { get; set; } public bool Normalize { get; set; } + public bool HideTransitions { get; set; } public bool Verbose { get; set; } public bool Diff { get; set; } public bool DiffHideSameDisasm { get; set; } @@ -55,16 +57,29 @@ public class DumpOptions : IAssemblyResolver private readonly static string[] ProbeExtensions = new string[] { ".ni.exe", ".ni.dll", ".exe", ".dll" }; /// - /// Try to locate a (reference) assembly using the list of explicit reference assemblies + /// Try to locate a (reference) assembly based on an AssemblyRef handle using the list of explicit reference assemblies /// and the list of reference paths passed to R2RDump. /// - /// Simple name of the assembly to look up + /// Containing metadata reader for the assembly reference handle + /// Handle representing the assembly reference /// Name of assembly from which we're performing the lookup /// public MetadataReader FindAssembly(MetadataReader metadataReader, AssemblyReferenceHandle assemblyReferenceHandle, string parentFile) { string simpleName = metadataReader.GetString(metadataReader.GetAssemblyReference(assemblyReferenceHandle).Name); + return FindAssembly(simpleName, parentFile); + } + + /// + /// Try to locate a (reference) assembly using the list of explicit reference assemblies + /// and the list of reference paths passed to R2RDump. + /// + /// Simple name of the assembly to look up + /// Name of assembly from which we're performing the lookup + /// + public MetadataReader FindAssembly(string simpleName, string parentFile) + { foreach (FileInfo refAsm in Reference ?? Enumerable.Empty()) { if (Path.GetFileNameWithoutExtension(refAsm.FullName).Equals(simpleName, StringComparison.OrdinalIgnoreCase)) @@ -80,10 +95,16 @@ public MetadataReader FindAssembly(MetadataReader metadataReader, AssemblyRefere { foreach (string extension in ProbeExtensions) { - string probeFile = Path.Combine(refPath, simpleName + extension); - if (File.Exists(probeFile)) + try + { + string probeFile = Path.Combine(refPath, simpleName + extension); + if (File.Exists(probeFile)) + { + return Open(probeFile); + } + } + catch (BadImageFormatException) { - return Open(probeFile); } } } @@ -99,7 +120,7 @@ private static unsafe MetadataReader Open(string filename) if (!peReader.HasMetadata) { - throw new Exception($"ECMA metadata not found in file '{filename}'"); + throw new BadImageFormatException($"ECMA metadata not found in file '{filename}'"); } return peReader.GetMetadataReader(); @@ -176,7 +197,7 @@ public IEnumerable NormalizedMethods() class R2RDump { private readonly DumpOptions _options; - private readonly Dictionary _selectedSections = new Dictionary(); + private readonly Dictionary _selectedSections = new Dictionary(); private readonly TextWriter _writer; private Dumper _dumper; @@ -404,7 +425,7 @@ private bool Match(ReadyToRunSection section, string query) { int queryInt; bool isNum = ArgStringToInt(query, out queryInt); - string typeName = Enum.GetName(typeof(ReadyToRunSection.SectionType), section.Type); + string typeName = Enum.GetName(typeof(ReadyToRunSectionType), section.Type); return (isNum && (int)section.Type == queryInt) || typeName.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0; } diff --git a/src/coreclr/src/tools/r2rdump/R2RDump.csproj b/src/coreclr/src/tools/r2rdump/R2RDump.csproj index c0ca503d24b672..9210228b4e3d79 100644 --- a/src/coreclr/src/tools/r2rdump/R2RDump.csproj +++ b/src/coreclr/src/tools/r2rdump/R2RDump.csproj @@ -1,4 +1,4 @@ - + R2RDump 1.0.0.0 diff --git a/src/coreclr/src/tools/r2rdump/R2RDump.sln b/src/coreclr/src/tools/r2rdump/R2RDump.sln index dcbf816348e3e4..08814630d09a72 100644 --- a/src/coreclr/src/tools/r2rdump/R2RDump.sln +++ b/src/coreclr/src/tools/r2rdump/R2RDump.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29703.146 diff --git a/src/coreclr/src/tools/r2rdump/TextDumper.cs b/src/coreclr/src/tools/r2rdump/TextDumper.cs index d9cde7c4183cde..b5610d732aa993 100644 --- a/src/coreclr/src/tools/r2rdump/TextDumper.cs +++ b/src/coreclr/src/tools/r2rdump/TextDumper.cs @@ -1,8 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using ILCompiler.Reflection.ReadyToRun; using System; using System.Collections.Generic; using System.IO; @@ -11,7 +10,9 @@ using System.Reflection.Metadata.Ecma335; using System.Reflection.PortableExecutable; using System.Text; -using System.Xml; + +using ILCompiler.Reflection.ReadyToRun; +using Internal.Runtime; namespace R2RDump { @@ -212,9 +213,18 @@ internal override void DumpDisasm(RuntimeFunction rtf, int imageOffset) } } - if (rtf.Method.GcInfo?.Transitions != null && rtf.Method.GcInfo.Transitions.ContainsKey(codeOffset)) + if (!_options.HideTransitions && rtf.Method.GcInfo?.Transitions != null && rtf.Method.GcInfo.Transitions.TryGetValue(codeOffset, out List transitionsForOffset)) { - foreach (BaseGcTransition transition in rtf.Method.GcInfo.Transitions[codeOffset]) + string[] formattedTransitions = new string[transitionsForOffset.Count]; + for (int transitionIndex = 0; transitionIndex < formattedTransitions.Length; transitionIndex++) + { + formattedTransitions[transitionIndex] = transitionsForOffset[transitionIndex].ToString(); + } + if (_options.Normalize) + { + Array.Sort(formattedTransitions); + } + foreach (string transition in formattedTransitions) { _writer.WriteLine($"{indentString}{transition}"); } @@ -270,7 +280,7 @@ internal override void DumpSectionContents(ReadyToRunSection section) { switch (section.Type) { - case ReadyToRunSection.SectionType.READYTORUN_SECTION_AVAILABLE_TYPES: + case ReadyToRunSectionType.AvailableTypes: if (!_options.Naked) { uint availableTypesSectionOffset = (uint)_r2r.GetOffset(section.RelativeVirtualAddress); @@ -284,14 +294,14 @@ internal override void DumpSectionContents(ReadyToRunSection section) _writer.WriteLine(name); } break; - case ReadyToRunSection.SectionType.READYTORUN_SECTION_METHODDEF_ENTRYPOINTS: + case ReadyToRunSectionType.MethodDefEntryPoints: if (!_options.Naked) { NativeArray methodEntryPoints = new NativeArray(_r2r.Image, (uint)_r2r.GetOffset(section.RelativeVirtualAddress)); _writer.Write(methodEntryPoints.ToString()); } break; - case ReadyToRunSection.SectionType.READYTORUN_SECTION_INSTANCE_METHOD_ENTRYPOINTS: + case ReadyToRunSectionType.InstanceMethodEntryPoints: if (!_options.Naked) { uint instanceSectionOffset = (uint)_r2r.GetOffset(section.RelativeVirtualAddress); @@ -305,7 +315,7 @@ internal override void DumpSectionContents(ReadyToRunSection section) _writer.WriteLine($@"0x{instanceMethod.Bucket:X2} -> {instanceMethod.Method.SignatureString}"); } break; - case ReadyToRunSection.SectionType.READYTORUN_SECTION_RUNTIME_FUNCTIONS: + case ReadyToRunSectionType.RuntimeFunctions: int rtfOffset = _r2r.GetOffset(section.RelativeVirtualAddress); int rtfEndOffset = rtfOffset + section.Size; int rtfIndex = 0; @@ -326,10 +336,10 @@ internal override void DumpSectionContents(ReadyToRunSection section) rtfIndex++; } break; - case ReadyToRunSection.SectionType.READYTORUN_SECTION_COMPILER_IDENTIFIER: + case ReadyToRunSectionType.CompilerIdentifier: _writer.WriteLine(_r2r.CompilerIdentifier); break; - case ReadyToRunSection.SectionType.READYTORUN_SECTION_IMPORT_SECTIONS: + case ReadyToRunSectionType.ImportSections: if (_options.Naked) { DumpNakedImportSections(); @@ -366,14 +376,19 @@ internal override void DumpSectionContents(ReadyToRunSection section) } } break; - case ReadyToRunSection.SectionType.READYTORUN_SECTION_MANIFEST_METADATA: - int assemblyRefCount = _r2r.MetadataReader.GetTableRowCount(TableIndex.AssemblyRef); - _writer.WriteLine($"MSIL AssemblyRef's ({assemblyRefCount} entries):"); - for (int assemblyRefIndex = 1; assemblyRefIndex <= assemblyRefCount; assemblyRefIndex++) + case ReadyToRunSectionType.ManifestMetadata: + int assemblyRefCount = 0; + if (!_r2r.Composite) { - AssemblyReference assemblyRef = _r2r.MetadataReader.GetAssemblyReference(MetadataTokens.AssemblyReferenceHandle(assemblyRefIndex)); - string assemblyRefName = _r2r.MetadataReader.GetString(assemblyRef.Name); - _writer.WriteLine($"[ID 0x{assemblyRefIndex:X2}]: {assemblyRefName}"); + MetadataReader globalReader = _r2r.GetGlobalMetadataReader(); + assemblyRefCount = globalReader.GetTableRowCount(TableIndex.AssemblyRef); + _writer.WriteLine($"MSIL AssemblyRef's ({assemblyRefCount} entries):"); + for (int assemblyRefIndex = 1; assemblyRefIndex <= assemblyRefCount; assemblyRefIndex++) + { + AssemblyReference assemblyRef = globalReader.GetAssemblyReference(MetadataTokens.AssemblyReferenceHandle(assemblyRefIndex)); + string assemblyRefName = globalReader.GetString(assemblyRef.Name); + _writer.WriteLine($"[ID 0x{assemblyRefIndex:X2}]: {assemblyRefName}"); + } } _writer.WriteLine($"Manifest metadata AssemblyRef's ({_r2r.ManifestReferenceAssemblies.Count()} entries):"); @@ -384,25 +399,34 @@ internal override void DumpSectionContents(ReadyToRunSection section) manifestAsmIndex++; } break; - case ReadyToRunSection.SectionType.READYTORUN_SECTION_ATTRIBUTEPRESENCE: + case ReadyToRunSectionType.AttributePresence: int attributesStartOffset = _r2r.GetOffset(section.RelativeVirtualAddress); int attributesEndOffset = attributesStartOffset + section.Size; NativeCuckooFilter attributes = new NativeCuckooFilter(_r2r.Image, attributesStartOffset, attributesEndOffset); _writer.WriteLine("Attribute presence filter"); _writer.WriteLine(attributes.ToString()); break; - case ReadyToRunSection.SectionType.READYTORUN_SECTION_INLINING_INFO: + case ReadyToRunSectionType.InliningInfo: int iiOffset = _r2r.GetOffset(section.RelativeVirtualAddress); int iiEndOffset = iiOffset + section.Size; InliningInfoSection inliningInfoSection = new InliningInfoSection(_r2r, iiOffset, iiEndOffset); _writer.WriteLine(inliningInfoSection.ToString()); break; - case ReadyToRunSection.SectionType.READYTORUN_SECTION_INLINING_INFO2: + case ReadyToRunSectionType.InliningInfo2: int ii2Offset = _r2r.GetOffset(section.RelativeVirtualAddress); int ii2EndOffset = ii2Offset + section.Size; InliningInfoSection2 inliningInfoSection2 = new InliningInfoSection2(_r2r, ii2Offset, ii2EndOffset); _writer.WriteLine(inliningInfoSection2.ToString()); break; + case ReadyToRunSectionType.OwnerCompositeExecutable: + int oceOffset = _r2r.GetOffset(section.RelativeVirtualAddress); + Decoder decoder = Encoding.UTF8.GetDecoder(); + int charLength = decoder.GetCharCount(_r2r.Image, oceOffset, section.Size); + char[] charArray = new char[charLength]; + decoder.GetChars(_r2r.Image, oceOffset, section.Size, charArray, 0, flush: true); + string ownerCompositeExecutable = new string(charArray); + _writer.WriteLine("Composite executable: {0}", ownerCompositeExecutable); + break; } } diff --git a/src/coreclr/src/utilcode/ccomprc.cpp b/src/coreclr/src/utilcode/ccomprc.cpp index 0fca5cc692cbf1..1417caf4e7c6b9 100644 --- a/src/coreclr/src/utilcode/ccomprc.cpp +++ b/src/coreclr/src/utilcode/ccomprc.cpp @@ -8,7 +8,7 @@ #include "ndpversion.h" #include "../dlls/mscorrc/resource.h" -#ifdef TARGET_UNIX +#ifdef HOST_UNIX #include "resourcestring.h" #define NATIVE_STRING_RESOURCE_NAME mscorrc_debug __attribute__((visibility("default"))) DECLARE_NATIVE_STRING_RESOURCE_TABLE(NATIVE_STRING_RESOURCE_NAME); @@ -115,10 +115,10 @@ HRESULT CCompRC::AddMapNode(LocaleID langId, HRESOURCEDLL hInst, BOOL fMissing) LPCWSTR CCompRC::m_pDefaultResource = W("mscorrc.debug.dll"); LPCWSTR CCompRC::m_pFallbackResource= W("mscorrc.dll"); -#ifdef TARGET_UNIX +#ifdef HOST_UNIX LPCSTR CCompRC::m_pDefaultResourceDomain = "mscorrc.debug"; LPCSTR CCompRC::m_pFallbackResourceDomain = "mscorrc"; -#endif // TARGET_UNIX +#endif // HOST_UNIX HRESULT CCompRC::Init(LPCWSTR pResourceFile, BOOL bUseFallback) { @@ -166,7 +166,7 @@ HRESULT CCompRC::Init(LPCWSTR pResourceFile, BOOL bUseFallback) return E_OUTOFMEMORY; } -#ifdef TARGET_UNIX +#ifdef HOST_UNIX if (m_pResourceFile == m_pDefaultResource) { @@ -181,7 +181,7 @@ HRESULT CCompRC::Init(LPCWSTR pResourceFile, BOOL bUseFallback) _ASSERTE(!"Unsupported resource file"); } -#endif // TARGET_UNIX +#endif // HOST_UNIX if (m_csMap == NULL) { @@ -551,7 +551,7 @@ HRESULT CCompRC::LoadString(ResourceCategory eCategory, LocaleID langId, UINT iR } CONTRACTL_END; -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS HRESULT hr; HRESOURCEDLL hInst = 0; //instance of cultured resource dll int length; @@ -692,17 +692,17 @@ HRESULT CCompRC::LoadString(ResourceCategory eCategory, LocaleID langId, UINT iR *szBuffer = W('\0'); return hr; -#else // !TARGET_UNIX +#else // HOST_WINDOWS return LoadNativeStringResource(NATIVE_STRING_RESOURCE_TABLE(NATIVE_STRING_RESOURCE_NAME), iResourceID, szBuffer, iMax, pcwchUsed); -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS } #ifndef DACCESS_COMPILE HRESULT CCompRC::LoadResourceFile(HRESOURCEDLL * pHInst, LPCWSTR lpFileName) { -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS DWORD dwLoadLibraryFlags; if(m_pResourceFile == m_pDefaultResource) dwLoadLibraryFlags = LOAD_LIBRARY_AS_DATAFILE; @@ -712,9 +712,9 @@ HRESULT CCompRC::LoadResourceFile(HRESOURCEDLL * pHInst, LPCWSTR lpFileName) if ((*pHInst = WszLoadLibraryEx(lpFileName, NULL, dwLoadLibraryFlags)) == NULL) { return HRESULT_FROM_GetLastError(); } -#else // !TARGET_UNIX +#else // HOST_WINDOWS PORTABILITY_ASSERT("UNIXTODO: Implement resource loading - use peimagedecoder?"); -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS return S_OK; } diff --git a/src/coreclr/src/utilcode/ex.cpp b/src/coreclr/src/utilcode/ex.cpp index 479a1e0fd08ab9..c9703262732971 100644 --- a/src/coreclr/src/utilcode/ex.cpp +++ b/src/coreclr/src/utilcode/ex.cpp @@ -1216,7 +1216,7 @@ void GenerateTopLevelHRExceptionMessage(HRESULT hresult, SString &result) #if !defined(DACCESS_COMPILE) -void GetCurrentExceptionPointers(PEXCEPTION_POINTERS pExceptionInfo) +void GetCurrentExceptionPointers(PEXCEPTION_POINTERS pExceptionInfo DEBUG_ARG(bool checkExceptionRecordLocation)) { WRAPPER_NO_CONTRACT; @@ -1227,7 +1227,7 @@ void GetCurrentExceptionPointers(PEXCEPTION_POINTERS pExceptionInfo) pExceptionInfo->ExceptionRecord = pRecord; #ifdef _DEBUG - if (pRecord != NULL) + if (pRecord != NULL && checkExceptionRecordLocation) { _ASSERTE ((PVOID)(pRecord) > (PVOID)(&pRecord)); } diff --git a/src/coreclr/src/utilcode/longfilepathwrappers.cpp b/src/coreclr/src/utilcode/longfilepathwrappers.cpp index 44c35ad2a9abae..4a0bf3b86b424a 100644 --- a/src/coreclr/src/utilcode/longfilepathwrappers.cpp +++ b/src/coreclr/src/utilcode/longfilepathwrappers.cpp @@ -11,14 +11,14 @@ class LongFile { private: -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS static const WCHAR* ExtendedPrefix; static const WCHAR* DevicePathPrefix; static const WCHAR* UNCPathPrefix; static const WCHAR* UNCExtendedPathPrefix; static const WCHAR VolumeSeparatorChar; #define UNCPATHPREFIX W("\\\\") -#endif //TARGET_UNIX +#endif //HOST_WINDOWS static const WCHAR DirectorySeparatorChar; static const WCHAR AltDirectorySeparatorChar; public: @@ -31,7 +31,7 @@ class LongFile static HRESULT NormalizePath(SString& path); -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS static void NormalizeDirectorySeparators(SString& path); #endif }; @@ -60,11 +60,11 @@ LoadLibraryExWrapper( if (LongFile::IsPathNotFullyQualified(path) || SUCCEEDED(LongFile::NormalizePath(path))) { -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS //Adding the assert to ensure relative paths which are not just filenames are not used for LoadLibrary Calls _ASSERTE(!LongFile::IsPathNotFullyQualified(path) || !LongFile::ContainsDirectorySeparator(path)); LongFile::NormalizeDirectorySeparators(path); -#endif //TARGET_UNIX +#endif //HOST_WINDOWS ret = LoadLibraryExW(path.GetUnicode(), hFile, dwFlags); } @@ -657,7 +657,7 @@ DWORD WINAPI GetEnvironmentVariableWrapper( } -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS BOOL CopyFileExWrapper( @@ -764,10 +764,10 @@ FindFirstFileExWrapper( return ret; } -#endif //!TARGET_UNIX +#endif // HOST_WINDOWS -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS #if ! defined(DACCESS_COMPILE) && !defined(SELF_NO_HOST) extern HINSTANCE g_pMSCorEE; @@ -822,13 +822,13 @@ BOOL PAL_GetPALDirectoryWrapper(SString& pbuffer) return retval; } -#endif // TARGET_UNIX +#endif // HOST_WINDOWS //Implementation of LongFile Helpers const WCHAR LongFile::DirectorySeparatorChar = W('\\'); const WCHAR LongFile::AltDirectorySeparatorChar = W('/'); -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS const WCHAR LongFile::VolumeSeparatorChar = W(':'); const WCHAR* LongFile::ExtendedPrefix = W("\\\\?\\"); const WCHAR* LongFile::DevicePathPrefix = W("\\\\.\\"); @@ -1003,7 +1003,7 @@ HRESULT LongFile::NormalizePath(SString & path) { return S_OK; } -#endif //TARGET_UNIX +#endif //HOST_WINDOWS BOOL LongFile::ContainsDirectorySeparator(SString & path) { diff --git a/src/coreclr/src/utilcode/pedecoder.cpp b/src/coreclr/src/utilcode/pedecoder.cpp index 33d0bf440e7ce0..11563ddd556f3a 100644 --- a/src/coreclr/src/utilcode/pedecoder.cpp +++ b/src/coreclr/src/utilcode/pedecoder.cpp @@ -2863,7 +2863,7 @@ PTR_CVOID PEDecoder::GetNativeManifestMetadata(COUNT_T *pSize) const _ASSERTE(i == 0 || (pSections[i - 1].Type < pSections[i].Type)); READYTORUN_SECTION * pSection = pSections + i; - if (pSection->Type == READYTORUN_SECTION_MANIFEST_METADATA) + if (pSection->Type == ReadyToRunSectionType::ManifestMetadata) { // Set pDir to the address of the manifest metadata section pDir = &pSection->Section; @@ -2871,7 +2871,7 @@ PTR_CVOID PEDecoder::GetNativeManifestMetadata(COUNT_T *pSize) const } } - // ReadyToRun file without large version bubble support doesn't have the READYTORUN_SECTION_MANIFEST_METADATA + // ReadyToRun file without large version bubble support doesn't have the ManifestMetadata if (pDir == NULL) { if (pSize != NULL) diff --git a/src/coreclr/src/utilcode/util.cpp b/src/coreclr/src/utilcode/util.cpp index db7f2be643a11e..9ee644482df09f 100644 --- a/src/coreclr/src/utilcode/util.cpp +++ b/src/coreclr/src/utilcode/util.cpp @@ -503,12 +503,12 @@ BYTE * ClrVirtualAllocExecutable(SIZE_T dwSize, // Fall through to #endif // USE_UPPER_ADDRESS -#ifdef TARGET_UNIX +#ifdef HOST_UNIX // Tell PAL to use the executable memory allocator to satisfy this request for virtual memory. // This will allow us to place JIT'ed code close to the coreclr library // and thus improve performance by avoiding jump stubs in managed code. flAllocationType |= MEM_RESERVE_EXECUTABLE; -#endif // TARGET_UNIX +#endif // HOST_UNIX return (BYTE *) ClrVirtualAlloc (NULL, dwSize, flAllocationType, flProtect); @@ -523,13 +523,13 @@ LPVOID ClrVirtualAllocAligned(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocatio _ASSERTE(alignment != 0); _ASSERTE((alignment & (alignment - 1)) == 0); -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS // The VirtualAlloc on Windows ensures 64kB alignment _ASSERTE(alignment <= 0x10000); return ClrVirtualAlloc(lpAddress, dwSize, flAllocationType, flProtect); -#else // !TARGET_UNIX +#else // HOST_WINDOWS if(alignment < GetOsPageSize()) alignment = GetOsPageSize(); @@ -538,7 +538,7 @@ LPVOID ClrVirtualAllocAligned(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocatio SIZE_T addr = (SIZE_T)ClrVirtualAlloc(lpAddress, dwSize, flAllocationType, flProtect); return (LPVOID)((addr + (alignment - 1)) & ~(alignment - 1)); -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS } #ifdef _DEBUG @@ -620,13 +620,13 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, return (BYTE*) ClrVirtualAlloc(nullptr, dwSize, flAllocationType, flProtect); } -#ifdef TARGET_UNIX +#ifdef HOST_UNIX pResult = (BYTE *)PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(pMinAddr, pMaxAddr, dwSize); if (pResult != nullptr) { return pResult; } -#endif // TARGET_UNIX +#endif // HOST_UNIX // We will do one scan from [pMinAddr .. pMaxAddr] // First align the tryAddr up to next 64k base address. @@ -733,7 +733,7 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, return ::VirtualAllocExNuma(hProc, lpAddr, dwSize, allocType, prot, node); } -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS /*static*/ BOOL NumaNodeInfo::GetNumaProcessorNodeEx(PPROCESSOR_NUMBER proc_no, PUSHORT node_no) { return ::GetNumaProcessorNodeEx(proc_no, node_no); @@ -767,12 +767,12 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, return false; } -#else // !TARGET_UNIX +#else // HOST_WINDOWS /*static*/ BOOL NumaNodeInfo::GetNumaProcessorNodeEx(USHORT proc_no, PUSHORT node_no) { return PAL_GetNumaProcessorNode(proc_no, node_no); } -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS #endif /*static*/ BOOL NumaNodeInfo::m_enableGCNumaAware = FALSE; @@ -808,7 +808,7 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, m_enableGCNumaAware = InitNumaNodeInfoAPI(); } -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS //****************************************************************************** // CPUGroupInfo @@ -840,7 +840,7 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, { LIMITED_METHOD_CONTRACT; -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS return ::GetSystemTimes(idleTime, kernelTime, userTime); #else return FALSE; @@ -1238,7 +1238,7 @@ BOOL CPUGroupInfo::GetCPUGroupRange(WORD group_number, WORD* group_begin, WORD* LIMITED_METHOD_CONTRACT; return m_threadUseAllCpuGroups; } -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS //****************************************************************************** // Returns the number of processors that a process has been configured to run on @@ -1259,7 +1259,7 @@ int GetCurrentProcessCpuCount() unsigned int count = 0; -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS DWORD_PTR pmask, smask; if (!GetProcessAffinityMask(GetCurrentProcess(), &pmask, &smask)) @@ -1287,20 +1287,20 @@ int GetCurrentProcessCpuCount() count = 64; } -#else // !TARGET_UNIX +#else // HOST_WINDOWS count = PAL_GetLogicalCpuCountFromOS(); uint32_t cpuLimit; if (PAL_GetCpuLimit(&cpuLimit) && cpuLimit < count) count = cpuLimit; -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS cCPUs = count; return count; } -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS DWORD_PTR GetCurrentProcessCpuMask() { CONTRACTL @@ -1310,7 +1310,7 @@ DWORD_PTR GetCurrentProcessCpuMask() } CONTRACTL_END; -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS DWORD_PTR pmask, smask; if (!GetProcessAffinityMask(GetCurrentProcess(), &pmask, &smask)) @@ -1322,7 +1322,7 @@ DWORD_PTR GetCurrentProcessCpuMask() return 0; #endif } -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS uint32_t GetOsPageSizeUncached() { @@ -1338,7 +1338,7 @@ namespace uint32_t GetOsPageSize() { -#ifdef TARGET_UNIX +#ifdef HOST_UNIX size_t result = g_pageSize.LoadWithoutBarrier(); if(!result) @@ -2958,7 +2958,7 @@ BOOL IsIPInModule(HMODULE_TGT hModule, PCODE ip) param.fRet = FALSE; // UNIXTODO: implement a proper version for PAL -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS PAL_TRY(Param *, pParam, ¶m) { PTR_BYTE pBase = dac_cast(pParam->hModule); @@ -3027,7 +3027,7 @@ lDone: ; { } PAL_ENDTRY -#endif // !TARGET_UNIX +#endif // HOST_WINDOWS return param.fRet; } @@ -3096,7 +3096,7 @@ namespace Util static BOOL g_fLocalAppDataDirectoryInitted = FALSE; static WCHAR *g_wszLocalAppDataDirectory = NULL; -#ifndef TARGET_UNIX +#ifdef HOST_WINDOWS // Struct used to scope suspension of client impersonation for the current thread. // https://docs.microsoft.com/en-us/windows/desktop/secauthz/client-impersonation class SuspendImpersonation @@ -3337,7 +3337,7 @@ namespace Com return __imp::FindSubKeyDefaultValueForCLSID(rclsid, W("InprocServer32"), ssInprocServer32Name); } } // namespace Com -#endif // TARGET_UNIX +#endif // HOST_WINDOWS } // namespace Util } // namespace Clr diff --git a/src/coreclr/src/vm/CMakeLists.txt b/src/coreclr/src/vm/CMakeLists.txt index f53baee7842f57..66f75ef27c8d0f 100644 --- a/src/coreclr/src/vm/CMakeLists.txt +++ b/src/coreclr/src/vm/CMakeLists.txt @@ -38,6 +38,7 @@ set(VM_SOURCES_DAC_AND_WKS_COMMON appdomain.cpp array.cpp assembly.cpp + assemblyloadcontext.cpp baseassemblyspec.cpp binder.cpp castcache.cpp @@ -139,6 +140,7 @@ set(VM_HEADERS_DAC_AND_WKS_COMMON appdomain.inl array.h assembly.hpp + assemblyloadcontext.h baseassemblyspec.h baseassemblyspec.inl binder.h diff --git a/src/coreclr/src/vm/amd64/JitHelpers_Fast.asm b/src/coreclr/src/vm/amd64/JitHelpers_Fast.asm index 171e5a2c769e90..54c0019a944c63 100644 --- a/src/coreclr/src/vm/amd64/JitHelpers_Fast.asm +++ b/src/coreclr/src/vm/amd64/JitHelpers_Fast.asm @@ -651,6 +651,6 @@ ProbeLoop: ret -LEAF_END JIT_StackProbe, _TEXT +LEAF_END_MARKED JIT_StackProbe, _TEXT end diff --git a/src/coreclr/src/vm/amd64/jithelpers_fast.S b/src/coreclr/src/vm/amd64/jithelpers_fast.S index 57f7b9ed9adf7a..d5c9eaec923775 100644 --- a/src/coreclr/src/vm/amd64/jithelpers_fast.S +++ b/src/coreclr/src/vm/amd64/jithelpers_fast.S @@ -550,7 +550,7 @@ LEAF_END JIT_Stelem_Ref__ArrayStoreCheck_Helper, _TEXT #define PAGE_SIZE 0x1000 -NESTED_ENTRY JIT_StackProbe, _TEXT, NoHandler +LEAF_ENTRY JIT_StackProbe, _TEXT // On entry: // r11 - points to the lowest address on the stack frame being allocated (i.e. [InitialSp - FrameSize]) // rsp - points to some byte on the last probed page @@ -577,4 +577,4 @@ LOCAL_LABEL(ProbeLoop): RESET_FRAME_WITH_RBP ret -NESTED_END JIT_StackProbe, _TEXT +LEAF_END_MARKED JIT_StackProbe, _TEXT diff --git a/src/coreclr/src/vm/appdomain.cpp b/src/coreclr/src/vm/appdomain.cpp index 3a7a9413d5fd83..44aa02dad8cfa9 100644 --- a/src/coreclr/src/vm/appdomain.cpp +++ b/src/coreclr/src/vm/appdomain.cpp @@ -6342,7 +6342,7 @@ HRESULT RuntimeInvokeHostAssemblyResolver(INT_PTR pManagedAssemblyLoadContextToB else { pLoadedPEAssembly = pDomainAssembly->GetFile(); - if (pLoadedPEAssembly->HasHostAssembly() != true) + if (!pLoadedPEAssembly->HasHostAssembly()) { // Reflection emitted assemblies will not have a domain assembly. fFailLoad = true; diff --git a/src/coreclr/src/vm/arm/asmhelpers.S b/src/coreclr/src/vm/arm/asmhelpers.S index 68e6f08a035f59..34fb7235ff2f50 100644 --- a/src/coreclr/src/vm/arm/asmhelpers.S +++ b/src/coreclr/src/vm/arm/asmhelpers.S @@ -1466,7 +1466,7 @@ DelayLoad_Helper\suffix: #define PAGE_SIZE 0x1000 #define PAGE_SIZE_LOG2 12 - NESTED_ENTRY JIT_StackProbe, _TEXT, NoHandler + LEAF_ENTRY JIT_StackProbe, _TEXT PROLOG_PUSH "{r7}" PROLOG_STACK_SAVE r7 @@ -1484,4 +1484,4 @@ ProbeLoop: EPILOG_STACK_RESTORE r7 EPILOG_POP "{r7}" EPILOG_BRANCH_REG lr - NESTED_END JIT_StackProbe, _TEXT + LEAF_END_MARKED JIT_StackProbe, _TEXT diff --git a/src/coreclr/src/vm/arm/asmhelpers.asm b/src/coreclr/src/vm/arm/asmhelpers.asm index 1df5420770a80f..89cb80f00d2604 100644 --- a/src/coreclr/src/vm/arm/asmhelpers.asm +++ b/src/coreclr/src/vm/arm/asmhelpers.asm @@ -2160,7 +2160,7 @@ $__RealName ; ; NOTE: this helper will probe at least one page below the one pointed to by sp. #define PAGE_SIZE_LOG2 12 - NESTED_ENTRY JIT_StackProbe + LEAF_ENTRY JIT_StackProbe PROLOG_PUSH {r7} PROLOG_STACK_SAVE r7 @@ -2178,7 +2178,7 @@ ProbeLoop EPILOG_STACK_RESTORE r7 EPILOG_POP {r7} EPILOG_BRANCH_REG lr - NESTED_END + LEAF_END_MARKED JIT_StackProbe ; Must be at very end of file END diff --git a/src/coreclr/src/vm/assemblyloadcontext.cpp b/src/coreclr/src/vm/assemblyloadcontext.cpp new file mode 100644 index 00000000000000..40cb2432c0a6c8 --- /dev/null +++ b/src/coreclr/src/vm/assemblyloadcontext.cpp @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include "common.h" + +AssemblyLoadContext::AssemblyLoadContext() +{ +} + +HRESULT AssemblyLoadContext::GetBinderID( + UINT_PTR* pBinderId) +{ + *pBinderId = reinterpret_cast(this); + return S_OK; +} diff --git a/src/coreclr/src/vm/assemblyloadcontext.h b/src/coreclr/src/vm/assemblyloadcontext.h new file mode 100644 index 00000000000000..395e697562ea39 --- /dev/null +++ b/src/coreclr/src/vm/assemblyloadcontext.h @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#ifndef _ASSEMBLYLOADCONTEXT_H +#define _ASSEMBLYLOADCONTEXT_H + +// +// Unmanaged counter-part of System.Runtime.Loader.AssemblyLoadContext +// +class AssemblyLoadContext : public IUnknownCommon +{ +public: + AssemblyLoadContext(); + + STDMETHOD(GetBinderID)( + /* [retval][out] */ UINT_PTR* pBinderId); +}; + +#endif diff --git a/src/coreclr/src/vm/assemblyname.cpp b/src/coreclr/src/vm/assemblyname.cpp index 02f16684843022..f9291158bc384a 100644 --- a/src/coreclr/src/vm/assemblyname.cpp +++ b/src/coreclr/src/vm/assemblyname.cpp @@ -24,10 +24,6 @@ #include "strongnameinternal.h" #include "eeconfig.h" -#ifndef URL_ESCAPE_AS_UTF8 -#define URL_ESCAPE_AS_UTF8 0x00040000 // Percent-encode all non-ASCII characters as their UTF-8 equivalents. -#endif - FCIMPL1(Object*, AssemblyNameNative::GetFileInformation, StringObject* filenameUNSAFE) { FCALL_CONTRACT; diff --git a/src/coreclr/src/vm/assemblynative.cpp b/src/coreclr/src/vm/assemblynative.cpp index 6567cd9dce1ab1..b9cec28e3c5a27 100644 --- a/src/coreclr/src/vm/assemblynative.cpp +++ b/src/coreclr/src/vm/assemblynative.cpp @@ -1280,11 +1280,7 @@ INT_PTR QCALLTYPE AssemblyNative::InitializeAssemblyLoadContext(INT_PTR ptrManag { // We are initializing the managed instance of Assembly Load Context that would represent the TPA binder. // First, confirm we do not have an existing managed ALC attached to the TPA binder. - INT_PTR ptrTPAAssemblyLoadContext = pTPABinderContext->GetManagedAssemblyLoadContext(); - if ((ptrTPAAssemblyLoadContext != NULL) && (ptrTPAAssemblyLoadContext != ptrManagedAssemblyLoadContext)) - { - COMPlusThrow(kInvalidOperationException, IDS_HOST_ASSEMBLY_RESOLVER_INCOMPATIBLE_TPA_BINDING_CONTEXT); - } + _ASSERTE(pTPABinderContext->GetManagedAssemblyLoadContext() == NULL); // Attach the managed TPA binding context with the native one. pTPABinderContext->SetManagedAssemblyLoadContext(ptrManagedAssemblyLoadContext); @@ -1325,55 +1321,13 @@ INT_PTR QCALLTYPE AssemblyNative::GetLoadContextForAssembly(QCall::AssemblyHandl _ASSERTE(pAssembly != NULL); - // Get the PEAssembly for the RuntimeAssembly - PEFile *pPEFile = pAssembly->GetFile(); - PTR_PEAssembly pPEAssembly = pPEFile ? pPEFile->AsAssembly() : NULL; - - // Platform assemblies are semantically bound against the "Default" binder. - // The reference to the same will be returned when this QCall returns. - - // Get the binding context for the assembly. - // - ICLRPrivBinder *pOpaqueBinder = nullptr; - AppDomain *pCurDomain = AppDomain::GetCurrentDomain(); - CLRPrivBinderCoreCLR *pTPABinder = pCurDomain->GetTPABinderContext(); - - // GetBindingContext returns a ICLRPrivAssembly which can be used to get access to the - // actual ICLRPrivBinder instance in which the assembly was loaded. - PTR_ICLRPrivBinder pBindingContext = pPEAssembly->GetBindingContext(); - UINT_PTR assemblyBinderID = 0; - - if (pBindingContext) - { - IfFailThrow(pBindingContext->GetBinderID(&assemblyBinderID)); - - // If the assembly was bound using the TPA binder, - // then we will return the reference to "Default" binder from the managed implementation when this QCall returns. - // - // See earlier comment about "Default" binder for additional context. - pOpaqueBinder = reinterpret_cast(assemblyBinderID); - } - else - { - // GetBindingContext() returns NULL for System.Private.CoreLib - pOpaqueBinder = pTPABinder; - } + AssemblyLoadContext* pAssemblyLoadContext = pAssembly->GetFile()->GetAssemblyLoadContext(); - // We should have a load context binder at this point. - _ASSERTE(pOpaqueBinder != nullptr); - - // the TPA binder uses the default ALC - // WinRT assemblies (bound using the WinRT binder) don't actually have an ALC, - // so treat them the same as if they were loaded into the TPA ALC in this case. -#ifdef FEATURE_COMINTEROP - if (!AreSameBinderInstance(pTPABinder, pOpaqueBinder) && !AreSameBinderInstance(pCurDomain->GetWinRtBinder(), pOpaqueBinder)) -#else - if (!AreSameBinderInstance(pTPABinder, pOpaqueBinder)) -#endif // FEATURE_COMINTEROP + if (pAssemblyLoadContext != AppDomain::GetCurrentDomain()->GetTPABinderContext()) { // Only CLRPrivBinderAssemblyLoadContext instance contains the reference to its // corresponding managed instance. - CLRPrivBinderAssemblyLoadContext *pBinder = (CLRPrivBinderAssemblyLoadContext *)(pOpaqueBinder); + CLRPrivBinderAssemblyLoadContext* pBinder = (CLRPrivBinderAssemblyLoadContext*)(pAssemblyLoadContext); // Fetch the managed binder reference from the native binder instance ptrManagedAssemblyLoadContext = pBinder->GetManagedAssemblyLoadContext(); diff --git a/src/coreclr/src/vm/ceemain.cpp b/src/coreclr/src/vm/ceemain.cpp index 0f2a8b015acb6e..b7f8b4a4a5cee6 100644 --- a/src/coreclr/src/vm/ceemain.cpp +++ b/src/coreclr/src/vm/ceemain.cpp @@ -199,10 +199,6 @@ #include "profilinghelper.h" #endif // PROFILING_SUPPORTED -#ifdef FEATURE_COMINTEROP -#include "synchronizationcontextnative.h" // For SynchronizationContextNative::Cleanup -#endif - #ifdef FEATURE_INTERPRETER #include "interpreter.h" #endif // FEATURE_INTERPRETER @@ -1163,41 +1159,6 @@ HRESULT EEStartup(COINITIEE fFlags) #ifndef CROSSGEN_COMPILE -#ifdef FEATURE_COMINTEROP - -void InnerCoEEShutDownCOM() -{ - CONTRACTL - { - THROWS; - GC_TRIGGERS; - MODE_ANY; - } CONTRACTL_END; - - static LONG AlreadyDone = -1; - - if (g_fEEStarted != TRUE) - return; - - if (FastInterlockIncrement(&AlreadyDone) != 0) - return; - - g_fShutDownCOM = true; - - // Release IJupiterGCMgr * - RCWWalker::OnEEShutdown(); - - // Release all of the RCWs in all contexts in all caches. - ReleaseRCWsInCaches(NULL); - -#ifdef FEATURE_APPX - // Cleanup cached factory pointer in SynchronizationContextNative - SynchronizationContextNative::Cleanup(); -#endif -} - -#endif // FEATURE_COMINTEROP - // --------------------------------------------------------------------------- // %%Function: ForceEEShutdown() // diff --git a/src/coreclr/src/vm/ceemain.h b/src/coreclr/src/vm/ceemain.h index 064d1f80ca0fb1..1d81c1c0af818f 100644 --- a/src/coreclr/src/vm/ceemain.h +++ b/src/coreclr/src/vm/ceemain.h @@ -42,7 +42,6 @@ enum ShutdownCompleteAction // Force shutdown of the EE void ForceEEShutdown(ShutdownCompleteAction sca = SCA_ExitProcessWhenShutdownComplete); -void InnerCoEEShutDownCOM(); // We have an internal class that can be used to expose EE functionality to other CLR // DLLs, via the deliberately obscure IEE DLL exports from the shim and the EE diff --git a/src/coreclr/src/vm/codeman.cpp b/src/coreclr/src/vm/codeman.cpp index 9faaa002cfc79a..e7c08e0255adc5 100644 --- a/src/coreclr/src/vm/codeman.cpp +++ b/src/coreclr/src/vm/codeman.cpp @@ -2551,7 +2551,11 @@ CodeHeader* EEJitManager::allocCode(MethodDesc* pMD, size_t blockSize, size_t re unsigned alignment = CODE_SIZE_ALIGN; - if ((flag & CORJIT_ALLOCMEM_FLG_16BYTE_ALIGN) != 0) + if ((flag & CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN) != 0) + { + alignment = max(alignment, 32); + } + else if ((flag & CORJIT_ALLOCMEM_FLG_16BYTE_ALIGN) != 0) { alignment = max(alignment, 16); } @@ -6595,7 +6599,7 @@ unsigned ReadyToRunJitManager::InitializeEHEnumeration(const METHODTOKEN& Method ReadyToRunInfo * pReadyToRunInfo = JitTokenToReadyToRunInfo(MethodToken); - IMAGE_DATA_DIRECTORY * pExceptionInfoDir = pReadyToRunInfo->FindSection(READYTORUN_SECTION_EXCEPTION_INFO); + IMAGE_DATA_DIRECTORY * pExceptionInfoDir = pReadyToRunInfo->FindSection(ReadyToRunSectionType::ExceptionInfo); if (pExceptionInfoDir == NULL) return 0; @@ -6662,7 +6666,7 @@ StubCodeBlockKind ReadyToRunJitManager::GetStubCodeBlockKind(RangeSection * pRan ReadyToRunInfo * pReadyToRunInfo = dac_cast(pRangeSection->pHeapListOrZapModule)->GetReadyToRunInfo(); - IMAGE_DATA_DIRECTORY * pDelayLoadMethodCallThunksDir = pReadyToRunInfo->FindSection(READYTORUN_SECTION_DELAYLOAD_METHODCALL_THUNKS); + IMAGE_DATA_DIRECTORY * pDelayLoadMethodCallThunksDir = pReadyToRunInfo->FindSection(ReadyToRunSectionType::DelayLoadMethodCallThunks); if (pDelayLoadMethodCallThunksDir != NULL) { if (pDelayLoadMethodCallThunksDir->VirtualAddress <= rva diff --git a/src/coreclr/src/vm/common.h b/src/coreclr/src/vm/common.h index cbaa63ba2f68ad..2f26763f5310a8 100644 --- a/src/coreclr/src/vm/common.h +++ b/src/coreclr/src/vm/common.h @@ -242,11 +242,11 @@ FORCEINLINE void* memcpyUnsafe(void *dest, const void *src, size_t len) //If memcpy has been defined to PAL_memcpy, we undefine it so that this case //can be covered by the if !defined(memcpy) block below - #ifdef TARGET_UNIX + #ifdef HOST_UNIX #if IS_REDEFINED_IN_PAL(memcpy) #undef memcpy #endif //IS_REDEFINED_IN_PAL - #endif //TARGET_UNIX + #endif //HOST_UNIX // You should be using CopyValueClass if you are doing an memcpy // in the CG heap. @@ -254,11 +254,11 @@ FORCEINLINE void* memcpyUnsafe(void *dest, const void *src, size_t len) FORCEINLINE void* memcpyNoGCRefs(void * dest, const void * src, size_t len) { WRAPPER_NO_CONTRACT; - #ifndef TARGET_UNIX - return memcpy(dest, src, len); - #else //TARGET_UNIX + #ifdef HOST_UNIX return PAL_memcpy(dest, src, len); - #endif //TARGET_UNIX + #else //HOST_UNIX + return memcpy(dest, src, len); + #endif //HOST_UNIX } extern "C" void * __cdecl GCSafeMemCpy(void *, const void *, size_t); diff --git a/src/coreclr/src/vm/comutilnative.cpp b/src/coreclr/src/vm/comutilnative.cpp index 1b31fff6459179..7d0dea14da052c 100644 --- a/src/coreclr/src/vm/comutilnative.cpp +++ b/src/coreclr/src/vm/comutilnative.cpp @@ -1648,22 +1648,6 @@ FCIMPL3(INT32, COMInterlocked::CompareExchange, INT32* location, INT32 value, IN } FCIMPLEND -FCIMPL4(INT32, COMInterlocked::CompareExchangeReliableResult, INT32* location, INT32 value, INT32 comparand, CLR_BOOL* succeeded) -{ - FCALL_CONTRACT; - - if( NULL == location) { - FCThrow(kNullReferenceException); - } - - INT32 result = FastInterlockCompareExchange((LONG*)location, value, comparand); - if (result == comparand) - *succeeded = true; - - return result; -} -FCIMPLEND - FCIMPL3_IVV(INT64, COMInterlocked::CompareExchange64, INT64* location, INT64 value, INT64 comparand) { FCALL_CONTRACT; diff --git a/src/coreclr/src/vm/comutilnative.h b/src/coreclr/src/vm/comutilnative.h index 17442d91431c96..56030c4382a81b 100644 --- a/src/coreclr/src/vm/comutilnative.h +++ b/src/coreclr/src/vm/comutilnative.h @@ -172,7 +172,6 @@ class COMInterlocked static FCDECL2_IV(INT64, Exchange64, INT64 *location, INT64 value); static FCDECL2(LPVOID, ExchangePointer, LPVOID* location, LPVOID value); static FCDECL3(INT32, CompareExchange, INT32* location, INT32 value, INT32 comparand); - static FCDECL4(INT32, CompareExchangeReliableResult, INT32* location, INT32 value, INT32 comparand, CLR_BOOL* succeeded); static FCDECL3_IVV(INT64, CompareExchange64, INT64* location, INT64 value, INT64 comparand); static FCDECL3(LPVOID, CompareExchangePointer, LPVOID* location, LPVOID value, LPVOID comparand); static FCDECL2_IV(float, ExchangeFloat, float *location, float value); diff --git a/src/coreclr/src/vm/crossgen/CMakeLists.txt b/src/coreclr/src/vm/crossgen/CMakeLists.txt index dcf43e853eda1f..e89ae13f45ae14 100644 --- a/src/coreclr/src/vm/crossgen/CMakeLists.txt +++ b/src/coreclr/src/vm/crossgen/CMakeLists.txt @@ -2,6 +2,7 @@ set(VM_CROSSGEN_SOURCES ../appdomain.cpp ../array.cpp ../assembly.cpp + ../assemblyloadcontext.cpp ../assemblyspec.cpp ../baseassemblyspec.cpp ../binder.cpp @@ -91,6 +92,7 @@ set(VM_CROSSGEN_HEADERS ../appdomain.inl ../array.h ../assembly.hpp + ../assemblyloadcontext.h ../assemblyspec.hpp ../assemblyspecbase.h ../baseassemblyspec.h diff --git a/src/coreclr/src/vm/crst.cpp b/src/coreclr/src/vm/crst.cpp index 29a9b03cac67b3..67985f8cd4bfcc 100644 --- a/src/coreclr/src/vm/crst.cpp +++ b/src/coreclr/src/vm/crst.cpp @@ -22,6 +22,19 @@ #include #undef __IN_CRST_CPP +#if defined(DAC_COMPILE) && defined(TARGET_UNIX) && !defined(CROSS_COMPILE) + // Validate the DAC T_CRITICAL_SECTION matches the runtime CRITICAL section when we are not cross compiling. + // This is important when we are cross OS compiling the DAC + static_assert(PAL_CS_NATIVE_DATA_SIZE == DAC_CS_NATIVE_DATA_SIZE, T_CRITICAL_SECTION_VALIDATION_MESSAGE); + static_assert(sizeof(CRITICAL_SECTION) == sizeof(T_CRITICAL_SECTION), T_CRITICAL_SECTION_VALIDATION_MESSAGE); + + static_assert(offsetof(CRITICAL_SECTION, DebugInfo) == offsetof(T_CRITICAL_SECTION, DebugInfo), T_CRITICAL_SECTION_VALIDATION_MESSAGE); + static_assert(offsetof(CRITICAL_SECTION, LockCount) == offsetof(T_CRITICAL_SECTION, LockCount), T_CRITICAL_SECTION_VALIDATION_MESSAGE); + static_assert(offsetof(CRITICAL_SECTION, RecursionCount) == offsetof(T_CRITICAL_SECTION, RecursionCount), T_CRITICAL_SECTION_VALIDATION_MESSAGE); + static_assert(offsetof(CRITICAL_SECTION, OwningThread) == offsetof(T_CRITICAL_SECTION, OwningThread), T_CRITICAL_SECTION_VALIDATION_MESSAGE); + static_assert(offsetof(CRITICAL_SECTION, SpinCount) == offsetof(T_CRITICAL_SECTION, SpinCount), T_CRITICAL_SECTION_VALIDATION_MESSAGE); +#endif // defined(DAC_COMPILE) && defined(TARGET_UNIX) && !defined(CROSS_COMPILE) + #ifndef DACCESS_COMPILE Volatile g_ShutdownCrstUsageCount = 0; diff --git a/src/coreclr/src/vm/crst.h b/src/coreclr/src/vm/crst.h index 1457a7b4a21180..dd10beb4ed676f 100644 --- a/src/coreclr/src/vm/crst.h +++ b/src/coreclr/src/vm/crst.h @@ -296,9 +296,7 @@ friend class Crst; void DebugDestroy(); #endif - union { - CRITICAL_SECTION m_criticalsection; - }; + T_CRITICAL_SECTION m_criticalsection; typedef enum { diff --git a/src/coreclr/src/vm/diagnosticserver.cpp b/src/coreclr/src/vm/diagnosticserver.cpp index c1a8aa7acf6498..5a80396179ae00 100644 --- a/src/coreclr/src/vm/diagnosticserver.cpp +++ b/src/coreclr/src/vm/diagnosticserver.cpp @@ -135,24 +135,22 @@ bool DiagnosticServer::Initialize() szMessage); // data2 }; - // char transportPath[MAX_PATH]; - NewArrayHolder transportPath = nullptr; - CLRConfigStringHolder wTransportPath = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_DiagnosticsServerTransportPath); + NewArrayHolder address = nullptr; + CLRConfigStringHolder wAddress = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_DOTNET_DiagnosticsServerAddress); int nCharactersWritten = 0; - if (wTransportPath != nullptr) + if (wAddress != nullptr) { - nCharactersWritten = WideCharToMultiByte(CP_UTF8, 0, wTransportPath, -1, NULL, 0, NULL, NULL); + nCharactersWritten = WideCharToMultiByte(CP_UTF8, 0, wAddress, -1, NULL, 0, NULL, NULL); if (nCharactersWritten != 0) { - transportPath = new char[nCharactersWritten]; - nCharactersWritten = WideCharToMultiByte(CP_UTF8, 0, wTransportPath, -1, transportPath, nCharactersWritten, NULL, NULL); + address = new char[nCharactersWritten]; + nCharactersWritten = WideCharToMultiByte(CP_UTF8, 0, wAddress, -1, address, nCharactersWritten, NULL, NULL); assert(nCharactersWritten != 0); } } // TODO: Should we handle/assert that (s_pIpc == nullptr)? - s_pIpc = IpcStream::DiagnosticsIpc::Create( - transportPath, ErrorCallback); + s_pIpc = IpcStream::DiagnosticsIpc::Create(address, ErrorCallback); if (s_pIpc != nullptr) { diff --git a/src/coreclr/src/vm/diagnosticsprotocol.h b/src/coreclr/src/vm/diagnosticsprotocol.h index 823fc5e3394a84..bbc622a6411a3c 100644 --- a/src/coreclr/src/vm/diagnosticsprotocol.h +++ b/src/coreclr/src/vm/diagnosticsprotocol.h @@ -24,7 +24,7 @@ bool TryParse(uint8_t *&bufferCursor, uint32_t &bufferLen, T &result) if (bufferLen < sizeof(T)) return false; - result = *(reinterpret_cast(bufferCursor)); + memcpy(&result, bufferCursor, sizeof(T)); bufferCursor += sizeof(T); bufferLen -= sizeof(T); return true; diff --git a/src/coreclr/src/vm/dllimport.cpp b/src/coreclr/src/vm/dllimport.cpp index c17f4a0ca2d796..ed8fa724c33429 100644 --- a/src/coreclr/src/vm/dllimport.cpp +++ b/src/coreclr/src/vm/dllimport.cpp @@ -3983,10 +3983,10 @@ static void CreateNDirectStubWorker(StubState* pss, // For functions with value type class, managed and unmanaged calling convention differ fMarshalReturnValueFirst = HasRetBuffArgUnmanagedFixup(&msig); #elif defined(TARGET_ARM) - fMarshalReturnValueFirst = HasRetBuffArg(&msig); + fMarshalReturnValueFirst = (isInstanceMethod && isReturnTypeValueType) && HasRetBuffArg(&msig); #else // On Windows-X86, the native signature might need a return buffer when the managed doesn't (specifically when the native signature is a member function). - fMarshalReturnValueFirst = HasRetBuffArg(&msig) || (isInstanceMethod && isReturnTypeValueType); + fMarshalReturnValueFirst = (!SF_IsReverseStub(dwStubFlags) && HasRetBuffArg(&msig)) || (isInstanceMethod && isReturnTypeValueType); #endif // UNIX_X86_ABI #elif defined(TARGET_AMD64) || defined (TARGET_ARM64) fMarshalReturnValueFirst = isInstanceMethod && isReturnTypeValueType; @@ -4828,7 +4828,7 @@ void NDirect::PopulateNDirectMethodDesc(NDirectMethodDesc* pNMD, PInvokeStaticSi if (callConv == pmCallConvThiscall) ndirectflags |= NDirectMethodDesc::kThisCall; - if (pNMD->GetLoaderModule()->IsSystem() && strcmp(szLibName, "QCall") == 0) + if (pNMD->GetLoaderModule()->IsSystem() && (strcmp(szLibName, "QCall") == 0 || strcmp(szLibName, "System.Globalization.Native") == 0)) { ndirectflags |= NDirectMethodDesc::kIsQCall; } diff --git a/src/coreclr/src/vm/dynamicmethod.cpp b/src/coreclr/src/vm/dynamicmethod.cpp index da8cf538d8a39d..a9f3a876d2cd7b 100644 --- a/src/coreclr/src/vm/dynamicmethod.cpp +++ b/src/coreclr/src/vm/dynamicmethod.cpp @@ -1197,6 +1197,21 @@ LCGMethodResolver::IsValidStringRef(mdToken metaTok) return GetStringLiteral(metaTok) != NULL; } +int +LCGMethodResolver::GetStringLiteralLength(mdToken metaTok) +{ + STANDARD_VM_CONTRACT; + + GCX_COOP(); + + STRINGREF str = GetStringLiteral(metaTok); + if (str != NULL) + { + return str->GetStringLength(); + } + return -1; +} + //--------------------------------------------------------------------------------------- // STRINGREF diff --git a/src/coreclr/src/vm/dynamicmethod.h b/src/coreclr/src/vm/dynamicmethod.h index c119877d55a8b1..9e4322de213cfe 100644 --- a/src/coreclr/src/vm/dynamicmethod.h +++ b/src/coreclr/src/vm/dynamicmethod.h @@ -73,6 +73,7 @@ class DynamicResolver // jit interface api virtual OBJECTHANDLE ConstructStringLiteral(mdToken metaTok) = 0; virtual BOOL IsValidStringRef(mdToken metaTok) = 0; + virtual int GetStringLiteralLength(mdToken metaTok) = 0; virtual void ResolveToken(mdToken token, TypeHandle * pTH, MethodDesc ** ppMD, FieldDesc ** ppFD) = 0; virtual SigPointer ResolveSignature(mdToken token) = 0; virtual SigPointer ResolveSignatureForVarArg(mdToken token) = 0; @@ -122,6 +123,7 @@ class LCGMethodResolver : public DynamicResolver OBJECTHANDLE ConstructStringLiteral(mdToken metaTok); BOOL IsValidStringRef(mdToken metaTok); + int GetStringLiteralLength(mdToken metaTok); void ResolveToken(mdToken token, TypeHandle * pTH, MethodDesc ** ppMD, FieldDesc ** ppFD); SigPointer ResolveSignature(mdToken token); SigPointer ResolveSignatureForVarArg(mdToken token); diff --git a/src/coreclr/src/vm/ecall.cpp b/src/coreclr/src/vm/ecall.cpp index 4d0ad323f23070..692b058e4d378d 100644 --- a/src/coreclr/src/vm/ecall.cpp +++ b/src/coreclr/src/vm/ecall.cpp @@ -191,6 +191,10 @@ void ECall::PopulateManagedCastHelpers() pDest = pMD->GetMultiCallableAddrOfCode(); SetJitHelperFunction(CORINFO_HELP_CHKCASTCLASS_SPECIAL, pDest); + pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__UNBOX)); + pDest = pMD->GetMultiCallableAddrOfCode(); + SetJitHelperFunction(CORINFO_HELP_UNBOX, pDest); + #endif //CROSSGEN_COMPILE } diff --git a/src/coreclr/src/vm/ecalllist.h b/src/coreclr/src/vm/ecalllist.h index 4f1b50c12058a1..7fa9dc48c3f5ab 100644 --- a/src/coreclr/src/vm/ecalllist.h +++ b/src/coreclr/src/vm/ecalllist.h @@ -717,6 +717,7 @@ FCFuncEnd() FCFuncStart(gCastHelpers) FCFuncElement("IsInstanceOfAny_NoCacheLookup", ::IsInstanceOfAny_NoCacheLookup) FCFuncElement("ChkCastAny_NoCacheLookup", ::ChkCastAny_NoCacheLookup) + FCFuncElement("Unbox_Helper", ::Unbox_Helper) FCFuncEnd() FCFuncStart(gArrayFuncs) @@ -869,7 +870,6 @@ FCFuncStart(gInterlockedFuncs) FCFuncElementSig("CompareExchange", &gsig_SM_RefDbl_Dbl_Dbl_RetDbl, COMInterlocked::CompareExchangeDouble) FCFuncElementSig("CompareExchange", &gsig_SM_RefFlt_Flt_Flt_RetFlt, COMInterlocked::CompareExchangeFloat) FCFuncElementSig("CompareExchange", &gsig_SM_RefObj_Obj_Obj_RetObj, COMInterlocked::CompareExchangeObject) - FCFuncElementSig("CompareExchange", &gsig_SM_RefInt_Int_Int_RefBool_RetInt, COMInterlocked::CompareExchangeReliableResult) FCFuncElementSig("CompareExchange", &gsig_SM_RefIntPtr_IntPtr_IntPtr_RetIntPtr, COMInterlocked::CompareExchangePointer) FCIntrinsicSig("ExchangeAdd", &gsig_SM_RefInt_Int_RetInt, COMInterlocked::ExchangeAdd32, CORINFO_INTRINSIC_InterlockedXAdd32) FCIntrinsicSig("ExchangeAdd", &gsig_SM_RefLong_Long_RetLong, COMInterlocked::ExchangeAdd64, CORINFO_INTRINSIC_InterlockedXAdd64) @@ -1226,6 +1226,11 @@ FCClassElement("FileLoadException", "System.IO", gFileLoadExceptionFuncs) FCClassElement("GC", "System", gGCInterfaceFuncs) FCClassElement("GCHandle", "System.Runtime.InteropServices", gGCHandleFuncs) FCClassElement("GCSettings", "System.Runtime", gGCSettingsFuncs) +#ifdef TARGET_UNIX +#ifndef CROSSGEN_COMPILE +FCClassElement("Globalization", "", gPalGlobalizationNative) +#endif +#endif #ifdef FEATURE_COMINTEROP FCClassElement("IEnumerable", "System.Collections", gStdMngIEnumerableFuncs) FCClassElement("IEnumerator", "System.Collections", gStdMngIEnumeratorFuncs) diff --git a/src/coreclr/src/vm/eedbginterface.h b/src/coreclr/src/vm/eedbginterface.h index f00c4509ec829b..2d54b5445d1780 100644 --- a/src/coreclr/src/vm/eedbginterface.h +++ b/src/coreclr/src/vm/eedbginterface.h @@ -375,7 +375,7 @@ class EEDebugInterface #endif #ifndef DACCESS_COMPILE - virtual BOOL AdjustContextForWriteBarrierForDebugger(CONTEXT* context) = 0; + virtual BOOL AdjustContextForJITHelpersForDebugger(CONTEXT* context) = 0; #endif }; diff --git a/src/coreclr/src/vm/eedbginterfaceimpl.cpp b/src/coreclr/src/vm/eedbginterfaceimpl.cpp index 2c5580a0d36823..dc5a85c8df2f64 100644 --- a/src/coreclr/src/vm/eedbginterfaceimpl.cpp +++ b/src/coreclr/src/vm/eedbginterfaceimpl.cpp @@ -1584,11 +1584,11 @@ void EEDbgInterfaceImpl::ObjectRefFlush(Thread *pThread) #ifndef DACCESS_COMPILE -BOOL AdjustContextForWriteBarrier(EXCEPTION_RECORD *pExceptionRecord, CONTEXT *pContext); -BOOL EEDbgInterfaceImpl::AdjustContextForWriteBarrierForDebugger(CONTEXT* context) +BOOL AdjustContextForJITHelpers(EXCEPTION_RECORD *pExceptionRecord, CONTEXT *pContext); +BOOL EEDbgInterfaceImpl::AdjustContextForJITHelpersForDebugger(CONTEXT* context) { WRAPPER_NO_CONTRACT; - return AdjustContextForWriteBarrier(nullptr, context); + return AdjustContextForJITHelpers(nullptr, context); } #endif diff --git a/src/coreclr/src/vm/eedbginterfaceimpl.h b/src/coreclr/src/vm/eedbginterfaceimpl.h index 0d77f0b8fb5001..036aeb9ff493a9 100644 --- a/src/coreclr/src/vm/eedbginterfaceimpl.h +++ b/src/coreclr/src/vm/eedbginterfaceimpl.h @@ -345,7 +345,7 @@ class EEDbgInterfaceImpl : public EEDebugInterface #endif #ifndef DACCESS_COMPILE - virtual BOOL AdjustContextForWriteBarrierForDebugger(CONTEXT* context); + virtual BOOL AdjustContextForJITHelpersForDebugger(CONTEXT* context); #endif }; diff --git a/src/coreclr/src/vm/eepolicy.cpp b/src/coreclr/src/vm/eepolicy.cpp index e1de20a54b25c3..075737e0f8a34f 100644 --- a/src/coreclr/src/vm/eepolicy.cpp +++ b/src/coreclr/src/vm/eepolicy.cpp @@ -700,7 +700,7 @@ void EEPolicy::HandleStackOverflow(StackOverflowDetector detector, void * pLimit } EXCEPTION_POINTERS exceptionInfo; - GetCurrentExceptionPointers(&exceptionInfo); + GetCurrentExceptionPointers(&exceptionInfo DEBUG_ARG(!pThread->IsExecutingOnAltStack())); _ASSERTE(exceptionInfo.ExceptionRecord); @@ -739,33 +739,119 @@ void EEPolicy::HandleExitProcess(ShutdownCompleteAction sca) HandleExitProcessHelper(action, 0, sca); } -StackWalkAction LogCallstackForLogCallback( - CrawlFrame *pCF, // - VOID* pData // Caller's private data -) + +//--------------------------------------------------------------------------------------- +// This class is responsible for displaying a stack trace. It uses a condensed way for +// stack overflow stack traces where there are possibly many repeated frames. +// It displays a count and a repeated sequence of frames at the top of the stack in +// such a case, instead of displaying possibly thousands of lines with the same +// method. +//--------------------------------------------------------------------------------------- +class CallStackLogger { - CONTRACTL + // MethodDescs of the stack frames, the TOS is at index 0 + CDynArray m_frames; + + // Index of a stack frame where a possible repetition of frames starts + int m_commonStartIndex = -1; + // Length of the largest found repeated sequence of frames + int m_largestCommonStartLength = 0; + // Number of repetitions of the largest repeated sequence of frames + int m_largestCommonStartRepeat = 0; + + StackWalkAction LogCallstackForLogCallbackWorker(CrawlFrame *pCF) { - THROWS; - GC_TRIGGERS; - MODE_ANY; + WRAPPER_NO_CONTRACT; + + MethodDesc *pMD = pCF->GetFunction(); + + if (m_commonStartIndex != -1) + { + // Some common frames were already found + + if (m_frames[m_frames.Count() - m_commonStartIndex] != pMD) + { + // The frame being added is not part of the repeated sequence + if (m_frames.Count() / m_commonStartIndex >= 2) + { + // A sequence repeated at least twice was found. It is the largest one that was found so far + m_largestCommonStartLength = m_commonStartIndex; + m_largestCommonStartRepeat = m_frames.Count() / m_commonStartIndex; + } + + m_commonStartIndex = -1; + } + } + + if (m_commonStartIndex == -1) + { + if ((m_frames.Count() != 0) && (pMD == m_frames[0])) + { + // We have found a frame with the same MethodDesc as the frame at the top of the stack, + // possibly a new repeated sequence is starting. + m_commonStartIndex = m_frames.Count(); + } + } + + MethodDesc** itemPtr = m_frames.Append(); + if (itemPtr == nullptr) + { + // Memory allocation failure + return SWA_ABORT; + } + + *itemPtr = pMD; + + return SWA_CONTINUE; } - CONTRACTL_END; - SmallStackSString *pWordAt = ((SmallStackSString*)pData); + void PrintFrame(int index, const WCHAR* pWordAt) + { + WRAPPER_NO_CONTRACT; + + SString str(pWordAt); - MethodDesc *pMD = pCF->GetFunction(); - _ASSERTE(pMD != NULL); + MethodDesc* pMD = m_frames[index]; + TypeString::AppendMethodInternal(str, pMD, TypeString::FormatNamespace|TypeString::FormatFullInst|TypeString::FormatSignature); + PrintToStdErrW(str.GetUnicode()); + PrintToStdErrA("\n"); + } - StackSString str; - str = *pWordAt; +public: - TypeString::AppendMethodInternal(str, pMD, TypeString::FormatNamespace|TypeString::FormatFullInst|TypeString::FormatSignature); - PrintToStdErrW(str.GetUnicode()); - PrintToStdErrA("\n"); + // Callback called by the stack walker for each frame on the stack + static StackWalkAction LogCallstackForLogCallback(CrawlFrame *pCF, VOID* pData) + { + WRAPPER_NO_CONTRACT; - return SWA_CONTINUE; -} + CallStackLogger* logger = (CallStackLogger*)pData; + return logger->LogCallstackForLogCallbackWorker(pCF); + } + + void PrintStackTrace(const WCHAR* pWordAt) + { + WRAPPER_NO_CONTRACT; + + if (m_largestCommonStartLength != 0) + { + SmallStackSString repeatStr; + repeatStr.AppendPrintf("Repeat %d times:\n", m_largestCommonStartRepeat); + + PrintToStdErrW(repeatStr.GetUnicode()); + PrintToStdErrA("--------------------------------\n"); + for (int i = 0; i < m_largestCommonStartLength; i++) + { + PrintFrame(i, pWordAt); + } + PrintToStdErrA("--------------------------------\n"); + } + + for (int i = m_largestCommonStartLength * m_largestCommonStartRepeat; i < m_frames.Count(); i++) + { + PrintFrame(i, pWordAt); + } + } +}; //--------------------------------------------------------------------------------------- // @@ -777,14 +863,16 @@ StackWalkAction LogCallstackForLogCallback( // Return Value: // None // -inline void LogCallstackForLogWorker() +inline void LogCallstackForLogWorker(bool isStackOverflow = false) { + WRAPPER_NO_CONTRACT; + Thread* pThread = GetThread(); _ASSERTE (pThread); SmallStackSString WordAt; - if (!WordAt.LoadResource(CCompRC::Optional, IDS_ER_WORDAT)) + if (isStackOverflow || !WordAt.LoadResource(CCompRC::Optional, IDS_ER_WORDAT)) { WordAt.Set(W(" at")); } @@ -794,7 +882,12 @@ inline void LogCallstackForLogWorker() } WordAt += W(" "); - pThread->StackWalkFrames(&LogCallstackForLogCallback, &WordAt, QUICKUNWIND | FUNCTIONSONLY); + CallStackLogger logger; + + pThread->StackWalkFrames(&CallStackLogger::LogCallstackForLogCallback, &logger, QUICKUNWIND | FUNCTIONSONLY); + + logger.PrintStackTrace(WordAt.GetUnicode()); + } //--------------------------------------------------------------------------------------- @@ -1056,7 +1149,35 @@ void DECLSPEC_NORETURN EEPolicy::HandleFatalStackOverflow(EXCEPTION_POINTERS *pE STRESS_LOG0(LF_EH, LL_INFO100, "In EEPolicy::HandleFatalStackOverflow\n"); - DisplayStackOverflowException(); + FrameWithCookie fef; +#if defined(FEATURE_EH_FUNCLETS) + *((&fef)->GetGSCookiePtr()) = GetProcessGSCookie(); +#endif // FEATURE_EH_FUNCLETS + if (pExceptionInfo && pExceptionInfo->ContextRecord) + { + GCX_COOP(); + AdjustContextForJITHelpers(pExceptionInfo->ExceptionRecord, pExceptionInfo->ContextRecord); + fef.InitAndLink(pExceptionInfo->ContextRecord); + } + + static volatile LONG g_stackOverflowCallStackLogged = 0; + + // Dump stack trace only for the first thread failing with stack overflow to prevent mixing + // multiple stack traces together. + if (InterlockedCompareExchange(&g_stackOverflowCallStackLogged, 1, 0) == 0) + { + DisplayStackOverflowException(); + LogCallstackForLogWorker(true /* isStackOverflow */); + g_stackOverflowCallStackLogged = 2; + } + else + { + // Wait for the thread that is logging the stack trace to complete + while (g_stackOverflowCallStackLogged != 2) + { + Sleep(50); + } + } if(ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, FailFast)) { @@ -1097,15 +1218,6 @@ void DECLSPEC_NORETURN EEPolicy::HandleFatalStackOverflow(EXCEPTION_POINTERS *pE fTreatAsNativeUnhandledException = TRUE; } } - FrameWithCookie fef; -#if defined(FEATURE_EH_FUNCLETS) - *((&fef)->GetGSCookiePtr()) = GetProcessGSCookie(); -#endif // FEATURE_EH_FUNCLETS - if (pExceptionInfo && pExceptionInfo->ContextRecord) - { - GCX_COOP(); - fef.InitAndLink(pExceptionInfo->ContextRecord); - } #ifndef TARGET_UNIX if (IsWatsonEnabled() && (g_pDebugInterface != NULL)) diff --git a/src/coreclr/src/vm/eventing/CMakeLists.txt b/src/coreclr/src/vm/eventing/CMakeLists.txt index 92d9bd1f607736..98dd158df54577 100644 --- a/src/coreclr/src/vm/eventing/CMakeLists.txt +++ b/src/coreclr/src/vm/eventing/CMakeLists.txt @@ -1,7 +1,7 @@ set(EVENT_MANIFEST ${VM_DIR}/ClrEtwAll.man) set(EVENT_EXCLUSIONS ${VM_DIR}/ClrEtwAllMeta.lst) -if (CLR_CMAKE_TARGET_WIN32) +if (CLR_CMAKE_HOST_WIN32) set(NONEXTERN_ARG "--nonextern") set(NOXPLATHEADER_ARG "--noxplatheader") else() @@ -35,6 +35,6 @@ add_dependencies(eventing_headers eventprovider) add_subdirectory(eventpipe) -if(CLR_CMAKE_TARGET_WIN32) +if(CLR_CMAKE_HOST_WIN32) add_subdirectory(EtwProvider) endif() diff --git a/src/coreclr/src/vm/excep.cpp b/src/coreclr/src/vm/excep.cpp index 3394a3fc01c4f2..35a39f359cecc8 100644 --- a/src/coreclr/src/vm/excep.cpp +++ b/src/coreclr/src/vm/excep.cpp @@ -6638,6 +6638,10 @@ IsDebuggerFault(EXCEPTION_RECORD *pExceptionRecord, #endif // TARGET_UNIX +#ifndef TARGET_ARM64 +EXTERN_C void JIT_StackProbe_End(); +#endif // TARGET_ARM64 + #ifdef FEATURE_EH_FUNCLETS #ifndef TARGET_X86 @@ -6703,6 +6707,9 @@ bool IsIPInMarkedJitHelper(UINT_PTR uControlPc) CHECK_RANGE(JIT_WriteBarrier) CHECK_RANGE(JIT_CheckedWriteBarrier) CHECK_RANGE(JIT_ByRefWriteBarrier) +#if !defined(TARGET_ARM64) + CHECK_RANGE(JIT_StackProbe) +#endif // !TARGET_ARM64 #else #ifdef TARGET_UNIX CHECK_RANGE(JIT_WriteBarrierGroup) @@ -6720,7 +6727,7 @@ bool IsIPInMarkedJitHelper(UINT_PTR uControlPc) // Returns TRUE if caller should resume execution. BOOL -AdjustContextForWriteBarrier( +AdjustContextForJITHelpers( EXCEPTION_RECORD *pExceptionRecord, CONTEXT *pContext) { @@ -6739,7 +6746,7 @@ AdjustContextForWriteBarrier( #ifdef FEATURE_DATABREAKPOINT - // If pExceptionRecord is null, it means it is called from EEDbgInterfaceImpl::AdjustContextForWriteBarrierForDebugger() + // If pExceptionRecord is null, it means it is called from EEDbgInterfaceImpl::AdjustContextForJITHelpersForDebugger() // This is called only when a data breakpoint is hitm which could be inside a JIT write barrier helper and required // this logic to help unwind out of it. For the x86, not patched case, we assume the IP lies within the region where we // have already saved the registers on the stack, and therefore the code unwind those registers as well. This is not true @@ -6792,6 +6799,19 @@ AdjustContextForWriteBarrier( // put ESP back to what it was before the call. SetSP(pContext, PCODE((BYTE*)GetSP(pContext) + sizeof(void*))); } + + if ((f_IP >= (void *) JIT_StackProbe) && (f_IP <= (void *) JIT_StackProbe_End)) + { + TADDR ebp = GetFP(pContext); + void* callsite = (void *)*dac_cast(ebp + 4); + pExceptionRecord->ExceptionAddress = callsite; + SetIP(pContext, (PCODE)callsite); + + // Restore EBP / ESP back to what it was before the call. + SetFP(pContext, *dac_cast(ebp)); + SetSP(pContext, ebp + 8); + } + return FALSE; #elif defined(FEATURE_EH_FUNCLETS) // TARGET_X86 && !TARGET_UNIX void* f_IP = dac_cast(GetIP(pContext)); @@ -6860,7 +6880,7 @@ AdjustContextForWriteBarrier( return FALSE; #else // FEATURE_EH_FUNCLETS - PORTABILITY_ASSERT("AdjustContextForWriteBarrier"); + PORTABILITY_ASSERT("AdjustContextForJITHelpers"); return FALSE; #endif // ELSE } @@ -7467,9 +7487,9 @@ VEH_ACTION WINAPI CLRVectoredExceptionHandlerPhase3(PEXCEPTION_POINTERS pExcepti { if (IsWellFormedAV(pExceptionRecord)) { - if (AdjustContextForWriteBarrier(pExceptionRecord, pContext)) + if (AdjustContextForJITHelpers(pExceptionRecord, pContext)) { - // On x86, AdjustContextForWriteBarrier simply backs up AV's + // On x86, AdjustContextForJITHelpers simply backs up AV's // in write barrier helpers into the calling frame, so that // the subsequent logic here sees a managed fault. // diff --git a/src/coreclr/src/vm/excep.h b/src/coreclr/src/vm/excep.h index 7f9aba1b30995a..b6fb51242dc1f2 100644 --- a/src/coreclr/src/vm/excep.h +++ b/src/coreclr/src/vm/excep.h @@ -32,6 +32,8 @@ BOOL IsIPinVirtualStub(PCODE f_IP); #endif // VSD_STUB_CAN_THROW_AV bool IsIPInMarkedJitHelper(UINT_PTR uControlPc); +BOOL AdjustContextForJITHelpers(EXCEPTION_RECORD *pExceptionRecord, CONTEXT *pContext); + #if defined(FEATURE_HIJACK) && (!defined(TARGET_X86) || defined(TARGET_UNIX)) // General purpose functions for use on an IP in jitted code. diff --git a/src/coreclr/src/vm/exceptionhandling.cpp b/src/coreclr/src/vm/exceptionhandling.cpp index 827637b53a30aa..e473814af65c12 100644 --- a/src/coreclr/src/vm/exceptionhandling.cpp +++ b/src/coreclr/src/vm/exceptionhandling.cpp @@ -5217,6 +5217,13 @@ BOOL HandleHardwareException(PAL_SEHException* ex) { _ASSERTE(IsSafeToHandleHardwareException(ex->GetContextRecord(), ex->GetExceptionRecord())); + if (ex->GetExceptionRecord()->ExceptionCode == EXCEPTION_STACK_OVERFLOW) + { + GetThread()->SetExecutingOnAltStack(); + EEPolicy::HandleFatalStackOverflow(&ex->ExceptionPointers, FALSE); + UNREACHABLE(); + } + if (ex->GetExceptionRecord()->ExceptionCode != STATUS_BREAKPOINT && ex->GetExceptionRecord()->ExceptionCode != STATUS_SINGLE_STEP) { // A hardware exception is handled only if it happened in a jitted code or diff --git a/src/coreclr/src/vm/frames.cpp b/src/coreclr/src/vm/frames.cpp index fafc7d3d681172..9210323fcc5ea1 100644 --- a/src/coreclr/src/vm/frames.cpp +++ b/src/coreclr/src/vm/frames.cpp @@ -402,7 +402,8 @@ VOID Frame::Push(Thread *pThread) // in which the C compiler will lay them out in the stack frame. // So GetOsPageSize() is a guess of the maximum stack frame size of any method // with multiple Frames in mscorwks.dll - _ASSERTE(((m_Next == FRAME_TOP) || + _ASSERTE(pThread->IsExecutingOnAltStack() || + ((m_Next == FRAME_TOP) || (PBYTE(m_Next) + (2 * GetOsPageSize())) > PBYTE(this)) && "Pushing a frame out of order ?"); diff --git a/src/coreclr/src/vm/h2inc.ps1 b/src/coreclr/src/vm/h2inc.ps1 index 4316d98fe11915..b6bf298049237f 100644 --- a/src/coreclr/src/vm/h2inc.ps1 +++ b/src/coreclr/src/vm/h2inc.ps1 @@ -1,4 +1,4 @@ -# Licensed to the .NET Foundation under one or more agreements. +# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. diff --git a/src/coreclr/src/vm/i386/jithelp.S b/src/coreclr/src/vm/i386/jithelp.S index 49a5aa16307ed6..86a25f98d50638 100644 --- a/src/coreclr/src/vm/i386/jithelp.S +++ b/src/coreclr/src/vm/i386/jithelp.S @@ -27,8 +27,8 @@ // // ******************************************************************************* -// The code here is tightly coupled with AdjustContextForWriteBarrier, if you change -// anything here, you might need to change AdjustContextForWriteBarrier as well +// The code here is tightly coupled with AdjustContextForJITHelpers, if you change +// anything here, you might need to change AdjustContextForJITHelpers as well .macro WriteBarrierHelper rg .align 4 @@ -80,7 +80,7 @@ PATCH_LABEL JIT_DebugWriteBarrier\rg #ifdef WRITE_BARRIER_CHECK // Test dest here so if it is bad AV would happen before we change register/stack - // status. This makes job of AdjustContextForWriteBarrier easier. + // status. This makes job of AdjustContextForJITHelpers easier. cmp BYTE PTR [edx], 0 // ALSO update the shadow GC heap if that is enabled // Make ebp into the temporary src register. We need to do this so that we can use ecx @@ -226,8 +226,8 @@ NESTED_END JIT_CheckedWriteBarrier\rg, _TEXT // // ******************************************************************************* // -// The code here is tightly coupled with AdjustContextForWriteBarrier, if you change -// anything here, you might need to change AdjustContextForWriteBarrier as well +// The code here is tightly coupled with AdjustContextForJITHelpers, if you change +// anything here, you might need to change AdjustContextForJITHelpers as well // .macro ByRefWriteBarrierHelper .align 4 @@ -253,7 +253,7 @@ LEAF_ENTRY JIT_ByRefWriteBarrier, _TEXT #ifdef WRITE_BARRIER_CHECK // Test dest here so if it is bad AV would happen before we change register/stack - // status. This makes job of AdjustContextForWriteBarrier easier. + // status. This makes job of AdjustContextForJITHelpers easier. cmp BYTE PTR [edi], 0 // ALSO update the shadow GC heap if that is enabled diff --git a/src/coreclr/src/vm/i386/jithelp.asm b/src/coreclr/src/vm/i386/jithelp.asm index 14c39755238304..3eec4408cfab43 100644 --- a/src/coreclr/src/vm/i386/jithelp.asm +++ b/src/coreclr/src/vm/i386/jithelp.asm @@ -124,8 +124,8 @@ ENDM ; ;******************************************************************************* -; The code here is tightly coupled with AdjustContextForWriteBarrier, if you change -; anything here, you might need to change AdjustContextForWriteBarrier as well +; The code here is tightly coupled with AdjustContextForJITHelpers, if you change +; anything here, you might need to change AdjustContextForJITHelpers as well ; Note that beside the AV case, we might be unwinding inside the region where we have ; already push ecx and ebp in the branch under FEATURE_DATABREAKPOINT WriteBarrierHelper MACRO rg @@ -176,7 +176,7 @@ endif ifdef WRITE_BARRIER_CHECK ; Test dest here so if it is bad AV would happen before we change register/stack - ; status. This makes job of AdjustContextForWriteBarrier easier. + ; status. This makes job of AdjustContextForJITHelpers easier. cmp [edx], 0 ;; ALSO update the shadow GC heap if that is enabled ; Make ebp into the temporary src register. We need to do this so that we can use ecx @@ -293,8 +293,8 @@ ENDM ; ;******************************************************************************* -; The code here is tightly coupled with AdjustContextForWriteBarrier, if you change -; anything here, you might need to change AdjustContextForWriteBarrier as well +; The code here is tightly coupled with AdjustContextForJITHelpers, if you change +; anything here, you might need to change AdjustContextForJITHelpers as well ByRefWriteBarrierHelper MACRO ALIGN 4 @@ -314,7 +314,7 @@ endif ifdef WRITE_BARRIER_CHECK ; Test dest here so if it is bad AV would happen before we change register/stack - ; status. This makes job of AdjustContextForWriteBarrier easier. + ; status. This makes job of AdjustContextForJITHelpers easier. cmp [edi], 0 ;; ALSO update the shadow GC heap if that is enabled @@ -1337,8 +1337,8 @@ _JIT_StackProbe@0 PROC public and esp, -PAGE_SIZE ; esp points to the **lowest address** on the last probed page ; This is done to make the loop end condition simpler. ProbeLoop: + test [esp - 4], eax ; esp points to the lowest address on the **last probed** page sub esp, PAGE_SIZE ; esp points to the lowest address of the **next page** to probe - test [esp], eax ; esp points to the lowest address on the **last probed** page cmp esp, eax jg ProbeLoop ; if esp > eax, then we need to probe at least one more page. @@ -1348,4 +1348,9 @@ ProbeLoop: _JIT_StackProbe@0 ENDP +PUBLIC _JIT_StackProbe_End@0 +_JIT_StackProbe_End@0 PROC + ret +_JIT_StackProbe_End@0 ENDP + end diff --git a/src/coreclr/src/vm/ilstubresolver.cpp b/src/coreclr/src/vm/ilstubresolver.cpp index 665d39dd20de1c..94be0cf9ca2bee 100644 --- a/src/coreclr/src/vm/ilstubresolver.cpp +++ b/src/coreclr/src/vm/ilstubresolver.cpp @@ -140,6 +140,13 @@ BOOL ILStubResolver::IsValidStringRef(mdToken metaTok) return FALSE; } +int ILStubResolver::GetStringLiteralLength(mdToken metaTok) +{ + STANDARD_VM_CONTRACT; + _ASSERTE(FALSE); + return -1; +} + void ILStubResolver::ResolveToken(mdToken token, TypeHandle * pTH, MethodDesc ** ppMD, FieldDesc ** ppFD) { STANDARD_VM_CONTRACT; diff --git a/src/coreclr/src/vm/ilstubresolver.h b/src/coreclr/src/vm/ilstubresolver.h index c3be136aaa9dca..8b42a0cd3b3132 100644 --- a/src/coreclr/src/vm/ilstubresolver.h +++ b/src/coreclr/src/vm/ilstubresolver.h @@ -33,6 +33,7 @@ class ILStubResolver : DynamicResolver OBJECTHANDLE ConstructStringLiteral(mdToken metaTok); BOOL IsValidStringRef(mdToken metaTok); + int GetStringLiteralLength(mdToken metaTok); void ResolveToken(mdToken token, TypeHandle * pTH, MethodDesc ** ppMD, FieldDesc ** ppFD); SigPointer ResolveSignature(mdToken token); SigPointer ResolveSignatureForVarArg(mdToken token); diff --git a/src/coreclr/src/vm/interpreter.cpp b/src/coreclr/src/vm/interpreter.cpp index 662e57354f97ca..7386ee7ec98d09 100644 --- a/src/coreclr/src/vm/interpreter.cpp +++ b/src/coreclr/src/vm/interpreter.cpp @@ -8534,7 +8534,7 @@ void Interpreter::Unbox() CorElementType type1 = pMT1->GetInternalCorElementType(); CorElementType type2 = pMT2->GetInternalCorElementType(); - // we allow enums and their primtive type to be interchangable + // we allow enums and their primitive type to be interchangable if (type1 == type2) { if ((pMT1->IsEnum() || pMT1->IsTruePrimitive()) && @@ -8695,17 +8695,11 @@ void Interpreter::UnboxAny() } else { - CorElementType type1 = pMT1->GetInternalCorElementType(); - CorElementType type2 = pMT2->GetInternalCorElementType(); - - // we allow enums and their primtive type to be interchangable - if (type1 == type2) - { - if ((pMT1->IsEnum() || pMT1->IsTruePrimitive()) && + if (pMT1->GetInternalCorElementType() == pMT2->GetInternalCorElementType() && + (pMT1->IsEnum() || pMT1->IsTruePrimitive()) && (pMT2->IsEnum() || pMT2->IsTruePrimitive())) - { - res = OpStackGet(tos)->UnBox(); - } + { + res = OpStackGet(tos)->UnBox(); } } diff --git a/src/coreclr/src/vm/jithelpers.cpp b/src/coreclr/src/vm/jithelpers.cpp index 07be69a245fd66..57c314fe0feeb8 100644 --- a/src/coreclr/src/vm/jithelpers.cpp +++ b/src/coreclr/src/vm/jithelpers.cpp @@ -2972,6 +2972,7 @@ NOINLINE HCIMPL3(VOID, JIT_Unbox_Nullable_Framed, void * destPtr, MethodTable* t { COMPlusThrowInvalidCastException(&objRef, TypeHandle(typeMT)); } + HELPER_METHOD_POLL(); HELPER_METHOD_FRAME_END(); } HCIMPLEND @@ -2991,6 +2992,7 @@ HCIMPL3(VOID, JIT_Unbox_Nullable, void * destPtr, CORINFO_CLASS_HANDLE type, Obj if (Nullable::UnBoxNoGC(destPtr, objRef, typeMT)) { // exact match (type equivalence not needed) + FC_GC_POLL(); return; } @@ -3001,23 +3003,33 @@ HCIMPL3(VOID, JIT_Unbox_Nullable, void * destPtr, CORINFO_CLASS_HANDLE type, Obj HCIMPLEND /*************************************************************/ -/* framed helper that handles full-blown type equivalence */ -NOINLINE HCIMPL2(LPVOID, JIT_Unbox_Helper_Framed, CORINFO_CLASS_HANDLE type, Object* obj) +/* framed Unbox helper that handles enums and full-blown type equivalence */ +NOINLINE HCIMPL2(LPVOID, Unbox_Helper_Framed, MethodTable* pMT1, Object* obj) { FCALL_CONTRACT; LPVOID result = NULL; + MethodTable* pMT2 = obj->GetMethodTable(); OBJECTREF objRef = ObjectToOBJECTREF(obj); HELPER_METHOD_FRAME_BEGIN_RET_1(objRef); - if (TypeHandle(type).IsEquivalentTo(objRef->GetTypeHandle())) + HELPER_METHOD_POLL(); + + if (pMT1->GetInternalCorElementType() == pMT2->GetInternalCorElementType() && + (pMT1->IsEnum() || pMT1->IsTruePrimitive()) && + (pMT2->IsEnum() || pMT2->IsTruePrimitive())) + { + // we allow enums and their primitive type to be interchangable + result = objRef->GetData(); + } + else if (pMT1->IsEquivalentTo(pMT2)) { // the structures are equivalent result = objRef->GetData(); } else { - COMPlusThrowInvalidCastException(&objRef, TypeHandle(type)); + COMPlusThrowInvalidCastException(&objRef, TypeHandle(pMT1)); } HELPER_METHOD_FRAME_END(); @@ -3026,59 +3038,34 @@ NOINLINE HCIMPL2(LPVOID, JIT_Unbox_Helper_Framed, CORINFO_CLASS_HANDLE type, Obj HCIMPLEND /*************************************************************/ -/* the uncommon case for the helper below (allowing enums to be unboxed - as their underlying type */ -LPVOID __fastcall JIT_Unbox_Helper(CORINFO_CLASS_HANDLE type, Object* obj) +/* Unbox helper that handles enums */ +HCIMPL2(LPVOID, Unbox_Helper, CORINFO_CLASS_HANDLE type, Object* obj) { FCALL_CONTRACT; TypeHandle typeHnd(type); + // boxable types have method tables + _ASSERTE(!typeHnd.IsTypeDesc()); - CorElementType type1 = typeHnd.GetInternalCorElementType(); - - // we allow enums and their primtive type to be interchangable + MethodTable* pMT1 = typeHnd.AsMethodTable(); + // must be a value type + _ASSERTE(pMT1->IsValueType()); MethodTable* pMT2 = obj->GetMethodTable(); - CorElementType type2 = pMT2->GetInternalCorElementType(); - if (type1 == type2) + + // we allow enums and their primitive type to be interchangable. + // if suspension is requested, defer to the framed helper. + if (pMT1->GetInternalCorElementType() == pMT2->GetInternalCorElementType() && + (pMT1->IsEnum() || pMT1->IsTruePrimitive()) && + (pMT2->IsEnum() || pMT2->IsTruePrimitive()) && + g_TrapReturningThreads.LoadWithoutBarrier() == 0) { - MethodTable* pMT1 = typeHnd.AsMethodTable(); - if (pMT1 && (pMT1->IsEnum() || pMT1->IsTruePrimitive()) && - (pMT2->IsEnum() || pMT2->IsTruePrimitive())) - { - _ASSERTE(CorTypeInfo::IsPrimitiveType_NoThrow(type1)); - return(obj->GetData()); - } + return obj->GetData(); } - // Even less common cases (type equivalence) go to a framed helper. + // Fall back to a framed helper that can also handle GC suspension and type equivalence. ENDFORBIDGC(); - return HCCALL2(JIT_Unbox_Helper_Framed, type, obj); -} - -/*************************************************************/ -HCIMPL2(LPVOID, JIT_Unbox, CORINFO_CLASS_HANDLE type, Object* obj) -{ - FCALL_CONTRACT; - - TypeHandle typeHnd(type); - VALIDATEOBJECT(obj); - _ASSERTE(!typeHnd.IsTypeDesc()); // boxable types have method tables - - // This has been tuned so that branch predictions are good - // (fall through for forward branches) for the common case - if (obj != NULL) { - if (obj->GetMethodTable() == typeHnd.AsMethodTable()) - return(obj->GetData()); - else { - // Stuff the uncommon case into a helper so that - // its register needs don't cause spills that effect - // the common case above. - return JIT_Unbox_Helper(type, obj); - } - } - - FCThrow(kNullReferenceException); + return HCCALL2(Unbox_Helper_Framed, pMT1, obj); } HCIMPLEND diff --git a/src/coreclr/src/vm/jitinterface.cpp b/src/coreclr/src/vm/jitinterface.cpp index 923fe69b09cb70..8fd7319af20449 100644 --- a/src/coreclr/src/vm/jitinterface.cpp +++ b/src/coreclr/src/vm/jitinterface.cpp @@ -799,6 +799,48 @@ BOOL CEEInfo::isValidStringRef ( return result; } +LPCWSTR CEEInfo::getStringLiteral ( + CORINFO_MODULE_HANDLE moduleHnd, + mdToken metaTOK, + int* length) +{ + CONTRACTL{ + THROWS; + GC_TRIGGERS; + MODE_PREEMPTIVE; + } CONTRACTL_END; + + Module* module = GetModule(moduleHnd); + + LPCWSTR result = nullptr; + + JIT_TO_EE_TRANSITION(); + + if (IsDynamicScope(moduleHnd)) + { + *length = GetDynamicResolver(moduleHnd)->GetStringLiteralLength(metaTOK); + } + else + { + DWORD dwCharCount; + LPCWSTR pString; + if (!FAILED((module)->GetMDImport()->GetUserString(metaTOK, &dwCharCount, NULL, &pString))) + { + // For string.Empty pString will be null + *length = dwCharCount; + result = pString; + } + else + { + *length = -1; + } + } + + EE_TO_JIT_TRANSITION(); + + return result; +} + /* static */ size_t CEEInfo::findNameOfToken (Module* module, mdToken metaTOK, @@ -12023,7 +12065,11 @@ void CEEJitInfo::allocMem ( S_SIZE_T totalSize = S_SIZE_T(codeSize); size_t roDataAlignment = sizeof(void*); - if ((flag & CORJIT_ALLOCMEM_FLG_RODATA_16BYTE_ALIGN)!= 0) + if ((flag & CORJIT_ALLOCMEM_FLG_RODATA_32BYTE_ALIGN)!= 0) + { + roDataAlignment = 32; + } + else if ((flag & CORJIT_ALLOCMEM_FLG_RODATA_16BYTE_ALIGN)!= 0) { roDataAlignment = 16; } @@ -12033,9 +12079,18 @@ void CEEJitInfo::allocMem ( } if (roDataSize > 0) { - size_t codeAlignment = ((flag & CORJIT_ALLOCMEM_FLG_16BYTE_ALIGN)!= 0) - ? 16 : sizeof(void*); + size_t codeAlignment = sizeof(void*); + + if ((flag & CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN) != 0) + { + codeAlignment = 32; + } + else if ((flag & CORJIT_ALLOCMEM_FLG_16BYTE_ALIGN) != 0) + { + codeAlignment = 16; + } totalSize.AlignUp(codeAlignment); + if (roDataAlignment > codeAlignment) { // Add padding to align read-only data. totalSize += (roDataAlignment - codeAlignment); diff --git a/src/coreclr/src/vm/jitinterface.h b/src/coreclr/src/vm/jitinterface.h index cf80d843ac11ce..dd5d4fc734d7e7 100644 --- a/src/coreclr/src/vm/jitinterface.h +++ b/src/coreclr/src/vm/jitinterface.h @@ -246,6 +246,7 @@ extern "C" FCDECL2(VOID, JIT_WriteBarrierEnsureNonHeapTarget, Object **dst, Obje extern "C" FCDECL2(Object*, ChkCastAny_NoCacheLookup, CORINFO_CLASS_HANDLE type, Object* obj); extern "C" FCDECL2(Object*, IsInstanceOfAny_NoCacheLookup, CORINFO_CLASS_HANDLE type, Object* obj); +extern "C" FCDECL2(LPVOID, Unbox_Helper, CORINFO_CLASS_HANDLE type, Object* obj); extern "C" FCDECL1(void, JIT_InternalThrow, unsigned exceptNum); extern "C" FCDECL1(void*, JIT_InternalThrowFromHelper, unsigned exceptNum); @@ -662,6 +663,12 @@ class CEEInfo : public ICorJitInfo CORINFO_MODULE_HANDLE module, mdToken metaTOK); + // Get string length and content (can be null) for given metaTOK + LPCWSTR getStringLiteral ( + CORINFO_MODULE_HANDLE module, + mdToken metaTOK, + int* length); + static size_t findNameOfToken (Module* module, mdToken metaTOK, __out_ecount (FQNameCapacity) char * szFQName, size_t FQNameCapacity); diff --git a/src/coreclr/src/vm/metasig.h b/src/coreclr/src/vm/metasig.h index e4b2be2dd5f20d..f6309e352407c8 100644 --- a/src/coreclr/src/vm/metasig.h +++ b/src/coreclr/src/vm/metasig.h @@ -244,6 +244,7 @@ DEFINE_METASIG(SM(IntPtr_IntPtr_Int_Int_IntPtr_RetVoid, I I i i I, v)) DEFINE_METASIG(SM(IntPtr_RefObj_IntPtr_Obj_RetVoid, I r(j) I j, v)) DEFINE_METASIG(SM(Obj_Int_RetVoid, j i,v)) DEFINE_METASIG(SM(PtrVoid_Obj_RetObj, P(v) j, j)) +DEFINE_METASIG(SM(PtrVoid_Obj_RetRefByte, P(v) j, r(b))) DEFINE_METASIG(SM(Flt_RetFlt, f, f)) DEFINE_METASIG(SM(Dbl_RetDbl, d, d)) diff --git a/src/coreclr/src/vm/methodtable.h b/src/coreclr/src/vm/methodtable.h index d5bd84adc2caee..0c701489277800 100644 --- a/src/coreclr/src/vm/methodtable.h +++ b/src/coreclr/src/vm/methodtable.h @@ -2652,7 +2652,7 @@ class MethodTable // GetInternalCorElementType() retrieves the internal representation of the type. It's not always // appropiate to use this. For example, we treat enums as their underlying type or some structs are // optimized to be ints. To get the signature type or the verifier type (same as signature except for - // enums are normalized to the primtive type that underlies them), use the APIs in Typehandle.h + // enums are normalized to the primitive type that underlies them), use the APIs in Typehandle.h // // * code:TypeHandle.GetSignatureCorElementType() // * code:TypeHandle.GetVerifierCorElementType() diff --git a/src/coreclr/src/vm/mscorlib.cpp b/src/coreclr/src/vm/mscorlib.cpp index a6d652cc3a5963..40a1e14f58ff78 100644 --- a/src/coreclr/src/vm/mscorlib.cpp +++ b/src/coreclr/src/vm/mscorlib.cpp @@ -367,15 +367,14 @@ const MscorlibFieldDescription c_rgMscorlibFieldDescriptions[] = }; const USHORT c_nMscorlibFieldDescriptions = NumItems(c_rgMscorlibFieldDescriptions) + 1; - - - - /////////////////////////////////////////////////////////////////////////////// // // ECalls // +// ECalls defined by libraries-native shims +EXTERN_C const LPVOID gPalGlobalizationNative[]; + // When compiling crossgen, we only need the target version of the ecall tables #if !defined(CROSSGEN_COMPILE) || defined(CROSSGEN_MSCORLIB) diff --git a/src/coreclr/src/vm/mscorlib.h b/src/coreclr/src/vm/mscorlib.h index 397f8b86b61a7d..dfcf9bc704a18b 100644 --- a/src/coreclr/src/vm/mscorlib.h +++ b/src/coreclr/src/vm/mscorlib.h @@ -1461,6 +1461,7 @@ DEFINE_METHOD(CASTHELPERS, CHKCASTANY, ChkCastAny, SM_Ptr DEFINE_METHOD(CASTHELPERS, CHKCASTINTERFACE, ChkCastInterface, SM_PtrVoid_Obj_RetObj) DEFINE_METHOD(CASTHELPERS, CHKCASTCLASS, ChkCastClass, SM_PtrVoid_Obj_RetObj) DEFINE_METHOD(CASTHELPERS, CHKCASTCLASSSPECIAL, ChkCastClassSpecial, SM_PtrVoid_Obj_RetObj) +DEFINE_METHOD(CASTHELPERS, UNBOX, Unbox, SM_PtrVoid_Obj_RetRefByte) DEFINE_CLASS_U(CompilerServices, LAHashDependentHashTracker, LAHashDependentHashTrackerObject) DEFINE_FIELD_U(_dependentHandle, LAHashDependentHashTrackerObject,_dependentHandle) diff --git a/src/coreclr/src/vm/pefile.cpp b/src/coreclr/src/vm/pefile.cpp index 6928cc6f98c478..480482bf3b1dd6 100644 --- a/src/coreclr/src/vm/pefile.cpp +++ b/src/coreclr/src/vm/pefile.cpp @@ -2448,7 +2448,6 @@ PTR_ICLRPrivBinder PEFile::GetBindingContext() // CoreLibrary is always bound in context of the TPA Binder. However, since it gets loaded and published // during EEStartup *before* DefaultContext Binder (aka TPAbinder) is initialized, we dont have a binding context to publish against. - // Thus, we will always return NULL for its binding context. if (!IsSystem()) { pBindingContext = dac_cast(GetHostAssembly()); @@ -2466,3 +2465,31 @@ PTR_ICLRPrivBinder PEFile::GetBindingContext() return pBindingContext; } + +#ifndef DACCESS_COMPILE +AssemblyLoadContext* PEFile::GetAssemblyLoadContext() +{ + LIMITED_METHOD_CONTRACT; + + PTR_ICLRPrivBinder pBindingContext = GetBindingContext(); + ICLRPrivBinder* pOpaqueBinder = NULL; + + if (pBindingContext != NULL) + { + UINT_PTR assemblyBinderID = 0; + IfFailThrow(pBindingContext->GetBinderID(&assemblyBinderID)); + + pOpaqueBinder = reinterpret_cast(assemblyBinderID); + +#ifdef FEATURE_COMINTEROP + // Treat WinRT assemblies (bound using the WinRT binder) as if they were loaded into the TPA ALC + if (AreSameBinderInstance(AppDomain::GetCurrentDomain()->GetWinRtBinder(), pOpaqueBinder)) + { + pOpaqueBinder = NULL; + } +#endif + } + + return (pOpaqueBinder != NULL) ? (AssemblyLoadContext*)pOpaqueBinder : AppDomain::GetCurrentDomain()->GetTPABinderContext(); +} +#endif diff --git a/src/coreclr/src/vm/pefile.h b/src/coreclr/src/vm/pefile.h index f21ff7b0654f78..a417c4b881a88d 100644 --- a/src/coreclr/src/vm/pefile.h +++ b/src/coreclr/src/vm/pefile.h @@ -46,6 +46,7 @@ class PEFile; class PEModule; class PEAssembly; class SimpleRWLock; +class AssemblyLoadContext; typedef VPTR(PEModule) PTR_PEModule; typedef VPTR(PEAssembly) PTR_PEAssembly; @@ -568,6 +569,8 @@ class PEFile // Returns the ICLRPrivBinder* instance associated with the PEFile PTR_ICLRPrivBinder GetBindingContext(); + AssemblyLoadContext* GetAssemblyLoadContext(); + bool HasHostAssembly() { STATIC_CONTRACT_WRAPPER; return GetHostAssembly() != nullptr; } @@ -729,8 +732,8 @@ class PEAssembly : public PEFile // Indicates if the assembly can be cached in a binding cache such as AssemblySpecBindingCache. inline bool CanUseWithBindingCache() { - STATIC_CONTRACT_WRAPPER; - return (HasBindableIdentity()); + STATIC_CONTRACT_WRAPPER; + return (HasBindableIdentity()); } }; diff --git a/src/coreclr/src/vm/rcwwalker.cpp b/src/coreclr/src/vm/rcwwalker.cpp index 76b7ac2996a03c..5c94a3ea536909 100644 --- a/src/coreclr/src/vm/rcwwalker.cpp +++ b/src/coreclr/src/vm/rcwwalker.cpp @@ -525,25 +525,6 @@ void RCWWalker::BeforeJupiterRCWDestroyed(RCW *pRCW) LOG((LF_INTEROP, LL_INFO100, "[RCW Walker] ----- RCWWalker::BeforeJupiterRCWDestroyed (RCW = 0x%p) ENDS ----- \n", pRCW)); } -// -// Cleanup stuff when EE is about to unload -// -void RCWWalker::OnEEShutdown() -{ - WRAPPER_NO_CONTRACT; - - if (s_pGCManager) - { - LOG((LF_INTEROP, LL_INFO100, "[RCW Walker] Releasing RCWWalker::s_pIGCManager 0x%p\n", s_pGCManager)); - - // Make sure s_pGCManager is always either NULL or a valid IJupiterGCManager * - // this will make crash easier to diagnose - IJupiterGCManager *pGCManager = FastInterlockExchangePointer((IJupiterGCManager **)&s_pGCManager, NULL); - if (pGCManager != NULL) - pGCManager->Release(); - } -} - // // Walk all the jupiter RCWs in all AppDomains and build references from RCW -> CCW as we go // diff --git a/src/coreclr/src/vm/rcwwalker.h b/src/coreclr/src/vm/rcwwalker.h index f411fc505c35b2..0a532d8830ef80 100644 --- a/src/coreclr/src/vm/rcwwalker.h +++ b/src/coreclr/src/vm/rcwwalker.h @@ -43,7 +43,6 @@ public : static void OnJupiterRCWCreated(RCW *pRCW, IJupiterObject *pJupiterObject); static void AfterJupiterRCWCreated(RCW *pRCW); static void BeforeJupiterRCWDestroyed(RCW *pRCW); - static void OnEEShutdown(); // // Send out a AddRefFromTrackerSource callback to notify Jupiter we've done a AddRef diff --git a/src/coreclr/src/vm/readytoruninfo.cpp b/src/coreclr/src/vm/readytoruninfo.cpp index 7222cdccc09be1..99b252056a3a73 100644 --- a/src/coreclr/src/vm/readytoruninfo.cpp +++ b/src/coreclr/src/vm/readytoruninfo.cpp @@ -20,7 +20,7 @@ using namespace NativeFormat; -IMAGE_DATA_DIRECTORY * ReadyToRunInfo::FindSection(DWORD type) +IMAGE_DATA_DIRECTORY * ReadyToRunInfo::FindSection(ReadyToRunSectionType type) { CONTRACTL { @@ -313,7 +313,7 @@ PTR_BYTE ReadyToRunInfo::GetDebugInfo(PTR_RUNTIME_FUNCTION pRuntimeFunction) } CONTRACTL_END; - IMAGE_DATA_DIRECTORY * pDebugInfoDir = FindSection(READYTORUN_SECTION_DEBUG_INFO); + IMAGE_DATA_DIRECTORY * pDebugInfoDir = FindSection(ReadyToRunSectionType::DebugInfo); if (pDebugInfoDir == NULL) return NULL; @@ -410,7 +410,7 @@ static bool AcquireImage(Module * pModule, PEImageLayout * pLayout, READYTORUN_H READYTORUN_SECTION * pSections = (READYTORUN_SECTION*)(pHeader + 1); for (DWORD i = 0; i < pHeader->NumberOfSections; i++) { - if (pSections[i].Type == READYTORUN_SECTION_IMPORT_SECTIONS) + if (pSections[i].Type == ReadyToRunSectionType::ImportSections) { pImportSections = (READYTORUN_IMPORT_SECTION*)((PBYTE)pLayout->GetBase() + pSections[i].Section.VirtualAddress); pImportSectionsEnd = (READYTORUN_IMPORT_SECTION*)((PBYTE)pImportSections + pSections[i].Section.Size); @@ -541,7 +541,7 @@ ReadyToRunInfo::ReadyToRunInfo(Module * pModule, PEImageLayout * pLayout, READYT { STANDARD_VM_CONTRACT; - IMAGE_DATA_DIRECTORY * pRuntimeFunctionsDir = FindSection(READYTORUN_SECTION_RUNTIME_FUNCTIONS); + IMAGE_DATA_DIRECTORY * pRuntimeFunctionsDir = FindSection(ReadyToRunSectionType::RuntimeFunctions); if (pRuntimeFunctionsDir != NULL) { m_pRuntimeFunctions = (T_RUNTIME_FUNCTION *)pLayout->GetDirectoryData(pRuntimeFunctionsDir); @@ -552,7 +552,7 @@ ReadyToRunInfo::ReadyToRunInfo(Module * pModule, PEImageLayout * pLayout, READYT m_nRuntimeFunctions = 0; } - IMAGE_DATA_DIRECTORY * pImportSectionsDir = FindSection(READYTORUN_SECTION_IMPORT_SECTIONS); + IMAGE_DATA_DIRECTORY * pImportSectionsDir = FindSection(ReadyToRunSectionType::ImportSections); if (pImportSectionsDir != NULL) { m_pImportSections = (CORCOMPILE_IMPORT_SECTION*)pLayout->GetDirectoryData(pImportSectionsDir); @@ -565,20 +565,20 @@ ReadyToRunInfo::ReadyToRunInfo(Module * pModule, PEImageLayout * pLayout, READYT m_nativeReader = NativeReader((byte *)pLayout->GetBase(), pLayout->GetVirtualSize()); - IMAGE_DATA_DIRECTORY * pEntryPointsDir = FindSection(READYTORUN_SECTION_METHODDEF_ENTRYPOINTS); + IMAGE_DATA_DIRECTORY * pEntryPointsDir = FindSection(ReadyToRunSectionType::MethodDefEntryPoints); if (pEntryPointsDir != NULL) { m_methodDefEntryPoints = NativeArray(&m_nativeReader, pEntryPointsDir->VirtualAddress); } - IMAGE_DATA_DIRECTORY * pinstMethodsDir = FindSection(READYTORUN_SECTION_INSTANCE_METHOD_ENTRYPOINTS); + IMAGE_DATA_DIRECTORY * pinstMethodsDir = FindSection(ReadyToRunSectionType::InstanceMethodEntryPoints); if (pinstMethodsDir != NULL) { NativeParser parser = NativeParser(&m_nativeReader, pinstMethodsDir->VirtualAddress); m_instMethodEntryPoints = NativeHashtable(parser); } - IMAGE_DATA_DIRECTORY * pAvailableTypesDir = FindSection(READYTORUN_SECTION_AVAILABLE_TYPES); + IMAGE_DATA_DIRECTORY * pAvailableTypesDir = FindSection(ReadyToRunSectionType::AvailableTypes); if (pAvailableTypesDir != NULL) { NativeParser parser = NativeParser(&m_nativeReader, pAvailableTypesDir->VirtualAddress); @@ -593,7 +593,7 @@ ReadyToRunInfo::ReadyToRunInfo(Module * pModule, PEImageLayout * pLayout, READYT // For format version 4.1 and later, there is an optional inlining table if (IsImageVersionAtLeast(4, 1)) { - IMAGE_DATA_DIRECTORY* pInlineTrackingInfoDir = FindSection(READYTORUN_SECTION_INLINING_INFO2); + IMAGE_DATA_DIRECTORY* pInlineTrackingInfoDir = FindSection(ReadyToRunSectionType::InliningInfo2); if (pInlineTrackingInfoDir != NULL) { const BYTE* pInlineTrackingMapData = (const BYTE*)GetImage()->GetDirectoryData(pInlineTrackingInfoDir); @@ -605,7 +605,7 @@ ReadyToRunInfo::ReadyToRunInfo(Module * pModule, PEImageLayout * pLayout, READYT // For format version 2.1 and later, there is an optional inlining table if (m_pPersistentInlineTrackingMap == nullptr && IsImageVersionAtLeast(2, 1)) { - IMAGE_DATA_DIRECTORY * pInlineTrackingInfoDir = FindSection(READYTORUN_SECTION_INLINING_INFO); + IMAGE_DATA_DIRECTORY * pInlineTrackingInfoDir = FindSection(ReadyToRunSectionType::InliningInfo); if (pInlineTrackingInfoDir != NULL) { const BYTE* pInlineTrackingMapData = (const BYTE*)GetImage()->GetDirectoryData(pInlineTrackingInfoDir); @@ -617,7 +617,7 @@ ReadyToRunInfo::ReadyToRunInfo(Module * pModule, PEImageLayout * pLayout, READYT // For format version 2.2 and later, there is an optional profile-data section if (IsImageVersionAtLeast(2, 2)) { - IMAGE_DATA_DIRECTORY * pProfileDataInfoDir = FindSection(READYTORUN_SECTION_PROFILEDATA_INFO); + IMAGE_DATA_DIRECTORY * pProfileDataInfoDir = FindSection(ReadyToRunSectionType::ProfileDataInfo); if (pProfileDataInfoDir != NULL) { CORCOMPILE_METHOD_PROFILE_LIST * pMethodProfileList; @@ -628,7 +628,7 @@ ReadyToRunInfo::ReadyToRunInfo(Module * pModule, PEImageLayout * pLayout, READYT } // For format version 3.1 and later, there is an optional attributes section - IMAGE_DATA_DIRECTORY *attributesPresenceDataInfoDir = FindSection(READYTORUN_SECTION_ATTRIBUTEPRESENCE); + IMAGE_DATA_DIRECTORY *attributesPresenceDataInfoDir = FindSection(ReadyToRunSectionType::AttributePresence); if (attributesPresenceDataInfoDir != NULL) { NativeCuckooFilter newFilter( diff --git a/src/coreclr/src/vm/readytoruninfo.h b/src/coreclr/src/vm/readytoruninfo.h index 370dca33ce3452..11cabd0932030b 100644 --- a/src/coreclr/src/vm/readytoruninfo.h +++ b/src/coreclr/src/vm/readytoruninfo.h @@ -86,7 +86,7 @@ class ReadyToRunInfo return m_pLayout; } - IMAGE_DATA_DIRECTORY * FindSection(DWORD type); + IMAGE_DATA_DIRECTORY * FindSection(ReadyToRunSectionType type); PTR_CORCOMPILE_IMPORT_SECTION GetImportSections(COUNT_T * pCount) { diff --git a/src/coreclr/src/vm/runtimecallablewrapper.cpp b/src/coreclr/src/vm/runtimecallablewrapper.cpp index acad5f2dbf8b1b..f61ed2b61b417e 100644 --- a/src/coreclr/src/vm/runtimecallablewrapper.cpp +++ b/src/coreclr/src/vm/runtimecallablewrapper.cpp @@ -4081,16 +4081,6 @@ BOOL RCW::AllowEagerSTACleanup() // with before calling this. _ASSERTE(GetSTAThread() != NULL); - // If the client has called CoEEShutdownCOM, then we should always try to - // clean up RCWs, even if they have previously opted out by calling - // DisableComObjectEagerCleanup. There's no way for clients to re-enable - // eager cleanup so, if we don't clean up now, they will be leaked. After - // shutting down COM, clients would not expect any RCWs to be left over. - if( g_fShutDownCOM ) - { - return TRUE; - } - return m_Flags.m_fAllowEagerSTACleanup; } diff --git a/src/coreclr/src/vm/runtimecallablewrapper.h b/src/coreclr/src/vm/runtimecallablewrapper.h index ed1e95b2aeaba3..16b9e753f7d2aa 100644 --- a/src/coreclr/src/vm/runtimecallablewrapper.h +++ b/src/coreclr/src/vm/runtimecallablewrapper.h @@ -90,8 +90,6 @@ class Thread; #define GC_PRESSURE_WINRT_HIGH 800000 #endif // HOST_64BIT -extern bool g_fShutDownCOM; - enum {INTERFACE_ENTRY_CACHE_SIZE = 8}; struct RCWAuxiliaryData; diff --git a/src/coreclr/src/vm/stackwalk.cpp b/src/coreclr/src/vm/stackwalk.cpp index 0251b05724f8c8..66890ec1002a6c 100644 --- a/src/coreclr/src/vm/stackwalk.cpp +++ b/src/coreclr/src/vm/stackwalk.cpp @@ -2570,9 +2570,9 @@ StackWalkAction StackFrameIterator::NextRaw(void) PTR_VOID newSP = PTR_VOID((TADDR)GetRegdisplaySP(m_crawl.pRD)); #ifndef NO_FIXED_STACK_LIMIT - FAIL_IF_SPECULATIVE_WALK(newSP >= m_crawl.pThread->GetCachedStackLimit()); + FAIL_IF_SPECULATIVE_WALK(m_crawl.pThread->IsExecutingOnAltStack() || newSP >= m_crawl.pThread->GetCachedStackLimit()); #endif // !NO_FIXED_STACK_LIMIT - FAIL_IF_SPECULATIVE_WALK(newSP < m_crawl.pThread->GetCachedStackBase()); + FAIL_IF_SPECULATIVE_WALK(m_crawl.pThread->IsExecutingOnAltStack() || newSP < m_crawl.pThread->GetCachedStackBase()); #undef FAIL_IF_SPECULATIVE_WALK diff --git a/src/coreclr/src/vm/synchronizationcontextnative.cpp b/src/coreclr/src/vm/synchronizationcontextnative.cpp index 52ca8471feb715..447053c7eb2398 100644 --- a/src/coreclr/src/vm/synchronizationcontextnative.cpp +++ b/src/coreclr/src/vm/synchronizationcontextnative.cpp @@ -149,22 +149,4 @@ void* QCALLTYPE SynchronizationContextNative::GetWinRTDispatcherForCurrentThread return result; } -void SynchronizationContextNative::Cleanup() -{ - CONTRACTL - { - NOTHROW; - GC_TRIGGERS; - MODE_ANY; - } CONTRACTL_END; - - if (g_pICoreWindowStatic) - { - SafeRelease(g_pICoreWindowStatic); - g_pICoreWindowStatic = NULL; - } -} - - - #endif //FEATURE_APPX diff --git a/src/coreclr/src/vm/synchronizationcontextnative.h b/src/coreclr/src/vm/synchronizationcontextnative.h index 47b7f013559f9c..3d563c519810ff 100644 --- a/src/coreclr/src/vm/synchronizationcontextnative.h +++ b/src/coreclr/src/vm/synchronizationcontextnative.h @@ -21,7 +21,6 @@ class SynchronizationContextNative #ifdef FEATURE_APPX static void* QCALLTYPE GetWinRTDispatcherForCurrentThread(); - static void Cleanup(); #endif }; #endif // _SYNCHRONIZATIONCONTEXTNATIVE_H diff --git a/src/coreclr/src/vm/threads.cpp b/src/coreclr/src/vm/threads.cpp index da222bc10253f4..f9586156b7b555 100644 --- a/src/coreclr/src/vm/threads.cpp +++ b/src/coreclr/src/vm/threads.cpp @@ -184,8 +184,8 @@ void Thread::SetFrame(Frame *pFrame) if (pFrame == stopFrame) _ASSERTE(!"SetFrame frame == stopFrame"); - _ASSERTE(espVal < pFrame); - _ASSERTE(pFrame < m_CacheStackBase); + _ASSERTE(IsExecutingOnAltStack() || espVal < pFrame); + _ASSERTE(IsExecutingOnAltStack() || pFrame < m_CacheStackBase); _ASSERTE(pFrame->GetFrameType() < Frame::TYPE_COUNT); pFrame = pFrame->m_Next; @@ -6481,7 +6481,7 @@ HRESULT Thread::CLRSetThreadStackGuarantee(SetThreadStackGuaranteeScope fScope) // -additionally, we need to provide some region to hosts to allow for lock acquisition in a hosted scenario // EXTRA_PAGES = 3; - INDEBUG(EXTRA_PAGES += 1); + INDEBUG(EXTRA_PAGES += 3); int ThreadGuardPages = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_ThreadGuardPages); if (ThreadGuardPages == 0) @@ -6495,7 +6495,7 @@ HRESULT Thread::CLRSetThreadStackGuarantee(SetThreadStackGuaranteeScope fScope) #else // HOST_64BIT #ifdef _DEBUG - uGuardSize += (1 * GetOsPageSize()); // one extra page for debug infrastructure + uGuardSize += (3 * GetOsPageSize()); // three extra pages for debug infrastructure #endif // _DEBUG #endif // HOST_64BIT @@ -7106,9 +7106,9 @@ void CheckRegDisplaySP (REGDISPLAY *pRD) if (pRD->SP && pRD->_pThread) { #ifndef NO_FIXED_STACK_LIMIT - _ASSERTE(PTR_VOID(pRD->SP) >= pRD->_pThread->GetCachedStackLimit()); + _ASSERTE(pRD->_pThread->IsExecutingOnAltStack() || PTR_VOID(pRD->SP) >= pRD->_pThread->GetCachedStackLimit()); #endif // NO_FIXED_STACK_LIMIT - _ASSERTE(PTR_VOID(pRD->SP) < pRD->_pThread->GetCachedStackBase()); + _ASSERTE(pRD->_pThread->IsExecutingOnAltStack() || PTR_VOID(pRD->SP) < pRD->_pThread->GetCachedStackBase()); } } diff --git a/src/coreclr/src/vm/threads.h b/src/coreclr/src/vm/threads.h index 1810c3ee0d8789..112a96d42134db 100644 --- a/src/coreclr/src/vm/threads.h +++ b/src/coreclr/src/vm/threads.h @@ -1035,6 +1035,8 @@ class Thread if(STSGuarantee_Force == fScope) return TRUE; + // For debug, always enable setting thread stack guarantee so that we can print the stack trace +#ifndef DEBUG //The runtime must be hosted to have escalation policy //If escalation policy is enabled but StackOverflow is not part of the policy // then we don't use SetThreadStackGuarantee @@ -1044,6 +1046,7 @@ class Thread //FAIL_StackOverflow is ProcessExit so don't use SetThreadStackGuarantee return FALSE; } +#endif // DEBUG return TRUE; } @@ -1081,7 +1084,7 @@ class Thread TS_LegalToJoin = 0x00000020, // Is it now legal to attempt a Join() - // unused = 0x00000040, + TS_ExecutingOnAltStack = 0x00000040, // Runtime is executing on an alternate stack located anywhere in the memory #ifdef FEATURE_HIJACK TS_Hijacked = 0x00000080, // Return address has been hijacked @@ -1416,6 +1419,18 @@ class Thread } #endif // DACCESS_COMPILE + DWORD IsExecutingOnAltStack() + { + LIMITED_METHOD_CONTRACT; + return (m_State & TS_ExecutingOnAltStack); + } + + void SetExecutingOnAltStack() + { + LIMITED_METHOD_CONTRACT; + FastInterlockOr((ULONG *) &m_State, TS_ExecutingOnAltStack); + } + DWORD IsBackground() { LIMITED_METHOD_CONTRACT; @@ -1841,7 +1856,7 @@ class Thread { void* curSP; curSP = (void *)GetCurrentSP(); - _ASSERTE((curSP <= m_pFrame && m_pFrame < m_CacheStackBase) || m_pFrame == (Frame*) -1); + _ASSERTE(IsExecutingOnAltStack() || (curSP <= m_pFrame && m_pFrame < m_CacheStackBase) || m_pFrame == (Frame*) -1); } #endif diff --git a/src/coreclr/src/vm/threadsuspend.cpp b/src/coreclr/src/vm/threadsuspend.cpp index 2348a72f686b5d..eb51e67ffe5760 100644 --- a/src/coreclr/src/vm/threadsuspend.cpp +++ b/src/coreclr/src/vm/threadsuspend.cpp @@ -23,6 +23,8 @@ bool ThreadSuspend::s_fSuspendRuntimeInProgress = false; +bool ThreadSuspend::s_fSuspended = false; + CLREvent* ThreadSuspend::g_pGCSuspendEvent = NULL; ThreadSuspend::SUSPEND_REASON ThreadSuspend::m_suspendReason; @@ -6227,6 +6229,7 @@ void Thread::UnmarkForSuspension(ULONG mask) void ThreadSuspend::RestartEE(BOOL bFinishedGC, BOOL SuspendSucceded) { + ThreadSuspend::s_fSuspended = false; #ifdef TIME_SUSPEND g_SuspendStatistics.StartRestart(); #endif //TIME_SUSPEND @@ -6589,6 +6592,7 @@ void ThreadSuspend::SuspendEE(SUSPEND_REASON reason) #ifdef TIME_SUSPEND g_SuspendStatistics.EndSuspend(reason == SUSPEND_FOR_GC || reason == SUSPEND_FOR_GC_PREP); #endif //TIME_SUSPEND + ThreadSuspend::s_fSuspended = true; } #if defined(FEATURE_HIJACK) && defined(TARGET_UNIX) diff --git a/src/coreclr/src/vm/threadsuspend.h b/src/coreclr/src/vm/threadsuspend.h index a5fb30238de3d9..b8df42dbb33fd0 100644 --- a/src/coreclr/src/vm/threadsuspend.h +++ b/src/coreclr/src/vm/threadsuspend.h @@ -192,10 +192,9 @@ class ThreadSuspend // that the runtime was suspended static Thread* m_pThreadAttemptingSuspendForGC; -public: static HRESULT SuspendRuntime(ThreadSuspend::SUSPEND_REASON reason); static void ResumeRuntime(BOOL bFinishedGC, BOOL SuspendSucceded); - +public: // Initialize thread suspension support static void Initialize(); @@ -229,6 +228,8 @@ class ThreadSuspend // But there won't be any corruption or AV. More details on the profiler API scenario in VsWhidbey bug 454936. static bool s_fSuspendRuntimeInProgress; + static bool s_fSuspended; + static void SetSuspendRuntimeInProgress(); static void ResetSuspendRuntimeInProgress(); @@ -236,6 +237,7 @@ class ThreadSuspend public: static bool SysIsSuspendInProgress() { return s_fSuspendRuntimeInProgress; } + static bool SysIsSuspended() { return s_fSuspended; } public: //suspend all threads diff --git a/src/coreclr/src/vm/util.hpp b/src/coreclr/src/vm/util.hpp index d2b5639ab286cb..e28ec8814a5471 100644 --- a/src/coreclr/src/vm/util.hpp +++ b/src/coreclr/src/vm/util.hpp @@ -655,7 +655,7 @@ FORCEINLINE void VoidFreeNativeLibrary(NATIVE_LIBRARY_HANDLE h) if (h == NULL) return; -#ifdef TARGET_UNIX +#ifdef HOST_UNIX PAL_FreeLibraryDirect(h); #else FreeLibrary(h); diff --git a/src/coreclr/src/vm/vars.cpp b/src/coreclr/src/vm/vars.cpp index 2e3e8e9c89b64d..ba0cac3dea478b 100644 --- a/src/coreclr/src/vm/vars.cpp +++ b/src/coreclr/src/vm/vars.cpp @@ -207,9 +207,6 @@ GVAL_IMPL(SIZE_T, g_runtimeVirtualSize); Volatile g_fForbidEnterEE = false; bool g_fManagedAttach = false; bool g_fNoExceptions = false; -#ifdef FEATURE_COMINTEROP -bool g_fShutDownCOM = false; -#endif //FEATURE_COMINTEROP DWORD g_FinalizerWaiterStatus = 0; diff --git a/src/coreclr/src/vm/vars.hpp b/src/coreclr/src/vm/vars.hpp index 7ea536b52c9726..65bb74fff44e92 100644 --- a/src/coreclr/src/vm/vars.hpp +++ b/src/coreclr/src/vm/vars.hpp @@ -504,9 +504,6 @@ EXTERN Volatile g_fForbidEnterEE; GVAL_DECL(bool, g_fProcessDetach); EXTERN bool g_fManagedAttach; EXTERN bool g_fNoExceptions; -#ifdef FEATURE_COMINTEROP -EXTERN bool g_fShutDownCOM; -#endif // FEATURE_COMINTEROP // Indicates whether we're executing shut down as a result of DllMain // (DLL_PROCESS_DETACH). See comments at code:EEShutDown for details. diff --git a/src/coreclr/src/vm/weakreferencenative.cpp b/src/coreclr/src/vm/weakreferencenative.cpp index 568dcbb3b12a6d..b1dc825494f35d 100644 --- a/src/coreclr/src/vm/weakreferencenative.cpp +++ b/src/coreclr/src/vm/weakreferencenative.cpp @@ -15,6 +15,7 @@ #include "weakreferencenative.h" #include "typestring.h" #include "typeparse.h" +#include "threadsuspend.h" //************************************************************************ @@ -495,7 +496,8 @@ void FinalizeWeakReference(Object * obj) WEAKREFERENCEREF pThis((WeakReferenceObject *)(obj)); - OBJECTHANDLE handle = AcquireWeakHandleSpinLock(pThis); + // The suspension state of the runtime must be prevented from changing while in this function in order for this to be safe. + OBJECTHANDLE handle = ThreadSuspend::SysIsSuspended() ? pThis->m_Handle.LoadWithoutBarrier() : AcquireWeakHandleSpinLock(pThis); OBJECTHANDLE handleToDestroy = NULL; bool isWeakWinRTHandle = false; @@ -518,6 +520,9 @@ void FinalizeWeakReference(Object * obj) } // Release the spin lock + // This is necessary even when the spin lock is not acquired + // (i.e. When ThreadSuspend::SysIsSuspended() == true) + // so that the new handle value is set. ReleaseWeakHandleSpinLock(pThis, handle); if (handleToDestroy != NULL) diff --git a/src/coreclr/src/zap/zapimage.cpp b/src/coreclr/src/zap/zapimage.cpp index 379dda06f93fe6..5ca0fa9c6ed350 100644 --- a/src/coreclr/src/zap/zapimage.cpp +++ b/src/coreclr/src/zap/zapimage.cpp @@ -223,7 +223,7 @@ void ZapImage::InitializeSectionsForReadyToRun() const char * pCompilerIdentifier = COMPILER_NAME " " FX_FILEVERSION_STR " " QUOTE_MACRO(__BUILDMACHINE__); ZapBlob * pCompilerIdentifierBlob = new (GetHeap()) ZapBlobPtr((PVOID)pCompilerIdentifier, strlen(pCompilerIdentifier) + 1); - GetReadyToRunHeader()->RegisterSection(READYTORUN_SECTION_COMPILER_IDENTIFIER, pCompilerIdentifierBlob); + GetReadyToRunHeader()->RegisterSection(ReadyToRunSectionType::CompilerIdentifier, pCompilerIdentifierBlob); m_pHeaderSection->Place(pCompilerIdentifierBlob); } @@ -283,7 +283,7 @@ void ZapImage::InitializeSectionsForReadyToRun() // Make sure the import sections table is in the image, so we can find the slot for module // _ASSERTE(m_pImportSectionsTable->GetSize() != 0); - GetReadyToRunHeader()->RegisterSection(READYTORUN_SECTION_IMPORT_SECTIONS, m_pImportSectionsTable); + GetReadyToRunHeader()->RegisterSection(ReadyToRunSectionType::ImportSections, m_pImportSectionsTable); } #endif // FEATURE_READYTORUN_COMPILER diff --git a/src/coreclr/src/zap/zapinfo.cpp b/src/coreclr/src/zap/zapinfo.cpp index eef524a167aad1..e5ffb56d1d1650 100644 --- a/src/coreclr/src/zap/zapinfo.cpp +++ b/src/coreclr/src/zap/zapinfo.cpp @@ -3809,6 +3809,13 @@ BOOL ZapInfo::isValidStringRef ( return m_pEEJitInfo->isValidStringRef(tokenScope, token); } +LPCWSTR ZapInfo::getStringLiteral ( + CORINFO_MODULE_HANDLE tokenScope, + unsigned token, + int* length) +{ + return m_pEEJitInfo->getStringLiteral(tokenScope, token, length); +} // // ICorMethodInfo diff --git a/src/coreclr/src/zap/zapinfo.h b/src/coreclr/src/zap/zapinfo.h index a81a213c2e9ea5..08869b69c405e1 100644 --- a/src/coreclr/src/zap/zapinfo.h +++ b/src/coreclr/src/zap/zapinfo.h @@ -629,6 +629,9 @@ class ZapInfo unsigned metaTOK); BOOL isValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK); + LPCWSTR getStringLiteral(CORINFO_MODULE_HANDLE module, + unsigned metaTOK, + int* length); // ICorMethodInfo diff --git a/src/coreclr/src/zap/zapreadytorun.cpp b/src/coreclr/src/zap/zapreadytorun.cpp index 27f76ec5f4ee4f..be35b33c3fd00e 100644 --- a/src/coreclr/src/zap/zapreadytorun.cpp +++ b/src/coreclr/src/zap/zapreadytorun.cpp @@ -317,15 +317,15 @@ void ZapImage::OutputEntrypointsTableForReadyToRun() m_pCodeMethodDescsSection->Place(pHashtableBlob); ZapReadyToRunHeader * pReadyToRunHeader = GetReadyToRunHeader(); - pReadyToRunHeader->RegisterSection(READYTORUN_SECTION_METHODDEF_ENTRYPOINTS, pArrayBlob); - pReadyToRunHeader->RegisterSection(READYTORUN_SECTION_INSTANCE_METHOD_ENTRYPOINTS, pHashtableBlob); - pReadyToRunHeader->RegisterSection(READYTORUN_SECTION_RUNTIME_FUNCTIONS, m_pRuntimeFunctionSection); + pReadyToRunHeader->RegisterSection(ReadyToRunSectionType::MethodDefEntryPoints, pArrayBlob); + pReadyToRunHeader->RegisterSection(ReadyToRunSectionType::InstanceMethodEntryPoints, pHashtableBlob); + pReadyToRunHeader->RegisterSection(ReadyToRunSectionType::RuntimeFunctions, m_pRuntimeFunctionSection); if (m_pLazyMethodCallHelperSection->GetNodeCount() != 0) - pReadyToRunHeader->RegisterSection(READYTORUN_SECTION_DELAYLOAD_METHODCALL_THUNKS, m_pLazyMethodCallHelperSection); + pReadyToRunHeader->RegisterSection(ReadyToRunSectionType::DelayLoadMethodCallThunks, m_pLazyMethodCallHelperSection); if (m_pExceptionInfoLookupTable->GetSize() != 0) - pReadyToRunHeader->RegisterSection(READYTORUN_SECTION_EXCEPTION_INFO, m_pExceptionInfoLookupTable); + pReadyToRunHeader->RegisterSection(ReadyToRunSectionType::ExceptionInfo, m_pExceptionInfoLookupTable); EndRegion(CORINFO_REGION_COLD); } @@ -417,7 +417,7 @@ void ZapImage::OutputDebugInfoForReadyToRun() ZapNode * pBlob = ZapBlob::NewBlob(this, &blob[0], blob.size()); m_pDebugSection->Place(pBlob); - GetReadyToRunHeader()->RegisterSection(READYTORUN_SECTION_DEBUG_INFO, pBlob); + GetReadyToRunHeader()->RegisterSection(ReadyToRunSectionType::DebugInfo, pBlob); } void ZapImage::OutputInliningTableForReadyToRun() @@ -426,14 +426,14 @@ void ZapImage::OutputInliningTableForReadyToRun() m_pPreloader->GetSerializedInlineTrackingMap(&serializedInlineTrackingBuffer); ZapNode * pBlob = ZapBlob::NewAlignedBlob(this, (PVOID)(const BYTE*) serializedInlineTrackingBuffer, serializedInlineTrackingBuffer.GetSize(), 4); m_pDebugSection->Place(pBlob); - GetReadyToRunHeader()->RegisterSection(READYTORUN_SECTION_INLINING_INFO, pBlob); + GetReadyToRunHeader()->RegisterSection(ReadyToRunSectionType::InliningInfo, pBlob); } void ZapImage::OutputProfileDataForReadyToRun() { if (m_pInstrumentSection != nullptr) { - GetReadyToRunHeader()->RegisterSection(READYTORUN_SECTION_PROFILEDATA_INFO, m_pInstrumentSection); + GetReadyToRunHeader()->RegisterSection(ReadyToRunSectionType::ProfileDataInfo, m_pInstrumentSection); } } @@ -441,7 +441,7 @@ void ZapImage::OutputManifestMetadataForReadyToRun() { if (m_pMetaDataSection != nullptr) { - GetReadyToRunHeader()->RegisterSection(READYTORUN_SECTION_MANIFEST_METADATA, m_pMetaDataSection); + GetReadyToRunHeader()->RegisterSection(ReadyToRunSectionType::ManifestMetadata, m_pMetaDataSection); } } @@ -491,7 +491,7 @@ void ZapImage::OutputTypesTableForReadyToRun(IMDInternalImport * pMDImport) _ASSERTE(m_pAvailableTypesSection); m_pAvailableTypesSection->Place(pBlob); - GetReadyToRunHeader()->RegisterSection(READYTORUN_SECTION_AVAILABLE_TYPES, pBlob); + GetReadyToRunHeader()->RegisterSection(ReadyToRunSectionType::AvailableTypes, pBlob); } template @@ -754,7 +754,7 @@ void ZapImage::OutputAttributePresenceFilter(IMDInternalImport * pMDImport) _ASSERTE(m_pAttributePresenceSection); m_pAttributePresenceSection->Place(pBlob); - GetReadyToRunHeader()->RegisterSection(READYTORUN_SECTION_ATTRIBUTEPRESENCE, pBlob); + GetReadyToRunHeader()->RegisterSection(ReadyToRunSectionType::AttributePresence, pBlob); } } diff --git a/src/coreclr/src/zap/zapreadytorun.h b/src/coreclr/src/zap/zapreadytorun.h index 1e9ca7f634f46f..8e1eab61a4579c 100644 --- a/src/coreclr/src/zap/zapreadytorun.h +++ b/src/coreclr/src/zap/zapreadytorun.h @@ -19,15 +19,15 @@ class ZapReadyToRunHeader : public ZapNode { struct Section { - DWORD type; - ZapNode * pSection; + ReadyToRunSectionType type; + ZapNode * pSection; }; SArray
m_Sections; static int __cdecl SectionCmp(const void* a_, const void* b_) { - return ((Section*)a_)->type - ((Section*)b_)->type; + return (uint32_t)((Section*)a_)->type - (uint32_t)((Section*)b_)->type; } public: @@ -35,7 +35,7 @@ class ZapReadyToRunHeader : public ZapNode { } - void RegisterSection(DWORD type, ZapNode * pSection) + void RegisterSection(ReadyToRunSectionType type, ZapNode * pSection) { Section section; section.type = type; diff --git a/src/coreclr/tests/bringup_runtest.sh b/src/coreclr/tests/bringup_runtest.sh index 916589f10c6ff9..8b7fa33d122ef6 100755 --- a/src/coreclr/tests/bringup_runtest.sh +++ b/src/coreclr/tests/bringup_runtest.sh @@ -751,68 +751,11 @@ function print_info_from_core_file { fi } -function download_dumpling_script { - echo "Downloading latest version of dumpling script." - wget "https://dumpling.azurewebsites.net/api/client/dumpling.py" - local dumpling_script="dumpling.py" - chmod +x $dumpling_script -} - -function upload_core_file_to_dumpling { - local core_file_name=$1 - local dumpling_script="dumpling.py" - local dumpling_file="local_dumplings.txt" - - # dumpling requires that the file exist before appending. - touch ./$dumpling_file - - if [ ! -x $dumpling_script ]; then - download_dumpling_script - fi - - if [ ! -x $dumpling_script ]; then - echo "Failed to download dumpling script. Dump cannot be uploaded." - return - fi - - echo "Uploading $core_file_name to dumpling service." - - local paths_to_add="" - if [ -d "$coreClrBinDir" ]; then - echo "Uploading CoreCLR binaries with dump." - paths_to_add=$coreClrBinDir - fi - - # Ensure the script has Unix line endings - perl -pi -e 's/\r\n|\n|\r/\n/g' "$dumpling_script" - - # The output from this will include a unique ID for this dump. - ./$dumpling_script "upload" "--dumppath" "$core_file_name" "--incpaths" $paths_to_add "--properties" "Project=CoreCLR" "--squelch" | tee -a $dumpling_file -} - -function preserve_core_file { - local core_file_name=$1 - local storage_location="/tmp/coredumps_coreclr" - - # Create the directory (this shouldn't fail even if it already exists). - mkdir -p $storage_location - - # Only preserve the dump if the directory is empty. Otherwise, do nothing. - # This is a way to prevent us from storing/uploading too many dumps. - if [ ! "$(ls -A $storage_location)" ]; then - echo "Copying core file $core_file_name to $storage_location" - cp $core_file_name $storage_location - - upload_core_file_to_dumpling $core_file_name - fi -} function inspect_and_delete_core_files { # This function prints some basic information from core files in the current - # directory and deletes them immediately. Based on the state of the system, it may - # also upload a core file to the dumpling service. - # (see preserve_core_file). + # directory and deletes them immediately. # Depending on distro/configuration, the core files may either be named "core" # or "core." by default. We will read /proc/sys/kernel/core_uses_pid to @@ -829,11 +772,10 @@ function inspect_and_delete_core_files { # We don't know what the PID of the process was, so let's look at all core # files whose name matches core.NUMBER for f in core.*; do - [[ $f =~ core.[0-9]+ ]] && print_info_from_core_file "$f" $CORE_ROOT/"corerun" && preserve_core_file "$f" && rm "$f" + [[ $f =~ core.[0-9]+ ]] && print_info_from_core_file "$f" $CORE_ROOT/"corerun" && rm "$f" done elif [ -f core ]; then print_info_from_core_file "core" $CORE_ROOT/"corerun" - preserve_core_file "core" rm "core" fi } @@ -1457,11 +1399,6 @@ export __TestEnv=$testEnv cd "$testRootDir" -dumplingsListPath="$testRootDir/dumplings.txt" - -# clean up any existing dumpling remnants from previous runs. -rm -f "$dumplingsListPath" -find $testRootDir -type f -name "local_dumplings.txt" -exec rm {} \; time_start=$(date +"%s") if [ -z "$testDirectories" ] @@ -1484,14 +1421,6 @@ finish_remaining_tests print_results -find $testRootDir -type f -name "local_dumplings.txt" -exec cat {} \; > $dumplingsListPath - -if [ -s $dumplingsListPath ]; then - cat $dumplingsListPath -else - rm $dumplingsListPath -fi - time_end=$(date +"%s") time_diff=$(($time_end-$time_start)) echo "$(($time_diff / 60)) minutes and $(($time_diff % 60)) seconds taken to run CoreCLR tests." diff --git a/src/coreclr/tests/debugger_tests/ScriptGenerator/ScriptGenerator.csproj b/src/coreclr/tests/debugger_tests/ScriptGenerator/ScriptGenerator.csproj index c6be8afa583821..4692942527deba 100644 --- a/src/coreclr/tests/debugger_tests/ScriptGenerator/ScriptGenerator.csproj +++ b/src/coreclr/tests/debugger_tests/ScriptGenerator/ScriptGenerator.csproj @@ -1,4 +1,4 @@ - + Exe diff --git a/src/coreclr/tests/external/external.csproj b/src/coreclr/tests/external/external.csproj index 13383f9a73f31a..b27853bfbf4a72 100644 --- a/src/coreclr/tests/external/external.csproj +++ b/src/coreclr/tests/external/external.csproj @@ -62,6 +62,7 @@ + @@ -77,6 +78,7 @@ + diff --git a/src/coreclr/tests/issues.targets b/src/coreclr/tests/issues.targets index aaf9d7057cda49..ac8e8f9375dd88 100644 --- a/src/coreclr/tests/issues.targets +++ b/src/coreclr/tests/issues.targets @@ -3,103 +3,106 @@ - 19339 + https://github.com/dotnet/runtime/issues/10847 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 3392 + https://github.com/dotnet/runtime/issues/5933 - 11408 + https://github.com/dotnet/runtime/issues/8017 - 20322 + https://github.com/dotnet/runtime/issues/11213 - 6397 + https://github.com/dotnet/runtime/issues/6372 19441;22020 - 20299 + https://github.com/dotnet/runtime/issues/11204 timeout - 27595 + https://github.com/dotnet/runtime/issues/13703 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 - 84 + https://github.com/dotnet/runtime/issues/3893 + + + 32333 @@ -112,10 +115,10 @@ Issue building native components for the test. - 22975 + https://github.com/dotnet/runtime/issues/12166 - 23124 + https://github.com/dotnet/runtime/issues/12216 Unix does not support tailcall helper @@ -176,7 +179,7 @@ needs triage - + https://github.com/dotnet/runtime/issues/ times out @@ -272,7 +275,7 @@ arm32 does not support implicit tailcalls (#13828) - 26105 + https://github.com/dotnet/runtime/issues/13241 Unix arm32 does not support tailcall helper @@ -306,10 +309,10 @@ needs triage - 18895 + https://github.com/dotnet/runtime/issues/10672 - 18989 + https://github.com/dotnet/runtime/issues/10711 needs triage @@ -321,7 +324,7 @@ needs triage - 23124 + https://github.com/dotnet/runtime/issues/12216 arm64 does not support tailcall helper @@ -330,14 +333,14 @@ arm64 does not support tailcall helper - 26491 + https://github.com/dotnet/runtime/issues/13355 - 18056 + https://github.com/dotnet/runtime/issues/10354 Varargs supported on this platform @@ -349,10 +352,10 @@ WindowsXamlManager and DesktopWindowXamlSource are supported for apps targeting Windows version 10.0.18226.0 and later. - 26311 + https://github.com/dotnet/runtime/issues/13296 - 129 + https://github.com/dotnet/runtime/issues/129 @@ -390,199 +393,199 @@ - 20682 + https://github.com/dotnet/runtime/issues/11360 - 20682 + https://github.com/dotnet/runtime/issues/11360 - 20682 + https://github.com/dotnet/runtime/issues/11360 - 20682 + https://github.com/dotnet/runtime/issues/11360 - 20682 + https://github.com/dotnet/runtime/issues/11360 - 20682 + https://github.com/dotnet/runtime/issues/11360 - 20682 + https://github.com/dotnet/runtime/issues/11360 - 20682 + https://github.com/dotnet/runtime/issues/11360 - 22784 + https://github.com/dotnet/runtime/issues/12104 - 20682 + https://github.com/dotnet/runtime/issues/11360 - 23358 + https://github.com/dotnet/runtime/issues/12299 - 23358 + https://github.com/dotnet/runtime/issues/12299 - 23358 + https://github.com/dotnet/runtime/issues/12299 - 23358 + https://github.com/dotnet/runtime/issues/12299 - 23358 + https://github.com/dotnet/runtime/issues/12299 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 - 25428 + https://github.com/dotnet/runtime/issues/12979 @@ -590,67 +593,73 @@ - 15016 + https://github.com/dotnet/runtime/issues/9270 - 15016 + https://github.com/dotnet/runtime/issues/9270 - 15016 + https://github.com/dotnet/runtime/issues/9270 Requires helper-based tailcalls + + https://github.com/dotnet/runtime/issues/31729 + + + https://github.com/dotnet/runtime/issues/31729 + - 9565 + https://github.com/dotnet/runtime/issues/7430 extremely memory/time intensive test - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 15016 + https://github.com/dotnet/runtime/issues/9270 - 9565 + https://github.com/dotnet/runtime/issues/7430 - 9565 + https://github.com/dotnet/runtime/issues/7430 needs triage @@ -745,17 +754,17 @@ Release only crash - 17129 + https://github.com/dotnet/runtime/issues/10001 - 19340 + https://github.com/dotnet/runtime/issues/10848 - 17129 + https://github.com/dotnet/runtime/issues/10001 diff --git a/src/coreclr/tests/runtest.cmd b/src/coreclr/tests/runtest.cmd index 7d5fd923888511..75091108dd12be 100644 --- a/src/coreclr/tests/runtest.cmd +++ b/src/coreclr/tests/runtest.cmd @@ -28,7 +28,6 @@ set __LongGCTests= set __GCSimulatorTests= set __JitDisasm= set __IlasmRoundTrip= -set __CollectDumps= set __DoCrossgen= set __CrossgenAltJit= set __BuildXUnitWrappers= @@ -87,7 +86,6 @@ if /i "%1" == "altjitarch" (set __AltJitArch=%2&shi REM change it to COMPlus_GCStress when we stop using xunit harness if /i "%1" == "gcstresslevel" (set COMPlus_GCStress=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop) -if /i "%1" == "collectdumps" (set __CollectDumps=true&shift&goto Arg_Loop) if /i "%1" == "runincontext" (set RunInUnloadableContext=1&shift&goto Arg_Loop) @@ -269,22 +267,6 @@ if not exist %XunitTestBinBase% ( exit /b 1 ) -if "%__CollectDumps%"=="true" ( - :: Install dumpling - set "__DumplingHelperPath=%__ProjectDir%\..\Tools\DumplingHelper.py" - python "!__DumplingHelperPath!" install_dumpling - - :: Create the crash dump folder if necessary - set "__CrashDumpFolder=%tmp%\CoreCLRTestCrashDumps" - if not exist "!__CrashDumpFolder!" ( - mkdir "!__CrashDumpFolder!" - ) - - :: Grab the current time before execution begins. This will be used to determine which crash dumps - :: will be uploaded. - for /f "delims=" %%a in ('python !__DumplingHelperPath! get_timestamp') do @set __StartTime=%%a -) - echo %__MsgPrefix%CORE_ROOT that will be used is: %CORE_ROOT% echo %__MsgPrefix%Starting test run at %TIME% @@ -292,9 +274,6 @@ set __BuildLogRootName=TestRunResults call :msbuild "%__ProjectFilesDir%\src\runtest.proj" /p:Runtests=true /clp:showcommandline set __errorlevel=%errorlevel% -if "%__CollectDumps%"=="true" ( - python "%__DumplingHelperPath%" collect_dump %errorlevel% "%__CrashDumpFolder%" %__StartTime% "CoreCLR_Tests" -) if %__errorlevel% GEQ 1 ( echo %__MsgPrefix%Test Run failed. Refer to the following: diff --git a/src/coreclr/tests/runtest.py b/src/coreclr/tests/runtest.py index ae407d6e8da636..52a446b8381e61 100755 --- a/src/coreclr/tests/runtest.py +++ b/src/coreclr/tests/runtest.py @@ -801,7 +801,6 @@ def preserve_coredump_file(coredump_name, root_storage_location="/tmp/coredumps_ if os.path.isfile(coredump_name) and not os.listdir(storage_location): print("Copying coredump file %s to %s" % (coredump_name, storage_location)) shutil.copy2(coredump_name, storage_location) - # TODO: Support uploading to dumpling def inspect_and_delete_coredump_file(host_os, arch, coredump_name): """ Prints information from the specified coredump and creates a backup of it @@ -825,9 +824,7 @@ def inspect_and_delete_coredump_files(host_os, arch, test_location): test_location (String) : the folder under which to search for coredumps """ # This function prints some basic information from core files in the current - # directory and deletes them immediately. Based on the state of the system, it may - # also upload a core file to the dumpling service. - # (see preserve_core_file). + # directory and deletes them immediately. # Depending on distro/configuration, the core files may either be named "core" # or "core." by default. We will read /proc/sys/kernel/core_uses_pid to diff --git a/src/coreclr/tests/scripts/ci_perf.py b/src/coreclr/tests/scripts/ci_perf.py deleted file mode 100755 index ecf39d37864b4a..00000000000000 --- a/src/coreclr/tests/scripts/ci_perf.py +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env python3 - -# This script is a simulation of what perf.groovy does in CI. It is not currently used for any official purpose, but I wanted -# to check it in hopes it might be useful to others. - -import ctypes -import json -import argparse -import os -import shutil -import subprocess -import sys -import glob -from sys import version_info - -########################################################################## -# Argument Parser -########################################################################## - -description = 'Tool to simulate CI perf jobs' - -parser = argparse.ArgumentParser(description=description) - -#job arguments -parser.add_argument('-job', dest='job', default=None, required=True, choices=['CoreCLR-Scenarios']) -parser.add_argument('-isPR', dest='isPR', default=True, choices=[True, False]) -parser.add_argument('-arch', dest='arch', default='x64', choices=['x64', 'x86']) -parser.add_argument('-os', dest='operatingSystem', default='Windows_NT', choices=['Windows_NT', 'Ubuntu16.04', 'Ubuntu14.04', 'OSX']) -parser.add_argument('-optLevel', dest='optLevel', default='full_opt', choices=['full_opt', 'min_opt', 'tiered']) -parser.add_argument('-jitName', dest='jitName', default='ryujit', choices=['ryujit']) -parser.add_argument('-benchviewCommitName', dest='benchviewCommitName', default='FAKE_BV_COMMIT_NAME') - -#ambient jenkins properties -parser.add_argument('-workspace', dest='workspace', default=os.path.abspath(os.getcwd())) -parser.add_argument('-gitBranchWithoutOrigin', dest='gitBranchWithoutOrigin', default='FAKE_BRANCHNAME') -parser.add_argument('-gitBranch', dest='gitBranch', default='origin/FAKE_BRANCHNAME') -parser.add_argument('-gitCommit', dest='gitCommit', default='FAKE_GIT_COMMIT') - - - -########################################################################## -# Helper Functions -########################################################################## - -def log(message): - """ Print logging information - Args: - message (str): message to be printed - """ - - print('[%s]: %s' % (sys.argv[0], message)) - -def is_supported_version() -> bool: - """ Checkes that the version of python is at least 3.5 - Returns: - bool : true if python version is 3.5 or higher - """ - return version_info.major > 2 and version_info.minor > 4 - -def run_command(runArgs, environment): - """ Run command specified by runArgs - Args: - runargs (str[]): list of arguments for subprocess - environment(str{}): dict of environment variable - """ - log('RUNNING COMMAND: ' + runArgs) - subprocess.check_call(runArgs, env=environment) - -########################################################################## -# CI jobs -########################################################################## - -class jenkins_properties: - def __init__(self, workspace, git_branch_without_origin, git_branch, git_commit): - self.workspace = workspace - self.git_branch_without_origin = git_branch_without_origin - self.git_branch = git_branch - self.git_commit = git_commit - - -class coreclr_scenarios_args: - def __init__(self, is_pr, arch, os, jit_name, opt_level, benchview_commit_name): - self.is_pr = is_pr - self.arch = arch - self.os = os - self.jit_name = jit_name - self.opt_level = opt_level - self.benchview_commit_name = benchview_commit_name - -def coreclr_scenarios(args, props): - architecture = args.arch - testEnv = '' - configuration = 'Release' - runType = 'private' if args.is_pr else 'rolling' - benchViewName = 'CoreCLR-Scenarios private ' + args.benchview_commit_name if args.is_pr else 'CoreCLR-Scenarios rolling ' + props.git_branch_without_origin + ' ' + props.git_commit - uploadString = '' - - run_command('powershell -NoProfile wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile \"' + props.workspace + '\\nuget.exe\"', os.environ) - if os.path.isdir(props.workspace + '\\Microsoft.BenchView.JSONFormat'): - shutil.rmtree(props.workspace + '\\Microsoft.BenchView.JSONFormat') - run_command('\"' + props.workspace + '\\nuget.exe\" install Microsoft.BenchView.JSONFormat -Source http://benchviewtestfeed.azurewebsites.net/nuget -OutputDirectory \"' + props.workspace + '\" -Prerelease -ExcludeVersion', os.environ) - run_command('py \"' + props.workspace + '\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"' + benchViewName + '\" --user-email \"dotnet-bot@microsoft.com\"', os.environ) - run_command('py \"' + props.workspace + '\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch ' + props.git_branch_without_origin + ' --type ' + runType, os.environ) - run_command('py \"' + props.workspace + '\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"', os.environ) - run_command('cmd.exe /c set __TestIntermediateDir=int&&build.cmd ' + configuration + ' ' + architecture, os.environ) - run_command('tests\\runtest.cmd ' + configuration + ' ' + architecture + ' GenerateLayoutOnly', os.environ) - - runXUnitPerfCommonArgs = '-arch ' + args.arch + ' -configuration ' + configuration + ' -os ' + args.os + ' -generateBenchviewData \"' + props.workspace + '\\Microsoft.Benchview.JSONFormat\\tools\"' + uploadString + ' -runtype ' + runType + ' ' + testEnv + ' -optLevel ' + args.opt_level + ' -jitName ' + args.jit_name + ' -outputdir \"' + props.workspace + '\\bin\\sandbox_logs\" -stabilityPrefix \"START \\\"CORECLR_PERF_RUN\\\" /B /WAIT /HIGH\" -scenarioTest' - - # Profile=Off - run_command('py tests\\scripts\\run-xunit-perf.py ' + runXUnitPerfCommonArgs + ' -testBinLoc bin\\tests\\' + args.os + '.' + architecture + '.' + configuration + '\\performance\\Scenario\\JitBench -group CoreCLR-Scenarios', os.environ) - - # Profile=On - if(args.opt_level != 'min_opt'): - run_command('py tests\\scripts\\run-xunit-perf.py ' + runXUnitPerfCommonArgs + ' -testBinLoc bin\\tests\\' + args.os + '.' + architecture + '.' + configuration + '\\performance\\Scenario\\JitBench -group CoreCLR-Scenarios -collectionFlags BranchMispredictions+CacheMisses+InstructionRetired', os.environ) - - -########################################################################## -# Main -########################################################################## - -def main(args): - if not is_supported_version(): - log("Python 3.5 or newer is required") - return 1 - - cwd = os.getcwd() - if(os.path.abspath(args.workspace) != cwd): - log('ERROR: the working directory must be the same as the workspace') - return 2 - if(not os.path.isfile(os.path.join(args.workspace, 'perf.groovy'))): - log('ERROR: the workspace must point to the root of the repo') - return 3 - if(not ctypes.windll.shell32.IsUserAnAdmin()): - log('ERROR: this script must be run as an admin because perf jobs use ETW') - return 4 - - log("NOTICE: This script is a simulation of what CI runs, but it is never actually invoked by CI. The real logic for CI currently resides in perf.groovy. " + - "This script is only provided in hopes it might be useful to repro CI issues outside of CI") - log("") - - log('== ARGUMENTS ==') - log('job: %s' % args.job) - - # Jenkins properties available in all jobs - log('workspace: %s' % args.workspace) - log('git_branch_without_origin: %s' % args.gitBranchWithoutOrigin) - log('git_branch: %s' % args.gitBranch) - log('git_commit: %s' % args.gitCommit) - props = jenkins_properties(args.workspace, args.gitBranchWithoutOrigin, args.gitBranch, args.gitCommit) - - - if(args.job == 'CoreCLR-Scenarios'): - log('isPR: %s' % args.isPR) - log('arch: %s' % args.arch) - log('operatingSystem: %s' % args.operatingSystem) - log('jitName: %s' % args.jitName) - log('optLevel: %s' % args.optLevel) - log('benchviewCommitName: %s' % args.benchviewCommitName) - log('') - log('== RUNNING JOB ==') - job_args = coreclr_scenarios_args(args.isPR, args.arch, args.operatingSystem, args.jitName, args.optLevel, args.benchviewCommitName) - coreclr_scenarios(job_args, props) - - else: - log('Unrecognized job argument: ' + args.job) - - return 0 - - - -if __name__ == "__main__": - Args = parser.parse_args(sys.argv[1:]) - sys.exit(main(Args)) diff --git a/src/coreclr/tests/scripts/migrate-tags.py b/src/coreclr/tests/scripts/migrate-tags.py index e780bccb5f36c4..77223a378ef831 100644 --- a/src/coreclr/tests/scripts/migrate-tags.py +++ b/src/coreclr/tests/scripts/migrate-tags.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python # ## Licensed to the .NET Foundation under one or more agreements. ## The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/coreclr/tests/scripts/perf-prep.sh b/src/coreclr/tests/scripts/perf-prep.sh deleted file mode 100755 index 2916a4b46d0900..00000000000000 --- a/src/coreclr/tests/scripts/perf-prep.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env bash - -function print_usage { - echo '' - echo 'CoreCLR perf test environment set up script on Linux.' - echo '' - echo 'Typical command line:' - echo '' - echo 'coreclr/tests/scripts/perf-perp.sh' - echo ' --repo="dotnet_coreclr"' - echo '' - echo 'Required arguments:' - echo ' --branch= : branch where coreclr/corefx/test bits are copied from (e.g. dotnet_coreclr).' - echo 'Optional arguments:' - echo ' --throughput : if we are running setup for a throughput run.' -} - -# Exit code constants -readonly EXIT_CODE_SUCCESS=0 # Script ran normally. - -# Argument variables -perfArch="x64" -perfConfig="Release" -perfBranch="master" -perfRepo= -throughput=0 -nocorefx=0 - -for i in "$@" -do - case $i in - -h|--help) - print_usage - exit $EXIT_CODE_SUCCESS - ;; - --repo=*) - perfRepo=${i#*=} - ;; - --branch=*) - perfBranch=${i#*=} - ;; - -t|--throughput) - throughput=1 - ;; - --nocorefx) - nocorefx=1 - ;; - --arch=*) - perfArch=${i#*=} - ;; - *) - echo "Unknown switch: $i" - print_usage - exit $EXIT_CODE_SUCCESS - ;; - esac -done - -perfRepo="dotnet_coreclr" -echo "repo = $perfRepo" -echo "branch = $perfBranch" -echo "architecture = $perfArch" -echo "configuration = $perfConfig" - -# Since not all perf machines have Mono we cannot run nuget locally to get the Benchview tools -# Instead we curl the package feed and use grep and sed to find the newest package. -# We grep for content type and that returns us strings that contain the path to the nupkg -# Then we match only the last line using '$' and use the s command to replace the entire line -# with what we find inside of the quotes after src=. We then jump to label x on a match and if -# we don't match we delete the line. This returns just the address of the last nupkg to curl. - -if [ ! -d "./tests/scripts/Microsoft.Benchview.JSONFormat" ]; then - curl "http://benchviewtestfeed.azurewebsites.net/nuget/FindPackagesById()?id='Microsoft.BenchView.JSONFormat'" | grep "content type" | sed "$ s/.*src=\"\([^\"]*\)\".*/\1/;tx;d;:x" | xargs curl -o benchview.zip - unzip -q -o benchview.zip -d ./tests/scripts/Microsoft.BenchView.JSONFormat -fi - -# Install python 3.5.2 to run machinedata.py for machine data collection -if [ $perfArch == "arm" ]; then - python3.6 --version - python3.6 ./tests/scripts/Microsoft.BenchView.JSONFormat/tools/machinedata.py --machine-manufacturer NVIDIA -else - python3 --version - python3 ./tests/scripts/Microsoft.BenchView.JSONFormat/tools/machinedata.py -fi - -if [ $throughput -eq 1 ]; then - # Download throughput benchmarks - if [ ! -d "Microsoft.Benchview.ThroughputBenchmarks.x64.Windows_NT" ]; then - mkdir Microsoft.Benchview.ThroughputBenchmarks.x64.Windows_NT - cd Microsoft.Benchview.ThroughputBenchmarks.x64.Windows_NT - - curl -OL https://dotnet.myget.org/F/dotnet-core/api/v2/package/Microsoft.Benchview.ThroughputBenchmarks.x64.Windows_NT/1.0.0 - mv 1.0.0 1.0.0.zip - unzip -q 1.0.0.zip - fi - -else - if [ $nocorefx -eq 0 ]; then - # Corefx components. We now have full stack builds on all distros we test here, so we can copy straight from CoreFX jobs. - echo "Downloading corefx" - mkdir corefx - curl https://ci.dot.net/job/dotnet_corefx/job/master/job/ubuntu14.04_release/lastSuccessfulBuild/artifact/bin/build.tar.gz -o ./corefx/build.tar.gz - - # Unpack the corefx binaries - pushd corefx > /dev/null - tar -xf build.tar.gz - rm build.tar.gz - popd > /dev/null - fi - - # If the tests don't already exist, download them. - if [ ! -d "bin" ]; then - echo "Making bin dir" - mkdir bin - fi - - if [ ! -d "bin/tests" ]; then - echo "Making bin/tests" - mkdir bin/tests - fi - - if [ ! -d "bin/tests/Windows_NT.$perfArch.$perfConfig" ]; then - echo "Downloading tests" - curl https://ci.dot.net/job/$perfRepo/job/$perfBranch/job/release_windows_nt/lastSuccessfulBuild/artifact/bin/tests/tests.zip -o tests.zip - echo "unzip tests to ./bin/tests/Windows_NT.$perfArch.$perfConfig" - unzip -q -o tests.zip -d ./bin/tests/Windows_NT.$perfArch.$perfConfig || exit 0 - fi -fi diff --git a/src/coreclr/tests/scripts/run-throughput-perf.py b/src/coreclr/tests/scripts/run-throughput-perf.py deleted file mode 100644 index 3c86748dbc41da..00000000000000 --- a/src/coreclr/tests/scripts/run-throughput-perf.py +++ /dev/null @@ -1,468 +0,0 @@ -#!/usr/bin/env python -# -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. -# -########################################################################## -########################################################################## -# -# Module: run-throughput-tests.py -# -# Notes: runs throughput testing for coreclr and uploads the timing results -# to benchview -# -# -########################################################################## -########################################################################## - -import argparse -import distutils.dir_util -import os -import re -import shutil -import subprocess -import sys -import time -import timeit -import stat -import csv - -########################################################################## -# Globals -########################################################################## - -# List of dlls we want to exclude -dll_exclude_list = { - 'All': [ - # Require Newtonsoft.Json - "Microsoft.DotNet.ProjectModel.dll", - "Microsoft.Extensions.DependencyModel.dll", - # Require System.Security.Principal.Windows - "System.Net.Requests.dll", - "System.Net.Security.dll", - "System.Net.Sockets.dll", - # Moving target. Not a reliable measurement - "System.Private.CoreLib.dll", - # Reference and forwarding assemblies - "System.AppContext.dll", - "System.Diagnostics.Contracts.dll", - "System.Dynamic.Runtime.dll", - "System.Globalization.dll", - "System.Globalization.Calendars.dll", - "System.IO.dll", - "System.IO.FileSystem.Primitives.dll", - "System.Reflection.dll", - "System.Reflection.Emit.dll", - "System.Reflection.Emit.ILGeneration.dll", - "System.Reflection.Emit.Lightweight.dll", - "System.Reflection.Extensions.dll", - "System.Reflection.Primitives.dll", - "System.Resources.ResourceManager.dll", - "System.Runtime.Handles.dll", - "System.Runtime.Loader.dll", - "System.Runtime.Serialization.Json.dll", - "System.Runtime.Serialization.Xml.dll", - "System.Security.Principal.dll", - "System.Text.Encoding.dll", - "System.Text.Encoding.Extensions.dll", - "System.Threading.ThreadPool.dll", - "System.Threading.Timer.dll", - "System.Xml.ReaderWriter.dll", - "System.Xml.XDocument.dll", - "System.Xml.XmlDocument.dll", - "System.Xml.XmlSerializer.dll", - "System.Xml.XPath.dll" - ], - 'Windows_NT': [ - ], - 'Linux' : [ - ] -} - -jit_list = { - 'Windows_NT': { - 'x64': 'clrjit.dll', - 'x86': 'clrjit.dll', - 'x86lb': 'legacyjit.dll' - }, - 'Linux': { - 'x64': 'libclrjit.so', - 'arm': 'libclrjit.so' - } -} - -os_group_list = { - 'Windows_NT': 'Windows_NT', - 'Ubuntu14.04': 'Linux', - 'Ubuntu16.04': 'Linux' -} - -########################################################################## -# Argument Parser -########################################################################## - -description = 'Tool to collect throughtput performance data' - -parser = argparse.ArgumentParser(description=description) - -parser.add_argument('-arch', dest='arch', default='x64') -parser.add_argument('-configuration', dest='build_type', default='Release') -parser.add_argument('-run_type', dest='run_type', default='rolling') -parser.add_argument('-os', dest='operating_system', default='Windows_NT') -parser.add_argument('-clr_root', dest='clr_root', default=None) -parser.add_argument('-assembly_root', dest='assembly_root', default=None) -parser.add_argument('-benchview_path', dest='benchview_path', default=None) -parser.add_argument('-iterations', dest='iterations', default=5, type=int) -parser.add_argument('-opt_level', dest='opt_level', default='full_opt') -parser.add_argument('-jit_name', dest='jit_name', default='ryujit') -parser.add_argument('-nopgo', dest='no_pgo', default=False, action='store_true') - -########################################################################## -# Helper Functions -########################################################################## - -def validate_args(args): - """ Validate all of the arguments parsed. - Args: - args (argparser.ArgumentParser): Args parsed by the argument parser. - Returns: - (arch, build_type, clr_root, fx_root, fx_branch, fx_commit, env_script) - (str, str, str, str, str, str, str) - Notes: - If the arguments are valid then return them all in a tuple. If not, raise - an exception stating x argument is incorrect. - """ - - arch = args.arch - build_type = args.build_type - run_type = args.run_type - operating_system = args.operating_system - clr_root = args.clr_root - assembly_root = args.assembly_root - benchview_path = args.benchview_path - iterations = args.iterations - opt_level = args.opt_level.lower() - jit_name = args.jit_name.lower() - no_pgo = args.no_pgo - - def validate_arg(arg, check): - """ Validate an individual arg - Args: - arg (str|bool): argument to be validated - check (lambda: x-> bool): test that returns either True or False - : based on whether the check passes. - - Returns: - is_valid (bool): Is the argument valid? - """ - - helper = lambda item: item is not None and check(item) - - if not helper(arg): - raise Exception('Argument: %s is not valid.' % (arg)) - - valid_archs = {'Windows_NT': ['x86', 'x64'], 'Linux': ['x64', 'arm']} - valid_build_types = ['Release'] - valid_run_types = ['rolling', 'private'] - valid_os = ['Windows_NT', 'Ubuntu14.04', 'Ubuntu16.04'] - valid_opt_levels = ['full_opt', 'min_opt'] - valid_jit_names = ['ryujit'] - - arch = next((a for a in valid_archs if a.lower() == arch.lower()), arch) - build_type = next((b for b in valid_build_types if b.lower() == build_type.lower()), build_type) - - validate_arg(operating_system, lambda item: item in valid_os) - - os_group = os_group_list[operating_system] - - validate_arg(arch, lambda item: item in valid_archs[os_group]) - validate_arg(build_type, lambda item: item in valid_build_types) - validate_arg(run_type, lambda item: item in valid_run_types) - validate_arg(iterations, lambda item: item > 0) - validate_arg(opt_level, lambda item: item in valid_opt_levels) - validate_arg(jit_name, lambda item: item in valid_jit_names) - - if clr_root is None: - raise Exception('--clr_root must be set') - else: - clr_root = os.path.normpath(clr_root) - validate_arg(clr_root, lambda item: os.path.isdir(clr_root)) - - if assembly_root is None: - raise Exception('--assembly_root must be set') - else: - assembly_root = os.path.normpath(assembly_root) - validate_arg(assembly_root, lambda item: os.path.isdir(assembly_root)) - - if not benchview_path is None: - benchview_path = os.path.normpath(benchview_path) - validate_arg(benchview_path, lambda item: os.path.isdir(benchview_path)) - - args = (arch, operating_system, os_group, build_type, run_type, clr_root, assembly_root, benchview_path, iterations, opt_level, jit_name, no_pgo) - - # Log configuration - log('Configuration:') - log(' arch: %s' % arch) - log(' os: %s' % operating_system) - log(' os_group: %s' % os_group) - log(' build_type: %s' % build_type) - log(' opt_level: %s' % opt_level) - log(' jit_name: %s' % jit_name) - log(' no_pgo: %s' % no_pgo) - log(' run_type: %s' % run_type) - log(' iterations: %d' % iterations) - log(' clr_root: %s' % clr_root) - log(' assembly_root: %s' % assembly_root) - if not benchview_path is None: - log('benchview_path : %s' % benchview_path) - - return args - -def nth_dirname(path, n): - """ Find the Nth parent directory of the given path - Args: - path (str): path name containing at least N components - n (int): num of basenames to remove - Returns: - outpath (str): path with the last n components removed - Notes: - If n is 0, path is returned unmodified - """ - - assert n >= 0 - - for i in range(0, n): - path = os.path.dirname(path) - - return path - -def del_rw(action, name, exc): - os.chmod(name, stat.S_IWRITE) - os.remove(name) - -def log(message): - """ Print logging information - Args: - message (str): message to be printed - """ - - print('[%s]: %s' % (sys.argv[0], message)) - -def generateCSV(dll_name, dll_runtimes): - """ Write throuput performance data to a csv file to be consumed by measurement.py - Args: - dll_name (str): the name of the dll - dll_runtimes (float[]): A list of runtimes for each iteration of the performance test - """ - - csv_file_name = "throughput-%s.csv" % (dll_name) - csv_file_path = os.path.join(os.getcwd(), csv_file_name) - - with open(csv_file_path, 'w') as csvfile: - output_file = csv.writer(csvfile, delimiter=',', lineterminator='\n') - - for iteration in dll_runtimes: - output_file.writerow(["default", "coreclr-crossgen-tp", dll_name, iteration]) - - return csv_file_name - -def runIterations(dll_name, dll_path, iterations, crossgen_path, jit_path, assemblies_path, opt_level, jit_name): - """ Run throughput testing for a given dll - Args: - dll_name: the name of the dll - dll_path: the path to the dll - iterations: the number of times to run crossgen on the dll - crossgen_path: the path to crossgen - jit_path: the path to the jit - assemblies_path: the path to the assemblies that may be needed for the crossgen run - Returns: - dll_elapsed_times: a list of the elapsed times for the dll - """ - - dll_elapsed_times = [] - - # Set up arguments for running crossgen - run_args = [crossgen_path, - '/JITPath', - jit_path, - '/Platform_Assemblies_Paths', - assemblies_path, - dll_path - ] - - my_env = os.environ - - if opt_level == 'min_opt': - my_env['COMPlus_JITMinOpts'] = '1' - - log(" ".join(run_args)) - - # Time.clock() returns seconds, with a resolution of 0.4 microseconds, so multiply by the multiplier to get milliseconds - multiplier = 1000 - - for iteration in range(0,iterations + 1): - proc = subprocess.Popen(run_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env) - - start_time = timeit.default_timer() - (out, err) = proc.communicate() - end_time = timeit.default_timer() - - if proc.returncode == 0: - # Calculate the runtime - elapsed_time = (end_time - start_time) * multiplier - dll_elapsed_times.append(elapsed_time) - else: - log("Error in %s" % (dll_name)) - log(err.decode("utf-8")) - - return dll_elapsed_times - -########################################################################## -# Main -########################################################################## - -def main(args): - global dll_exclude_list - global jit_list - global os_group_list - - architecture, operating_system, os_group, build_type, run_type, clr_root, assembly_root, benchview_path, iterations, opt_level, jit_name, no_pgo = validate_args(args) - arch = architecture - - pgo_string = 'pgo' - - if no_pgo: - pgo_string = 'nopgo' - - current_dir = os.getcwd() - jit = jit_list[os_group][architecture] - crossgen = 'crossgen' - - if os_group == 'Windows_NT': - crossgen += '.exe' - - # Make sandbox - sandbox_path = os.path.join(clr_root, "sandbox") - if os.path.isdir(sandbox_path): - shutil.rmtree(sandbox_path, onerror=del_rw) - - os.makedirs(sandbox_path) - os.chdir(sandbox_path) - - # Set up paths - bin_path = os.path.join(clr_root, 'bin', 'Product', os_group + '.' + arch + '.' + build_type) - - crossgen_path = os.path.join(bin_path,crossgen) - jit_path = os.path.join(bin_path, jit) - - # Replace assembly_root's System.Private.CoreLib with built System.Private.CoreLib. - shutil.copyfile(os.path.join(bin_path, 'System.Private.CoreLib.dll'), os.path.join(assembly_root, 'System.Private.CoreLib.dll')) - - python_exe = sys.executable - - # Run throughput testing - for dll_file_name in os.listdir(assembly_root): - # Find all framework dlls in the assembly_root dir, which we will crossgen - if (dll_file_name.endswith(".dll") and - (not ".ni." in dll_file_name) and - ("Microsoft" in dll_file_name or "System" in dll_file_name) and - (not dll_file_name in dll_exclude_list[os_group]) and - (not dll_file_name in dll_exclude_list["All"])): - dll_name = dll_file_name.replace(".dll", "") - dll_path = os.path.join(assembly_root, dll_file_name) - dll_elapsed_times = runIterations(dll_file_name, dll_path, iterations, crossgen_path, jit_path, assembly_root, opt_level, jit_name) - - if len(dll_elapsed_times) != 0: - if not benchview_path is None: - # Generate the csv file - csv_file_name = generateCSV(dll_name, dll_elapsed_times) - shutil.copy(csv_file_name, clr_root) - - # For each benchmark, call measurement.py - measurement_args = [python_exe, - os.path.join(benchview_path, "measurement.py"), - "csv", - os.path.join(os.getcwd(), csv_file_name), - "--metric", - "execution_time", - "--unit", - "milliseconds", - "--better", - "desc", - "--drop-first-value", - "--append"] - log(" ".join(measurement_args)) - proc = subprocess.Popen(measurement_args) - proc.communicate() - else: - # Write output to console if we are not publishing - log("%s" % (dll_name)) - log("Duration: [%s]" % (", ".join(str(x) for x in dll_elapsed_times[1:]))) - - # Upload the data - if not benchview_path is None: - # Call submission.py - submission_args = [python_exe, - os.path.join(benchview_path, "submission.py"), - "measurement.json", - "--build", - os.path.join(clr_root, "build.json"), - "--machine-data", - os.path.join(clr_root, "machinedata.json"), - "--metadata", - os.path.join(clr_root, "submission-metadata.json"), - "--group", - "CoreCLR-throughput", - "--type", - run_type, - "--config-name", - build_type, - "--config", - "Configuration", - build_type, - "--config", - "OS", - operating_system, - "--config", - "OptLevel", - opt_level, - "--config", - "JitName", - jit_name, - "--config", - "PGO", - pgo_string, - "--architecture", - architecture, - "--machinepool", - "PerfSnake" - ] - log(" ".join(submission_args)) - proc = subprocess.Popen(submission_args) - proc.communicate() - if proc.returncode != 0: - os.chdir(current_dir) - return -1 - - # Call upload.py - upload_args = [python_exe, - os.path.join(benchview_path, "upload.py"), - "submission.json", - "--container", - "coreclr" - ] - log(" ".join(upload_args)) - proc = subprocess.Popen(upload_args) - proc.communicate() - if proc.returncode != 0: - os.chdir(current_dir) - return -1 - - os.chdir(current_dir) - - return 0 - -if __name__ == "__main__": - Args = parser.parse_args(sys.argv[1:]) - main(Args) diff --git a/src/coreclr/tests/scripts/run-xunit-perf.py b/src/coreclr/tests/scripts/run-xunit-perf.py deleted file mode 100755 index b808deb77c0a05..00000000000000 --- a/src/coreclr/tests/scripts/run-xunit-perf.py +++ /dev/null @@ -1,529 +0,0 @@ -#!/usr/bin/env python3 - -import json -import argparse -import os -import shutil -import subprocess -import sys -import glob -from sys import version_info - -########################################################################## -# Argument Parser -########################################################################## - -description = 'Tool to run coreclr perf tests' - -parser = argparse.ArgumentParser(description=description) - -parser.add_argument('-testBinLoc', dest='coreclrPerf', default=None, required=True) -parser.add_argument('-assemblyName', dest='assemblyName', default=None) -parser.add_argument('-arch', dest='arch', default='x64', choices=['x64', 'x86']) -parser.add_argument('-os', dest='operatingSystem', default=sys.platform, choices=['Windows_NT', 'Ubuntu16.04', 'Ubuntu14.04', 'OSX', sys.platform]) -parser.add_argument('-configuration', dest='configuration', default='Release', choices=['Release', 'Checked', 'Debug']) -parser.add_argument('-optLevel', dest='optLevel', default='full_opt', choices=['full_opt', 'min_opt', 'tiered']) -parser.add_argument('-jitName', dest='jitName', default='ryujit') -parser.add_argument('-runtype', dest='runType', default='local', choices=['local', 'private', 'rolling']) -parser.add_argument('-noPgo', dest='isPgoOptimized', action='store_false', default=True) -parser.add_argument('-scenarioTest', dest='isScenarioTest', action='store_true', default=False) -parser.add_argument('-stabilityPrefix', dest='stabilityPrefix', default=None) -parser.add_argument('-uploadToBenchview', dest='uploadToBenchview', action='store_true', default=False) -parser.add_argument('-generateBenchviewData', dest='benchviewPath', default=None) -parser.add_argument('-slice', dest='sliceNumber', default=-1, type=int) -parser.add_argument('-sliceConfigFile', dest='sliceConfigFile', default=None) -parser.add_argument('-nowarmup', dest='hasWarmupRun', action='store_false', default=True) -parser.add_argument('-better', dest='better', default='desc') -parser.add_argument('-collectionFlags', dest='collectionFlags', default='stopwatch') -parser.add_argument('-library', dest='library', action='store_true', default=False) -parser.add_argument('-group', dest='benchviewGroup', default='CoreCLR') -parser.add_argument('-outputdir', dest='outputDir', default=None) - -########################################################################## -# Helper Functions -########################################################################## - -def validate_args(args): - """ Validate all of the arguments parsed. - Args: - args (argparser.ArgumentParser): Args parsed by the argument parser. - Returns: - (arch, build_type, clr_root, fx_root, fx_branch, fx_commit, env_script) - (str, str, str, str, str, str, str) - Notes: - If the arguments are valid then return them all in a tuple. If not, raise - an exception stating x argument is incorrect. - """ - - def validate_arg(arg, check): - """ Validate an individual arg - Args: - arg (str|bool): argument to be validated - check (lambda: x-> bool): test that returns either True or False - : based on whether the check passes. - - Returns: - is_valid (bool): Is the argument valid? - """ - - helper = lambda item: item is not None and check(item) - - if not helper(arg): - raise ValueError('Argument: %s is not valid.' % (arg)) - - coreclrPerf = os.path.join(os.getcwd(), args.coreclrPerf) - validate_arg(coreclrPerf, lambda item: os.path.isdir(item)) - if(args.assemblyName != None): - validate_arg(args.assemblyName, lambda item: os.path.isfile(os.path.join(coreclrPerf, item))) - - if args.benchviewPath is not None: - validate_arg(args.benchviewPath, lambda item: os.path.isdir(item)) - if args.sliceNumber != -1: - validate_arg(args.sliceConfigFile, lambda item: os.path.isfile(item)) - - log('Args:') - log('arch: %s' % args.arch) - log('operatingSystem: %s' % args.operatingSystem) - log('jitName: %s' % args.jitName) - log('optLevel: %s' % args.optLevel) - log('coreclrPerf: %s' % coreclrPerf) - log('assemblyName: %s' % args.assemblyName) - log('better: %s' % args.better) - log('runType: %s' % args.runType) - log('configuration: %s' % args.configuration) - if args.benchviewPath is not None: - log('benchviewPath: %s' % args.benchviewPath) - if args.sliceNumber != -1: - log('sliceNumber: %s' % args.sliceNumber) - log('sliceConfigFile: %s' % args.sliceConfigFile) - if args.outputDir is not None: - log('outputDir: %s' % args.outputDir) - if args.stabilityPrefix is not None: - log('stabilityPrefix: %s' % args.stabilityPrefix) - log('isScenarioTest: %s' % args.isScenarioTest) - log('isPgoOptimized: %s' % args.isPgoOptimized) - log('benchviewGroup: %s' % args.isScenarioTest) - log('hasWarmupRun: %s' % args.hasWarmupRun) - log('library: %s' % args.library) - log('collectionFlags: %s' % args.collectionFlags) - log('uploadToBenchview: %s' % args.uploadToBenchview) - - return (coreclrPerf, args.assemblyName, args.arch, args.operatingSystem, args.configuration, args.jitName, args.optLevel, args.runType, args.outputDir, args.stabilityPrefix, args.isScenarioTest, args.benchviewPath, args.isPgoOptimized, args.benchviewGroup, args.hasWarmupRun, args.collectionFlags, args.library, args.uploadToBenchview, args.better, args.sliceNumber, args.sliceConfigFile) - -def log(message): - """ Print logging information - Args: - message (str): message to be printed - """ - - print('[%s]: %s' % (sys.argv[0], message)) - -def is_supported_version() -> bool: - """ Checkes that the version of python is at least 3.5 - Returns: - bool : true if python version is 3.5 or higher - """ - return version_info.major > 2 and version_info.minor > 4 - -def copytree(src, dst): - """ Copy the entire tree found in src to dest - Args: - src (str): path to the source directory - dst (str): path to the destination directory - """ - for item in os.listdir(src): - s = os.path.join(src, item) - d = os.path.join(dst, item) - if os.path.isdir(s): - shutil.copytree(s, d) - else: - shutil.copy2(s, d) - -def run_command(runArgs, environment, errorMessage): - """ Run command specified by runArgs - Args: - runargs (str[]): list of arguments for subprocess - environment(str{}): dict of environment variable - errorMessage(str): message to print if there is an error - """ - log('') - log(" ".join(runArgs)) - - try: - subprocess.check_output(runArgs, stderr=subprocess.PIPE, env=environment) - except subprocess.CalledProcessError as e: - log(errorMessage) - log(e.output.decode('utf-8')) - raise - -########################################################################## -# Execution Functions -########################################################################## - -def run_benchmark(benchname, benchdir, env, sandboxDir, benchmarkOutputDir, testFileExt, stabilityPrefix, collectionFlags, lvRunId, isScenarioTest, arch, extension, executable): - """ Run perf benchmark - Args: - benchname (str): name of the benchmark - benchdir (srr): path to the benchmark - env (str{}): environment for the benchmark - sandboxDir (str): path to the sandbox - benchmarkOutputDir (str): directory where we should save output of the benchmark - testFileExt (str): extension of the benchmark - stabilityPrefix (str): stability prefix to run the benchmark under - collectionFlags (str): data to collect - lvRunId (str): ID of the benchmark - isScenarioTest (bool): if the benchmark is a scenario - arch (str): arch of the benchmark - extension (str): extension for corerun (.exe for windows, empty string for non-windows) - executable (str[]): executable to run benchmark under (cmd /c for windows, empty for non-windows) - - Returns: 0 if benchmark passed, 1 if benchmark failed - """ - myEnv = dict(env) - benchnameWithExt = benchname + '.' + testFileExt - fullPath = os.path.join(benchdir, benchnameWithExt) - - # Copy all files in the benchmark directory to the sandbox - files = glob.iglob(os.path.join(benchdir, "*.*")) - for filename in files: - if os.path.isfile(filename): - shutil.copy2(filename, sandboxDir) - - myEnv['CORE_ROOT'] = sandboxDir - - benchnameLogFileName = os.path.join(benchmarkOutputDir, lvRunId + '-' + benchname + '.log') - - if not os.path.isdir(benchmarkOutputDir): - os.makedirs(benchmarkOutputDir) - - log('') - log('--------') - log('Running %s %s' % (lvRunId, benchname)) - log('--------') - log('') - - lvCommonArgs = [os.path.join(sandboxDir, benchnameWithExt), - '--perf:outputdir', - benchmarkOutputDir, - '--perf:runid', - lvRunId] - - if isScenarioTest: - lvCommonArgs += ['--target-architecture', - arch] - else: - lvCommonArgs.insert(0, 'PerfHarness.dll') - - splitPrefix = [] if stabilityPrefix is None else stabilityPrefix.split() - runArgs = executable + splitPrefix + [os.path.join(sandboxDir, 'corerun' + extension)] + lvCommonArgs + ['--perf:collect', collectionFlags] - log(" ".join(runArgs)) - - error = 0 - with open(benchnameLogFileName, 'wb') as out: - proc = subprocess.Popen(' '.join(runArgs), shell=True, stdout=out, stderr=out, env=myEnv) - proc.communicate() - if proc.returncode != 0: - error = proc.returncode - - if error != 0: - log("CoreRun.exe exited with %s code" % (error)) - if os.path.isfile(benchnameLogFileName): - with open(benchnameLogFileName, 'r') as f: - print(f.read()) - return 1 - - return 0 - -def generate_results_for_benchview(python, lvRunId, benchname, isScenarioTest, better, hasWarmupRun, benchmarkOutputDir, benchviewPath): - """ Generates results to be uploaded to benchview using measurement.py - Args: - python (str): python executable - lvRunId (str): ID for the benchmark run - isScenarioTest (bool): if the benchmark was a scenario - better (str): how to order results - hasWarmupRun (bool): if there was a warmup run - benchmarkOutputDir (str): path to where benchmark results were written - benchviewPath (str): path to benchview tools - """ - benchviewMeasurementParser = 'xunitscenario' if isScenarioTest else 'xunit' - lvMeasurementArgs = [benchviewMeasurementParser, - '--better', - better] - if hasWarmupRun: - lvMeasurementArgs = lvMeasurementArgs + ['--drop-first-value'] - - lvMeasurementArgs = lvMeasurementArgs + ['--append'] - - files = glob.iglob(os.path.join(benchmarkOutputDir, "*.xml")) - for filename in files: - runArgs = [python, os.path.join(benchviewPath, 'measurement.py')] + lvMeasurementArgs + [filename] - run_command(runArgs, os.environ, 'Call to %s failed' % runArgs[1]) - -def upload_to_benchview(python, coreclrRepo, benchviewPath, uploadToBenchview, benchviewGroup, runType, configuration, operatingSystem, etwCollection, optLevel, jitName, pgoOptimized, architecture): - """ Upload results to benchview - Args: - python (str): python executable - coreclrRepo (str): directory where build.json, machinedata.json and submission-metadata.json were written - benchviewPath (str): path to benchview tools - benchviewGroup (str): group to upload to - runType (str): type of run this was (rolling, private) - configuration (str): configuration of the build (Release, Checked, etc) - operatingSystem (str): operating system of the run - etwCollection (str): collection type (On or Off) - optLevl (str): optimization level (full_opt, min_opt, tiered) - jitName (str): jit type (ryujit, etc) - pgoOptimized (str): if the run was with pgo optimizations on - architecture (str): architecture of the run (x86, x64) - """ - measurementJson = os.path.join(os.getcwd(), 'measurement.json') - buildJson = os.path.join(coreclrRepo, 'build.json') - machinedataJson = os.path.join(coreclrRepo, 'machinedata.json') - submissionMetadataJson = os.path.join(coreclrRepo, 'submission-metadata.json') - - for jsonFile in [measurementJson, buildJson, machinedataJson, submissionMetadataJson]: - if not os.path.isfile(jsonFile): - raise Exception('%s does not exist. There is no data to be uploaded.' % jsonFile) - - runArgs = [python, - os.path.join(benchviewPath, 'submission.py'), - measurementJson, - '--build', - buildJson, - '--machine-data', - machinedataJson, - '--metadata', - submissionMetadataJson, - '--group', - benchviewGroup, - '--type', - runType, - '--config-name', - configuration, - '--config', - 'Configuration', - configuration, - '--config', - 'OS', - operatingSystem, - '--config', - 'Profile', - etwCollection, - '--config', - 'OptLevel', - optLevel, - '--config', - 'JitName', - jitName, - '--config', - 'PGO', - pgoOptimized, - '--architecture', - architecture, - '--machinepool', - 'PerfSnake'] - - run_command(runArgs, os.environ, 'Call to %s failed' % runArgs[1]) - - if uploadToBenchview: - runArgs = [python, - os.path.join(benchviewPath, 'upload.py'), - 'submission.json', - '--container', - 'coreclr'] - - run_command(runArgs, os.environ, 'Call to %s failed' % runArgs[1]) - -def verify_core_overlay(coreclrRepo, operatingSystem, arch, configuration): - """ Create the path to and verify the core overlay directory exists - Args: - coreclrRepo (str): path to the coreclrRepo - operatingSystem (str): platform of the build - arch (str): architecture if the build - configuration (str): configuration of the build - Returns: - coreOverlay (str): path to the coreOverlay directory - """ - configurationDir = "%s.%s.%s" % (operatingSystem, arch, configuration) - overlayDir = 'Core_Root' - coreclrOverlay = os.path.join(coreclrRepo, "bin", "tests", configurationDir, "Tests", overlayDir) - if not os.path.isdir(coreclrOverlay): - raise ValueError("Can't find test overlay directory '%s'. Please build and run CoreCLR tests" % coreclrOverlay) - - return coreclrOverlay - -def setup_sandbox(sandboxDir): - """ Setup the sand box directory by deleting it if it exists and then creating it - Args: - sandboxDir (str): path to the sandbox directory - """ - if os.path.isdir(sandboxDir): - shutil.rmtree(sandboxDir) - os.mkdir(sandboxDir) - -def set_perf_run_log(sandboxOutputDir): - """ Setup the path to the sandbox output directory and generate the perfrun.log file - Args: - sandboxOutputDirectory (str): path to the sandbox output directory - Returns: - str: path to the perfrun.log - """ - if not os.path.isdir(sandboxOutputDir): - os.makedirs(sandboxOutputDir) - return os.path.join(sandboxOutputDir, "perfrun.log") - -def build_perfharness(coreclrRepo, sandboxDir, extension, dotnetEnv): - """ Build the perf harness - Args: - coreclrRepo (str): path to the coreclr repository - sandboxDir (str): path to the sandbox directory - extension (str): extension of dotnet - dotnetEnv (str{}): environment for dotnet - """ - # Confirm dotnet works - dotnet = os.path.join(coreclrRepo, '.dotnet', 'dotnet' + extension) - runArgs = [dotnet, - '--info' - ] - - run_command(runArgs, dotnetEnv, 'Failed to get information about the CLI tool.') - - # Restore PerfHarness - perfHarnessPath = os.path.join(coreclrRepo, 'tests', 'src', 'Common', 'PerfHarness', 'PerfHarness.csproj') - runArgs = [dotnet, - 'restore', - perfHarnessPath] - - run_command(runArgs, dotnetEnv, 'Failed to restore PerfHarness.csproj') - - # Publish PerfHarness - runArgs = [dotnet, - 'publish', - perfHarnessPath, - '-c', - 'Release', - '-o', - sandboxDir] - - run_command(runArgs, dotnetEnv, 'Failed to publish PerfHarness.csproj') - -########################################################################## -# Main -########################################################################## - -def main(args): - if not is_supported_version(): - log("Python 3.5 or newer is required") - return 1 - - coreclrPerf, assemblyName, arch, operatingSystem, configuration, jitName, optLevel, runType, outputDir, stabilityPrefix, isScenarioTest, benchviewPath, isPgoOptimized, benchviewGroup, hasWarmupRun, collectionFlags, isLibrary, uploadToBenchview, better, sliceNumber, sliceConfigFile = validate_args(args) - - platform = sys.platform - python = sys.executable - if platform == 'linux' or platform == 'linux2': - platform = 'Linux' - elif platform == 'darwin': - platform = 'OSX' - elif platform == 'win32': - platform = "Windows_NT" - else: - raise ValueError("Platform %s is not supported" % platform) - - executable = ['cmd.exe', '/c'] if platform == 'Windows_NT' else [] - - coreclrRepo = os.getcwd() - etwCollection = 'Off' if collectionFlags == 'stopwatch' else 'On' - sandboxDir = os.path.join(coreclrRepo, 'bin', 'sandbox') - sandboxOutputDir = outputDir if outputDir is not None else os.path.join(sandboxDir, 'Logs') - - extension = '.exe' if platform == 'Windows_NT' else '' - - myEnv = dict(os.environ) - myEnv['DOTNET_MULTILEVEL_LOOKUP'] = '0' - myEnv['UseSharedCompilation'] = 'false' - myEnv['CORECLR_REPO'] = coreclrRepo - - # Setup directories - log('Setting up directories') - coreclrOverlay = verify_core_overlay(coreclrRepo, platform, arch, configuration) - setup_sandbox(sandboxDir) - - os.chdir(sandboxDir) - - perfRunLog = set_perf_run_log(sandboxOutputDir) - build_perfharness(coreclrRepo, sandboxDir, extension, myEnv) - - # Set up environment for running tests - if optLevel == 'min_opt': - myEnv['COMPlus_JITMinOpts'] = '1' - myEnv['COMPlus_TieredCompilation'] = '0' - elif optLevel == 'full_opt': - myEnv['COMPlus_TieredCompilation'] = '0' - - if not 'XUNIT_PERFORMANCE_MAX_ITERATION' in myEnv: - myEnv['XUNIT_PERFORMANCE_MAX_ITERATION'] = '21' - if not 'XUNIT_PERFORMANCE_MAX_ITERATION_INNER_SPECIFIED' in myEnv: - myEnv['XUNIT_PERFORMANCE_MAX_ITERATION_INNER_SPECIFIED'] = '21' - - # Copy core overlay contents to sandbox - copytree(coreclrOverlay, sandboxDir) - - # Determine benchmarks we will be running - benchmarks = [] - if sliceNumber != -1: - with open(sliceConfigFile) as jsonData: - data = json.load(jsonData) - if sliceNumber >= len(data["slices"]): - raise ValueError('Invalid slice number. %s is greater than the max number of slices %s' % (sliceNumber, len(data["slices"]))) - for benchmark in data["slices"][sliceNumber]["folders"]: - benchmarks += [benchmark] - - # If slice was not specified, either: - # - run a specific indicated benchmark assembly in coreclrPerf directory if assemblyName is set - # - otherwise run everything in the coreclrPerf directory. - elif assemblyName != None: - name,ext = os.path.splitext(assemblyName) - benchmarks = [{'directory' : '', 'extraFlags': '-library' if ext == '.dll' else '', 'benchname': name}] - else: - benchmarks = [{ 'directory' : '', 'extraFlags': '-library' if isLibrary else ''}] - - testFileExt = 'dll' if isLibrary else 'exe' - - # Run benchmarks - failures = 0 - totalBenchmarks = 0 - lvRunId = 'Perf-%s' % etwCollection - - for benchmark in benchmarks: - testFileExt = 'dll' if benchmark["extraFlags"] == '-library' else 'exe' - benchmarkDir = os.path.normpath(benchmark["directory"]) - - testPath = os.path.join(coreclrPerf, benchmarkDir) - - for root, dirs, files in os.walk(testPath): - for f in files: - benchname, ext = os.path.splitext(f) - if f.endswith(testFileExt) and ((not 'benchname' in benchmark) or benchmark['benchname'] == benchname): - totalBenchmarks += 1 - benchmarkOutputDir = os.path.join(sandboxOutputDir, 'Scenarios') if isScenarioTest else os.path.join(sandboxOutputDir, 'Microbenchmarks') - benchmarkOutputDir = os.path.join(benchmarkOutputDir, etwCollection, benchname) - - failure = run_benchmark(benchname, root, myEnv, sandboxDir, benchmarkOutputDir, testFileExt, stabilityPrefix, collectionFlags, lvRunId, isScenarioTest, arch, extension, executable) - failures += failure - if (benchviewPath is not None) and (failure == 0): - generate_results_for_benchview(python, lvRunId, benchname, isScenarioTest, better, hasWarmupRun, benchmarkOutputDir, benchviewPath) - - # Setup variables for uploading to benchview - pgoOptimized = 'pgo' if isPgoOptimized else 'nopgo' - - # Upload to benchview only if we did not fail all benchmarks - if benchviewPath is not None and failures != totalBenchmarks: - upload_to_benchview(python, coreclrRepo, benchviewPath, uploadToBenchview, benchviewGroup, runType, configuration, operatingSystem, etwCollection, optLevel, jitName, pgoOptimized, arch) - - if failures != 0: - log('%s benchmarks have failed' % failures) - - return failures - -if __name__ == "__main__": - Args = parser.parse_args(sys.argv[1:]) - sys.exit(main(Args)) diff --git a/src/coreclr/tests/src/CLRTest.Execute.Bash.targets b/src/coreclr/tests/src/CLRTest.Execute.Bash.targets index 74dcae7b06fc2a..d6cca14ee1b314 100644 --- a/src/coreclr/tests/src/CLRTest.Execute.Bash.targets +++ b/src/coreclr/tests/src/CLRTest.Execute.Bash.targets @@ -18,7 +18,7 @@ WARNING: When setting properties based on their current state (for example: --> - + - + + TestLibrary Library diff --git a/src/coreclr/tests/src/Common/CoreCLRTestLibrary/HostPolicyMock.cs b/src/coreclr/tests/src/Common/CoreCLRTestLibrary/HostPolicyMock.cs index ed14e93a413340..406a70e9e7abab 100644 --- a/src/coreclr/tests/src/Common/CoreCLRTestLibrary/HostPolicyMock.cs +++ b/src/coreclr/tests/src/Common/CoreCLRTestLibrary/HostPolicyMock.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; diff --git a/src/coreclr/tests/src/Common/CoreCLRTestLibrary/XPlatformUtils.cs b/src/coreclr/tests/src/Common/CoreCLRTestLibrary/XPlatformUtils.cs index c940d097ace676..05953dc9e0105e 100644 --- a/src/coreclr/tests/src/Common/CoreCLRTestLibrary/XPlatformUtils.cs +++ b/src/coreclr/tests/src/Common/CoreCLRTestLibrary/XPlatformUtils.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Common/test_dependencies/test_dependencies.csproj b/src/coreclr/tests/src/Common/test_dependencies/test_dependencies.csproj index 8d668cf795e28c..ac597b9214bb7c 100644 --- a/src/coreclr/tests/src/Common/test_dependencies/test_dependencies.csproj +++ b/src/coreclr/tests/src/Common/test_dependencies/test_dependencies.csproj @@ -1,4 +1,4 @@ - + BuildOnly false diff --git a/src/coreclr/tests/src/GC/Features/BackgroundGC/foregroundgc.cs b/src/coreclr/tests/src/GC/Features/BackgroundGC/foregroundgc.cs index cd57f1c96f0840..62aaf532f3948a 100644 --- a/src/coreclr/tests/src/GC/Features/BackgroundGC/foregroundgc.cs +++ b/src/coreclr/tests/src/GC/Features/BackgroundGC/foregroundgc.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi.cs b/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi.cs index fc69b4145d1e09..b54954af362698 100644 --- a/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi.cs +++ b/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi.cs @@ -1,8 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Collections.Generic; using System.Runtime; using System.Reflection; diff --git a/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi2.cs b/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi2.cs index e25baad12df6bd..3aefc90f40f409 100644 --- a/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi2.cs +++ b/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi2.cs @@ -1,8 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Collections.Generic; using System.Runtime; using System.Reflection; diff --git a/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi_exceptions.cs b/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi_exceptions.cs index 0ba7c297de1bc2..9ab16c01630bd0 100644 --- a/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi_exceptions.cs +++ b/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactapi_exceptions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Runtime; diff --git a/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactscenariorepro.cs b/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactscenariorepro.cs index 23b3c84890b9b0..e4de3badfdbf3e 100644 --- a/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactscenariorepro.cs +++ b/src/coreclr/tests/src/GC/Features/LOHCompaction/lohcompactscenariorepro.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Collections.Generic; using System.Runtime; using System.Reflection; diff --git a/src/coreclr/tests/src/GC/Features/LOHCompaction/lohpin.cs b/src/coreclr/tests/src/GC/Features/LOHCompaction/lohpin.cs index 8a91fb24a0c7e8..e31cd668a8c9df 100644 --- a/src/coreclr/tests/src/GC/Features/LOHCompaction/lohpin.cs +++ b/src/coreclr/tests/src/GC/Features/LOHCompaction/lohpin.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/src/coreclr/tests/src/GC/Features/PartialCompaction/eco1.cs b/src/coreclr/tests/src/GC/Features/PartialCompaction/eco1.cs index 522c2ec78570d8..11b94d65cf49d8 100644 --- a/src/coreclr/tests/src/GC/Features/PartialCompaction/eco1.cs +++ b/src/coreclr/tests/src/GC/Features/PartialCompaction/eco1.cs @@ -1,8 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/src/coreclr/tests/src/GC/Features/PartialCompaction/partialcompactiontest.cs b/src/coreclr/tests/src/GC/Features/PartialCompaction/partialcompactiontest.cs index 4108765fed1538..86adc58f602fc3 100644 --- a/src/coreclr/tests/src/GC/Features/PartialCompaction/partialcompactiontest.cs +++ b/src/coreclr/tests/src/GC/Features/PartialCompaction/partialcompactiontest.cs @@ -1,8 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -241,7 +241,7 @@ public static void UpdateReferences() if (OAr[j] != null) { int pos = Rand.Next(0, weakList.Count); - if (weakList[pos] != null && weakList[pos].IsAllocated) + if (weakList[pos].IsAllocated) { OAr[j] = weakList[pos].Target; } @@ -360,7 +360,7 @@ public static void CleanupWeakReferenceArr() { for (int k = weakList.Count - 1; k >= 0; k--) { - if (weakList[k] == null || !(weakList[k].IsAllocated)) + if (!weakList[k].IsAllocated) { weakList.RemoveAt(k); } @@ -442,7 +442,7 @@ public static void AddRefFrom(Object from) while (!found) { pos = Rand.Next(0, weakList.Count); - if (weakList[pos] == null || !weakList[pos].IsAllocated) + if (!weakList[pos].IsAllocated) continue; if (weakList[pos].Target != null) { @@ -460,7 +460,7 @@ public static void AddRefTo(Object to) while (!found) { pos = Rand.Next(0, weakList.Count); - if (weakList[pos] == null || !weakList[pos].IsAllocated) + if (!weakList[pos].IsAllocated) continue; if (weakList[pos].Target != null) { @@ -498,7 +498,7 @@ public static Object AddObject(int size, List Arr) found = false; for (int i = 0; i < weakList.Count; i++) { - if (weakList[i] == null || !weakList[i].IsAllocated) + if (!weakList[i].IsAllocated) { weakList[i] = GCHandle.Alloc(o, GCHandleType.Weak); found = true; diff --git a/src/coreclr/tests/src/GC/Features/PartialCompaction/partialcompactionwloh.cs b/src/coreclr/tests/src/GC/Features/PartialCompaction/partialcompactionwloh.cs index 6f0ea57028a123..87346427f97e49 100644 --- a/src/coreclr/tests/src/GC/Features/PartialCompaction/partialcompactionwloh.cs +++ b/src/coreclr/tests/src/GC/Features/PartialCompaction/partialcompactionwloh.cs @@ -1,8 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. - using System; using System.Collections.Generic; using System.Linq; @@ -267,7 +266,7 @@ public static void UpdateReferences() if (OAr[j] != null) { int pos = Rand.Next(0, weakList.Count); - if (weakList[pos] != null && weakList[pos].IsAllocated) + if (weakList[pos].IsAllocated) { OAr[j] = weakList[pos].Target; } @@ -385,7 +384,7 @@ public static void CleanupWeakReferenceArr() { for (int k = weakList.Count - 1; k >= 0; k--) { - if (weakList[k] == null || !(weakList[k].IsAllocated)) + if (!weakList[k].IsAllocated) { weakList.RemoveAt(k); } @@ -468,7 +467,7 @@ public static void AddRefFrom(Object from) while (!found) { pos = Rand.Next(0, weakList.Count); - if (weakList[pos] == null || !weakList[pos].IsAllocated) + if (!weakList[pos].IsAllocated) continue; if (weakList[pos].Target != null) { @@ -486,7 +485,7 @@ public static void AddRefTo(Object to) while (!found) { pos = Rand.Next(0, weakList.Count); - if (weakList[pos] == null || !weakList[pos].IsAllocated) + if (!weakList[pos].IsAllocated) continue; if (weakList[pos].Target != null) { @@ -524,7 +523,7 @@ public static Object AddObject(int size, List Arr) found = false; for (int i = 0; i < weakList.Count; i++) { - if (weakList[i] == null || !weakList[i].IsAllocated) + if (!weakList[i].IsAllocated) { weakList[i] = GCHandle.Alloc(o, GCHandleType.Weak); found = true; diff --git a/src/coreclr/tests/src/GC/Features/SustainedLowLatency/sustainedlowlatency_race.cs b/src/coreclr/tests/src/GC/Features/SustainedLowLatency/sustainedlowlatency_race.cs index 20c3bf610f2293..7e9e40cd6fb561 100644 --- a/src/coreclr/tests/src/GC/Features/SustainedLowLatency/sustainedlowlatency_race.cs +++ b/src/coreclr/tests/src/GC/Features/SustainedLowLatency/sustainedlowlatency_race.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/src/coreclr/tests/src/GC/Features/SustainedLowLatency/sustainedlowlatency_race_reverse.cs b/src/coreclr/tests/src/GC/Features/SustainedLowLatency/sustainedlowlatency_race_reverse.cs index a21c3715c9b41a..adb211a1ba565e 100644 --- a/src/coreclr/tests/src/GC/Features/SustainedLowLatency/sustainedlowlatency_race_reverse.cs +++ b/src/coreclr/tests/src/GC/Features/SustainedLowLatency/sustainedlowlatency_race_reverse.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/src/coreclr/tests/src/GC/Performance/Tests/LargeArr_CrdMrk.cs b/src/coreclr/tests/src/GC/Performance/Tests/LargeArr_CrdMrk.cs index cfb7ff11721aaf..1e0b6e77f7c587 100644 --- a/src/coreclr/tests/src/GC/Performance/Tests/LargeArr_CrdMrk.cs +++ b/src/coreclr/tests/src/GC/Performance/Tests/LargeArr_CrdMrk.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/GC/Performance/Tests/List_CrdMrk.cs b/src/coreclr/tests/src/GC/Performance/Tests/List_CrdMrk.cs index 2d61bc30fc0fc5..7106913e701ef6 100644 --- a/src/coreclr/tests/src/GC/Performance/Tests/List_CrdMrk.cs +++ b/src/coreclr/tests/src/GC/Performance/Tests/List_CrdMrk.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Interop/CMakeLists.txt b/src/coreclr/tests/src/Interop/CMakeLists.txt index 9de657750644bd..afd1e257436e2a 100644 --- a/src/coreclr/tests/src/Interop/CMakeLists.txt +++ b/src/coreclr/tests/src/Interop/CMakeLists.txt @@ -34,6 +34,7 @@ add_subdirectory(PInvoke/CriticalHandles) add_subdirectory(PInvoke/Generics) add_subdirectory(PInvoke/AsAny) add_subdirectory(PInvoke/SafeHandles) +add_subdirectory(PInvoke/Vector2_3_4) add_subdirectory(NativeCallable) add_subdirectory(PrimitiveMarshalling/Bool) add_subdirectory(PrimitiveMarshalling/UIntPtr) diff --git a/src/coreclr/tests/src/Interop/COM/NETClients/Primitives/App.manifest b/src/coreclr/tests/src/Interop/COM/NETClients/Primitives/App.manifest index 37b4f65804715d..86a151bccbab0e 100644 --- a/src/coreclr/tests/src/Interop/COM/NETClients/Primitives/App.manifest +++ b/src/coreclr/tests/src/Interop/COM/NETClients/Primitives/App.manifest @@ -1,4 +1,4 @@ - + + { + Assert.AreEqual(startingVector, vectorParam); + return newVector; + })); + } + + private static void RunVector3Tests() + { + float X = StartingIntValue; + float Y = StartingIntValue + 1; + float Z = StartingIntValue + 232; + float W = StartingIntValue + 93719; + + float XNew = 71; + float YNew = 999; + float ZNew = 1203; + float WNew = 4; + + Vector3 startingVector = new Vector3(X, Y, Z); + Vector3 newVector = new Vector3(XNew, YNew, ZNew); + + Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateVector3FromFloats(X, Y, Z)); + + Assert.IsTrue(Vector2_3_4TestNative.Vector3EqualToFloats(startingVector, X, Y, Z)); + + Vector3 localVector = startingVector; + Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeVector3(ref localVector, X, Y, Z, XNew, YNew, ZNew)); + Assert.AreEqual(newVector, localVector); + + Vector2_3_4TestNative.GetVector3ForFloats(X, Y, Z, out var vec); + Assert.AreEqual(startingVector, vec); + + Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateWrappedVector3FromFloats(X, Y, Z).vec); + + Assert.IsTrue(Vector2_3_4TestNative.WrappedVector3EqualToFloats(new Vector2_3_4TestNative.Vector3Wrapper { vec = startingVector }, X, Y, Z)); + + var localVectorWrapper = new Vector2_3_4TestNative.Vector3Wrapper { vec = startingVector }; + Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeWrappedVector3(ref localVectorWrapper, X, Y, Z, XNew, YNew, ZNew)); + Assert.AreEqual(newVector, localVectorWrapper.vec); + + Assert.AreEqual(newVector, Vector2_3_4TestNative.PassThroughVector3ToCallback(startingVector, vectorParam => + { + Assert.AreEqual(startingVector, vectorParam); + return newVector; + })); + } + + private static void RunVector4Tests() + { + float X = StartingIntValue; + float Y = StartingIntValue + 1; + float Z = StartingIntValue + 232; + float W = StartingIntValue + 93719; + + float XNew = 71; + float YNew = 999; + float ZNew = 1203; + float WNew = 4; + + Vector4 startingVector = new Vector4(X, Y, Z, W); + Vector4 newVector = new Vector4(XNew, YNew, ZNew, WNew); + + Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateVector4FromFloats(X, Y, Z, W)); + + Assert.IsTrue(Vector2_3_4TestNative.Vector4EqualToFloats(startingVector, X, Y, Z, W)); + + Vector4 localVector = startingVector; + Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeVector4(ref localVector, X, Y, Z, W, XNew, YNew, ZNew, WNew)); + Assert.AreEqual(newVector, localVector); + + Vector2_3_4TestNative.GetVector4ForFloats(X, Y, Z, W, out var vec); + Assert.AreEqual(startingVector, vec); + + Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateWrappedVector4FromFloats(X, Y, Z, W).vec); + + Assert.IsTrue(Vector2_3_4TestNative.WrappedVector4EqualToFloats(new Vector2_3_4TestNative.Vector4Wrapper { vec = startingVector }, X, Y, Z, W)); + + var localVectorWrapper = new Vector2_3_4TestNative.Vector4Wrapper { vec = startingVector }; + Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeWrappedVector4(ref localVectorWrapper, X, Y, Z, W, XNew, YNew, ZNew, WNew)); + Assert.AreEqual(newVector, localVectorWrapper.vec); + + Assert.AreEqual(newVector, Vector2_3_4TestNative.PassThroughVector4ToCallback(startingVector, vectorParam => + { + Assert.AreEqual(startingVector, vectorParam); + return newVector; + })); + } +} diff --git a/src/coreclr/tests/src/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj b/src/coreclr/tests/src/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj new file mode 100644 index 00000000000000..c6b2767243b338 --- /dev/null +++ b/src/coreclr/tests/src/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj @@ -0,0 +1,12 @@ + + + + Exe + + + + + + + + diff --git a/src/coreclr/tests/src/Interop/PInvoke/Vector2_3_4/Vector2_3_4TestNative.cpp b/src/coreclr/tests/src/Interop/PInvoke/Vector2_3_4/Vector2_3_4TestNative.cpp new file mode 100644 index 00000000000000..d16165fe60249e --- /dev/null +++ b/src/coreclr/tests/src/Interop/PInvoke/Vector2_3_4/Vector2_3_4TestNative.cpp @@ -0,0 +1,182 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include "xplatform.h" +#include + +struct Vector2 +{ + float x; + float y; +}; + +struct Vector3 +{ + float x; + float y; + float z; +}; + +struct Vector4 +{ + float x; + float y; + float z; + float w; +}; + +namespace +{ + BOOL operator==(Vector2 lhs, Vector2 rhs) + { + return lhs.x == rhs.x && lhs.y == rhs.y ? TRUE : FALSE; + } + BOOL operator==(Vector3 lhs, Vector3 rhs) + { + return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z ? TRUE : FALSE; + } + BOOL operator==(Vector4 lhs, Vector4 rhs) + { + return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z && lhs.w == rhs.w ? TRUE : FALSE; + } +} + +extern "C" DLL_EXPORT Vector4 STDMETHODCALLTYPE CreateVector4FromFloats(float x, float y, float z, float w) +{ + Vector4 result; + result.x = x; + result.y = y; + result.z = z; + result.w = w; + return result; +} + +extern "C" DLL_EXPORT Vector3 STDMETHODCALLTYPE CreateVector3FromFloats(float x, float y, float z) +{ + Vector3 result; + result.x = x; + result.y = y; + result.z = z; + return result; +} + +extern "C" DLL_EXPORT Vector2 STDMETHODCALLTYPE CreateVector2FromFloats(float x, float y) +{ + Vector2 result; + result.x = x; + result.y = y; + return result; +} + +extern "C" DLL_EXPORT BOOL STDMETHODCALLTYPE Vector4EqualToFloats(Vector4 vec, float x, float y, float z, float w) +{ + Vector4 vecFromFloats; + vecFromFloats.x = x; + vecFromFloats.y = y; + vecFromFloats.z = z; + vecFromFloats.w = w; + return vec == vecFromFloats; +} + +extern "C" DLL_EXPORT BOOL STDMETHODCALLTYPE Vector3EqualToFloats(Vector3 vec, float x, float y, float z) +{ + Vector3 vecFromFloats; + vecFromFloats.x = x; + vecFromFloats.y = y; + vecFromFloats.z = z; + return vec == vecFromFloats; +} + +extern "C" DLL_EXPORT BOOL STDMETHODCALLTYPE Vector2EqualToFloats(Vector2 vec, float x, float y) +{ + Vector2 vecFromFloats; + vecFromFloats.x = x; + vecFromFloats.y = y; + return vec == vecFromFloats; +} + +extern "C" DLL_EXPORT BOOL STDMETHODCALLTYPE ValidateAndChangeVector4(Vector4* vec, float expectedX, float expectedY, float expectedZ, float expectedW, float newX, float newY, float newZ, float newW) +{ + Vector4 vecExpected; + vecExpected.x = expectedX; + vecExpected.y = expectedY; + vecExpected.z = expectedZ; + vecExpected.w = expectedW; + + BOOL result = *vec == vecExpected; + vec->x = newX; + vec->y = newY; + vec->z = newZ; + vec->w = newW; + return result; +} + +extern "C" DLL_EXPORT BOOL STDMETHODCALLTYPE ValidateAndChangeVector3(Vector3* vec, float expectedX, float expectedY, float expectedZ, float newX, float newY, float newZ) +{ + Vector3 vecExpected; + vecExpected.x = expectedX; + vecExpected.y = expectedY; + vecExpected.z = expectedZ; + + BOOL result = *vec == vecExpected; + vec->x = newX; + vec->y = newY; + vec->z = newZ; + return result; +} + +extern "C" DLL_EXPORT BOOL STDMETHODCALLTYPE ValidateAndChangeVector2(Vector2* vec, float expectedX, float expectedY, float newX, float newY) +{ + Vector2 vecExpected; + vecExpected.x = expectedX; + vecExpected.y = expectedY; + + BOOL result = *vec == vecExpected; + vec->x = newX; + vec->y = newY; + return result; +} + +extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVector4ForFloats(float x, float y, float z, float w, Vector4* vec) +{ + vec->x = x; + vec->y = y; + vec->z = z; + vec->w = w; +} + +extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVector3ForFloats(float x, float y, float z, Vector3* vec) +{ + vec->x = x; + vec->y = y; + vec->z = z; +} + +extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVector2ForFloats(float x, float y, Vector2* vec) +{ + vec->x = x; + vec->y = y; +} + + +using Vector4Callback = Vector4(STDMETHODCALLTYPE*)(Vector4); + +extern "C" DLL_EXPORT Vector4 STDMETHODCALLTYPE PassThroughVector4ToCallback(Vector4 vec, Vector4Callback cb) +{ + return cb(vec); +} + +using Vector3Callback = Vector3(STDMETHODCALLTYPE*)(Vector3); + +extern "C" DLL_EXPORT Vector3 STDMETHODCALLTYPE PassThroughVector3ToCallback(Vector3 vec, Vector3Callback cb) +{ + return cb(vec); +} + +using Vector2Callback = Vector2(STDMETHODCALLTYPE*)(Vector2); + +extern "C" DLL_EXPORT Vector2 STDMETHODCALLTYPE PassThroughVector2ToCallback(Vector2 vec, Vector2Callback cb) +{ + return cb(vec); +} diff --git a/src/coreclr/tests/src/Interop/PInvoke/Vector2_3_4/Vector2_3_4TestNative.cs b/src/coreclr/tests/src/Interop/PInvoke/Vector2_3_4/Vector2_3_4TestNative.cs new file mode 100644 index 00000000000000..2bf5267153019f --- /dev/null +++ b/src/coreclr/tests/src/Interop/PInvoke/Vector2_3_4/Vector2_3_4TestNative.cs @@ -0,0 +1,85 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Numerics; +using System.Runtime.InteropServices; + +#pragma warning disable 0618 +static class Vector2_3_4TestNative +{ + public struct Vector2Wrapper + { + public Vector2 vec; + }; + + public struct Vector3Wrapper + { + public Vector3 vec; + }; + + public struct Vector4Wrapper + { + public Vector4 vec; + }; + + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern Vector2 CreateVector2FromFloats(float x, float y); + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern Vector3 CreateVector3FromFloats(float x, float y, float z); + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern Vector4 CreateVector4FromFloats(float x, float y, float z, float w); + + [DllImport(nameof(Vector2_3_4TestNative), EntryPoint = "CreateVector2FromFloats")] + public static extern Vector2Wrapper CreateWrappedVector2FromFloats(float x, float b); + [DllImport(nameof(Vector2_3_4TestNative), EntryPoint = "CreateVector3FromFloats")] + public static extern Vector3Wrapper CreateWrappedVector3FromFloats(float x, float y, float z); + [DllImport(nameof(Vector2_3_4TestNative), EntryPoint = "CreateVector4FromFloats")] + public static extern Vector4Wrapper CreateWrappedVector4FromFloats(float x, float y, float z, float w); + + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern bool Vector2EqualToFloats(Vector2 vec, float x, float y); + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern bool Vector3EqualToFloats(Vector3 vec, float x, float y, float z); + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern bool Vector4EqualToFloats(Vector4 vec, float x, float y, float z, float w); + + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern bool ValidateAndChangeVector2(ref Vector2 dec, float expectedX, float expectedY, float newX, float newY); + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern bool ValidateAndChangeVector3(ref Vector3 dec, float expectedX, float expectedY, float expectedZ, float newX, float newY, float newZ); + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern bool ValidateAndChangeVector4(ref Vector4 dec, float expectedX, float expectedY, float expectedZ, float expectedW, float newX, float newY, float newZ, float newW); + + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern void GetVector2ForFloats(float x, float y, out Vector2 dec); + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern void GetVector3ForFloats(float x, float y, float z, out Vector3 dec); + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern void GetVector4ForFloats(float x, float y, float z, float w, out Vector4 dec); + + [DllImport(nameof(Vector2_3_4TestNative), EntryPoint = "Vector2EqualToFloats")] + public static extern bool WrappedVector2EqualToFloats(Vector2Wrapper vec, float x, float y); + [DllImport(nameof(Vector2_3_4TestNative), EntryPoint = "Vector3EqualToFloats")] + public static extern bool WrappedVector3EqualToFloats(Vector3Wrapper vec, float x, float y, float z); + [DllImport(nameof(Vector2_3_4TestNative), EntryPoint = "Vector4EqualToFloats")] + public static extern bool WrappedVector4EqualToFloats(Vector4Wrapper vec, float x, float y, float z, float w); + + [DllImport(nameof(Vector2_3_4TestNative), EntryPoint = "ValidateAndChangeVector2")] + public static extern bool ValidateAndChangeWrappedVector2(ref Vector2Wrapper dec, float expectedX, float expectedY, float newX, float newY); + [DllImport(nameof(Vector2_3_4TestNative), EntryPoint = "ValidateAndChangeVector3")] + public static extern bool ValidateAndChangeWrappedVector3(ref Vector3Wrapper dec, float expectedX, float expectedY, float expectedZ, float newX, float newY, float newZ); + [DllImport(nameof(Vector2_3_4TestNative), EntryPoint = "ValidateAndChangeVector4")] + public static extern bool ValidateAndChangeWrappedVector4(ref Vector4Wrapper dec, float expectedX, float expectedY, float expectedZ, float expectedW, float newX, float newY, float newZ, float newW); + + public delegate Vector2 Vector2Callback(Vector2 dec); + public delegate Vector3 Vector3Callback(Vector3 dec); + public delegate Vector4 Vector4Callback(Vector4 dec); + + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern Vector2 PassThroughVector2ToCallback(Vector2 startingVector, Vector2Callback callback); + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern Vector3 PassThroughVector3ToCallback(Vector3 startingVector, Vector3Callback callback); + [DllImport(nameof(Vector2_3_4TestNative))] + public static extern Vector4 PassThroughVector4ToCallback(Vector4 startingVector, Vector4Callback callback); +} diff --git a/src/coreclr/tests/src/Interop/PrimitiveMarshalling/Bool/NativeMethodDef.cs b/src/coreclr/tests/src/Interop/PrimitiveMarshalling/Bool/NativeMethodDef.cs index 4d29f70d546be4..5d038d9156367b 100644 --- a/src/coreclr/tests/src/Interop/PrimitiveMarshalling/Bool/NativeMethodDef.cs +++ b/src/coreclr/tests/src/Interop/PrimitiveMarshalling/Bool/NativeMethodDef.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; +using System; using System.Runtime.InteropServices; using System.Reflection; using System.Text; diff --git a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/Helper.cs b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/Helper.cs index effd483f535e71..4f2f709d702fcd 100644 --- a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/Helper.cs +++ b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/Helper.cs @@ -994,6 +994,72 @@ public static bool ValidateLongStructPack16Explicit(LongStructPack16Explicit str #endregion + #region methods for ByteStruct3Byte struct + public static ByteStruct3Byte NewByteStruct3Byte(byte b1, byte b2, byte b3) + { + ByteStruct3Byte u1 = new ByteStruct3Byte(); + u1.b1 = b1; + u1.b2 = b2; + u1.b3 = b3; + + return u1; + } + public static void PrintByteStruct3Byte(ByteStruct3Byte str1, string name) + { + Console.WriteLine("\t{0}.b1 = {1}", name, str1.b1); + Console.WriteLine("\t{0}.b2 = {1}", name, str1.b2); + Console.WriteLine("\t{0}.b3 = {1}", name, str1.b3); + } + public static bool ValidateByteStruct3Byte(ByteStruct3Byte str1, ByteStruct3Byte str2, string methodName) + { + if (str1.b1 != str2.b1 || str1.b2 != str2.b2) + { + Console.WriteLine("\tFAILED! " + methodName + "did not receive result as expected."); + Console.WriteLine("\tThe Actual is..."); + PrintByteStruct3Byte(str1, str1.ToString()); + Console.WriteLine("\tThe Expected is..."); + PrintByteStruct3Byte(str2, str2.ToString()); + return false; + } + else + { + Console.WriteLine("\tPASSED!"); + return true; + } + } + #endregion + + #region methods for IntergerStructSequential struct + public static IntergerStructSequential NewIntergerStructSequential(int i1) + { + IntergerStructSequential u1 = new IntergerStructSequential(); + u1.i = i1; + + return u1; + } + public static void PrintIntergerStructSequential(IntergerStructSequential str1, string name) + { + Console.WriteLine("\t{0}.i = {1}", name, str1.i); + } + public static bool ValidateIntergerStructSequential(IntergerStructSequential str1, IntergerStructSequential str2, string methodName) + { + if (str1.i != str2.i) + { + Console.WriteLine("\tFAILED! " + methodName + "did not receive result as expected."); + Console.WriteLine("\tThe Actual is..."); + PrintIntergerStructSequential(str1, str1.ToString()); + Console.WriteLine("\tThe Expected is..."); + PrintIntergerStructSequential(str2, str2.ToString()); + return false; + } + else + { + Console.WriteLine("\tPASSED!"); + return true; + } + } + #endregion + } public static class TestFramework diff --git a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest.cs b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest.cs deleted file mode 100644 index a6e789c30ffaca..00000000000000 Binary files a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest.cs and /dev/null differ diff --git a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest.csproj b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest.csproj index a1db4da663a41c..e2666a9337d158 100644 --- a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest.csproj +++ b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest.csproj @@ -4,7 +4,7 @@ true - + diff --git a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs new file mode 100644 index 00000000000000..2ee6ba354e9bf7 --- /dev/null +++ b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs @@ -0,0 +1,1858 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Text; +using System.Security; +using System.Runtime.InteropServices; +using TestLibrary; + +public class MarshalStructTest +{ + const int iNative = 11;//the value passed from Native side to Managed side + const int iManaged = 10;//The value passed from Managed side to Native side + + private static string strOne; + private static string strTwo; + + enum StructID + { + InnerSequentialId, + InnerArraySequentialId, + CharSetAnsiSequentialId, + CharSetUnicodeSequentialId, + NumberSequentialId, + S3Id, + S5Id, + StringStructSequentialAnsiId, + StringStructSequentialUnicodeId, + S8Id, + S9Id, + IncludeOuterIntergerStructSequentialId, + S11Id, + ComplexStructId, + ByteStruct3Byte + } + + + private static void testMethod(S9 s9) + { + Console.WriteLine("The first field of s9 is:", s9.i32); + } + + #region Methods for the struct InnerSequential declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool InnerSequentialByRefCdeclcaller([In, Out]ref InnerSequential argStr); + private static bool TestMethodForStructInnerSequential_ReversePInvokeByRef_Cdecl(ref InnerSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string"); + //Check the input + Assert.IsTrue(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.f1 = 1; + argstr.f2 = 1.0F; + argstr.f3 = "some string"; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool InnerSequentialByRefStdCallcaller([In, Out]ref InnerSequential argStr); + private static bool TestMethodForStructInnerSequential_ReversePInvokeByRef_StdCall(ref InnerSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string"); + //Check the input + Assert.IsTrue(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByRef_StdCall")); + //Chanage the value + argstr.f1 = 1; + argstr.f2 = 1.0F; + argstr.f3 = "some string"; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructInnerSequentialByRef_Cdecl(InnerSequentialByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructInnerSequentialByRef_StdCall(InnerSequentialByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool InnerSequentialByValCdeclcaller([In, Out] InnerSequential argStr); + private static bool TestMethodForStructInnerSequential_ReversePInvokeByVal_Cdecl(InnerSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string"); + //Check the input + Assert.IsTrue(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.f1 = 1; + argstr.f2 = 1.0F; + argstr.f3 = "some string"; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool InnerSequentialByValStdCallcaller([In, Out] InnerSequential argStr); + private static bool TestMethodForStructInnerSequential_ReversePInvokeByVal_StdCall(InnerSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string"); + //Check the input + Assert.IsTrue(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.f1 = 1; + argstr.f2 = 1.0F; + argstr.f3 = "some string"; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructInnerSequentialByVal_Cdecl(InnerSequentialByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructInnerSequentialByVal_StdCall(InnerSequentialByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct InnerArraySequential declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool InnerArraySequentialByRefCdeclcaller([In, Out]ref InnerArraySequential argStr); + private static bool TestMethodForStructInnerArraySequential_ReversePInvokeByRef_Cdecl(ref InnerArraySequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + InnerArraySequential change_is = Helper.NewInnerArraySequential(77, 77.0F, "changed string"); + //Check the input + Assert.IsTrue(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByRef_Cdecl")); + //Chanage the value + for (int i = 0; i < Common.NumArrElements; i++) + { + argstr.arr[i].f1 = 1; + argstr.arr[i].f2 = 1.0F; + argstr.arr[i].f3 = "some string"; + } + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool InnerArraySequentialByRefStdCallcaller([In, Out]ref InnerArraySequential argStr); + private static bool TestMethodForStructInnerArraySequential_ReversePInvokeByRef_StdCall(ref InnerArraySequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + InnerArraySequential change_is = Helper.NewInnerArraySequential(77, 77.0F, "changed string"); + //Check the input + Assert.IsTrue(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByRef_StdCall")); + //Chanage the value + for (int i = 0; i < Common.NumArrElements; i++) + { + argstr.arr[i].f1 = 1; + argstr.arr[i].f2 = 1.0F; + argstr.arr[i].f3 = "some string"; + } + return true; + } + + /////////////////////////////////////////////////////////////////////////////////////////////////////// + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructInnerArraySequentialByRef_Cdecl(InnerArraySequentialByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructInnerArraySequentialByRef_StdCall(InnerArraySequentialByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool InnerArraySequentialByValCdeclcaller([In, Out] InnerArraySequential argStr); + private static bool TestMethodForStructInnerArraySequential_ReversePInvokeByVal_Cdecl(InnerArraySequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + InnerArraySequential change_is = Helper.NewInnerArraySequential(77, 77.0F, "changed string"); + //Check the input + Assert.IsTrue(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByVal_Cdecl")); + //Chanage the value + for (int i = 0; i < Common.NumArrElements; i++) + { + argstr.arr[i].f1 = 1; + argstr.arr[i].f2 = 1.0F; + argstr.arr[i].f3 = "some string"; + } + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool InnerArraySequentialByValStdCallcaller([In, Out] InnerArraySequential argStr); + private static bool TestMethodForStructInnerArraySequential_ReversePInvokeByVal_StdCall(InnerArraySequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + InnerArraySequential change_is = Helper.NewInnerArraySequential(77, 77.0F, "changed string"); + //Check the input + Assert.IsTrue(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByVal_StdCall")); + //Chanage the value + for (int i = 0; i < Common.NumArrElements; i++) + { + argstr.arr[i].f1 = 1; + argstr.arr[i].f2 = 1.0F; + argstr.arr[i].f3 = "some string"; + } + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructInnerArraySequentialByVal_Cdecl(InnerArraySequentialByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructInnerArraySequentialByVal_StdCall(InnerArraySequentialByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct CharSetAnsiSequential declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool CharSetAnsiSequentialByRefCdeclcaller([In, Out]ref CharSetAnsiSequential argStr); + private static bool TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_Cdecl(ref CharSetAnsiSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + CharSetAnsiSequential change_is = Helper.NewCharSetAnsiSequential("change string", 'n'); + //Check the input + Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.f1 = "some string"; + argstr.f2 = 'c'; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool CharSetAnsiSequentialByRefStdCallcaller([In, Out]ref CharSetAnsiSequential argStr); + private static bool TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_StdCall(ref CharSetAnsiSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + CharSetAnsiSequential change_is = Helper.NewCharSetAnsiSequential("change string", 'n'); + //Check the input + Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_StdCall")); + //Chanage the value + argstr.f1 = "some string"; + argstr.f2 = 'c'; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructCharSetAnsiSequentialByRef_Cdecl(CharSetAnsiSequentialByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructCharSetAnsiSequentialByRef_StdCall(CharSetAnsiSequentialByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool CharSetAnsiSequentialByValCdeclcaller([In, Out] CharSetAnsiSequential argStr); + private static bool TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_Cdecl(CharSetAnsiSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + CharSetAnsiSequential change_is = Helper.NewCharSetAnsiSequential("change string", 'n'); + //Check the input + Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.f1 = "some string"; + argstr.f2 = 'c'; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool CharSetAnsiSequentialByValStdCallcaller([In, Out] CharSetAnsiSequential argStr); + private static bool TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_StdCall(CharSetAnsiSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + CharSetAnsiSequential change_is = Helper.NewCharSetAnsiSequential("change string", 'n'); + //Check the input + Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.f1 = "some string"; + argstr.f2 = 'c'; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructCharSetAnsiSequentialByVal_Cdecl(CharSetAnsiSequentialByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructCharSetAnsiSequentialByVal_StdCall(CharSetAnsiSequentialByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct CharSetUnicodeSequential declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool CharSetUnicodeSequentialByRefCdeclcaller([In, Out]ref CharSetUnicodeSequential argStr); + private static bool TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_Cdecl(ref CharSetUnicodeSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + CharSetUnicodeSequential change_is = Helper.NewCharSetUnicodeSequential("change string", 'n'); + //Check the input + Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.f1 = "some string"; + argstr.f2 = 'c'; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool CharSetUnicodeSequentialByRefStdCallcaller([In, Out]ref CharSetUnicodeSequential argStr); + private static bool TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_StdCall(ref CharSetUnicodeSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + CharSetUnicodeSequential change_is = Helper.NewCharSetUnicodeSequential("change string", 'n'); + //Check the input + Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_StdCall")); + //Chanage the value + argstr.f1 = "some string"; + argstr.f2 = 'c'; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructCharSetUnicodeSequentialByRef_Cdecl(CharSetUnicodeSequentialByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructCharSetUnicodeSequentialByRef_StdCall(CharSetUnicodeSequentialByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool CharSetUnicodeSequentialByValCdeclcaller([In, Out] CharSetUnicodeSequential argStr); + private static bool TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_Cdecl(CharSetUnicodeSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + CharSetUnicodeSequential change_is = Helper.NewCharSetUnicodeSequential("change string", 'n'); + //Check the input + Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.f1 = "some string"; + argstr.f2 = 'c'; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool CharSetUnicodeSequentialByValStdCallcaller([In, Out] CharSetUnicodeSequential argStr); + private static bool TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_StdCall(CharSetUnicodeSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + CharSetUnicodeSequential change_is = Helper.NewCharSetUnicodeSequential("change string", 'n'); + //Check the input + Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.f1 = "some string"; + argstr.f2 = 'c'; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_Cdecl(CharSetUnicodeSequentialByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_StdCall(CharSetUnicodeSequentialByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct NumberSequential declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool NumberSequentialByRefCdeclcaller([In, Out]ref NumberSequential argStr); + private static bool TestMethodForStructNumberSequential_ReversePInvokeByRef_Cdecl(ref NumberSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + NumberSequential change_is = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4); + //Check the input + Assert.IsTrue(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.i32 = Int32.MinValue; + argstr.ui32 = UInt32.MaxValue; + argstr.s1 = short.MinValue; + argstr.us1 = ushort.MaxValue; + argstr.b = byte.MinValue; + argstr.sb = sbyte.MaxValue; + argstr.i16 = Int16.MinValue; + argstr.ui16 = UInt16.MaxValue; + argstr.i64 = -1234567890; + argstr.ui64 = 1234567890; + argstr.sgl = 32.0F; + argstr.d = 3.2; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool NumberSequentialByRefStdCallcaller([In, Out]ref NumberSequential argStr); + private static bool TestMethodForStructNumberSequential_ReversePInvokeByRef_StdCall(ref NumberSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + NumberSequential change_is = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4); + //Check the input + Assert.IsTrue(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByRef_StdCall")); + //Chanage the value + argstr.i32 = Int32.MinValue; + argstr.ui32 = UInt32.MaxValue; + argstr.s1 = short.MinValue; + argstr.us1 = ushort.MaxValue; + argstr.b = byte.MinValue; + argstr.sb = sbyte.MaxValue; + argstr.i16 = Int16.MinValue; + argstr.ui16 = UInt16.MaxValue; + argstr.i64 = -1234567890; + argstr.ui64 = 1234567890; + argstr.sgl = 32.0F; + argstr.d = 3.2; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructNumberSequentialByRef_Cdecl(NumberSequentialByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructNumberSequentialByRef_StdCall(NumberSequentialByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NumberSequential NumberSequentialByValCdeclcaller([In, Out] NumberSequential argStr); + private static NumberSequential TestMethodForStructNumberSequential_ReversePInvokeByVal_Cdecl(NumberSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + NumberSequential change_is = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4); + //Check the input + Assert.IsTrue(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.i32 = Int32.MinValue; + argstr.ui32 = UInt32.MaxValue; + argstr.s1 = short.MinValue; + argstr.us1 = ushort.MaxValue; + argstr.b = byte.MinValue; + argstr.sb = sbyte.MaxValue; + argstr.i16 = Int16.MinValue; + argstr.ui16 = UInt16.MaxValue; + argstr.i64 = -1234567890; + argstr.ui64 = 1234567890; + argstr.sgl = 32.0F; + argstr.d = 3.2; + return argstr; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate NumberSequential NumberSequentialByValStdCallcaller([In, Out] NumberSequential argStr); + private static NumberSequential TestMethodForStructNumberSequential_ReversePInvokeByVal_StdCall(NumberSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + NumberSequential change_is = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4); + //Check the input + Assert.IsTrue(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.i32 = Int32.MinValue; + argstr.ui32 = UInt32.MaxValue; + argstr.s1 = short.MinValue; + argstr.us1 = ushort.MaxValue; + argstr.b = byte.MinValue; + argstr.sb = sbyte.MaxValue; + argstr.i16 = Int16.MinValue; + argstr.ui16 = UInt16.MaxValue; + argstr.i64 = -1234567890; + argstr.ui64 = 1234567890; + argstr.sgl = 32.0F; + argstr.d = 3.2; + return argstr; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructNumberSequentialByVal_Cdecl(NumberSequentialByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructNumberSequentialByVal_StdCall(NumberSequentialByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct S3 declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool S3ByRefCdeclcaller([In, Out]ref S3 argStr); + private static bool TestMethodForStructS3_ReversePInvokeByRef_Cdecl(ref S3 argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + int[] iarr = new int[256]; + int[] icarr = new int[256]; + Helper.InitialArray(iarr, icarr); + S3 changeS3 = Helper.NewS3(false, "change string", icarr); + //Check the input + Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.flag = true; + argstr.str = "some string"; + argstr.vals = iarr; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool S3ByRefStdCallcaller([In, Out]ref S3 argStr); + private static bool TestMethodForStructS3_ReversePInvokeByRef_StdCall(ref S3 argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + int[] iarr = new int[256]; + int[] icarr = new int[256]; + Helper.InitialArray(iarr, icarr); + S3 changeS3 = Helper.NewS3(false, "change string", icarr); + //Check the input + Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.flag = true; + argstr.str = "some string"; + argstr.vals = iarr; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructS3ByRef_Cdecl(S3ByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructS3ByRef_StdCall(S3ByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool S3ByValCdeclcaller([In, Out] S3 argStr); + private static bool TestMethodForStructS3_ReversePInvokeByVal_Cdecl(S3 argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + int[] iarr = new int[256]; + int[] icarr = new int[256]; + Helper.InitialArray(iarr, icarr); + S3 changeS3 = Helper.NewS3(false, "change string", icarr); + //Check the input + Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.flag = true; + argstr.str = "some string"; + argstr.vals = iarr; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool S3ByValStdCallcaller([In, Out] S3 argStr); + private static bool TestMethodForStructS3_ReversePInvokeByVal_StdCall(S3 argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + int[] iarr = new int[256]; + int[] icarr = new int[256]; + Helper.InitialArray(iarr, icarr); + S3 changeS3 = Helper.NewS3(false, "change string", icarr); + //Check the input + Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.flag = true; + argstr.str = "some string"; + argstr.vals = iarr; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructS3ByVal_Cdecl(S3ByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructS3ByVal_StdCall(S3ByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct S5 declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool S5ByRefCdeclcaller([In, Out]ref S5 argStr); + private static bool TestMethodForStructS5_ReversePInvokeByRef_Cdecl(ref S5 argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + Enum1 enums = Enum1.e1; + Enum1 enumch = Enum1.e2; + S4 s4 = new S4(); + s4.age = 32; + s4.name = "some string"; + S5 changeS5 = Helper.NewS5(64, "change string", enumch); + //Check the input + Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.s4 = s4; + argstr.ef = enums; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool S5ByRefStdCallcaller([In, Out]ref S5 argStr); + private static bool TestMethodForStructS5_ReversePInvokeByRef_StdCall(ref S5 argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + Enum1 enums = Enum1.e1; + Enum1 enumch = Enum1.e2; + S4 s4 = new S4(); + s4.age = 32; + s4.name = "some string"; + S5 changeS5 = Helper.NewS5(64, "change string", enumch); + //Check the input + Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByRef_StdCall")); + //Chanage the value + argstr.s4 = s4; + argstr.ef = enums; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructS5ByRef_Cdecl(S5ByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructS5ByRef_StdCall(S5ByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool S5ByValCdeclcaller([In, Out] S5 argStr); + private static bool TestMethodForStructS5_ReversePInvokeByVal_Cdecl(S5 argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + Enum1 enums = Enum1.e1; + Enum1 enumch = Enum1.e2; + S4 s4 = new S4(); + s4.age = 32; + s4.name = "some string"; + S5 changeS5 = Helper.NewS5(64, "change string", enumch); + //Check the input + Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.s4 = s4; + argstr.ef = enums; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool S5ByValStdCallcaller([In, Out] S5 argStr); + private static bool TestMethodForStructS5_ReversePInvokeByVal_StdCall(S5 argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + Enum1 enums = Enum1.e1; + Enum1 enumch = Enum1.e2; + S4 s4 = new S4(); + s4.age = 32; + s4.name = "some string"; + S5 changeS5 = Helper.NewS5(64, "change string", enumch); + //Check the input + Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.s4 = s4; + argstr.ef = enums; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructS5ByVal_Cdecl(S5ByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructS5ByVal_StdCall(S5ByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct StringStructSequentialAnsi declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool StringStructSequentialAnsiByRefCdeclcaller([In, Out]ref StringStructSequentialAnsi argStr); + private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_Cdecl(ref StringStructSequentialAnsi argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + strOne = new String('a', 512); + strTwo = new String('b', 512); + StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne); + //Check the input + Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.first = strOne; + argstr.last = strTwo; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool StringStructSequentialAnsiByRefStdCallcaller([In, Out]ref StringStructSequentialAnsi argStr); + private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_StdCall(ref StringStructSequentialAnsi argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + strOne = new String('a', 512); + strTwo = new String('b', 512); + StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne); + //Check the input + Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_StdCall")); + //Chanage the value + argstr.first = strOne; + argstr.last = strTwo; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructStringStructSequentialAnsiByRef_Cdecl(StringStructSequentialAnsiByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructStringStructSequentialAnsiByRef_StdCall(StringStructSequentialAnsiByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool StringStructSequentialAnsiByValCdeclcaller([In, Out] StringStructSequentialAnsi argStr); + private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_Cdecl(StringStructSequentialAnsi argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + strOne = new String('a', 512); + strTwo = new String('b', 512); + StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne); + //Check the input + Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.first = strOne; + argstr.last = strTwo; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool StringStructSequentialAnsiByValStdCallcaller([In, Out] StringStructSequentialAnsi argStr); + private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_StdCall(StringStructSequentialAnsi argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + strOne = new String('a', 512); + strTwo = new String('b', 512); + StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne); + //Check the input + Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.first = strOne; + argstr.last = strTwo; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructStringStructSequentialAnsiByVal_Cdecl(StringStructSequentialAnsiByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructStringStructSequentialAnsiByVal_StdCall(StringStructSequentialAnsiByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct StringStructSequentialUnicode declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool StringStructSequentialUnicodeByRefCdeclcaller([In, Out]ref StringStructSequentialUnicode argStr); + private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_Cdecl(ref StringStructSequentialUnicode argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + strOne = new String('a', 256); + strTwo = new String('b', 256); + StringStructSequentialUnicode change_sssa = Helper.NewStringStructSequentialUnicode(strTwo, strOne); + //Check the input + Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.first = strOne; + argstr.last = strTwo; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool StringStructSequentialUnicodeByRefStdCallcaller([In, Out]ref StringStructSequentialUnicode argStr); + private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_StdCall(ref StringStructSequentialUnicode argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + strOne = new String('a', 256); + strTwo = new String('b', 256); + StringStructSequentialUnicode change_sssa = Helper.NewStringStructSequentialUnicode(strTwo, strOne); + //Check the input + Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_StdCall")); + //Chanage the value + argstr.first = strOne; + argstr.last = strTwo; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_Cdecl(StringStructSequentialUnicodeByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_StdCall(StringStructSequentialUnicodeByRefStdCallcaller caller); + + #endregion + + #region PassByValue + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool StringStructSequentialUnicodeByValCdeclcaller([In, Out] StringStructSequentialUnicode argStr); + private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_Cdecl(StringStructSequentialUnicode argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + strOne = new String('a', 256); + strTwo = new String('b', 256); + StringStructSequentialUnicode change_sssa = Helper.NewStringStructSequentialUnicode(strTwo, strOne); + //Check the input + Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.first = strOne; + argstr.last = strTwo; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool StringStructSequentialUnicodeByValStdCallcaller([In, Out] StringStructSequentialUnicode argStr); + private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_StdCall(StringStructSequentialUnicode argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + strOne = new String('a', 256); + strTwo = new String('b', 256); + StringStructSequentialUnicode change_sssa = Helper.NewStringStructSequentialUnicode(strTwo, strOne); + //Check the input + Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.first = strOne; + argstr.last = strTwo; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_Cdecl(StringStructSequentialUnicodeByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_StdCall(StringStructSequentialUnicodeByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct S8 declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool S8ByRefCdeclcaller([In, Out]ref S8 argStr); + private static bool TestMethodForStructS8_ReversePInvokeByRef_Cdecl(ref S8 argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64); + //Check the input + Assert.IsTrue(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.name = "hello"; + argstr.gender = true; + argstr.jobNum = 10; + argstr.i32 = 128; + argstr.ui32 = 128; + argstr.mySByte = 32; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool S8ByRefStdCallcaller([In, Out]ref S8 argStr); + private static bool TestMethodForStructS8_ReversePInvokeByRef_StdCall(ref S8 argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64); + //Check the input + Assert.IsTrue(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.name = "hello"; + argstr.gender = true; + argstr.jobNum = 10; + argstr.i32 = 128; + argstr.ui32 = 128; + argstr.mySByte = 32; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructS8ByRef_Cdecl(S8ByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructS8ByRef_StdCall(S8ByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool S8ByValCdeclcaller([In, Out] S8 argStr); + private static bool TestMethodForStructS8_ReversePInvokeByVal_Cdecl(S8 argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64); + //Check the input + Assert.IsTrue(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.name = "hello"; + argstr.gender = true; + argstr.jobNum = 10; + argstr.i32 = 128; + argstr.ui32 = 128; + argstr.mySByte = 32; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool S8ByValStdCallcaller([In, Out] S8 argStr); + private static bool TestMethodForStructS8_ReversePInvokeByVal_StdCall(S8 argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64); + //Check the input + Assert.IsTrue(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.name = "hello"; + argstr.gender = true; + argstr.jobNum = 10; + argstr.i32 = 128; + argstr.ui32 = 128; + argstr.mySByte = 32; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructS8ByVal_Cdecl(S8ByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructS8ByVal_StdCall(S8ByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct S9 declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool S9ByRefCdeclcaller([In, Out]ref S9 argStr); + private static bool TestMethodForStructS9_ReversePInvokeByRef_Cdecl(ref S9 argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + S9 changeS9 = Helper.NewS9(256, null); + //Check the input + Assert.IsTrue(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.i32 = 128; + argstr.myDelegate1 = new TestDelegate1(testMethod); + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool S9ByRefStdCallcaller([In, Out]ref S9 argStr); + private static bool TestMethodForStructS9_ReversePInvokeByRef_StdCall(ref S9 argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + S9 changeS9 = Helper.NewS9(256, null); + //Check the input + Assert.IsTrue(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByRef_StdCall")); + //Chanage the value + argstr.i32 = 128; + argstr.myDelegate1 = new TestDelegate1(testMethod); + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructS9ByRef_Cdecl(S9ByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructS9ByRef_StdCall(S9ByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool S9ByValCdeclcaller([In, Out] S9 argStr); + private static bool TestMethodForStructS9_ReversePInvokeByVal_Cdecl(S9 argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + S9 changeS9 = Helper.NewS9(256, null); + //Check the input + Assert.IsTrue(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.i32 = 128; + argstr.myDelegate1 = new TestDelegate1(testMethod); + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool S9ByValStdCallcaller([In, Out] S9 argStr); + private static bool TestMethodForStructS9_ReversePInvokeByVal_StdCall(S9 argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + S9 changeS9 = Helper.NewS9(256, null); + //Check the input + Assert.IsTrue(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.i32 = 128; + argstr.myDelegate1 = new TestDelegate1(testMethod); + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructS9ByVal_Cdecl(S9ByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructS9ByVal_StdCall(S9ByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct IncludeOuterIntergerStructSequential declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool IncludeOuterIntergerStructSequentialByRefCdeclcaller([In, Out]ref IncludeOuterIntergerStructSequential argStr); + private static bool TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_Cdecl(ref IncludeOuterIntergerStructSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64); + //Check the input + Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, + changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.s.s_int.i = 32; + argstr.s.i = 32; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool IncludeOuterIntergerStructSequentialByRefStdCallcaller([In, Out]ref IncludeOuterIntergerStructSequential argStr); + private static bool TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_StdCall(ref IncludeOuterIntergerStructSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64); + //Check the input + Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, + changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.s.s_int.i = 32; + argstr.s.i = 32; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl(IncludeOuterIntergerStructSequentialByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall(IncludeOuterIntergerStructSequentialByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate IncludeOuterIntergerStructSequential IncludeOuterIntergerStructSequentialByValCdeclcaller([In, Out] IncludeOuterIntergerStructSequential argStr); + private static IncludeOuterIntergerStructSequential TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_Cdecl(IncludeOuterIntergerStructSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64); + //Check the input + Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, + changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.s.s_int.i = 32; + argstr.s.i = 32; + return argstr; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate IncludeOuterIntergerStructSequential IncludeOuterIntergerStructSequentialByValStdCallcaller([In, Out] IncludeOuterIntergerStructSequential argStr); + private static IncludeOuterIntergerStructSequential TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_StdCall(IncludeOuterIntergerStructSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64); + //Check the input + Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, + changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.s.s_int.i = 32; + argstr.s.i = 32; + return argstr; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl(IncludeOuterIntergerStructSequentialByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall(IncludeOuterIntergerStructSequentialByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct S11 declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool S11ByRefCdeclcaller([In, Out]ref S11 argStr); + unsafe private static bool TestMethodForStructS11_ReversePInvokeByRef_Cdecl(ref S11 argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + S11 changeS11 = Helper.NewS11((int*)(64), 64); + //Check the input + Assert.IsTrue(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByRef_Cdecl")); + //Chanage the value + argstr.i32 = (int*)(32); + argstr.i = 32; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool S11ByRefStdCallcaller([In, Out]ref S11 argStr); + unsafe private static bool TestMethodForStructS11_ReversePInvokeByRef_StdCall(ref S11 argstr) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + S11 changeS11 = Helper.NewS11((int*)(64), 64); + //Check the input + Assert.IsTrue(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByRef_StdCall")); + //Chanage the value + argstr.i32 = (int*)(32); + argstr.i = 32; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructS11ByRef_Cdecl(S11ByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructS11ByRef_StdCall(S11ByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool S11ByValCdeclcaller([In, Out] S11 argStr); + unsafe private static bool TestMethodForStructS11_ReversePInvokeByVal_Cdecl(S11 argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + S11 changeS11 = Helper.NewS11((int*)(64), 64); + //Check the input + Assert.IsTrue(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.i32 = (int*)(32); + argstr.i = 32; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool S11ByValStdCallcaller([In, Out] S11 argStr); + unsafe private static bool TestMethodForStructS11_ReversePInvokeByVal_StdCall(S11 argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + S11 changeS11 = Helper.NewS11((int*)(64), 64); + //Check the input + Assert.IsTrue(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.i32 = (int*)(32); + argstr.i = 32; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructS11ByVal_Cdecl(S11ByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructS11ByVal_StdCall(S11ByValStdCallcaller caller); + + #endregion + + #endregion + + #region Methods for the struct ComplexStruct declaration + + #region PassByRef + + //For Reverse Pinvoke ByRef + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool ComplexStructByRefCdeclcaller([In, Out]ref ComplexStruct argStr); + private static bool TestMethodForStructComplexStruct_ReversePInvokeByRef_Cdecl(ref ComplexStruct cs) + { + Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); + //Check the input + Assert.AreEqual(9999, cs.i); + Assert.IsFalse(cs.b); + Assert.AreEqual("Native", cs.str); + Assert.AreEqual(-1, cs.type.idata); + Assert.AreEqual(3.14159, cs.type.ddata); + //Chanage the value + cs.i = 321; + cs.b = true; + cs.str = "Managed"; + cs.type.idata = 123; + cs.type.ptrdata = (IntPtr)0x120000; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool ComplexStructByRefStdCallcaller([In, Out]ref ComplexStruct argStr); + private static bool TestMethodForStructComplexStruct_ReversePInvokeByRef_StdCall(ref ComplexStruct cs) + { + Console.WriteLine("ReversePinvoke,By Ref,StdCall"); + //Check the input + Assert.AreEqual(9999, cs.i); + Assert.IsFalse(cs.b); + Assert.AreEqual("Native", cs.str); + Assert.AreEqual(-1, cs.type.idata); + Assert.AreEqual(3.14159, cs.type.ddata); + //Chanage the value + cs.i = 321; + cs.b = true; + cs.str = "Managed"; + cs.type.idata = 123; + cs.type.ptrdata = (IntPtr)0x120000; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructComplexStructByRef_Cdecl(ComplexStructByRefCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructComplexStructByRef_StdCall(ComplexStructByRefStdCallcaller caller); + + #endregion + + #region PassByValue + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool ComplexStructByValCdeclcaller([In, Out] ComplexStruct argStr); + private static bool TestMethodForStructComplexStruct_ReversePInvokeByVal_Cdecl(ComplexStruct cs) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + //Check the input + Assert.AreEqual(9999, cs.i); + Assert.IsFalse(cs.b); + Assert.AreEqual("Native", cs.str); + Assert.AreEqual(-1, cs.type.idata); + Assert.AreEqual(3.14159, cs.type.ddata); + //Try to Chanage the value + cs.i = 321; + cs.b = true; + cs.str = "Managed"; + cs.type.idata = 123; + cs.type.ptrdata = (IntPtr)0x120000; + return true; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate bool ComplexStructByValStdCallcaller([In, Out] ComplexStruct argStr); + private static bool TestMethodForStructComplexStruct_ReversePInvokeByVal_StdCall(ComplexStruct cs) + { + Console.WriteLine("Reverse Pinvoke,By Value,StdCall"); + //Check the input + Assert.AreEqual(9999, cs.i); + Assert.IsFalse(cs.b); + Assert.AreEqual("Native", cs.str); + Assert.AreEqual(-1, cs.type.idata); + Assert.AreEqual(3.14159, cs.type.ddata); + //Try to Chanage the value + cs.i = 321; + cs.b = true; + cs.str = "Managed"; + cs.type.idata = 123; + cs.type.ptrdata = (IntPtr)0x120000; + return true; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructComplexStructByVal_Cdecl(ComplexStructByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructComplexStructByVal_StdCall(ComplexStructByValStdCallcaller caller); + + #endregion + + #endregion + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate ByteStruct3Byte ByValCdeclcaller_ByteStruct3Byte(ByteStruct3Byte bspe, [MarshalAs(UnmanagedType.Bool)] out bool success); + + public static ByteStruct3Byte TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_Cdecl(ByteStruct3Byte bspe, out bool success) + { + Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl"); + ByteStruct3Byte change_bspe = Helper.NewByteStruct3Byte(1, 42, 90); + Assert.IsTrue(Helper.ValidateByteStruct3Byte(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_Cdecl")); + //changed the value + bspe.b1 = 7; + bspe.b2 = 12; + bspe.b3 = 18; + success = true; + return bspe; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate ByteStruct3Byte ByValStdCallcaller_ByteStruct3Byte(ByteStruct3Byte bspe, [MarshalAs(UnmanagedType.Bool)] out bool success); + + public static ByteStruct3Byte TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_StdCall(ByteStruct3Byte bspe, out bool success) + { + Console.WriteLine("Reverse,Pinvoke,By Val,StdCall"); + ByteStruct3Byte change_bspe = Helper.NewByteStruct3Byte(1, 42, 90); + Assert.IsTrue(Helper.ValidateByteStruct3Byte(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_StdCall")); + //changed the value + bspe.b1 = 7; + bspe.b2 = 12; + bspe.b3 = 18; + success = true; + return bspe; + } + + + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte(ByValStdCallcaller_ByteStruct3Byte caller); + + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructByVal_Cdecl_ByteStruct3Byte(ByValCdeclcaller_ByteStruct3Byte caller); + + //For Reverse Pinvoke ByVal + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate IntergerStructSequential IntergerStructSequentialByValCdeclcaller([In, Out] IntergerStructSequential argStr); + private static IntergerStructSequential TestMethodForStructIntergerStructSequential_ReversePInvokeByVal_Cdecl(IntergerStructSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,Cdecl"); + IntergerStructSequential changeIntergerStructSequential = Helper.NewIntergerStructSequential(64); + //Check the input + Assert.IsTrue(Helper.ValidateIntergerStructSequential(argstr, + changeIntergerStructSequential, "TestMethodForStructIntergerStructSequential_ReversePInvokeByVal_Cdecl")); + //Chanage the value + argstr.i = 32; + return argstr; + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate IntergerStructSequential IntergerStructSequentialByValStdCallcaller([In, Out] IntergerStructSequential argStr); + private static IntergerStructSequential TestMethodForStructIntergerStructSequential_ReversePInvokeByVal_StdCall(IntergerStructSequential argstr) + { + Console.WriteLine("ReversePinvoke,By Value,StdCall"); + IntergerStructSequential changeIntergerStructSequential = Helper.NewIntergerStructSequential(64); + //Check the input + Assert.IsTrue(Helper.ValidateIntergerStructSequential(argstr, + changeIntergerStructSequential, "TestMethodForStructIntergerStructSequential_ReversePInvokeByVal_StdCall")); + //Chanage the value + argstr.i = 32; + return argstr; + } + + //Reverse Pinvoke,cdecl + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.Cdecl)] + public static extern bool DoCallBack_MarshalStructIntergerStructSequentialByVal_Cdecl(IntergerStructSequentialByValCdeclcaller caller); + //Reverse Pinvoke,stdcall + [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] + public static extern bool DoCallBack_MarshalStructIntergerStructSequentialByVal_StdCall(IntergerStructSequentialByValStdCallcaller caller); + + #region Methods implementation + + //Reverse P/Invoke By Ref + private static void TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID structid) + { + switch (structid) + { + case StructID.ComplexStructId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexStructByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructComplexStructByRef_Cdecl(new ComplexStructByRefCdeclcaller(TestMethodForStructComplexStruct_ReversePInvokeByRef_Cdecl))); + break; + case StructID.InnerSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerSequentialByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructInnerSequentialByRef_Cdecl(new InnerSequentialByRefCdeclcaller(TestMethodForStructInnerSequential_ReversePInvokeByRef_Cdecl))); + break; + case StructID.InnerArraySequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByRef_Cdecl( + new InnerArraySequentialByRefCdeclcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByRef_Cdecl))); + break; + case StructID.CharSetAnsiSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByRef_Cdecl( + new CharSetAnsiSequentialByRefCdeclcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_Cdecl))); + break; + case StructID.CharSetUnicodeSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByRef_Cdecl( + new CharSetUnicodeSequentialByRefCdeclcaller(TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_Cdecl))); + break; + case StructID.NumberSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructNumberSequentialByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructNumberSequentialByRef_Cdecl(new NumberSequentialByRefCdeclcaller(TestMethodForStructNumberSequential_ReversePInvokeByRef_Cdecl))); + break; + case StructID.S3Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS3ByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructS3ByRef_Cdecl(new S3ByRefCdeclcaller(TestMethodForStructS3_ReversePInvokeByRef_Cdecl))); + break; + case StructID.S5Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS5ByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructS5ByRef_Cdecl(new S5ByRefCdeclcaller(TestMethodForStructS5_ReversePInvokeByRef_Cdecl))); + break; + case StructID.StringStructSequentialAnsiId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByRef_Cdecl( + new StringStructSequentialAnsiByRefCdeclcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_Cdecl))); + break; + case StructID.StringStructSequentialUnicodeId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_Cdecl( + new StringStructSequentialUnicodeByRefCdeclcaller(TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_Cdecl))); + break; + case StructID.S8Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS8ByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructS8ByRef_Cdecl(new S8ByRefCdeclcaller(TestMethodForStructS8_ReversePInvokeByRef_Cdecl))); + break; + case StructID.S9Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS9ByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructS9ByRef_Cdecl(new S9ByRefCdeclcaller(TestMethodForStructS9_ReversePInvokeByRef_Cdecl))); + break; + case StructID.IncludeOuterIntergerStructSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl( + new IncludeOuterIntergerStructSequentialByRefCdeclcaller(TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_Cdecl))); + break; + case StructID.S11Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS11ByRef_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructS11ByRef_Cdecl(new S11ByRefCdeclcaller(TestMethodForStructS11_ReversePInvokeByRef_Cdecl))); + break; + default: + Assert.Fail("DoCallBack_MarshalStructByRef_Cdecl:The structid (Managed Side) is wrong"); + break; + } + } + + private static void TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID structid) + { + switch (structid) + { + case StructID.ComplexStructId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexStructByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructComplexStructByRef_StdCall(new ComplexStructByRefStdCallcaller(TestMethodForStructComplexStruct_ReversePInvokeByRef_StdCall))); + break; + case StructID.InnerSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerSequentialByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructInnerSequentialByRef_StdCall(new InnerSequentialByRefStdCallcaller(TestMethodForStructInnerSequential_ReversePInvokeByRef_StdCall))); + break; + case StructID.InnerArraySequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByRef_StdCall( + new InnerArraySequentialByRefStdCallcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByRef_StdCall))); + break; + case StructID.CharSetAnsiSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByRef_StdCall( + new CharSetAnsiSequentialByRefStdCallcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_StdCall))); + break; + case StructID.CharSetUnicodeSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByRef_StdCall( + new CharSetUnicodeSequentialByRefStdCallcaller(TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_StdCall))); + break; + case StructID.NumberSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructNumberSequentialByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructNumberSequentialByRef_StdCall(new NumberSequentialByRefStdCallcaller(TestMethodForStructNumberSequential_ReversePInvokeByRef_StdCall))); + break; + case StructID.S3Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS3ByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructS3ByRef_StdCall(new S3ByRefStdCallcaller(TestMethodForStructS3_ReversePInvokeByRef_StdCall))); + break; + case StructID.S5Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS5ByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructS5ByRef_StdCall(new S5ByRefStdCallcaller(TestMethodForStructS5_ReversePInvokeByRef_StdCall))); + break; + case StructID.StringStructSequentialAnsiId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByRef_StdCall( + new StringStructSequentialAnsiByRefStdCallcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_StdCall))); + break; + case StructID.StringStructSequentialUnicodeId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_StdCall( + new StringStructSequentialUnicodeByRefStdCallcaller(TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_StdCall))); + break; + case StructID.S8Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS8ByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructS8ByRef_StdCall(new S8ByRefStdCallcaller(TestMethodForStructS8_ReversePInvokeByRef_StdCall))); + break; + case StructID.S9Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS9ByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructS9ByRef_StdCall(new S9ByRefStdCallcaller(TestMethodForStructS9_ReversePInvokeByRef_StdCall))); + break; + case StructID.IncludeOuterIntergerStructSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall( + new IncludeOuterIntergerStructSequentialByRefStdCallcaller(TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_StdCall))); + break; + case StructID.S11Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS11ByRef_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructS11ByRef_StdCall(new S11ByRefStdCallcaller(TestMethodForStructS11_ReversePInvokeByRef_StdCall))); + break; + default: + Assert.Fail("DoCallBack_MarshalStructByRef_StdCall:The structid (Managed Side) is wrong"); + break; + } + } + + private static void Run_TestMethod_DoCallBack_MarshalStructByRef_Cdecl() + { + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.ComplexStructId); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.InnerSequentialId); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.InnerArraySequentialId); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.CharSetAnsiSequentialId); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.CharSetUnicodeSequentialId); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.NumberSequentialId); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.S3Id); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.S5Id); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.StringStructSequentialAnsiId); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.StringStructSequentialUnicodeId); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.S8Id); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.S9Id); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.IncludeOuterIntergerStructSequentialId); + TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID.S11Id); + } + + private static void Run_TestMethod_DoCallBack_MarshalStructByRef_StdCall() + { + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.ComplexStructId); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.InnerSequentialId); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.InnerArraySequentialId); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.CharSetAnsiSequentialId); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.CharSetUnicodeSequentialId); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.NumberSequentialId); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.S3Id); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.S5Id); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.StringStructSequentialAnsiId); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.StringStructSequentialUnicodeId); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.S8Id); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.S9Id); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.IncludeOuterIntergerStructSequentialId); + TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID.S11Id); + } + + //Reverse P/Invoke By Value + private static void TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID structid) + { + switch (structid) + { + case StructID.ComplexStructId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexeStructByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructComplexStructByVal_Cdecl(new ComplexStructByValCdeclcaller(TestMethodForStructComplexStruct_ReversePInvokeByVal_Cdecl))); + break; + case StructID.InnerSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerSequentialByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructInnerSequentialByVal_Cdecl(new InnerSequentialByValCdeclcaller(TestMethodForStructInnerSequential_ReversePInvokeByVal_Cdecl))); + break; + case StructID.InnerArraySequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByVal_Cdecl( + new InnerArraySequentialByValCdeclcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByVal_Cdecl))); + break; + case StructID.CharSetAnsiSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByVal_Cdecl + (new CharSetAnsiSequentialByValCdeclcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_Cdecl))); + break; + case StructID.CharSetUnicodeSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_Cdecl( + new CharSetUnicodeSequentialByValCdeclcaller(TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_Cdecl))); + break; + case StructID.NumberSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructNumberSequentialByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructNumberSequentialByVal_Cdecl(new NumberSequentialByValCdeclcaller(TestMethodForStructNumberSequential_ReversePInvokeByVal_Cdecl))); + break; + case StructID.S3Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS3ByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructS3ByVal_Cdecl(new S3ByValCdeclcaller(TestMethodForStructS3_ReversePInvokeByVal_Cdecl))); + break; + case StructID.S5Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS5ByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructS5ByVal_Cdecl(new S5ByValCdeclcaller(TestMethodForStructS5_ReversePInvokeByVal_Cdecl))); + break; + case StructID.StringStructSequentialAnsiId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByVal_Cdecl( + new StringStructSequentialAnsiByValCdeclcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_Cdecl))); + break; + case StructID.StringStructSequentialUnicodeId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_Cdecl( + new StringStructSequentialUnicodeByValCdeclcaller(TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_Cdecl))); + break; + case StructID.S8Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS8ByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructS8ByVal_Cdecl(new S8ByValCdeclcaller(TestMethodForStructS8_ReversePInvokeByVal_Cdecl))); + break; + case StructID.S9Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS9ByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructS9ByVal_Cdecl(new S9ByValCdeclcaller(TestMethodForStructS9_ReversePInvokeByVal_Cdecl))); + break; + case StructID.IncludeOuterIntergerStructSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl( + new IncludeOuterIntergerStructSequentialByValCdeclcaller(TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_Cdecl))); + break; + case StructID.S11Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS11ByVal_Cdecl..."); + Assert.IsTrue(DoCallBack_MarshalStructS11ByVal_Cdecl(new S11ByValCdeclcaller(TestMethodForStructS11_ReversePInvokeByVal_Cdecl))); + break; + case StructID.ByteStruct3Byte: + Console.WriteLine("Calling DoCallBack_MarshalStructByVal_Cdecl_ByteStruct3Byte..."); + Assert.IsTrue(DoCallBack_MarshalStructByVal_Cdecl_ByteStruct3Byte( + new ByValCdeclcaller_ByteStruct3Byte(TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_Cdecl))); + break; + default: + Assert.Fail("DoCallBack_MarshalStructByVal_Cdecl:The structid (Managed Side) is wrong"); + break; + } + } + + private static void TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID structid) + { + switch (structid) + { + case StructID.ComplexStructId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexStructByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructComplexStructByVal_StdCall(new ComplexStructByValStdCallcaller(TestMethodForStructComplexStruct_ReversePInvokeByVal_StdCall))); + break; + case StructID.InnerSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerSequentialByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructInnerSequentialByVal_StdCall(new InnerSequentialByValStdCallcaller(TestMethodForStructInnerSequential_ReversePInvokeByVal_StdCall))); + break; + case StructID.InnerArraySequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByVal_StdCall( + new InnerArraySequentialByValStdCallcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByVal_StdCall))); + break; + case StructID.CharSetAnsiSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByVal_StdCall( + new CharSetAnsiSequentialByValStdCallcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_StdCall))); + break; + case StructID.CharSetUnicodeSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_StdCall( + new CharSetUnicodeSequentialByValStdCallcaller(TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_StdCall))); + break; + case StructID.NumberSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructNumberSequentialByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructNumberSequentialByVal_StdCall(new NumberSequentialByValStdCallcaller(TestMethodForStructNumberSequential_ReversePInvokeByVal_StdCall))); + break; + case StructID.S3Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS3ByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructS3ByVal_StdCall(new S3ByValStdCallcaller(TestMethodForStructS3_ReversePInvokeByVal_StdCall))); + break; + case StructID.S5Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS5ByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructS5ByVal_StdCall(new S5ByValStdCallcaller(TestMethodForStructS5_ReversePInvokeByVal_StdCall))); + break; + case StructID.StringStructSequentialAnsiId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByVal_StdCall( + new StringStructSequentialAnsiByValStdCallcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_StdCall))); + break; + case StructID.StringStructSequentialUnicodeId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_StdCall( + new StringStructSequentialUnicodeByValStdCallcaller(TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_StdCall))); + break; + case StructID.S8Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS8ByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructS8ByVal_StdCall(new S8ByValStdCallcaller(TestMethodForStructS8_ReversePInvokeByVal_StdCall))); + break; + case StructID.S9Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS9ByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructS9ByVal_StdCall(new S9ByValStdCallcaller(TestMethodForStructS9_ReversePInvokeByVal_StdCall))); + break; + case StructID.IncludeOuterIntergerStructSequentialId: + Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall( + new IncludeOuterIntergerStructSequentialByValStdCallcaller(TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_StdCall))); + break; + case StructID.S11Id: + Console.WriteLine("Calling ReversePInvoke_MarshalStructS11ByVal_StdCall..."); + Assert.IsTrue(DoCallBack_MarshalStructS11ByVal_StdCall(new S11ByValStdCallcaller(TestMethodForStructS11_ReversePInvokeByVal_StdCall))); + break; + case StructID.ByteStruct3Byte: + Console.WriteLine("Calling DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte..."); + Assert.IsTrue(DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte( + new ByValStdCallcaller_ByteStruct3Byte(TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_StdCall))); + break; + default: + Assert.Fail("DoCallBack_MarshalStructByVal_StdCall:The structid (Managed Side) is wrong"); + break; + } + } + + private static void Run_TestMethod_DoCallBack_MarshalStructByVal_Cdecl() + { + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.ComplexStructId); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.InnerSequentialId); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.InnerArraySequentialId); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.CharSetAnsiSequentialId); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.CharSetUnicodeSequentialId); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.NumberSequentialId); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.S3Id); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.S5Id); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.StringStructSequentialAnsiId); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.StringStructSequentialUnicodeId); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.S8Id); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.S9Id); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.IncludeOuterIntergerStructSequentialId); + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.S11Id); + // Windows X86 has a long standing X86_ONLY logic that causes 3, 5,6,7 byte structure returns to behave incorrectly. + if ((RuntimeInformation.ProcessArchitecture != Architecture.X86) || !RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID.ByteStruct3Byte); + } + } + + private static void Run_TestMethod_DoCallBack_MarshalStructByVal_StdCall() + { + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.ComplexStructId); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.InnerSequentialId); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.InnerArraySequentialId); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.CharSetAnsiSequentialId); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.CharSetUnicodeSequentialId); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.NumberSequentialId); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.S3Id); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.S5Id); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.StringStructSequentialAnsiId); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.StringStructSequentialUnicodeId); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.S8Id); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.S9Id); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.IncludeOuterIntergerStructSequentialId); + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.S11Id); + // Windows X86 has a long standing X86_ONLY logic that causes 3, 5,6,7 byte structure returns to behave incorrectly. + if ((RuntimeInformation.ProcessArchitecture != Architecture.X86) || !RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.ByteStruct3Byte); + } + } + + #endregion + + static int Main() + { + try{ + + //Reverse Pinvoke,ByRef,cdecl + Console.WriteLine("Run the methods for marshaling struct Reverse P/Invoke ByRef"); + Run_TestMethod_DoCallBack_MarshalStructByRef_Cdecl(); + Run_TestMethod_DoCallBack_MarshalStructByRef_StdCall(); + + //Reverse PInvoke,ByValue,Cdcel + Console.WriteLine("Run the methods for marshaling struct Reverse P/Invoke ByVal"); + Run_TestMethod_DoCallBack_MarshalStructByVal_Cdecl(); + Run_TestMethod_DoCallBack_MarshalStructByVal_StdCall(); + + return 100; + } + catch (Exception e) + { + Console.WriteLine($"Test Failure: {e}"); + return 101; + } + } +} \ No newline at end of file diff --git a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/SeqStructDelRevPInvokeNative.cpp b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/SeqStructDelRevPInvokeNative.cpp index dcd124a97b9dd1..c6898329fbd177 100644 --- a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/SeqStructDelRevPInvokeNative.cpp +++ b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/SeqStructDelRevPInvokeNative.cpp @@ -1399,7 +1399,7 @@ extern "C" DLL_EXPORT BOOL __stdcall MarshalStructNumberSequentialByVal_StdCall( return TRUE; } -typedef BOOL (_cdecl *NumberSequentialByValCdeclCaller)(NumberSequential cs); +typedef NumberSequential (_cdecl *NumberSequentialByValCdeclCaller)(NumberSequential cs); extern "C" DLL_EXPORT BOOL _cdecl DoCallBack_MarshalStructNumberSequentialByVal_Cdecl(NumberSequentialByValCdeclCaller caller) { //Init @@ -1418,9 +1418,12 @@ extern "C" DLL_EXPORT BOOL _cdecl DoCallBack_MarshalStructNumberSequentialByVal_ argstr.sgl = 64.0; argstr.d = 6.4; - if(!caller(argstr)) + NumberSequential retstr = caller(argstr); + + if (!IsCorrectNumberSequential(&retstr)) { printf("DoCallBack_MarshalStructNumberSequentialByVal_Cdecl:The Caller returns wrong value\n"); + PrintNumberSequential(&retstr, "retstr"); return FALSE; } @@ -1435,7 +1438,7 @@ extern "C" DLL_EXPORT BOOL _cdecl DoCallBack_MarshalStructNumberSequentialByVal_ return TRUE; } -typedef BOOL (__stdcall *NumberSequentialByValStdCallCaller)(NumberSequential cs); +typedef NumberSequential (__stdcall *NumberSequentialByValStdCallCaller)(NumberSequential cs); extern "C" DLL_EXPORT BOOL __stdcall DoCallBack_MarshalStructNumberSequentialByVal_StdCall(NumberSequentialByValStdCallCaller caller) { //Init @@ -1454,9 +1457,12 @@ extern "C" DLL_EXPORT BOOL __stdcall DoCallBack_MarshalStructNumberSequentialByV argstr.sgl = 64.0; argstr.d = 6.4; - if(!caller(argstr)) + NumberSequential retstr = caller(argstr); + + if (!IsCorrectNumberSequential(&retstr)) { printf("DoCallBack_MarshalStructNumberSequentialByVal_StdCall:The Caller returns wrong value\n"); + PrintNumberSequential(&retstr, "retstr"); return FALSE; } @@ -3013,7 +3019,7 @@ extern "C" DLL_EXPORT BOOL __stdcall MarshalStructIncludeOuterIntergerStructSequ return TRUE; } -typedef BOOL (_cdecl *IncludeOuterIntergerStructSequentialByValCdeclCaller)(IncludeOuterIntergerStructSequential cs); +typedef IncludeOuterIntergerStructSequential (_cdecl *IncludeOuterIntergerStructSequentialByValCdeclCaller)(IncludeOuterIntergerStructSequential cs); extern "C" DLL_EXPORT BOOL _cdecl DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl(IncludeOuterIntergerStructSequentialByValCdeclCaller caller) { //Init @@ -3022,9 +3028,12 @@ extern "C" DLL_EXPORT BOOL _cdecl DoCallBack_MarshalStructIncludeOuterIntergerSt argstr.s.s_int.i = 64; argstr.s.i = 64; - if(!caller(argstr)) + IncludeOuterIntergerStructSequential retstr = caller(argstr); + + if (!IsCorrectIncludeOuterIntergerStructSequential(&retstr)) { printf("DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl:The Caller returns wrong value\n"); + PrintIncludeOuterIntergerStructSequential(&retstr, "retstr"); return FALSE; } @@ -3037,7 +3046,7 @@ extern "C" DLL_EXPORT BOOL _cdecl DoCallBack_MarshalStructIncludeOuterIntergerSt return TRUE; } -typedef BOOL (__stdcall *IncludeOuterIntergerStructSequentialByValStdCallCaller)(IncludeOuterIntergerStructSequential cs); +typedef IncludeOuterIntergerStructSequential (__stdcall *IncludeOuterIntergerStructSequentialByValStdCallCaller)(IncludeOuterIntergerStructSequential cs); extern "C" DLL_EXPORT BOOL __stdcall DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall(IncludeOuterIntergerStructSequentialByValStdCallCaller caller) { //Init @@ -3046,9 +3055,12 @@ extern "C" DLL_EXPORT BOOL __stdcall DoCallBack_MarshalStructIncludeOuterInterge argstr.s.s_int.i = 64; argstr.s.i = 64; - if(!caller(argstr)) + IncludeOuterIntergerStructSequential retstr = caller(argstr); + + if (!IsCorrectIncludeOuterIntergerStructSequential(&retstr)) { printf("DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall:The Caller returns wrong value\n"); + PrintIncludeOuterIntergerStructSequential(&retstr, "retstr"); return FALSE; } @@ -3239,3 +3251,112 @@ extern "C" DLL_EXPORT S11DelegatePInvokeByValStdCallCaller __stdcall Get_Marshal { return MarshalStructS11ByVal_StdCall; } + + +typedef ByteStruct3Byte (__stdcall *ByteStruct3ByteByValStdCallCaller)(ByteStruct3Byte cs, BOOL *pBool); +extern "C" DLL_EXPORT BOOL __stdcall DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte(ByteStruct3ByteByValStdCallCaller caller) +{ + //Init + ByteStruct3Byte argstr; + + argstr.b1 = 1; + argstr.b2 = 42; + argstr.b3 = 90; + + BOOL result; + ByteStruct3Byte retstruct = caller(argstr, &result); + + if(!IsCorrectByteStruct3Byte(&retstruct)) + { + printf("DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte:The Caller returns wrong value\n"); + return FALSE; + } + + if(!result) + { + printf("DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte:The Caller failed\n"); + return FALSE; + } + + //Verify the value unchanged + if(argstr.b1 != 1 || argstr.b2 != 42 || argstr.b3 != 90) + return false; + return TRUE; +} + +typedef ByteStruct3Byte (_cdecl *ByteStruct3ByteByValCdeclCaller)(ByteStruct3Byte cs, BOOL *pBool); +extern "C" DLL_EXPORT BOOL _cdecl DoCallBack_MarshalStructByVal_Cdecl_ByteStruct3Byte(ByteStruct3ByteByValCdeclCaller caller) +{ + //Init + ByteStruct3Byte argstr; + + argstr.b1 = 1; + argstr.b2 = 42; + argstr.b3 = 90; + + BOOL result; + ByteStruct3Byte retstruct = caller(argstr, &result); + + if(!IsCorrectByteStruct3Byte(&retstruct)) + { + printf("DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte:The Caller returns wrong value\n"); + return FALSE; + } + + if(!result) + { + printf("DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte:The Caller failed\n"); + return FALSE; + } + + //Verify the value unchanged + if(argstr.b1 != 1 || argstr.b2 != 42 || argstr.b3 != 90) + return false; + return TRUE; +} + +typedef IntergerStructSequential (_cdecl *IntergerStructSequentialByValCdeclCaller)(IntergerStructSequential cs); +extern "C" DLL_EXPORT BOOL _cdecl DoCallBack_MarshalStructIntergerStructSequentialByVal_Cdecl(IntergerStructSequentialByValCdeclCaller caller) +{ + //Init + IntergerStructSequential argstr; + + argstr.i = 64; + + IntergerStructSequential retstr = caller(argstr); + + if (!IsCorrectIntergerStructSequential(&retstr)) + { + printf("DoCallBack_MarshalStructIntergerStructSequentialByVal_Cdecl:The Caller returns wrong value\n"); + PrintIntergerStructSequential(&retstr, "retstr"); + return FALSE; + } + + //Verify the value unchanged + if(argstr.i != 64) + return false; + return TRUE; +} + +typedef IntergerStructSequential (__stdcall *IntergerStructSequentialByValStdCallCaller)(IntergerStructSequential cs); +extern "C" DLL_EXPORT BOOL __stdcall DoCallBack_MarshalStructIntergerStructSequentialByVal_StdCall(IntergerStructSequentialByValStdCallCaller caller) +{ + //Init + IntergerStructSequential argstr; + + argstr.i = 64; + + IntergerStructSequential retstr = caller(argstr); + + if (!IsCorrectIntergerStructSequential(&retstr)) + { + printf("DoCallBack_MarshalStructIntergerStructSequentialByVal_StdCall:The Caller returns wrong value\n"); + PrintIntergerStructSequential(&retstr, "retstr"); + return FALSE; + } + + //Verify the value unchanged + if(argstr.i != 64) + return false; + return TRUE; +} \ No newline at end of file diff --git a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/SeqStructDelRevPInvokeNative.h b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/SeqStructDelRevPInvokeNative.h index b497b6133bebaa..50e8abd813ca74 100644 --- a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/SeqStructDelRevPInvokeNative.h +++ b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/SeqStructDelRevPInvokeNative.h @@ -672,6 +672,18 @@ struct IntergerStructSequential // size = 4 bytes INT i; }; +void PrintIntergerStructSequential(IntergerStructSequential* str, const char* name) +{ + printf("\t%s.i = %d\n", name, str->i); +} + +bool IsCorrectIntergerStructSequential(IntergerStructSequential* str) +{ + if(str->i != 32) + return false; + return true; +} + struct S9; typedef void (*TestDelegate1)(struct S9 myStruct); @@ -879,3 +891,29 @@ bool IsCorrectLongStructPack16Explicit(LongStructPack16Explicit* p) return false; return true; } + +struct ByteStruct3Byte +{ + BYTE b1; + BYTE b2; + BYTE b3; +}; +void PrintByteStruct3Byte(ByteStruct3Byte* str, char const * name) +{ + printf("\t%s.b1 = %d", name, str->b1); + printf("\t%s.b2 = %d", name, str->b2); + printf("\t%s.b3 = %d", name, str->b3); +} + +void ChangeByteStruct3Byte(ByteStruct3Byte* p) +{ + p->b1 = 1; + p->b2 = 42; + p->b2 = 90; +} +bool IsCorrectByteStruct3Byte(ByteStruct3Byte* p) +{ + if(p->b1 != 7 || p->b2 != 12 || p->b3 != 18) + return false; + return true; +} diff --git a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/Struct.cs b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/Struct.cs index 07edd32cbf9ef5..207530c1273768 100644 --- a/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/Struct.cs +++ b/src/coreclr/tests/src/Interop/StructMarshalling/ReversePInvoke/Struct.cs @@ -189,6 +189,14 @@ public unsafe struct S11 public int i; } +[StructLayout(LayoutKind.Sequential)] +public struct ByteStruct3Byte +{ + public byte b1; + public byte b2; + public byte b3; +} + [StructLayout(LayoutKind.Explicit)] public struct U { diff --git a/src/coreclr/tests/src/Interop/WinRT/NETClients/Bindings/Program.cs b/src/coreclr/tests/src/Interop/WinRT/NETClients/Bindings/Program.cs index 608cdc9a432b74..579519510ca40c 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NETClients/Bindings/Program.cs +++ b/src/coreclr/tests/src/Interop/WinRT/NETClients/Bindings/Program.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Interop/WinRT/NETClients/Primitives/Program.cs b/src/coreclr/tests/src/Interop/WinRT/NETClients/Primitives/Program.cs index 64bcea1a371e3a..bd273615f7348e 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NETClients/Primitives/Program.cs +++ b/src/coreclr/tests/src/Interop/WinRT/NETClients/Primitives/Program.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ArrayTesting.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ArrayTesting.cpp index 3c5dafcc42f981..28b3cc81cef365 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ArrayTesting.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ArrayTesting.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "pch.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ArrayTesting.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ArrayTesting.h index 5ad383bbb9e3bd..168022cc947a25 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ArrayTesting.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ArrayTesting.h @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingProjectionsTesting.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingProjectionsTesting.cpp index 5c3236965e75cb..3d7688f1867524 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingProjectionsTesting.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingProjectionsTesting.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "pch.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingProjectionsTesting.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingProjectionsTesting.h index 38138405031d43..aeae54fa9aef29 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingProjectionsTesting.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingProjectionsTesting.h @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingViewModel.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingViewModel.cpp index 47b8dff55a7180..f4eb51464b03e3 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingViewModel.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingViewModel.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "pch.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingViewModel.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingViewModel.h index d3944324beb8cb..8fe76e2b2739fb 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingViewModel.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BindingViewModel.h @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BooleanTesting.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BooleanTesting.cpp index 16ad984876cc97..2abf2a236c6540 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BooleanTesting.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BooleanTesting.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "pch.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BooleanTesting.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BooleanTesting.h index c8449ef816e6ad..b1054f9d6a0238 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BooleanTesting.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.BooleanTesting.h @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.EnumTesting.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.EnumTesting.cpp index 07ffd92c16697e..825d56aa28bd41 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.EnumTesting.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.EnumTesting.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Component.Contracts.EnumTesting.h" namespace winrt::Component::Contracts::implementation diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.EnumTesting.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.EnumTesting.h index f01dffe24afcae..7bf886d12404f1 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.EnumTesting.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.EnumTesting.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Component/Contracts/EnumTesting.g.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ExceptionTesting.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ExceptionTesting.cpp index 7d994929f3e792..0b0cfb28833aa9 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ExceptionTesting.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ExceptionTesting.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "pch.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ExceptionTesting.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ExceptionTesting.h index 5335986088b3a2..3254cb0d5c4b62 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ExceptionTesting.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.ExceptionTesting.h @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.KeyValuePairTesting.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.KeyValuePairTesting.cpp index b6b921328f1f46..b571628339a498 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.KeyValuePairTesting.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.KeyValuePairTesting.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "pch.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.KeyValuePairTesting.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.KeyValuePairTesting.h index 1e8167c6be9240..820bdfcd28ed2a 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.KeyValuePairTesting.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.KeyValuePairTesting.h @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.NullableTesting.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.NullableTesting.cpp index 8cbd5e2e1d66c2..4593ca5606b413 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.NullableTesting.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.NullableTesting.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "pch.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.NullableTesting.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.NullableTesting.h index 44ecd5e55e6762..4701955389586b 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.NullableTesting.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.NullableTesting.h @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.StringTesting.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.StringTesting.cpp index 7b691cd49af990..edbb71962bc178 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.StringTesting.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.StringTesting.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "pch.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.StringTesting.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.StringTesting.h index 2d06e3e63c19b4..10c0967457823f 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.StringTesting.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.StringTesting.h @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.TypeTesting.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.TypeTesting.cpp index 2cc79a88818ca1..70972a328aae7b 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.TypeTesting.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.TypeTesting.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "pch.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.TypeTesting.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.TypeTesting.h index 1a4b233f187965..896183a46ca221 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.TypeTesting.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.TypeTesting.h @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.UriTesting.cpp b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.UriTesting.cpp index 98120212e54a1f..df5f900c38c22c 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.UriTesting.cpp +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.UriTesting.cpp @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "pch.h" diff --git a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.UriTesting.h b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.UriTesting.h index c8cda5966a2598..dcf5ad8341452c 100644 --- a/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.UriTesting.h +++ b/src/coreclr/tests/src/Interop/WinRT/NativeComponent/Component.Contracts.UriTesting.h @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/DivConst.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/DivConst.cs index 38b15e9cdc6fa8..a7418f75f79f84 100644 --- a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/DivConst.cs +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/DivConst.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ModConst.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ModConst.cs index bc9d3e9a82947f..c2b525b615a262 100644 --- a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ModConst.cs +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ModConst.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/UDivConst.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/UDivConst.cs index cd507fe554252a..47489c14945868 100644 --- a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/UDivConst.cs +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/UDivConst.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/UModConst.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/UModConst.cs index 06cc28d8a82901..70dbe91b3a49c1 100644 --- a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/UModConst.cs +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/UModConst.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Directed/Convert/ldind_conv.il b/src/coreclr/tests/src/JIT/Directed/Convert/ldind_conv.il index ca1136c3c80b87..32c1ea8ca7dfb0 100644 --- a/src/coreclr/tests/src/JIT/Directed/Convert/ldind_conv.il +++ b/src/coreclr/tests/src/JIT/Directed/Convert/ldind_conv.il @@ -4,17 +4,18 @@ .assembly extern mscorlib { auto } -.assembly extern System.Private.CoreLib { auto } +.assembly extern System.Console { auto } +.assembly extern System.Runtime { auto } .assembly test { } -.class auto Program extends [System.Private.CoreLib]System.Object +.class auto Program extends [System.Runtime]System.Object { - .method private static void print(class [System.Private.CoreLib]System.String) cil managed + .method private static void print(class [System.Runtime]System.String) cil managed { .maxstack 1 ldarg 0 - call void [System.Private.CoreLib]Internal.Console::WriteLine(class [System.Private.CoreLib]System.String) + call void [System.Console]System.Console::WriteLine(class [System.Runtime]System.String) ret } @@ -26,2998 +27,2998 @@ ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_i1(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_i1(0x80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i1_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i1_conv_i1(0xFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i1_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_i1(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_i1(0x80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i1_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i1_conv_ovf_i1(0xFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i1_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_i1_un(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_i1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_i1_un(0x80) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i1_conv_ovf_i1_un(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_u1(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0x00000080 ldstr "Checking ldind_i1_conv_u1(0x80) == 0x00000080" - call int32 Program::Check_ldind_i1_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_i1_conv_u1(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_i1_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_u1(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_u1(0x80) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i1_conv_ovf_u1(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_u1_un(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_u1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_u1_un(0x80) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i1_conv_ovf_u1_un(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_i2(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_i2(0x80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i1_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i1_conv_i2(0xFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i1_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_i2(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_i2(0x80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i1_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i1_conv_ovf_i2(0xFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i1_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_i2_un(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_i2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_i2_un(0x80) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i1_conv_ovf_i2_un(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_u2(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0x0000FF80 ldstr "Checking ldind_i1_conv_u2(0x80) == 0x0000FF80" - call int32 Program::Check_ldind_i1_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x0000FFFF ldstr "Checking ldind_i1_conv_u2(0xFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i1_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_u2(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_u2(0x80) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i1_conv_ovf_u2(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_u2_un(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_u2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_u2_un(0x80) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i1_conv_ovf_u2_un(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_i4(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_i4(0x80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i1_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i1_conv_i4(0xFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i1_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_i4(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_i4(0x80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i1_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i1_conv_ovf_i4(0xFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i1_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_i4_un(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_i4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_i4_un(0x80) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_i4_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_i4_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i1_conv_ovf_i4_un(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_i4_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_i4_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_u4(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_u4(0x80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i1_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i1_conv_u4(0xFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i1_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_u4(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_u4(0x80) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u4(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u4(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i1_conv_ovf_u4(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u4(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u4(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i1_conv_ovf_u4_un(0x7F) == 0x0000007F" - call int32 Program::Check_ldind_i1_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_u4_un(0x80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i1_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i1_conv_ovf_u4_un(0xFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i1_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i8 0x000000000000007F ldstr "Checking ldind_i1_conv_i8(0x7F) == 0x000000000000007F" - call int32 Program::Check_ldind_i1_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i8 0xFFFFFFFFFFFFFF80 ldstr "Checking ldind_i1_conv_i8(0x80) == 0xFFFFFFFFFFFFFF80" - call int32 Program::Check_ldind_i1_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i1_conv_i8(0xFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i1_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i8 0x000000000000007F ldstr "Checking ldind_i1_conv_ovf_i8(0x7F) == 0x000000000000007F" - call int32 Program::Check_ldind_i1_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i8 0xFFFFFFFFFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_i8(0x80) == 0xFFFFFFFFFFFFFF80" - call int32 Program::Check_ldind_i1_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i1_conv_ovf_i8(0xFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i1_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i8 0x000000000000007F ldstr "Checking ldind_i1_conv_ovf_i8_un(0x7F) == 0x000000000000007F" - call int32 Program::Check_ldind_i1_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i8 0x00000000FFFFFF80 ldstr "Checking ldind_i1_conv_ovf_i8_un(0x80) == 0x00000000FFFFFF80" - call int32 Program::Check_ldind_i1_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i1_conv_ovf_i8_un(0xFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_i1_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i8 0x000000000000007F ldstr "Checking ldind_i1_conv_u8(0x7F) == 0x000000000000007F" - call int32 Program::Check_ldind_i1_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i8 0x00000000FFFFFF80 ldstr "Checking ldind_i1_conv_u8(0x80) == 0x00000000FFFFFF80" - call int32 Program::Check_ldind_i1_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i1_conv_u8(0xFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_i1_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i8 0x000000000000007F ldstr "Checking ldind_i1_conv_ovf_u8(0x7F) == 0x000000000000007F" - call int32 Program::Check_ldind_i1_conv_ovf_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i1_conv_ovf_u8(0x80) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u8(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u8(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i1_conv_ovf_u8(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i1_conv_ovf_u8(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i1_conv_ovf_u8(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i8 0x000000000000007F ldstr "Checking ldind_i1_conv_ovf_u8_un(0x7F) == 0x000000000000007F" - call int32 Program::Check_ldind_i1_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i8 0x00000000FFFFFF80 ldstr "Checking ldind_i1_conv_ovf_u8_un(0x80) == 0x00000000FFFFFF80" - call int32 Program::Check_ldind_i1_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i1_conv_ovf_u8_un(0xFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_i1_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i1_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u1_conv_i1(0xFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u1_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_i1(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u1_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u1_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_i1_un(0xFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u1_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u1_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_u1(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_u1(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_u1_un(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_u1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_u1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_i2(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_i2(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_i2_un(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_i2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_i2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_u2(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_u2(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_u2_un(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_u2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_u2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_i4(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_i4(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_i4_un(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_i4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_i4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_u4(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_u4(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u1_conv_ovf_u4_un(0xFF) == 0x000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0x00000000000000FF ldstr "Checking ldind_u1_conv_i8(0xFF) == 0x00000000000000FF" - call int32 Program::Check_ldind_u1_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0x00000000000000FF ldstr "Checking ldind_u1_conv_ovf_i8(0xFF) == 0x00000000000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0x00000000000000FF ldstr "Checking ldind_u1_conv_ovf_i8_un(0xFF) == 0x00000000000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0x00000000000000FF ldstr "Checking ldind_u1_conv_u8(0xFF) == 0x00000000000000FF" - call int32 Program::Check_ldind_u1_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0x00000000000000FF ldstr "Checking ldind_u1_conv_ovf_u8(0xFF) == 0x00000000000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i8 0x00000000000000FF ldstr "Checking ldind_u1_conv_ovf_u8_un(0xFF) == 0x00000000000000FF" - call int32 Program::Check_ldind_u1_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u1_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i2_conv_i1(0x7FFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0x00000000 ldstr "Checking ldind_i2_conv_i1(0x8000) == 0x00000000" - call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i2_conv_i1(0xFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i2_conv_i1(0x007F) == 0x0000007F" - call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i2_conv_i1(0xFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i2_conv_i1(0x00FF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_i1(0x7FFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_i1(0x8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i2_conv_ovf_i1(0xFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i2_conv_ovf_i1(0x007F) == 0x0000007F" - call int32 Program::Check_ldind_i2_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i2_conv_ovf_i1(0xFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i2_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i2_conv_ovf_i1(0x00FF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_i1_un(0x7FFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_i1_un(0x8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i2_conv_ovf_i1_un(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i2_conv_ovf_i1_un(0x007F) == 0x0000007F" - call int32 Program::Check_ldind_i2_conv_ovf_i1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i2_conv_ovf_i1_un(0xFF80) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i2_conv_ovf_i1_un(0x00FF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x000000FF ldstr "Checking ldind_i2_conv_u1(0x7FFF) == 0x000000FF" - call int32 Program::Check_ldind_i2_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0x00000000 ldstr "Checking ldind_i2_conv_u1(0x8000) == 0x00000000" - call int32 Program::Check_ldind_i2_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x000000FF ldstr "Checking ldind_i2_conv_u1(0xFFFF) == 0x000000FF" - call int32 Program::Check_ldind_i2_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_i2_conv_u1(0x00FF) == 0x000000FF" - call int32 Program::Check_ldind_i2_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_u1(0x7FFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_u1(0x8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i2_conv_ovf_u1(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_i2_conv_ovf_u1(0x00FF) == 0x000000FF" - call int32 Program::Check_ldind_i2_conv_ovf_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_u1_un(0x7FFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_u1_un(0x8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i2_conv_ovf_u1_un(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_i2_conv_ovf_u1_un(0x00FF) == 0x000000FF" - call int32 Program::Check_ldind_i2_conv_ovf_u1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_i2(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_i2(0x8000) == 0xFFFF8000" - call int32 Program::Check_ldind_i2_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i2_conv_i2(0xFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_i2(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_i2(0x8000) == 0xFFFF8000" - call int32 Program::Check_ldind_i2_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i2_conv_ovf_i2(0xFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_i2_un(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_i2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_i2_un(0x8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i2_conv_ovf_i2_un(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_u2(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0x00008000 ldstr "Checking ldind_i2_conv_u2(0x8000) == 0x00008000" - call int32 Program::Check_ldind_i2_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i2_conv_u2(0xFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i2_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_u2(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_u2(0x8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i2_conv_ovf_u2(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_u2_un(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_u2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_u2_un(0x8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i2_conv_ovf_u2_un(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_i4(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_i4(0x8000) == 0xFFFF8000" - call int32 Program::Check_ldind_i2_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i2_conv_i4(0xFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_i4(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_i4(0x8000) == 0xFFFF8000" - call int32 Program::Check_ldind_i2_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i2_conv_ovf_i4(0xFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_i4_un(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_i4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_i4_un(0x8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i4_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i4_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i2_conv_ovf_i4_un(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_i4_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_i4_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_u4(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_u4(0x8000) == 0xFFFF8000" - call int32 Program::Check_ldind_i2_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i2_conv_u4(0xFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_u4(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_u4(0x8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u4(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u4(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i2_conv_ovf_u4(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u4(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u4(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i2_conv_ovf_u4_un(0x7FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_u4_un(0x8000) == 0xFFFF8000" - call int32 Program::Check_ldind_i2_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i2_conv_ovf_u4_un(0xFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i8 0x0000000000007FFF ldstr "Checking ldind_i2_conv_i8(0x7FFF) == 0x0000000000007FFF" - call int32 Program::Check_ldind_i2_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i8 0xFFFFFFFFFFFF8000 ldstr "Checking ldind_i2_conv_i8(0x8000) == 0xFFFFFFFFFFFF8000" - call int32 Program::Check_ldind_i2_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i2_conv_i8(0xFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i8 0x0000000000007FFF ldstr "Checking ldind_i2_conv_ovf_i8(0x7FFF) == 0x0000000000007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i8 0xFFFFFFFFFFFF8000 ldstr "Checking ldind_i2_conv_ovf_i8(0x8000) == 0xFFFFFFFFFFFF8000" - call int32 Program::Check_ldind_i2_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i2_conv_ovf_i8(0xFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i2_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i8 0x0000000000007FFF ldstr "Checking ldind_i2_conv_ovf_i8_un(0x7FFF) == 0x0000000000007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i8 0x00000000FFFF8000 ldstr "Checking ldind_i2_conv_ovf_i8_un(0x8000) == 0x00000000FFFF8000" - call int32 Program::Check_ldind_i2_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i2_conv_ovf_i8_un(0xFFFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_i2_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i8 0x0000000000007FFF ldstr "Checking ldind_i2_conv_u8(0x7FFF) == 0x0000000000007FFF" - call int32 Program::Check_ldind_i2_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i8 0x00000000FFFF8000 ldstr "Checking ldind_i2_conv_u8(0x8000) == 0x00000000FFFF8000" - call int32 Program::Check_ldind_i2_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i2_conv_u8(0xFFFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_i2_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i8 0x0000000000007FFF ldstr "Checking ldind_i2_conv_ovf_u8(0x7FFF) == 0x0000000000007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i2_conv_ovf_u8(0x8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u8(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u8(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i2_conv_ovf_u8(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i2_conv_ovf_u8(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i2_conv_ovf_u8(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i8 0x0000000000007FFF ldstr "Checking ldind_i2_conv_ovf_u8_un(0x7FFF) == 0x0000000000007FFF" - call int32 Program::Check_ldind_i2_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i8 0x00000000FFFF8000 ldstr "Checking ldind_i2_conv_ovf_u8_un(0x8000) == 0x00000000FFFF8000" - call int32 Program::Check_ldind_i2_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i2_conv_ovf_u8_un(0xFFFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_i2_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i2_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u2_conv_i1(0xFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u2_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_u2_conv_i1(0x007F) == 0x0000007F" - call int32 Program::Check_ldind_u2_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_u2_conv_i1(0xFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_u2_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u2_conv_i1(0x00FF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u2_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_i1(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_u2_conv_ovf_i1(0x007F) == 0x0000007F" - call int32 Program::Check_ldind_u2_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_u2_conv_ovf_i1(0xFF80) == OverflowException" - call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_u2_conv_ovf_i1(0x00FF) == OverflowException" - call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_i1_un(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_u2_conv_ovf_i1_un(0x007F) == 0x0000007F" - call int32 Program::Check_ldind_u2_conv_ovf_i1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_i1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_u2_conv_ovf_i1_un(0xFF80) == OverflowException" - call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_u2_conv_ovf_i1_un(0x00FF) == OverflowException" - call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u2_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x000000FF ldstr "Checking ldind_u2_conv_u1(0xFFFF) == 0x000000FF" - call int32 Program::Check_ldind_u2_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u2_conv_u1(0x00FF) == 0x000000FF" - call int32 Program::Check_ldind_u2_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_u1(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u2_conv_ovf_u1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u2_conv_ovf_u1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u2_conv_ovf_u1(0x00FF) == 0x000000FF" - call int32 Program::Check_ldind_u2_conv_ovf_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_u1_un(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u2_conv_ovf_u1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u2_conv_ovf_u1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u2_conv_ovf_u1_un(0x00FF) == 0x000000FF" - call int32 Program::Check_ldind_u2_conv_ovf_u1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_u1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u2_conv_i2(0xFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u2_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_i2(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u2_conv_ovf_i2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u2_conv_ovf_i2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_i2_un(0xFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u2_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u2_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_u2(0xFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u2_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_u2(0xFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u2_conv_ovf_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_u2_un(0xFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u2_conv_ovf_u2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_u2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_i4(0xFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u2_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_i4(0xFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u2_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_i4_un(0xFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u2_conv_ovf_i4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_i4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_u4(0xFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u2_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_u4(0xFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u2_conv_ovf_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u2_conv_ovf_u4_un(0xFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u2_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0x000000000000FFFF ldstr "Checking ldind_u2_conv_i8(0xFFFF) == 0x000000000000FFFF" - call int32 Program::Check_ldind_u2_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0x000000000000FFFF ldstr "Checking ldind_u2_conv_ovf_i8(0xFFFF) == 0x000000000000FFFF" - call int32 Program::Check_ldind_u2_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0x000000000000FFFF ldstr "Checking ldind_u2_conv_ovf_i8_un(0xFFFF) == 0x000000000000FFFF" - call int32 Program::Check_ldind_u2_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0x000000000000FFFF ldstr "Checking ldind_u2_conv_u8(0xFFFF) == 0x000000000000FFFF" - call int32 Program::Check_ldind_u2_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0x000000000000FFFF ldstr "Checking ldind_u2_conv_ovf_u8(0xFFFF) == 0x000000000000FFFF" - call int32 Program::Check_ldind_u2_conv_ovf_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i8 0x000000000000FFFF ldstr "Checking ldind_u2_conv_ovf_u8_un(0xFFFF) == 0x000000000000FFFF" - call int32 Program::Check_ldind_u2_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u2_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_i1(0x7FFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i4 0x00000000 ldstr "Checking ldind_i4_conv_i1(0x80000000) == 0x00000000" - call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_i1(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i4_conv_i1(0x0000007F) == 0x0000007F" - call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i4_conv_i1(0xFFFFFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_i1(0x000000FF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_i1(0x7FFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_i1(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_i1(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i4_conv_ovf_i1(0x0000007F) == 0x0000007F" - call int32 Program::Check_ldind_i4_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i4_conv_ovf_i1(0xFFFFFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i4_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i4_conv_ovf_i1(0x000000FF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_i1_un(0x7FFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_i1_un(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_i1_un(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_i4_conv_ovf_i1_un(0x0000007F) == 0x0000007F" - call int32 Program::Check_ldind_i4_conv_ovf_i1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i4_conv_ovf_i1_un(0xFFFFFF80) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_i4_conv_ovf_i1_un(0x000000FF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i4 0x000000FF ldstr "Checking ldind_i4_conv_u1(0x7FFFFFFF) == 0x000000FF" - call int32 Program::Check_ldind_i4_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i4 0x00000000 ldstr "Checking ldind_i4_conv_u1(0x80000000) == 0x00000000" - call int32 Program::Check_ldind_i4_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0x000000FF ldstr "Checking ldind_i4_conv_u1(0xFFFFFFFF) == 0x000000FF" - call int32 Program::Check_ldind_i4_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_i4_conv_u1(0x000000FF) == 0x000000FF" - call int32 Program::Check_ldind_i4_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_u1(0x7FFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_u1(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_u1(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_i4_conv_ovf_u1(0x000000FF) == 0x000000FF" - call int32 Program::Check_ldind_i4_conv_ovf_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_u1_un(0x7FFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_u1_un(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_u1_un(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_i4_conv_ovf_u1_un(0x000000FF) == 0x000000FF" - call int32 Program::Check_ldind_i4_conv_ovf_u1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_i2(0x7FFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i4 0x00000000 ldstr "Checking ldind_i4_conv_i2(0x80000000) == 0x00000000" - call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_i2(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i4_conv_i2(0x00007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_i4_conv_i2(0xFFFF8000) == 0xFFFF8000" - call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_i2(0x0000FFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_i2(0x7FFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_i2(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_i2(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i4_conv_ovf_i2(0x00007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i4_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_i4_conv_ovf_i2(0xFFFF8000) == 0xFFFF8000" - call int32 Program::Check_ldind_i4_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i4_conv_ovf_i2(0x0000FFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_i2_un(0x7FFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_i2_un(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_i2_un(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i4_conv_ovf_i2_un(0x00007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i4_conv_ovf_i2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_i4_conv_ovf_i2_un(0xFFFF8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_i4_conv_ovf_i2_un(0x0000FFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i4_conv_u2(0x7FFFFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i4_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i4 0x00000000 ldstr "Checking ldind_i4_conv_u2(0x80000000) == 0x00000000" - call int32 Program::Check_ldind_i4_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i4_conv_u2(0xFFFFFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i4_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i4_conv_u2(0x0000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i4_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_u2(0x7FFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_u2(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_u2(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i4_conv_ovf_u2(0x0000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i4_conv_ovf_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_u2_un(0x7FFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_u2_un(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_u2_un(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i4_conv_ovf_u2_un(0x0000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i4_conv_ovf_u2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_i4(0x7FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_i4_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_i4(0x80000000) == 0x80000000" - call int32 Program::Check_ldind_i4_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_i4(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_i4(0x7FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_i4(0x80000000) == 0x80000000" - call int32 Program::Check_ldind_i4_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_i4(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_i4_un(0x7FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_i4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_i4_un(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i4_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i4_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_i4_un(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_i4_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_i4_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_u4(0x7FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_i4_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_u4(0x80000000) == 0x80000000" - call int32 Program::Check_ldind_i4_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_u4(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_u4(0x7FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_u4(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u4(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u4(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_u4(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u4(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u4(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i4_conv_ovf_u4_un(0x7FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_u4_un(0x80000000) == 0x80000000" - call int32 Program::Check_ldind_i4_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_u4_un(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i8 0x000000007FFFFFFF ldstr "Checking ldind_i4_conv_i8(0x7FFFFFFF) == 0x000000007FFFFFFF" - call int32 Program::Check_ldind_i4_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i8 0xFFFFFFFF80000000 ldstr "Checking ldind_i4_conv_i8(0x80000000) == 0xFFFFFFFF80000000" - call int32 Program::Check_ldind_i4_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i4_conv_i8(0xFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i8 0x000000007FFFFFFF ldstr "Checking ldind_i4_conv_ovf_i8(0x7FFFFFFF) == 0x000000007FFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i8 0xFFFFFFFF80000000 ldstr "Checking ldind_i4_conv_ovf_i8(0x80000000) == 0xFFFFFFFF80000000" - call int32 Program::Check_ldind_i4_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_i8(0xFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i8 0x000000007FFFFFFF ldstr "Checking ldind_i4_conv_ovf_i8_un(0x7FFFFFFF) == 0x000000007FFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i8 0x0000000080000000 ldstr "Checking ldind_i4_conv_ovf_i8_un(0x80000000) == 0x0000000080000000" - call int32 Program::Check_ldind_i4_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i4_conv_ovf_i8_un(0xFFFFFFFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i8 0x000000007FFFFFFF ldstr "Checking ldind_i4_conv_u8(0x7FFFFFFF) == 0x000000007FFFFFFF" - call int32 Program::Check_ldind_i4_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i8 0x0000000080000000 ldstr "Checking ldind_i4_conv_u8(0x80000000) == 0x0000000080000000" - call int32 Program::Check_ldind_i4_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i4_conv_u8(0xFFFFFFFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_i4_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i8 0x000000007FFFFFFF ldstr "Checking ldind_i4_conv_ovf_u8(0x7FFFFFFF) == 0x000000007FFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldstr "Checking ldind_i4_conv_ovf_u8(0x80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u8(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u8(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i4_conv_ovf_u8(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i4_conv_ovf_u8(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i4_conv_ovf_u8(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x7FFFFFFF ldc.i8 0x000000007FFFFFFF ldstr "Checking ldind_i4_conv_ovf_u8_un(0x7FFFFFFF) == 0x000000007FFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x80000000 ldc.i8 0x0000000080000000 ldstr "Checking ldind_i4_conv_ovf_u8_un(0x80000000) == 0x0000000080000000" - call int32 Program::Check_ldind_i4_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i4_conv_ovf_u8_un(0xFFFFFFFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_i4_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i4_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_i1(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_u4_conv_i1(0x0000007F) == 0x0000007F" - call int32 Program::Check_ldind_u4_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_u4_conv_i1(0xFFFFFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_u4_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_i1(0x000000FF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_i1(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_u4_conv_ovf_i1(0x0000007F) == 0x0000007F" - call int32 Program::Check_ldind_u4_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_u4_conv_ovf_i1(0xFFFFFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_u4_conv_ovf_i1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_u4_conv_ovf_i1(0x000000FF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_i1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_i1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_i1_un(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000007F ldc.i4 0x0000007F ldstr "Checking ldind_u4_conv_ovf_i1_un(0x0000007F) == 0x0000007F" - call int32 Program::Check_ldind_u4_conv_ovf_i1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFF80 ldstr "Checking ldind_u4_conv_ovf_i1_un(0xFFFFFF80) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldstr "Checking ldind_u4_conv_ovf_i1_un(0x000000FF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_i1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_i1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0x000000FF ldstr "Checking ldind_u4_conv_u1(0xFFFFFFFF) == 0x000000FF" - call int32 Program::Check_ldind_u4_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u4_conv_u1(0x000000FF) == 0x000000FF" - call int32 Program::Check_ldind_u4_conv_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_u1(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_u1(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_u1(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u4_conv_ovf_u1(0x000000FF) == 0x000000FF" - call int32 Program::Check_ldind_u4_conv_ovf_u1(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_u1(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_u1_un(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_u1_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_u1_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u4_conv_ovf_u1_un(0x000000FF) == 0x000000FF" - call int32 Program::Check_ldind_u4_conv_ovf_u1_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_u1_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_i2(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_u4_conv_i2(0x00007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_u4_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_u4_conv_i2(0xFFFF8000) == 0xFFFF8000" - call int32 Program::Check_ldind_u4_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_i2(0x0000FFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_i2(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_u4_conv_ovf_i2(0x00007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_u4_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_u4_conv_ovf_i2(0xFFFF8000) == 0xFFFF8000" - call int32 Program::Check_ldind_u4_conv_ovf_i2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_u4_conv_ovf_i2(0x0000FFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_i2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_i2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_i2_un(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x00007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_u4_conv_ovf_i2_un(0x00007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_u4_conv_ovf_i2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFF8000 ldstr "Checking ldind_u4_conv_ovf_i2_un(0xFFFF8000) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldstr "Checking ldind_u4_conv_ovf_i2_un(0x0000FFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_i2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_i2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u4_conv_u2(0xFFFFFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u4_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u4_conv_u2(0x0000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u4_conv_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_u2(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_u2(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_u2(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u4_conv_ovf_u2(0x0000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u4_conv_ovf_u2(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_u2(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_u2_un(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_u2_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_u2_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0x0000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u4_conv_ovf_u2_un(0x0000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u4_conv_ovf_u2_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_u2_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_i4(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_i4(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_ovf_i4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_i4_un(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_i4_un(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_i4_un(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_u4(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_u4(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_u4(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_u4(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_u4(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_u4(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_u4_un(0xFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_ovf_u4_un(int32, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_u4_un(int32, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u4_conv_i8(0xFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_i8(0xFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_u4_conv_ovf_i8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_u4_conv_ovf_i8_un(0xFFFFFFFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_u4_conv_ovf_i8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_i8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_u4_conv_u8(0xFFFFFFFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_u4_conv_u8(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_u8(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u4_conv_ovf_u8(0xFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u4_conv_ovf_u8(int32, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u4_conv_ovf_u8(int32, class [System.Runtime]System.String) brfalse FAIL ldc.i4 0xFFFFFFFF ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_u4_conv_ovf_u8_un(0xFFFFFFFF) == 0x00000000FFFFFFFF" - call int32 Program::Check_ldind_u4_conv_ovf_u8_un(int32, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u4_conv_ovf_u8_un(int32, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_i1(0x7FFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldc.i4 0x00000000 ldstr "Checking ldind_i8_conv_i1(0x8000000000000000) == 0x00000000" - call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_i1(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000007F ldc.i4 0x0000007F ldstr "Checking ldind_i8_conv_i1(0x000000000000007F) == 0x0000007F" - call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i8_conv_i1(0xFFFFFFFFFFFFFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_i1(0x00000000000000FF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i1(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_i1(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i1(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000007F ldc.i4 0x0000007F ldstr "Checking ldind_i8_conv_ovf_i1(0x000000000000007F) == 0x0000007F" - call int32 Program::Check_ldind_i8_conv_ovf_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_i8_conv_ovf_i1(0xFFFFFFFFFFFFFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_i8_conv_ovf_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldstr "Checking ldind_i8_conv_ovf_i1(0x00000000000000FF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i1_un(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_i1_un(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i1_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000007F ldc.i4 0x0000007F ldstr "Checking ldind_i8_conv_ovf_i1_un(0x000000000000007F) == 0x0000007F" - call int32 Program::Check_ldind_i8_conv_ovf_i1_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i1_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFF80 ldstr "Checking ldind_i8_conv_ovf_i1_un(0xFFFFFFFFFFFFFF80) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldstr "Checking ldind_i8_conv_ovf_i1_un(0x00000000000000FF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i4 0x000000FF ldstr "Checking ldind_i8_conv_u1(0x7FFFFFFFFFFFFFFF) == 0x000000FF" - call int32 Program::Check_ldind_i8_conv_u1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldc.i4 0x00000000 ldstr "Checking ldind_i8_conv_u1(0x8000000000000000) == 0x00000000" - call int32 Program::Check_ldind_i8_conv_u1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0x000000FF ldstr "Checking ldind_i8_conv_u1(0xFFFFFFFFFFFFFFFF) == 0x000000FF" - call int32 Program::Check_ldind_i8_conv_u1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldc.i4 0x000000FF ldstr "Checking ldind_i8_conv_u1(0x00000000000000FF) == 0x000000FF" - call int32 Program::Check_ldind_i8_conv_u1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u1(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_u1(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u1(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldc.i4 0x000000FF ldstr "Checking ldind_i8_conv_ovf_u1(0x00000000000000FF) == 0x000000FF" - call int32 Program::Check_ldind_i8_conv_ovf_u1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_u1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u1_un(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_u1_un(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u1_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldc.i4 0x000000FF ldstr "Checking ldind_i8_conv_ovf_u1_un(0x00000000000000FF) == 0x000000FF" - call int32 Program::Check_ldind_i8_conv_ovf_u1_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_u1_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_i2(0x7FFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldc.i4 0x00000000 ldstr "Checking ldind_i8_conv_i2(0x8000000000000000) == 0x00000000" - call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_i2(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x0000000000007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i8_conv_i2(0x0000000000007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_i8_conv_i2(0xFFFFFFFFFFFF8000) == 0xFFFF8000" - call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_i2(0x000000000000FFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i2(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_i2(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i2(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x0000000000007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i8_conv_ovf_i2(0x0000000000007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i8_conv_ovf_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_i8_conv_ovf_i2(0xFFFFFFFFFFFF8000) == 0xFFFF8000" - call int32 Program::Check_ldind_i8_conv_ovf_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldstr "Checking ldind_i8_conv_ovf_i2(0x000000000000FFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i2_un(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_i2_un(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i2_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x0000000000007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_i8_conv_ovf_i2_un(0x0000000000007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_i8_conv_ovf_i2_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i2_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFF8000 ldstr "Checking ldind_i8_conv_ovf_i2_un(0xFFFFFFFFFFFF8000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldstr "Checking ldind_i8_conv_ovf_i2_un(0x000000000000FFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i8_conv_u2(0x7FFFFFFFFFFFFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i8_conv_u2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldc.i4 0x00000000 ldstr "Checking ldind_i8_conv_u2(0x8000000000000000) == 0x00000000" - call int32 Program::Check_ldind_i8_conv_u2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i8_conv_u2(0xFFFFFFFFFFFFFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i8_conv_u2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i8_conv_u2(0x000000000000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i8_conv_u2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u2(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_u2(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u2(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i8_conv_ovf_u2(0x000000000000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i8_conv_ovf_u2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_u2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u2_un(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_u2_un(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u2_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_i8_conv_ovf_u2_un(0x000000000000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_i8_conv_ovf_u2_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_u2_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_i4(0x7FFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldc.i4 0x00000000 ldstr "Checking ldind_i8_conv_i4(0x8000000000000000) == 0x00000000" - call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_i4(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000007FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i8_conv_i4(0x000000007FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFF80000000 ldc.i4 0x80000000 ldstr "Checking ldind_i8_conv_i4(0xFFFFFFFF80000000) == 0x80000000" - call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_i4(0x00000000FFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i4(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_i4(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i4(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000007FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i8_conv_ovf_i4(0x000000007FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFF80000000 ldc.i4 0x80000000 ldstr "Checking ldind_i8_conv_ovf_i4(0xFFFFFFFF80000000) == 0x80000000" - call int32 Program::Check_ldind_i8_conv_ovf_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i4(0x00000000FFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i4_un(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_i4_un(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i4_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000007FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_i8_conv_ovf_i4_un(0x000000007FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_i4_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i4_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFF80000000 ldstr "Checking ldind_i8_conv_ovf_i4_un(0xFFFFFFFF80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i4_un(0x00000000FFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_u4(0x7FFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_u4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldc.i4 0x00000000 ldstr "Checking ldind_i8_conv_u4(0x8000000000000000) == 0x00000000" - call int32 Program::Check_ldind_i8_conv_u4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_u4(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_u4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_u4(0x00000000FFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_u4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u4(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_u4(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u4(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u4(0x00000000FFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_u4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_u4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u4_un(0x7FFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_u4_un(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u4_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u4_un(0x00000000FFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_u4_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_u4_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_i8(0x7FFFFFFFFFFFFFFF) == 0x7FFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_i8(0x8000000000000000) == 0x8000000000000000" - call int32 Program::Check_ldind_i8_conv_i8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_i8(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_i8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_i8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i8(0x7FFFFFFFFFFFFFFF) == 0x7FFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_i8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_i8(0x8000000000000000) == 0x8000000000000000" - call int32 Program::Check_ldind_i8_conv_ovf_i8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i8(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_i8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i8_un(0x7FFFFFFFFFFFFFFF) == 0x7FFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_i8_un(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_i8_un(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_i8_un(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i8_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i8_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_i8_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_i8_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_i8_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_u8(0x7FFFFFFFFFFFFFFF) == 0x7FFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_u8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_u8(0x8000000000000000) == 0x8000000000000000" - call int32 Program::Check_ldind_i8_conv_u8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_u8(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_u8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_u8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u8(0x7FFFFFFFFFFFFFFF) == 0x7FFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_u8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_u8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_u8(0x8000000000000000) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u8(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u8(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u8(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_i8_conv_ovf_u8(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_i8_conv_ovf_u8(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x7FFFFFFFFFFFFFFF ldc.i8 0x7FFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u8_un(0x7FFFFFFFFFFFFFFF) == 0x7FFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_u8_un(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_u8_un(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x8000000000000000 ldc.i8 0x8000000000000000 ldstr "Checking ldind_i8_conv_ovf_u8_un(0x8000000000000000) == 0x8000000000000000" - call int32 Program::Check_ldind_i8_conv_ovf_u8_un(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_u8_un(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_i8_conv_ovf_u8_un(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_i8_conv_ovf_u8_un(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_i8_conv_ovf_u8_un(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_i1(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000007F ldc.i4 0x0000007F ldstr "Checking ldind_u8_conv_i1(0x000000000000007F) == 0x0000007F" - call int32 Program::Check_ldind_u8_conv_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_u8_conv_i1(0xFFFFFFFFFFFFFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_u8_conv_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_i1(0x00000000000000FF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_i1(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_ovf_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000007F ldc.i4 0x0000007F ldstr "Checking ldind_u8_conv_ovf_i1(0x000000000000007F) == 0x0000007F" - call int32 Program::Check_ldind_u8_conv_ovf_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFF80 ldc.i4 0xFFFFFF80 ldstr "Checking ldind_u8_conv_ovf_i1(0xFFFFFFFFFFFFFF80) == 0xFFFFFF80" - call int32 Program::Check_ldind_u8_conv_ovf_i1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldstr "Checking ldind_u8_conv_ovf_i1(0x00000000000000FF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i1(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i1(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_i1_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000007F ldc.i4 0x0000007F ldstr "Checking ldind_u8_conv_ovf_i1_un(0x000000000000007F) == 0x0000007F" - call int32 Program::Check_ldind_u8_conv_ovf_i1_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i1_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFF80 ldstr "Checking ldind_u8_conv_ovf_i1_un(0xFFFFFFFFFFFFFF80) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldstr "Checking ldind_u8_conv_ovf_i1_un(0x00000000000000FF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0x000000FF ldstr "Checking ldind_u8_conv_u1(0xFFFFFFFFFFFFFFFF) == 0x000000FF" - call int32 Program::Check_ldind_u8_conv_u1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_u1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u8_conv_u1(0x00000000000000FF) == 0x000000FF" - call int32 Program::Check_ldind_u8_conv_u1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_u1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_u1(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_u1(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_u1(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u8_conv_ovf_u1(0x00000000000000FF) == 0x000000FF" - call int32 Program::Check_ldind_u8_conv_ovf_u1(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_u1(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_u1_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_u1_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_u1_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000000000FF ldc.i4 0x000000FF ldstr "Checking ldind_u8_conv_ovf_u1_un(0x00000000000000FF) == 0x000000FF" - call int32 Program::Check_ldind_u8_conv_ovf_u1_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_u1_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_i2(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x0000000000007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_u8_conv_i2(0x0000000000007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_u8_conv_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_u8_conv_i2(0xFFFFFFFFFFFF8000) == 0xFFFF8000" - call int32 Program::Check_ldind_u8_conv_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_i2(0x000000000000FFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_i2(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_ovf_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x0000000000007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_u8_conv_ovf_i2(0x0000000000007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_u8_conv_ovf_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFF8000 ldc.i4 0xFFFF8000 ldstr "Checking ldind_u8_conv_ovf_i2(0xFFFFFFFFFFFF8000) == 0xFFFF8000" - call int32 Program::Check_ldind_u8_conv_ovf_i2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldstr "Checking ldind_u8_conv_ovf_i2(0x000000000000FFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i2(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i2(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_i2_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x0000000000007FFF ldc.i4 0x00007FFF ldstr "Checking ldind_u8_conv_ovf_i2_un(0x0000000000007FFF) == 0x00007FFF" - call int32 Program::Check_ldind_u8_conv_ovf_i2_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i2_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFF8000 ldstr "Checking ldind_u8_conv_ovf_i2_un(0xFFFFFFFFFFFF8000) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldstr "Checking ldind_u8_conv_ovf_i2_un(0x000000000000FFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u8_conv_u2(0xFFFFFFFFFFFFFFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u8_conv_u2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_u2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u8_conv_u2(0x000000000000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u8_conv_u2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_u2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_u2(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_u2(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_u2(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u8_conv_ovf_u2(0x000000000000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u8_conv_ovf_u2(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_u2(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_u2_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_u2_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_u2_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000000000FFFF ldc.i4 0x0000FFFF ldstr "Checking ldind_u8_conv_ovf_u2_un(0x000000000000FFFF) == 0x0000FFFF" - call int32 Program::Check_ldind_u8_conv_ovf_u2_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_u2_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_i4(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000007FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_u8_conv_i4(0x000000007FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_u8_conv_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFF80000000 ldc.i4 0x80000000 ldstr "Checking ldind_u8_conv_i4(0xFFFFFFFF80000000) == 0x80000000" - call int32 Program::Check_ldind_u8_conv_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_i4(0x00000000FFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_i4(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_ovf_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000007FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_u8_conv_ovf_i4(0x000000007FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_u8_conv_ovf_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFF80000000 ldc.i4 0x80000000 ldstr "Checking ldind_u8_conv_ovf_i4(0xFFFFFFFF80000000) == 0x80000000" - call int32 Program::Check_ldind_u8_conv_ovf_i4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_u8_conv_ovf_i4(0x00000000FFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i4(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i4(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_i4_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x000000007FFFFFFF ldc.i4 0x7FFFFFFF ldstr "Checking ldind_u8_conv_ovf_i4_un(0x000000007FFFFFFF) == 0x7FFFFFFF" - call int32 Program::Check_ldind_u8_conv_ovf_i4_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i4_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFF80000000 ldstr "Checking ldind_u8_conv_ovf_i4_un(0xFFFFFFFF80000000) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldstr "Checking ldind_u8_conv_ovf_i4_un(0x00000000FFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_u4(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_u4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_u4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_u4(0x00000000FFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_u4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_u4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_u4(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_u4(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_u4(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_u4(0x00000000FFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_ovf_u4(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_u4(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_u4_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_u4_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_u4_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0x00000000FFFFFFFF ldc.i4 0xFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_u4_un(0x00000000FFFFFFFF) == 0xFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_ovf_u4_un(int64, int32, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_u4_un(int64, int32, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_i8(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_i8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_i8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_i8(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_ovf_i8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_i8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_i8_un(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_i8_un(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_i8_un(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_u8(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_u8(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_u8(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_u8(0xFFFFFFFFFFFFFFFF) == OverflowException" - call int32 Program::CheckOvf_ldind_u8_conv_ovf_u8(int64, class [System.Private.CoreLib]System.String) + call int32 Program::CheckOvf_ldind_u8_conv_ovf_u8(int64, class [System.Runtime]System.String) brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldstr "Checking ldind_u8_conv_ovf_u8_un(0xFFFFFFFFFFFFFFFF) == 0xFFFFFFFFFFFFFFFF" - call int32 Program::Check_ldind_u8_conv_ovf_u8_un(int64, int64, class [System.Private.CoreLib]System.String) + call int32 Program::Check_ldind_u8_conv_ovf_u8_un(int64, int64, class [System.Runtime]System.String) brfalse FAIL ldc.i4 100 @@ -3025,7 +3026,7 @@ FAIL: ldstr "FAILED" - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldc.i4 1 ret } @@ -3041,12 +3042,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3069,12 +3070,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3086,12 +3087,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3099,7 +3100,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_i1(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3119,12 +3120,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3136,12 +3137,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3149,7 +3150,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_i1_un(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3169,12 +3170,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3197,12 +3198,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3214,12 +3215,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3227,7 +3228,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_u1(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3247,12 +3248,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3264,12 +3265,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3277,7 +3278,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_u1_un(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3297,12 +3298,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3325,12 +3326,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3342,12 +3343,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3355,7 +3356,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_i2(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3375,12 +3376,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3392,12 +3393,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3405,7 +3406,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_i2_un(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3425,12 +3426,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3453,12 +3454,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3470,12 +3471,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3483,7 +3484,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_u2(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3503,12 +3504,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3520,12 +3521,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3533,7 +3534,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_u2_un(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3553,12 +3554,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3581,12 +3582,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3598,12 +3599,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3611,7 +3612,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_i4(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3631,12 +3632,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3648,12 +3649,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3661,7 +3662,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_i4_un(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3681,12 +3682,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3709,12 +3710,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3726,12 +3727,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3739,7 +3740,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_u4(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3759,12 +3760,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3776,12 +3777,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3789,7 +3790,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_u4_un(int8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3809,12 +3810,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3837,12 +3838,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3854,12 +3855,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3867,7 +3868,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_i8(int8&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3887,12 +3888,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_i8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3904,12 +3905,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_i8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3917,7 +3918,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_i8_un(int8&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -3937,12 +3938,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3965,12 +3966,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -3982,12 +3983,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -3995,7 +3996,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_u8(int8&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4015,12 +4016,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i1_conv_ovf_u8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4032,12 +4033,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i1_conv_ovf_u8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int8 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4045,7 +4046,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i1_conv_ovf_u8_un(int8&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4065,12 +4066,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4093,12 +4094,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4110,12 +4111,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4123,7 +4124,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_i1(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4143,12 +4144,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4160,12 +4161,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4173,7 +4174,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_i1_un(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4193,12 +4194,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4221,12 +4222,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4238,12 +4239,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4251,7 +4252,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_u1(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4271,12 +4272,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4288,12 +4289,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4301,7 +4302,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_u1_un(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4321,12 +4322,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4349,12 +4350,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4366,12 +4367,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4379,7 +4380,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_i2(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4399,12 +4400,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4416,12 +4417,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4429,7 +4430,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_i2_un(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4449,12 +4450,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4477,12 +4478,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4494,12 +4495,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4507,7 +4508,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_u2(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4527,12 +4528,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4544,12 +4545,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4557,7 +4558,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_u2_un(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4577,12 +4578,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4605,12 +4606,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4622,12 +4623,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4635,7 +4636,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_i4(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4655,12 +4656,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4672,12 +4673,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4685,7 +4686,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_i4_un(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4705,12 +4706,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4733,12 +4734,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4750,12 +4751,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4763,7 +4764,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_u4(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4783,12 +4784,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4800,12 +4801,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4813,7 +4814,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_u4_un(uint8&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4833,12 +4834,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4861,12 +4862,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4878,12 +4879,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4891,7 +4892,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_i8(uint8&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4911,12 +4912,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_i8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4928,12 +4929,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_i8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -4941,7 +4942,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_i8_un(uint8&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -4961,12 +4962,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -4989,12 +4990,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5006,12 +5007,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5019,7 +5020,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_u8(uint8&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5039,12 +5040,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u1_conv_ovf_u8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5056,12 +5057,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u1_conv_ovf_u8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint8 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5069,7 +5070,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u1_conv_ovf_u8_un(uint8&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5089,12 +5090,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5117,12 +5118,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5134,12 +5135,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5147,7 +5148,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_i1(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5167,12 +5168,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5184,12 +5185,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5197,7 +5198,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_i1_un(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5217,12 +5218,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5245,12 +5246,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5262,12 +5263,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5275,7 +5276,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_u1(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5295,12 +5296,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5312,12 +5313,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5325,7 +5326,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_u1_un(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5345,12 +5346,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5373,12 +5374,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5390,12 +5391,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5403,7 +5404,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_i2(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5423,12 +5424,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5440,12 +5441,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5453,7 +5454,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_i2_un(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5473,12 +5474,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5501,12 +5502,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5518,12 +5519,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5531,7 +5532,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_u2(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5551,12 +5552,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5568,12 +5569,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5581,7 +5582,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_u2_un(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5601,12 +5602,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5629,12 +5630,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5646,12 +5647,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5659,7 +5660,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_i4(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5679,12 +5680,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5696,12 +5697,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5709,7 +5710,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_i4_un(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5729,12 +5730,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5757,12 +5758,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5774,12 +5775,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5787,7 +5788,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_u4(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5807,12 +5808,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5824,12 +5825,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5837,7 +5838,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_u4_un(int16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5857,12 +5858,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5885,12 +5886,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5902,12 +5903,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5915,7 +5916,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_i8(int16&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5935,12 +5936,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_i8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -5952,12 +5953,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_i8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -5965,7 +5966,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_i8_un(int16&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -5985,12 +5986,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6013,12 +6014,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6030,12 +6031,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6043,7 +6044,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_u8(int16&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6063,12 +6064,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i2_conv_ovf_u8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6080,12 +6081,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i2_conv_ovf_u8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int16 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6093,7 +6094,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i2_conv_ovf_u8_un(int16&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6113,12 +6114,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6141,12 +6142,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6158,12 +6159,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6171,7 +6172,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_i1(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6191,12 +6192,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6208,12 +6209,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6221,7 +6222,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_i1_un(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6241,12 +6242,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6269,12 +6270,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6286,12 +6287,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6299,7 +6300,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_u1(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6319,12 +6320,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6336,12 +6337,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6349,7 +6350,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_u1_un(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6369,12 +6370,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6397,12 +6398,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6414,12 +6415,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6427,7 +6428,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_i2(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6447,12 +6448,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6464,12 +6465,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6477,7 +6478,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_i2_un(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6497,12 +6498,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6525,12 +6526,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6542,12 +6543,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6555,7 +6556,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_u2(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6575,12 +6576,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6592,12 +6593,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6605,7 +6606,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_u2_un(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6625,12 +6626,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6653,12 +6654,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6670,12 +6671,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6683,7 +6684,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_i4(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6703,12 +6704,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6720,12 +6721,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6733,7 +6734,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_i4_un(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6753,12 +6754,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6781,12 +6782,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6798,12 +6799,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6811,7 +6812,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_u4(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6831,12 +6832,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6848,12 +6849,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6861,7 +6862,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_u4_un(uint16&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6881,12 +6882,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6909,12 +6910,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6926,12 +6927,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6939,7 +6940,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_i8(uint16&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -6959,12 +6960,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_i8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -6976,12 +6977,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_i8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -6989,7 +6990,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_i8_un(uint16&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7009,12 +7010,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7037,12 +7038,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7054,12 +7055,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7067,7 +7068,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_u8(uint16&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7087,12 +7088,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u2_conv_ovf_u8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7104,12 +7105,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u2_conv_ovf_u8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint16 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7117,7 +7118,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u2_conv_ovf_u8_un(uint16&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7137,12 +7138,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7165,12 +7166,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7182,12 +7183,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7195,7 +7196,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_i1(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7215,12 +7216,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7232,12 +7233,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7245,7 +7246,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_i1_un(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7265,12 +7266,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7293,12 +7294,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7310,12 +7311,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7323,7 +7324,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_u1(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7343,12 +7344,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7360,12 +7361,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7373,7 +7374,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_u1_un(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7393,12 +7394,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7421,12 +7422,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7438,12 +7439,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7451,7 +7452,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_i2(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7471,12 +7472,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7488,12 +7489,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7501,7 +7502,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_i2_un(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7521,12 +7522,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7549,12 +7550,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7566,12 +7567,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7579,7 +7580,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_u2(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7599,12 +7600,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7616,12 +7617,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7629,7 +7630,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_u2_un(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7649,12 +7650,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7677,12 +7678,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7694,12 +7695,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7707,7 +7708,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_i4(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7727,12 +7728,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7744,12 +7745,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7757,7 +7758,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_i4_un(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7777,12 +7778,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7805,12 +7806,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7822,12 +7823,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7835,7 +7836,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_u4(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7855,12 +7856,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7872,12 +7873,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7885,7 +7886,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_u4_un(int32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7905,12 +7906,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7933,12 +7934,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -7950,12 +7951,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -7963,7 +7964,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_i8(int32&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -7983,12 +7984,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_i8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8000,12 +8001,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_i8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8013,7 +8014,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_i8_un(int32&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8033,12 +8034,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8061,12 +8062,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8078,12 +8079,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8091,7 +8092,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_u8(int32&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8111,12 +8112,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i4_conv_ovf_u8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8128,12 +8129,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i4_conv_ovf_u8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int32 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8141,7 +8142,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i4_conv_ovf_u8_un(int32&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8161,12 +8162,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8189,12 +8190,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8206,12 +8207,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8219,7 +8220,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_i1(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8239,12 +8240,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8256,12 +8257,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8269,7 +8270,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_i1_un(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8289,12 +8290,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8317,12 +8318,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u1(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u1(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8334,12 +8335,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u1(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u1(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8347,7 +8348,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_u1(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8367,12 +8368,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u1_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u1_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8384,12 +8385,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u1_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u1_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8397,7 +8398,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_u1_un(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8417,12 +8418,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8445,12 +8446,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8462,12 +8463,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8475,7 +8476,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_i2(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8495,12 +8496,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8512,12 +8513,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8525,7 +8526,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_i2_un(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8545,12 +8546,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8573,12 +8574,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u2(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u2(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8590,12 +8591,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u2(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u2(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8603,7 +8604,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_u2(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8623,12 +8624,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u2_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u2_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8640,12 +8641,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u2_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u2_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8653,7 +8654,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_u2_un(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8673,12 +8674,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8701,12 +8702,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8718,12 +8719,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8731,7 +8732,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_i4(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8751,12 +8752,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8768,12 +8769,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8781,7 +8782,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_i4_un(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8801,12 +8802,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8829,12 +8830,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u4(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u4(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8846,12 +8847,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u4(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u4(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8859,7 +8860,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_u4(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8879,12 +8880,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u4_un(int32 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u4_un(int32 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8896,12 +8897,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u4_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u4_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8909,7 +8910,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_u4_un(uint32&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -8929,12 +8930,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8957,12 +8958,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -8974,12 +8975,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -8987,7 +8988,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_i8(uint32&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9007,12 +9008,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_i8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9024,12 +9025,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_i8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9037,7 +9038,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_i8_un(uint32&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9057,12 +9058,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9085,12 +9086,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u8(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u8(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9102,12 +9103,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u8(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u8(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9115,7 +9116,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_u8(uint32&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9135,12 +9136,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u8_un(int32 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u4_conv_ovf_u8_un(int32 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9152,12 +9153,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u8_un(int32 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u4_conv_ovf_u8_un(int32 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint32 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9165,7 +9166,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u4_conv_ovf_u8_un(uint32&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9185,12 +9186,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_i1(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_i1(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9213,12 +9214,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i1(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i1(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9230,12 +9231,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i1(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i1(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9243,7 +9244,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_i1(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9263,12 +9264,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i1_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i1_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9280,12 +9281,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i1_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i1_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9293,7 +9294,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_i1_un(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9313,12 +9314,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_u1(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_u1(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9341,12 +9342,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u1(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u1(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9358,12 +9359,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u1(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u1(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9371,7 +9372,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_u1(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9391,12 +9392,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u1_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u1_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9408,12 +9409,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u1_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u1_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9421,7 +9422,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_u1_un(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9441,12 +9442,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_i2(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_i2(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9469,12 +9470,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i2(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i2(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9486,12 +9487,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i2(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i2(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9499,7 +9500,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_i2(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9519,12 +9520,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i2_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i2_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9536,12 +9537,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i2_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i2_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9549,7 +9550,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_i2_un(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9569,12 +9570,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_u2(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_u2(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9597,12 +9598,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u2(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u2(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9614,12 +9615,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u2(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u2(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9627,7 +9628,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_u2(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9647,12 +9648,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u2_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u2_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9664,12 +9665,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u2_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u2_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9677,7 +9678,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_u2_un(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9697,12 +9698,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_i4(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_i4(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9725,12 +9726,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i4(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i4(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9742,12 +9743,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i4(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i4(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9755,7 +9756,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_i4(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9775,12 +9776,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i4_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i4_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9792,12 +9793,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i4_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i4_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9805,7 +9806,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_i4_un(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9825,12 +9826,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_u4(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_u4(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9853,12 +9854,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u4(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u4(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9870,12 +9871,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u4(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u4(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9883,7 +9884,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_u4(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9903,12 +9904,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u4_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u4_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9920,12 +9921,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u4_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u4_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -9933,7 +9934,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_u4_un(int64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -9953,12 +9954,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_i8(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_i8(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9981,12 +9982,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i8(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i8(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -9998,12 +9999,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i8(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i8(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10011,7 +10012,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_i8(int64&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10031,12 +10032,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i8_un(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_i8_un(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10048,12 +10049,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i8_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_i8_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10061,7 +10062,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_i8_un(int64&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10081,12 +10082,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_u8(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_u8(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10109,12 +10110,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u8(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u8(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10126,12 +10127,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u8(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u8(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10139,7 +10140,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_u8(int64&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10159,12 +10160,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u8_un(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_i8_conv_ovf_u8_un(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10176,12 +10177,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u8_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_i8_conv_ovf_u8_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(int64 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10189,7 +10190,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_i8_conv_ovf_u8_un(int64&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10209,12 +10210,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_i1(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_i1(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10237,12 +10238,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i1(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i1(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10254,12 +10255,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i1(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i1(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10267,7 +10268,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_i1(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10287,12 +10288,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i1_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i1_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10304,12 +10305,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i1_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i1_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10317,7 +10318,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_i1_un(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10337,12 +10338,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_u1(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_u1(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10365,12 +10366,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u1(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u1(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10382,12 +10383,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u1(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u1(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10395,7 +10396,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_u1(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10415,12 +10416,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u1_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u1_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10432,12 +10433,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u1_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u1_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10445,7 +10446,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_u1_un(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10465,12 +10466,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_i2(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_i2(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10493,12 +10494,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i2(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i2(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10510,12 +10511,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i2(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i2(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10523,7 +10524,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_i2(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10543,12 +10544,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i2_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i2_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10560,12 +10561,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i2_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i2_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10573,7 +10574,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_i2_un(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10593,12 +10594,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_u2(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_u2(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10621,12 +10622,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u2(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u2(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10638,12 +10639,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u2(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u2(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10651,7 +10652,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_u2(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10671,12 +10672,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u2_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u2_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10688,12 +10689,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u2_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u2_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10701,7 +10702,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_u2_un(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10721,12 +10722,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_i4(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_i4(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10749,12 +10750,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i4(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i4(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10766,12 +10767,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i4(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i4(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10779,7 +10780,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_i4(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10799,12 +10800,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i4_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i4_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10816,12 +10817,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i4_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i4_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10829,7 +10830,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_i4_un(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10849,12 +10850,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_u4(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_u4(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10877,12 +10878,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u4(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u4(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10894,12 +10895,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u4(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u4(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10907,7 +10908,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_u4(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10927,12 +10928,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u4_un(int64 input, int32 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u4_un(int64 input, int32 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -10944,12 +10945,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u4_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u4_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int32 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -10957,7 +10958,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_u4_un(uint64&, int32&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -10977,12 +10978,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_i8(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_i8(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -11005,12 +11006,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i8(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i8(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -11022,12 +11023,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i8(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i8(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -11035,7 +11036,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_i8(uint64&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -11055,12 +11056,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i8_un(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_i8_un(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -11072,12 +11073,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i8_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_i8_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -11085,7 +11086,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_i8_un(uint64&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -11105,12 +11106,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_u8(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_u8(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -11133,12 +11134,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u8(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u8(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -11150,12 +11151,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u8(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u8(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -11163,7 +11164,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_u8(uint64&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END @@ -11183,12 +11184,12 @@ FAIL: ret } - .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u8_un(int64 input, int64 expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 Check_ldind_u8_conv_ovf_u8_un(int64 input, int64 expected, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int64 dst) ldarg.2 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 ldloca 0 @@ -11200,12 +11201,12 @@ FAIL: ret } - .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u8_un(int64 input, class [System.Private.CoreLib]System.String desc) cil managed noinlining + .method private hidebysig static int32 CheckOvf_ldind_u8_conv_ovf_u8_un(int64 input, class [System.Runtime]System.String desc) cil managed noinlining { .maxstack 4 .locals init(uint64 src, int64 dst, int32 ovf) ldarg.1 - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldarg.0 stloc 0 .try { @@ -11213,7 +11214,7 @@ FAIL: ldloca 1 call void Program::Test_ldind_u8_conv_ovf_u8_un(uint64&, int64&) leave END - } catch [System.Private.CoreLib]System.OverflowException { + } catch [System.Runtime]System.OverflowException { ldc.i4 1 stloc 2 leave END diff --git a/src/coreclr/tests/src/JIT/Directed/Convert/ldind_conv_gen.csx b/src/coreclr/tests/src/JIT/Directed/Convert/ldind_conv_gen.csx index 3f5ddd561a1657..03621c06287a12 100644 --- a/src/coreclr/tests/src/JIT/Directed/Convert/ldind_conv_gen.csx +++ b/src/coreclr/tests/src/JIT/Directed/Convert/ldind_conv_gen.csx @@ -285,12 +285,12 @@ class Test public void WriteCheckMethod(TextWriter writer) { writer.WriteLine(); - writer.WriteLine($" .method private hidebysig static int32 Check_{Name}({Load.Type.ActualType.Name} input, {Store.Type.Name} expected, class [System.Private.CoreLib]System.String desc) cil managed noinlining"); + writer.WriteLine($" .method private hidebysig static int32 Check_{Name}({Load.Type.ActualType.Name} input, {Store.Type.Name} expected, class [System.Runtime]System.String desc) cil managed noinlining"); writer.WriteLine($" {{"); writer.WriteLine($" .maxstack 4"); writer.WriteLine($" .locals init({Load.Type.Name} src, {Store.Type.Name} dst)"); writer.WriteLine($" ldarg.2"); - writer.WriteLine($" call void Program::print(class [System.Private.CoreLib]System.String)"); + writer.WriteLine($" call void Program::print(class [System.Runtime]System.String)"); writer.WriteLine($" ldarg.0"); writer.WriteLine($" stloc 0"); writer.WriteLine($" ldloca 0"); @@ -306,12 +306,12 @@ class Test public void WriteCheckOverflowMethod(TextWriter writer) { writer.WriteLine(); - writer.WriteLine($" .method private hidebysig static int32 CheckOvf_{Name}({Load.Type.ActualType.Name} input, class [System.Private.CoreLib]System.String desc) cil managed noinlining"); + writer.WriteLine($" .method private hidebysig static int32 CheckOvf_{Name}({Load.Type.ActualType.Name} input, class [System.Runtime]System.String desc) cil managed noinlining"); writer.WriteLine($" {{"); writer.WriteLine($" .maxstack 4"); writer.WriteLine($" .locals init({Load.Type.Name} src, {Store.Type.Name} dst, int32 ovf)"); writer.WriteLine($" ldarg.1"); - writer.WriteLine($" call void Program::print(class [System.Private.CoreLib]System.String)"); + writer.WriteLine($" call void Program::print(class [System.Runtime]System.String)"); writer.WriteLine($" ldarg.0"); writer.WriteLine($" stloc 0"); writer.WriteLine($" .try {{"); @@ -319,7 +319,7 @@ class Test writer.WriteLine($" ldloca 1"); writer.WriteLine($" call void Program::Test_{Name}({Load.Type.Name}&, {Store.Type.Name}&)"); writer.WriteLine($" leave END"); - writer.WriteLine($" }} catch [System.Private.CoreLib]System.OverflowException {{"); + writer.WriteLine($" }} catch [System.Runtime]System.OverflowException {{"); writer.WriteLine($" ldc.i4 1"); writer.WriteLine($" stloc 2"); writer.WriteLine($" leave END"); @@ -348,16 +348,17 @@ const string FileBeginIL = @"// Licensed to the .NET Foundation under one or mor // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -.assembly extern System.Private.CoreLib { auto } +.assembly extern System.Console { auto } +.assembly extern System.Runtime { auto } .assembly test { } -.class auto Program extends [System.Private.CoreLib]System.Object +.class auto Program extends [System.Runtime]System.Object { - .method private static void print(class [System.Private.CoreLib]System.String) cil managed + .method private static void print(class [System.Runtime]System.String) cil managed { .maxstack 1 ldarg 0 - call void [System.Private.CoreLib]Internal.Console::WriteLine(class [System.Private.CoreLib]System.String) + call void [System.Console]System.Console::WriteLine(class [System.Runtime]System.String) ret }"; @@ -373,7 +374,7 @@ const string MainMethodEndIL = @" FAIL: ldstr ""FAILED"" - call void Program::print(class [System.Private.CoreLib]System.String) + call void Program::print(class [System.Runtime]System.String) ldc.i4 1 ret }"; @@ -433,13 +434,13 @@ void WriteMainMethod(TextWriter write, IEnumerable tests) if (i.Expected == null) { writer.WriteLine($" ldstr \"Checking {t.Name}({t.Load.Type.Hex(i.Input)}) == OverflowException\""); - writer.WriteLine($" call int32 Program::CheckOvf_{t.Name}({t.Load.Type.ActualType.Name}, class [System.Private.CoreLib]System.String)"); + writer.WriteLine($" call int32 Program::CheckOvf_{t.Name}({t.Load.Type.ActualType.Name}, class [System.Runtime]System.String)"); } else { writer.WriteLine($" {t.Store.Type.ILConst(i.Expected.Value)}"); writer.WriteLine($" ldstr \"Checking {t.Name}({t.Load.Type.Hex(i.Input)}) == {t.Store.Type.Hex(i.Expected.Value)}\""); - writer.WriteLine($" call int32 Program::Check_{t.Name}({t.Load.Type.ActualType.Name}, {t.Store.Type.Name}, class [System.Private.CoreLib]System.String)"); + writer.WriteLine($" call int32 Program::Check_{t.Name}({t.Load.Type.ActualType.Name}, {t.Store.Type.Name}, class [System.Runtime]System.String)"); } writer.WriteLine($" brfalse FAIL"); diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_r.csproj b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_r.csproj index 3a1d2940dfccb6..50474f718439d3 100644 --- a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_r.csproj +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_r.csproj @@ -81,6 +81,8 @@ + + diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_ro.csproj b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_ro.csproj index 46b4d6668febc3..4a2b744fa55f84 100644 --- a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_ro.csproj +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_ro.csproj @@ -81,6 +81,8 @@ + + diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/FusedMultiplyAdd.Vector128.Double.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/FusedMultiplyAdd.Vector128.Double.cs new file mode 100644 index 00000000000000..3d64adb631688a --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/FusedMultiplyAdd.Vector128.Double.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplyAdd_Vector128_Double() + { + var test = new SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Double(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Double testClass) + { + var result = AdvSimd.Arm64.FusedMultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Double testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.Arm64.FusedMultiplyAdd( + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)), + AdvSimd.LoadVector128((Double*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + private static Double[] _data3 = new Double[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Double[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.Arm64.FusedMultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.Arm64.FusedMultiplyAdd( + AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.FusedMultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.FusedMultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.Arm64.FusedMultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.Arm64.FusedMultiplyAdd( + AdvSimd.LoadVector128((Double*)(pClsVar1)), + AdvSimd.LoadVector128((Double*)(pClsVar2)), + AdvSimd.LoadVector128((Double*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.Arm64.FusedMultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.Arm64.FusedMultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Double(); + var result = AdvSimd.Arm64.FusedMultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Double(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.Arm64.FusedMultiplyAdd( + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)), + AdvSimd.LoadVector128((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.Arm64.FusedMultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.Arm64.FusedMultiplyAdd( + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)), + AdvSimd.LoadVector128((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.Arm64.FusedMultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.Arm64.FusedMultiplyAdd( + AdvSimd.LoadVector128((Double*)(&test._fld1)), + AdvSimd.LoadVector128((Double*)(&test._fld2)), + AdvSimd.LoadVector128((Double*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] thirdOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.FusedMultiplyAdd)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/FusedMultiplySubtract.Vector128.Double.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/FusedMultiplySubtract.Vector128.Double.cs new file mode 100644 index 00000000000000..830a8b9f35f087 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/FusedMultiplySubtract.Vector128.Double.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplySubtract_Vector128_Double() + { + var test = new SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Double(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Double testClass) + { + var result = AdvSimd.Arm64.FusedMultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Double testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.Arm64.FusedMultiplySubtract( + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)), + AdvSimd.LoadVector128((Double*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + private static Double[] _data3 = new Double[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Double[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.Arm64.FusedMultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.Arm64.FusedMultiplySubtract( + AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.FusedMultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.FusedMultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.Arm64.FusedMultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.Arm64.FusedMultiplySubtract( + AdvSimd.LoadVector128((Double*)(pClsVar1)), + AdvSimd.LoadVector128((Double*)(pClsVar2)), + AdvSimd.LoadVector128((Double*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.Arm64.FusedMultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.Arm64.FusedMultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Double(); + var result = AdvSimd.Arm64.FusedMultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Double(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.Arm64.FusedMultiplySubtract( + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)), + AdvSimd.LoadVector128((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.Arm64.FusedMultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.Arm64.FusedMultiplySubtract( + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)), + AdvSimd.LoadVector128((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.Arm64.FusedMultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.Arm64.FusedMultiplySubtract( + AdvSimd.LoadVector128((Double*)(&test._fld1)), + AdvSimd.LoadVector128((Double*)(&test._fld2)), + AdvSimd.LoadVector128((Double*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] thirdOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.FusedMultiplySubtract)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64.cs index 5946ae0475e7e7..20bc74df457c7f 100644 --- a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64.cs +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64.cs @@ -85,6 +85,8 @@ static Program() ["Divide.Vector64.Single"] = Divide_Vector64_Single, ["Divide.Vector128.Double"] = Divide_Vector128_Double, ["Divide.Vector128.Single"] = Divide_Vector128_Single, + ["FusedMultiplyAdd.Vector128.Double"] = FusedMultiplyAdd_Vector128_Double, + ["FusedMultiplySubtract.Vector128.Double"] = FusedMultiplySubtract_Vector128_Double, ["Max.Vector128.Double"] = Max_Vector128_Double, ["MaxScalar.Vector64.Double"] = MaxScalar_Vector64_Double, ["MaxScalar.Vector64.Single"] = MaxScalar_Vector64_Single, diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_r.csproj b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_r.csproj index a5b8156ab8889a..9d7dcb0e92c5e4 100644 --- a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_r.csproj +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_r.csproj @@ -206,6 +206,18 @@ + + + + + + + + + + + + @@ -288,6 +300,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_ro.csproj b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_ro.csproj index 4f80b42516e60d..3dc0be5e9e0189 100644 --- a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_ro.csproj +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_ro.csproj @@ -206,6 +206,18 @@ + + + + + + + + + + + + @@ -288,6 +300,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAdd.Vector128.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAdd.Vector128.Single.cs new file mode 100644 index 00000000000000..335f9423b03b26 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAdd.Vector128.Single.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplyAdd_Vector128_Single() + { + var test = new SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Single testClass) + { + var result = AdvSimd.FusedMultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Single testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)), + AdvSimd.LoadVector128((Single*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + private static Single[] _data3 = new Single[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector128((Single*)(pClsVar1)), + AdvSimd.LoadVector128((Single*)(pClsVar2)), + AdvSimd.LoadVector128((Single*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Single(); + var result = AdvSimd.FusedMultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAdd_Vector128_Single(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)), + AdvSimd.LoadVector128((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)), + AdvSimd.LoadVector128((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector128((Single*)(&test._fld1)), + AdvSimd.LoadVector128((Single*)(&test._fld2)), + AdvSimd.LoadVector128((Single*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplyAdd)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAdd.Vector64.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAdd.Vector64.Single.cs new file mode 100644 index 00000000000000..65e8620b0b0917 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAdd.Vector64.Single.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplyAdd_Vector64_Single() + { + var test = new SimpleTernaryOpTest__FusedMultiplyAdd_Vector64_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplyAdd_Vector64_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplyAdd_Vector64_Single testClass) + { + var result = AdvSimd.FusedMultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplyAdd_Vector64_Single testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + private static Single[] _data3 = new Single[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplyAdd_Vector64_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplyAdd_Vector64_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector64((Single*)(pClsVar1)), + AdvSimd.LoadVector64((Single*)(pClsVar2)), + AdvSimd.LoadVector64((Single*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAdd_Vector64_Single(); + var result = AdvSimd.FusedMultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAdd_Vector64_Single(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAdd( + AdvSimd.LoadVector64((Single*)(&test._fld1)), + AdvSimd.LoadVector64((Single*)(&test._fld2)), + AdvSimd.LoadVector64((Single*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplyAdd)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddNegatedScalar.Vector64.Double.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddNegatedScalar.Vector64.Double.cs new file mode 100644 index 00000000000000..1565ae7eeb62a5 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddNegatedScalar.Vector64.Double.cs @@ -0,0 +1,578 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplyAddNegatedScalar_Vector64_Double() + { + var test = new SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Double(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Double testClass) + { + var result = AdvSimd.FusedMultiplyAddNegatedScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Double testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + private static Double[] _data3 = new Double[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Double[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAddNegatedScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAddNegatedScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Double*)(pClsVar1)), + AdvSimd.LoadVector64((Double*)(pClsVar2)), + AdvSimd.LoadVector64((Double*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplyAddNegatedScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplyAddNegatedScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Double(); + var result = AdvSimd.FusedMultiplyAddNegatedScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Double(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplyAddNegatedScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAddNegatedScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Double*)(&test._fld1)), + AdvSimd.LoadVector64((Double*)(&test._fld2)), + AdvSimd.LoadVector64((Double*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] thirdOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAddNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplyAddNegatedScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddNegatedScalar.Vector64.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddNegatedScalar.Vector64.Single.cs new file mode 100644 index 00000000000000..09b02cb737b0ec --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddNegatedScalar.Vector64.Single.cs @@ -0,0 +1,578 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplyAddNegatedScalar_Vector64_Single() + { + var test = new SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Single testClass) + { + var result = AdvSimd.FusedMultiplyAddNegatedScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Single testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + private static Single[] _data3 = new Single[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAddNegatedScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAddNegatedScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Single*)(pClsVar1)), + AdvSimd.LoadVector64((Single*)(pClsVar2)), + AdvSimd.LoadVector64((Single*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplyAddNegatedScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplyAddNegatedScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Single(); + var result = AdvSimd.FusedMultiplyAddNegatedScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAddNegatedScalar_Vector64_Single(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplyAddNegatedScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAddNegatedScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAddNegatedScalar( + AdvSimd.LoadVector64((Single*)(&test._fld1)), + AdvSimd.LoadVector64((Single*)(&test._fld2)), + AdvSimd.LoadVector64((Single*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAddNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplyAddNegatedScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddScalar.Vector64.Double.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddScalar.Vector64.Double.cs new file mode 100644 index 00000000000000..4e65853f18962d --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddScalar.Vector64.Double.cs @@ -0,0 +1,578 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplyAddScalar_Vector64_Double() + { + var test = new SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Double(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Double testClass) + { + var result = AdvSimd.FusedMultiplyAddScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Double testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + private static Double[] _data3 = new Double[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Double[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplyAddScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAddScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAddScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplyAddScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Double*)(pClsVar1)), + AdvSimd.LoadVector64((Double*)(pClsVar2)), + AdvSimd.LoadVector64((Double*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplyAddScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplyAddScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Double(); + var result = AdvSimd.FusedMultiplyAddScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Double(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplyAddScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAddScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Double*)(&test._fld1)), + AdvSimd.LoadVector64((Double*)(&test._fld2)), + AdvSimd.LoadVector64((Double*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] thirdOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplyAddScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddScalar.Vector64.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddScalar.Vector64.Single.cs new file mode 100644 index 00000000000000..9883e34687a808 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplyAddScalar.Vector64.Single.cs @@ -0,0 +1,578 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplyAddScalar_Vector64_Single() + { + var test = new SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Single testClass) + { + var result = AdvSimd.FusedMultiplyAddScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Single testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + private static Single[] _data3 = new Single[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplyAddScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAddScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplyAddScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplyAddScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Single*)(pClsVar1)), + AdvSimd.LoadVector64((Single*)(pClsVar2)), + AdvSimd.LoadVector64((Single*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplyAddScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplyAddScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Single(); + var result = AdvSimd.FusedMultiplyAddScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplyAddScalar_Vector64_Single(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplyAddScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAddScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplyAddScalar( + AdvSimd.LoadVector64((Single*)(&test._fld1)), + AdvSimd.LoadVector64((Single*)(&test._fld2)), + AdvSimd.LoadVector64((Single*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplyAddScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtract.Vector128.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtract.Vector128.Single.cs new file mode 100644 index 00000000000000..9f7687bb2586dd --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtract.Vector128.Single.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplySubtract_Vector128_Single() + { + var test = new SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Single testClass) + { + var result = AdvSimd.FusedMultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Single testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)), + AdvSimd.LoadVector128((Single*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + private static Single[] _data3 = new Single[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector128((Single*)(pClsVar1)), + AdvSimd.LoadVector128((Single*)(pClsVar2)), + AdvSimd.LoadVector128((Single*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Single(); + var result = AdvSimd.FusedMultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtract_Vector128_Single(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)), + AdvSimd.LoadVector128((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)), + AdvSimd.LoadVector128((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector128((Single*)(&test._fld1)), + AdvSimd.LoadVector128((Single*)(&test._fld2)), + AdvSimd.LoadVector128((Single*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplySubtract)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtract.Vector64.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtract.Vector64.Single.cs new file mode 100644 index 00000000000000..0d524d7edb7523 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtract.Vector64.Single.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplySubtract_Vector64_Single() + { + var test = new SimpleTernaryOpTest__FusedMultiplySubtract_Vector64_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplySubtract_Vector64_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplySubtract_Vector64_Single testClass) + { + var result = AdvSimd.FusedMultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplySubtract_Vector64_Single testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + private static Single[] _data3 = new Single[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplySubtract_Vector64_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplySubtract_Vector64_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector64((Single*)(pClsVar1)), + AdvSimd.LoadVector64((Single*)(pClsVar2)), + AdvSimd.LoadVector64((Single*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtract_Vector64_Single(); + var result = AdvSimd.FusedMultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtract_Vector64_Single(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtract( + AdvSimd.LoadVector64((Single*)(&test._fld1)), + AdvSimd.LoadVector64((Single*)(&test._fld2)), + AdvSimd.LoadVector64((Single*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplySubtract)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractNegatedScalar.Vector64.Double.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractNegatedScalar.Vector64.Double.cs new file mode 100644 index 00000000000000..8e1a6594c6a97e --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractNegatedScalar.Vector64.Double.cs @@ -0,0 +1,578 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplySubtractNegatedScalar_Vector64_Double() + { + var test = new SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Double(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Double testClass) + { + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Double testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + private static Double[] _data3 = new Double[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Double[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtractNegatedScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtractNegatedScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Double*)(pClsVar1)), + AdvSimd.LoadVector64((Double*)(pClsVar2)), + AdvSimd.LoadVector64((Double*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Double(); + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Double(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Double*)(&test._fld1)), + AdvSimd.LoadVector64((Double*)(&test._fld2)), + AdvSimd.LoadVector64((Double*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] thirdOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtractNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplySubtractNegatedScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractNegatedScalar.Vector64.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractNegatedScalar.Vector64.Single.cs new file mode 100644 index 00000000000000..b87c655a99112a --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractNegatedScalar.Vector64.Single.cs @@ -0,0 +1,578 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplySubtractNegatedScalar_Vector64_Single() + { + var test = new SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Single testClass) + { + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Single testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + private static Single[] _data3 = new Single[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtractNegatedScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtractNegatedScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Single*)(pClsVar1)), + AdvSimd.LoadVector64((Single*)(pClsVar2)), + AdvSimd.LoadVector64((Single*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Single(); + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtractNegatedScalar_Vector64_Single(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtractNegatedScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtractNegatedScalar( + AdvSimd.LoadVector64((Single*)(&test._fld1)), + AdvSimd.LoadVector64((Single*)(&test._fld2)), + AdvSimd.LoadVector64((Single*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtractNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplySubtractNegatedScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractScalar.Vector64.Double.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractScalar.Vector64.Double.cs new file mode 100644 index 00000000000000..d0c1534c0326d2 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractScalar.Vector64.Double.cs @@ -0,0 +1,578 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplySubtractScalar_Vector64_Double() + { + var test = new SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Double(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Double testClass) + { + var result = AdvSimd.FusedMultiplySubtractScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Double testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + private static Double[] _data3 = new Double[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Double[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplySubtractScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtractScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtractScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplySubtractScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Double*)(pClsVar1)), + AdvSimd.LoadVector64((Double*)(pClsVar2)), + AdvSimd.LoadVector64((Double*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplySubtractScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplySubtractScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Double(); + var result = AdvSimd.FusedMultiplySubtractScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Double(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplySubtractScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)), + AdvSimd.LoadVector64((Double*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtractScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Double*)(&test._fld1)), + AdvSimd.LoadVector64((Double*)(&test._fld2)), + AdvSimd.LoadVector64((Double*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] thirdOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplySubtractScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractScalar.Vector64.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractScalar.Vector64.Single.cs new file mode 100644 index 00000000000000..f3f6637c620746 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/FusedMultiplySubtractScalar.Vector64.Single.cs @@ -0,0 +1,578 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void FusedMultiplySubtractScalar_Vector64_Single() + { + var test = new SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Single testClass) + { + var result = AdvSimd.FusedMultiplySubtractScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Single testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + private static Single[] _data3 = new Single[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.FusedMultiplySubtractScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtractScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.FusedMultiplySubtractScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.FusedMultiplySubtractScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Single*)(pClsVar1)), + AdvSimd.LoadVector64((Single*)(pClsVar2)), + AdvSimd.LoadVector64((Single*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.FusedMultiplySubtractScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.FusedMultiplySubtractScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Single(); + var result = AdvSimd.FusedMultiplySubtractScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__FusedMultiplySubtractScalar_Vector64_Single(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.FusedMultiplySubtractScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)), + AdvSimd.LoadVector64((Single*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtractScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.FusedMultiplySubtractScalar( + AdvSimd.LoadVector64((Single*)(&test._fld1)), + AdvSimd.LoadVector64((Single*)(&test._fld2)), + AdvSimd.LoadVector64((Single*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.FusedMultiplySubtractScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.Byte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.Byte.cs new file mode 100644 index 00000000000000..8b970226f1b0db --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.Byte.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector128_Byte() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_Byte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector128_Byte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector128_Byte testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector128_Byte testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector128_Byte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector128_Byte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Byte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Byte*)(pClsVar1)), + AdvSimd.LoadVector128((Byte*)(pClsVar2)), + AdvSimd.LoadVector128((Byte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_Byte(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_Byte(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Byte*)(&test._fld1)), + AdvSimd.LoadVector128((Byte*)(&test._fld2)), + AdvSimd.LoadVector128((Byte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] thirdOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.Int16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.Int16.cs new file mode 100644 index 00000000000000..18fc74da6195af --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.Int16.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector128_Int16() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector128_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector128_Int16 testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector128_Int16 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector128_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector128_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int16*)(pClsVar1)), + AdvSimd.LoadVector128((Int16*)(pClsVar2)), + AdvSimd.LoadVector128((Int16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_Int16(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_Int16(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int16*)(&test._fld1)), + AdvSimd.LoadVector128((Int16*)(&test._fld2)), + AdvSimd.LoadVector128((Int16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.Int32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.Int32.cs new file mode 100644 index 00000000000000..da23655e1b9e1f --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.Int32.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector128_Int32() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector128_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector128_Int32 testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector128_Int32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector128_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector128_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((Int32*)(pClsVar2)), + AdvSimd.LoadVector128((Int32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_Int32(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_Int32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((Int32*)(&test._fld2)), + AdvSimd.LoadVector128((Int32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.SByte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.SByte.cs new file mode 100644 index 00000000000000..a7890d17bc9eb9 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.SByte.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector128_SByte() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_SByte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector128_SByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector128_SByte testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector128_SByte testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector128_SByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector128_SByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new SByte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((SByte*)(pClsVar1)), + AdvSimd.LoadVector128((SByte*)(pClsVar2)), + AdvSimd.LoadVector128((SByte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_SByte(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_SByte(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((SByte*)(&test._fld1)), + AdvSimd.LoadVector128((SByte*)(&test._fld2)), + AdvSimd.LoadVector128((SByte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] thirdOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.UInt16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.UInt16.cs new file mode 100644 index 00000000000000..67adbea642a194 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.UInt16.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector128_UInt16() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt16 testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt16 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)), + AdvSimd.LoadVector128((UInt16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + private static UInt16[] _data3 = new UInt16[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt16*)(pClsVar1)), + AdvSimd.LoadVector128((UInt16*)(pClsVar2)), + AdvSimd.LoadVector128((UInt16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt16(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt16(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)), + AdvSimd.LoadVector128((UInt16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)), + AdvSimd.LoadVector128((UInt16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt16*)(&test._fld1)), + AdvSimd.LoadVector128((UInt16*)(&test._fld2)), + AdvSimd.LoadVector128((UInt16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] inArray3 = new UInt16[Op3ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] inArray3 = new UInt16[Op3ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] thirdOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.UInt32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.UInt32.cs new file mode 100644 index 00000000000000..5520c11c011f94 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector128.UInt32.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector128_UInt32() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt32 testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)), + AdvSimd.LoadVector128((UInt32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + private static UInt32[] _data3 = new UInt32[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt32*)(pClsVar1)), + AdvSimd.LoadVector128((UInt32*)(pClsVar2)), + AdvSimd.LoadVector128((UInt32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt32(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector128_UInt32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)), + AdvSimd.LoadVector128((UInt32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)), + AdvSimd.LoadVector128((UInt32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector128((UInt32*)(&test._fld1)), + AdvSimd.LoadVector128((UInt32*)(&test._fld2)), + AdvSimd.LoadVector128((UInt32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] inArray3 = new UInt32[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] inArray3 = new UInt32[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.Byte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.Byte.cs new file mode 100644 index 00000000000000..de6b198e849145 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.Byte.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector64_Byte() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_Byte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector64_Byte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector64_Byte testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector64_Byte testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector64_Byte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector64_Byte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Byte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Byte*)(pClsVar1)), + AdvSimd.LoadVector64((Byte*)(pClsVar2)), + AdvSimd.LoadVector64((Byte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_Byte(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_Byte(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Byte*)(&test._fld1)), + AdvSimd.LoadVector64((Byte*)(&test._fld2)), + AdvSimd.LoadVector64((Byte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] thirdOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.Int16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.Int16.cs new file mode 100644 index 00000000000000..d46975701dc06a --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.Int16.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector64_Int16() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector64_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector64_Int16 testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector64_Int16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector64_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector64_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_Int16(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_Int16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.Int32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.Int32.cs new file mode 100644 index 00000000000000..348384dee20227 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.Int32.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector64_Int32() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector64_Int32 testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_Int32(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.SByte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.SByte.cs new file mode 100644 index 00000000000000..d54c1099736a40 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.SByte.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector64_SByte() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_SByte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector64_SByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector64_SByte testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector64_SByte testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector64_SByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector64_SByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new SByte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((SByte*)(pClsVar1)), + AdvSimd.LoadVector64((SByte*)(pClsVar2)), + AdvSimd.LoadVector64((SByte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_SByte(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_SByte(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((SByte*)(&test._fld1)), + AdvSimd.LoadVector64((SByte*)(&test._fld2)), + AdvSimd.LoadVector64((SByte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] thirdOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.UInt16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.UInt16.cs new file mode 100644 index 00000000000000..787cd7a1e9bf56 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.UInt16.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector64_UInt16() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt16 testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)), + AdvSimd.LoadVector64((UInt16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + private static UInt16[] _data3 = new UInt16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt16*)(pClsVar1)), + AdvSimd.LoadVector64((UInt16*)(pClsVar2)), + AdvSimd.LoadVector64((UInt16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt16(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)), + AdvSimd.LoadVector64((UInt16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)), + AdvSimd.LoadVector64((UInt16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt16*)(&test._fld1)), + AdvSimd.LoadVector64((UInt16*)(&test._fld2)), + AdvSimd.LoadVector64((UInt16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] inArray3 = new UInt16[Op3ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] inArray3 = new UInt16[Op3ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] thirdOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.UInt32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.UInt32.cs new file mode 100644 index 00000000000000..63c113e77d7842 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyAdd.Vector64.UInt32.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyAdd_Vector64_UInt32() + { + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt32 testClass) + { + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)), + AdvSimd.LoadVector64((UInt32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + private static UInt32[] _data3 = new UInt32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplyAdd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyAdd), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplyAdd( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt32*)(pClsVar1)), + AdvSimd.LoadVector64((UInt32*)(pClsVar2)), + AdvSimd.LoadVector64((UInt32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplyAdd(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt32(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyAdd_Vector64_UInt32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)), + AdvSimd.LoadVector64((UInt32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplyAdd(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)), + AdvSimd.LoadVector64((UInt32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplyAdd( + AdvSimd.LoadVector64((UInt32*)(&test._fld1)), + AdvSimd.LoadVector64((UInt32*)(&test._fld2)), + AdvSimd.LoadVector64((UInt32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] inArray3 = new UInt32[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] inArray3 = new UInt32[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyAdd)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.Byte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.Byte.cs new file mode 100644 index 00000000000000..8d4429e83892c4 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.Byte.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector128_Byte() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_Byte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector128_Byte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector128_Byte testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector128_Byte testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector128_Byte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector128_Byte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Byte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Byte*)(pClsVar1)), + AdvSimd.LoadVector128((Byte*)(pClsVar2)), + AdvSimd.LoadVector128((Byte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_Byte(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_Byte(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Byte*)(&test._fld1)), + AdvSimd.LoadVector128((Byte*)(&test._fld2)), + AdvSimd.LoadVector128((Byte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] thirdOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.Int16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.Int16.cs new file mode 100644 index 00000000000000..f57df3823775c6 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.Int16.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector128_Int16() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector128_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector128_Int16 testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector128_Int16 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector128_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector128_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int16*)(pClsVar1)), + AdvSimd.LoadVector128((Int16*)(pClsVar2)), + AdvSimd.LoadVector128((Int16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_Int16(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_Int16(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int16*)(&test._fld1)), + AdvSimd.LoadVector128((Int16*)(&test._fld2)), + AdvSimd.LoadVector128((Int16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.Int32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.Int32.cs new file mode 100644 index 00000000000000..a1c0d2a063d90e --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.Int32.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector128_Int32() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector128_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector128_Int32 testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector128_Int32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector128_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector128_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((Int32*)(pClsVar2)), + AdvSimd.LoadVector128((Int32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_Int32(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_Int32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((Int32*)(&test._fld2)), + AdvSimd.LoadVector128((Int32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.SByte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.SByte.cs new file mode 100644 index 00000000000000..56c91b78bfbd67 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.SByte.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector128_SByte() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_SByte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector128_SByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector128_SByte testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector128_SByte testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector128_SByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector128_SByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new SByte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((SByte*)(pClsVar1)), + AdvSimd.LoadVector128((SByte*)(pClsVar2)), + AdvSimd.LoadVector128((SByte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_SByte(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_SByte(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((SByte*)(&test._fld1)), + AdvSimd.LoadVector128((SByte*)(&test._fld2)), + AdvSimd.LoadVector128((SByte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] thirdOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.UInt16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.UInt16.cs new file mode 100644 index 00000000000000..ab5ccd2e2bc572 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.UInt16.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector128_UInt16() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt16 testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt16 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)), + AdvSimd.LoadVector128((UInt16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + private static UInt16[] _data3 = new UInt16[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt16*)(pClsVar1)), + AdvSimd.LoadVector128((UInt16*)(pClsVar2)), + AdvSimd.LoadVector128((UInt16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt16(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt16(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)), + AdvSimd.LoadVector128((UInt16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)), + AdvSimd.LoadVector128((UInt16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt16*)(&test._fld1)), + AdvSimd.LoadVector128((UInt16*)(&test._fld2)), + AdvSimd.LoadVector128((UInt16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] inArray3 = new UInt16[Op3ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] inArray3 = new UInt16[Op3ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] thirdOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.UInt32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.UInt32.cs new file mode 100644 index 00000000000000..5b36429dcb2793 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector128.UInt32.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector128_UInt32() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt32 testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)), + AdvSimd.LoadVector128((UInt32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + private static UInt32[] _data3 = new UInt32[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt32*)(pClsVar1)), + AdvSimd.LoadVector128((UInt32*)(pClsVar2)), + AdvSimd.LoadVector128((UInt32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt32(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector128_UInt32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)), + AdvSimd.LoadVector128((UInt32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)), + AdvSimd.LoadVector128((UInt32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector128((UInt32*)(&test._fld1)), + AdvSimd.LoadVector128((UInt32*)(&test._fld2)), + AdvSimd.LoadVector128((UInt32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] inArray3 = new UInt32[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] inArray3 = new UInt32[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.Byte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.Byte.cs new file mode 100644 index 00000000000000..5fb234e0633b51 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.Byte.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector64_Byte() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_Byte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector64_Byte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector64_Byte testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector64_Byte testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector64_Byte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector64_Byte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Byte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Byte*)(pClsVar1)), + AdvSimd.LoadVector64((Byte*)(pClsVar2)), + AdvSimd.LoadVector64((Byte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_Byte(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_Byte(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Byte*)(&test._fld1)), + AdvSimd.LoadVector64((Byte*)(&test._fld2)), + AdvSimd.LoadVector64((Byte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] thirdOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.Int16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.Int16.cs new file mode 100644 index 00000000000000..7ec761995aae54 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.Int16.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector64_Int16() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector64_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector64_Int16 testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector64_Int16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector64_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector64_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_Int16(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_Int16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.Int32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.Int32.cs new file mode 100644 index 00000000000000..5838ae6df94a3b --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.Int32.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector64_Int32() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector64_Int32 testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_Int32(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.SByte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.SByte.cs new file mode 100644 index 00000000000000..b06d62a29989d6 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.SByte.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector64_SByte() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_SByte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector64_SByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector64_SByte testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector64_SByte testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector64_SByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector64_SByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new SByte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((SByte*)(pClsVar1)), + AdvSimd.LoadVector64((SByte*)(pClsVar2)), + AdvSimd.LoadVector64((SByte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_SByte(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_SByte(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((SByte*)(&test._fld1)), + AdvSimd.LoadVector64((SByte*)(&test._fld2)), + AdvSimd.LoadVector64((SByte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] thirdOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.UInt16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.UInt16.cs new file mode 100644 index 00000000000000..73765770ba22f2 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.UInt16.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector64_UInt16() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt16 testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)), + AdvSimd.LoadVector64((UInt16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + private static UInt16[] _data3 = new UInt16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt16*)(pClsVar1)), + AdvSimd.LoadVector64((UInt16*)(pClsVar2)), + AdvSimd.LoadVector64((UInt16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt16(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)), + AdvSimd.LoadVector64((UInt16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)), + AdvSimd.LoadVector64((UInt16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt16*)(&test._fld1)), + AdvSimd.LoadVector64((UInt16*)(&test._fld2)), + AdvSimd.LoadVector64((UInt16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] inArray3 = new UInt16[Op3ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] inArray3 = new UInt16[Op3ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] thirdOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.UInt32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.UInt32.cs new file mode 100644 index 00000000000000..bd3f9648644436 --- /dev/null +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplySubtract.Vector64.UInt32.cs @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplySubtract_Vector64_UInt32() + { + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt32 testClass) + { + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)), + AdvSimd.LoadVector64((UInt32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + private static UInt32[] _data3 = new UInt32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = AdvSimd.MultiplySubtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplySubtract), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = AdvSimd.MultiplySubtract( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt32*)(pClsVar1)), + AdvSimd.LoadVector64((UInt32*)(pClsVar2)), + AdvSimd.LoadVector64((UInt32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr)); + var result = AdvSimd.MultiplySubtract(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt32(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplySubtract_Vector64_UInt32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)), + AdvSimd.LoadVector64((UInt32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = AdvSimd.MultiplySubtract(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)), + AdvSimd.LoadVector64((UInt32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = AdvSimd.MultiplySubtract( + AdvSimd.LoadVector64((UInt32*)(&test._fld1)), + AdvSimd.LoadVector64((UInt32*)(&test._fld2)), + AdvSimd.LoadVector64((UInt32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] inArray3 = new UInt32[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] inArray3 = new UInt32[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplySubtract)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/Program.AdvSimd.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/Program.AdvSimd.cs index c28a6de36a9c21..031e6136de154c 100644 --- a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/Program.AdvSimd.cs +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/Program.AdvSimd.cs @@ -210,6 +210,18 @@ static Program() ["CompareTest.Vector128.UInt32"] = CompareTest_Vector128_UInt32, ["DivideScalar.Vector64.Double"] = DivideScalar_Vector64_Double, ["DivideScalar.Vector64.Single"] = DivideScalar_Vector64_Single, + ["FusedMultiplyAdd.Vector64.Single"] = FusedMultiplyAdd_Vector64_Single, + ["FusedMultiplyAdd.Vector128.Single"] = FusedMultiplyAdd_Vector128_Single, + ["FusedMultiplyAddScalar.Vector64.Double"] = FusedMultiplyAddScalar_Vector64_Double, + ["FusedMultiplyAddScalar.Vector64.Single"] = FusedMultiplyAddScalar_Vector64_Single, + ["FusedMultiplyAddNegatedScalar.Vector64.Double"] = FusedMultiplyAddNegatedScalar_Vector64_Double, + ["FusedMultiplyAddNegatedScalar.Vector64.Single"] = FusedMultiplyAddNegatedScalar_Vector64_Single, + ["FusedMultiplySubtract.Vector64.Single"] = FusedMultiplySubtract_Vector64_Single, + ["FusedMultiplySubtract.Vector128.Single"] = FusedMultiplySubtract_Vector128_Single, + ["FusedMultiplySubtractScalar.Vector64.Double"] = FusedMultiplySubtractScalar_Vector64_Double, + ["FusedMultiplySubtractScalar.Vector64.Single"] = FusedMultiplySubtractScalar_Vector64_Single, + ["FusedMultiplySubtractNegatedScalar.Vector64.Double"] = FusedMultiplySubtractNegatedScalar_Vector64_Double, + ["FusedMultiplySubtractNegatedScalar.Vector64.Single"] = FusedMultiplySubtractNegatedScalar_Vector64_Single, ["LeadingSignCount.Vector64.Int16"] = LeadingSignCount_Vector64_Int16, ["LeadingSignCount.Vector64.Int32"] = LeadingSignCount_Vector64_Int32, ["LeadingSignCount.Vector64.SByte"] = LeadingSignCount_Vector64_SByte, @@ -292,6 +304,30 @@ static Program() ["Multiply.Vector128.UInt32"] = Multiply_Vector128_UInt32, ["MultiplyScalar.Vector64.Double"] = MultiplyScalar_Vector64_Double, ["MultiplyScalar.Vector64.Single"] = MultiplyScalar_Vector64_Single, + ["MultiplyAdd.Vector64.Byte"] = MultiplyAdd_Vector64_Byte, + ["MultiplyAdd.Vector64.Int16"] = MultiplyAdd_Vector64_Int16, + ["MultiplyAdd.Vector64.Int32"] = MultiplyAdd_Vector64_Int32, + ["MultiplyAdd.Vector64.SByte"] = MultiplyAdd_Vector64_SByte, + ["MultiplyAdd.Vector64.UInt16"] = MultiplyAdd_Vector64_UInt16, + ["MultiplyAdd.Vector64.UInt32"] = MultiplyAdd_Vector64_UInt32, + ["MultiplyAdd.Vector128.Byte"] = MultiplyAdd_Vector128_Byte, + ["MultiplyAdd.Vector128.Int16"] = MultiplyAdd_Vector128_Int16, + ["MultiplyAdd.Vector128.Int32"] = MultiplyAdd_Vector128_Int32, + ["MultiplyAdd.Vector128.SByte"] = MultiplyAdd_Vector128_SByte, + ["MultiplyAdd.Vector128.UInt16"] = MultiplyAdd_Vector128_UInt16, + ["MultiplyAdd.Vector128.UInt32"] = MultiplyAdd_Vector128_UInt32, + ["MultiplySubtract.Vector64.Byte"] = MultiplySubtract_Vector64_Byte, + ["MultiplySubtract.Vector64.Int16"] = MultiplySubtract_Vector64_Int16, + ["MultiplySubtract.Vector64.Int32"] = MultiplySubtract_Vector64_Int32, + ["MultiplySubtract.Vector64.SByte"] = MultiplySubtract_Vector64_SByte, + ["MultiplySubtract.Vector64.UInt16"] = MultiplySubtract_Vector64_UInt16, + ["MultiplySubtract.Vector64.UInt32"] = MultiplySubtract_Vector64_UInt32, + ["MultiplySubtract.Vector128.Byte"] = MultiplySubtract_Vector128_Byte, + ["MultiplySubtract.Vector128.Int16"] = MultiplySubtract_Vector128_Int16, + ["MultiplySubtract.Vector128.Int32"] = MultiplySubtract_Vector128_Int32, + ["MultiplySubtract.Vector128.SByte"] = MultiplySubtract_Vector128_SByte, + ["MultiplySubtract.Vector128.UInt16"] = MultiplySubtract_Vector128_UInt16, + ["MultiplySubtract.Vector128.UInt32"] = MultiplySubtract_Vector128_UInt32, ["Negate.Vector64.Int16"] = Negate_Vector64_Int16, ["Negate.Vector64.Int32"] = Negate_Vector64_Int32, ["Negate.Vector64.SByte"] = Negate_Vector64_SByte, diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/GenerateTests.csx b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/GenerateTests.csx index e10c9e11e650d2..60d5af03d42bd0 100644 --- a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/GenerateTests.csx +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/GenerateTests.csx @@ -73,6 +73,7 @@ private static readonly (string templateFileName, string outputTemplateName, Dic ("_BinaryOpTestTemplate.template", "VecPairBinOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = VecPairBinOpTest_ValidationLogic }), ("_UnaryOpTestTemplate.template", "SimpleVecIterOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecIterOpTest_ValidationLogic }), ("_BinaryOpTestTemplate.template", "VecBinOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic }), + ("_TernaryOpTestTemplate.template", "SimpleTernOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleOpTest_ValidationLogic }) }; private static readonly (string templateFileName, Dictionary templateData)[] AdvSimdInputs = new [] @@ -275,6 +276,18 @@ private static readonly (string templateFileName, Dictionary tem ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "DivideScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DivideScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Divide(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "DivideScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DivideScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Divide(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAdd_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAdd_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddNegatedScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAddNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddNegatedScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAddNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtract_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtract_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractNegatedScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtractNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractNegatedScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtractNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), @@ -357,6 +370,30 @@ private static readonly (string templateFileName, Dictionary tem ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), @@ -550,6 +587,8 @@ private static readonly (string templateFileName, Dictionary tem ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Divide_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Divide", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Divide(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Divide_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Divide", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Divide(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Divide_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Divide", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Divide(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAdd_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtract_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Max(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MaxScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Max(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MaxScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Max(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index 9e04d387c3c623..02315cd70d3764 100644 --- a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -1421,9 +1421,25 @@ public static float CompareTest(float left, float right) public static uint AbsoluteDifference(uint left, uint right) => (uint)Math.Abs((long)left - (long)right); - public static float AbsoluteDifference(float left, float right) => Math.Abs(left - right); + public static float AbsoluteDifference(float op1, float op2) => MathF.Abs(op1 - op2); - public static double AbsoluteDifference(double left, double right) => Math.Abs(left - right); + public static float FusedMultiplyAdd(float op1, float op2, float op3) => MathF.FusedMultiplyAdd(op2, op3, op1); + + public static float FusedMultiplyAddNegated(float op1, float op2, float op3) => MathF.FusedMultiplyAdd(-op2, op3, -op1); + + public static float FusedMultiplySubtract(float op1, float op2, float op3) => MathF.FusedMultiplyAdd(-op2, op3, op1); + + public static float FusedMultiplySubtractNegated(float op1, float op2, float op3) => MathF.FusedMultiplyAdd(op2, op3, -op1); + + public static double AbsoluteDifference(double op1, double op2) => Math.Abs(op1 - op2); + + public static double FusedMultiplyAdd(double op1, double op2, double op3) => Math.FusedMultiplyAdd(op2, op3, op1); + + public static double FusedMultiplyAddNegated(double op1, double op2, double op3) => Math.FusedMultiplyAdd(-op2, op3, -op1); + + public static double FusedMultiplySubtract(double op1, double op2, double op3) => Math.FusedMultiplyAdd(-op2, op3, op1); + + public static double FusedMultiplySubtractNegated(double op1, double op2, double op3) => Math.FusedMultiplyAdd(op2, op3, -op1); public static sbyte Add(sbyte op1, sbyte op2) => (sbyte)(op1 + op2); @@ -1433,6 +1449,10 @@ public static float CompareTest(float left, float right) public static sbyte Multiply(sbyte op1, sbyte op2) => (sbyte)(op1 * op2); + public static sbyte MultiplyAdd(sbyte op1, sbyte op2, sbyte op3) => (sbyte)(op1 + (sbyte)(op2 * op3)); + + public static sbyte MultiplySubtract(sbyte op1, sbyte op2, sbyte op3) => (sbyte)(op1 - (sbyte)(op2 * op3)); + public static sbyte Subtract(sbyte op1, sbyte op2) => (sbyte)(op1 - op2); public static byte Add(byte op1, byte op2) => (byte)(op1 + op2); @@ -1443,6 +1463,10 @@ public static float CompareTest(float left, float right) public static byte Multiply(byte op1, byte op2) => (byte)(op1 * op2); + public static byte MultiplyAdd(byte op1, byte op2, byte op3) => (byte)(op1 + (byte)(op2 * op3)); + + public static byte MultiplySubtract(byte op1, byte op2, byte op3) => (byte)(op1 - (byte)(op2 * op3)); + public static byte Subtract(byte op1, byte op2) => (byte)(op1 - op2); public static short Add(short op1, short op2) => (short)(op1 + op2); @@ -1453,6 +1477,10 @@ public static float CompareTest(float left, float right) public static short Multiply(short op1, short op2) => (short)(op1 * op2); + public static short MultiplyAdd(short op1, short op2, short op3) => (short)(op1 + (short)(op2 * op3)); + + public static short MultiplySubtract(short op1, short op2, short op3) => (short)(op1 - (short)(op2 * op3)); + public static short Subtract(short op1, short op2) => (short)(op1 - op2); public static ushort Add(ushort op1, ushort op2) => (ushort)(op1 + op2); @@ -1463,6 +1491,10 @@ public static float CompareTest(float left, float right) public static ushort Multiply(ushort op1, ushort op2) => (ushort)(op1 * op2); + public static ushort MultiplyAdd(ushort op1, ushort op2, ushort op3) => (ushort)(op1 + (ushort)(op2 * op3)); + + public static ushort MultiplySubtract(ushort op1, ushort op2, ushort op3) => (ushort)(op1 - (ushort)(op2 * op3)); + public static ushort Subtract(ushort op1, ushort op2) => (ushort)(op1 - op2); public static int Add(int op1, int op2) => (int)(op1 + op2); @@ -1473,6 +1505,10 @@ public static float CompareTest(float left, float right) public static int Multiply(int op1, int op2) => (int)(op1 * op2); + public static int MultiplyAdd(int op1, int op2, int op3) => (int)(op1 + (int)(op2 * op3)); + + public static int MultiplySubtract(int op1, int op2, int op3) => (int)(op1 - (int)(op2 * op3)); + public static int Subtract(int op1, int op2) => (int)(op1 - op2); public static uint Add(uint op1, uint op2) => (uint)(op1 + op2); @@ -1483,6 +1519,10 @@ public static float CompareTest(float left, float right) public static uint Multiply(uint op1, uint op2) => (uint)(op1 * op2); + public static uint MultiplyAdd(uint op1, uint op2, uint op3) => (uint)(op1 + (uint)(op2 * op3)); + + public static uint MultiplySubtract(uint op1, uint op2, uint op3) => (uint)(op1 - (uint)(op2 * op3)); + public static uint Subtract(uint op1, uint op2) => (uint)(op1 - op2); public static long Add(long op1, long op2) => (long)(op1 + op2); @@ -1493,6 +1533,10 @@ public static float CompareTest(float left, float right) public static long Multiply(long op1, long op2) => (long)(op1 * op2); + public static long MultiplyAdd(long op1, long op2, long op3) => (long)(op1 + (long)(op2 * op3)); + + public static long MultiplySubtract(long op1, long op2, long op3) => (long)(op1 - (long)(op2 * op3)); + public static long Subtract(long op1, long op2) => (long)(op1 - op2); public static ulong Add(ulong op1, ulong op2) => (ulong)(op1 + op2); @@ -1503,6 +1547,10 @@ public static float CompareTest(float left, float right) public static ulong Multiply(ulong op1, ulong op2) => (ulong)(op1 * op2); + public static ulong MultiplyAdd(ulong op1, ulong op2, ulong op3) => (ulong)(op1 + (ulong)(op2 * op3)); + + public static ulong MultiplySubtract(ulong op1, ulong op2, ulong op3) => (ulong)(op1 - (ulong)(op2 * op3)); + public static ulong Subtract(ulong op1, ulong op2) => (ulong)(op1 - op2); public static float Add(float op1, float op2) => (float)(op1 + op2); @@ -1513,6 +1561,10 @@ public static float CompareTest(float left, float right) public static float Multiply(float op1, float op2) => (float)(op1 * op2); + public static float MultiplyAdd(float op1, float op2, float op3) => (float)(op1 + (float)(op2 * op3)); + + public static float MultiplySubtract(float op1, float op2, float op3) => (float)(op1 - (float)(op2 * op3)); + public static float Subtract(float op1, float op2) => (float)(op1 - op2); public static double Add(double op1, double op2) => (double)(op1 + op2); @@ -1523,6 +1575,10 @@ public static float CompareTest(float left, float right) public static double Multiply(double op1, double op2) => (double)(op1 * op2); + public static double MultiplyAdd(double op1, double op2, double op3) => (double)(op1 + (double)(op2 * op3)); + + public static double MultiplySubtract(double op1, double op2, double op3) => (double)(op1 - (double)(op2 * op3)); + public static double Subtract(double op1, double op2) => (double)(op1 - op2); public static sbyte Negate(sbyte op1) => (sbyte)(-op1); diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/Helpers.tt b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/Helpers.tt index 3ea6e1a64f44ea..79ac31a3c25539 100644 --- a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/Helpers.tt +++ b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/Helpers.tt @@ -320,12 +320,23 @@ namespace JIT.HardwareIntrinsics.Arm <# } + + foreach ((string typeName, string className) in new (string, string)[] { ("float", "MathF"), ("double", "Math") }) + { #> - public static float AbsoluteDifference(float left, float right) => Math.Abs(left - right); + public static <#= typeName #> AbsoluteDifference(<#= typeName #> op1, <#= typeName #> op2) => <#= className #>.Abs(op1 - op2); + + public static <#= typeName #> FusedMultiplyAdd(<#= typeName #> op1, <#= typeName #> op2, <#= typeName #> op3) => <#= className #>.FusedMultiplyAdd(op2, op3, op1); + + public static <#= typeName #> FusedMultiplyAddNegated(<#= typeName #> op1, <#= typeName #> op2, <#= typeName #> op3) => <#= className #>.FusedMultiplyAdd(-op2, op3, -op1); + + public static <#= typeName #> FusedMultiplySubtract(<#= typeName #> op1, <#= typeName #> op2, <#= typeName #> op3) => <#= className #>.FusedMultiplyAdd(-op2, op3, op1); - public static double AbsoluteDifference(double left, double right) => Math.Abs(left - right); + public static <#= typeName #> FusedMultiplySubtractNegated(<#= typeName #> op1, <#= typeName #> op2, <#= typeName #> op3) => <#= className #>.FusedMultiplyAdd(op2, op3, -op1); <# + } + foreach (string typeName in new string[] { "sbyte", "byte", "short", "ushort", "int", "uint", "long", "ulong", "float", "double" }) { #> @@ -337,6 +348,10 @@ namespace JIT.HardwareIntrinsics.Arm public static <#= typeName #> Multiply(<#= typeName #> op1, <#= typeName #> op2) => (<#= typeName #>)(op1 * op2); + public static <#= typeName #> MultiplyAdd(<#= typeName #> op1, <#= typeName #> op2, <#= typeName #> op3) => (<#= typeName #>)(op1 + (<#= typeName #>)(op2 * op3)); + + public static <#= typeName #> MultiplySubtract(<#= typeName #> op1, <#= typeName #> op2, <#= typeName #> op3) => (<#= typeName #>)(op1 - (<#= typeName #>)(op2 * op3)); + public static <#= typeName #> Subtract(<#= typeName #> op1, <#= typeName #> op2) => (<#= typeName #>)(op1 - op2); <# diff --git a/src/coreclr/tests/src/JIT/Methodical/tailcall_v4/hijacking.il b/src/coreclr/tests/src/JIT/Methodical/tailcall_v4/hijacking.il index ecc42d7b387de7..fd79227742ddb4 100644 --- a/src/coreclr/tests/src/JIT/Methodical/tailcall_v4/hijacking.il +++ b/src/coreclr/tests/src/JIT/Methodical/tailcall_v4/hijacking.il @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/BilinearInterpol/BilinearInterpol.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/BilinearInterpol/BilinearInterpol.cs index 5bec036a0d1080..24656569b5c000 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/BilinearInterpol/BilinearInterpol.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/BilinearInterpol/BilinearInterpol.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/HWIntrinsic/X86/PacketTracer/Program.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/HWIntrinsic/X86/PacketTracer/Program.cs index b2b49acc21e584..a502320e7aab85 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/HWIntrinsic/X86/PacketTracer/Program.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/HWIntrinsic/X86/PacketTracer/Program.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Layout/SearchLoops.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Layout/SearchLoops.cs index 57575356bf8b1b..972f7249a3d97d 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Layout/SearchLoops.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Layout/SearchLoops.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AbsDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AbsDouble.cs index 1bb59a7b0af8e5..ccd75182c90a27 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AbsDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AbsDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AcosDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AcosDouble.cs index 8e5f2ca31696b1..f758f0ad5f4f96 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AcosDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AcosDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AsinDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AsinDouble.cs index e5231db99c6678..61bf0c2a6791cb 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AsinDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AsinDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Atan2Double.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Atan2Double.cs index 1ca42857f5c88a..510485a0a64ab4 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Atan2Double.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Atan2Double.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AtanDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AtanDouble.cs index c4b5ddd9eb8b4b..edc22c8ff97840 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AtanDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/AtanDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CeilingDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CeilingDouble.cs index a3037c8ebb6975..6ccafe3b4e42c9 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CeilingDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CeilingDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CosDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CosDouble.cs index 3bea5f3cc588ad..68ad388aaf49f7 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CosDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CosDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CoshDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CoshDouble.cs index 628737a3b920b4..79f11a0861db34 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CoshDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/CoshDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/ExpDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/ExpDouble.cs index 05607eafa097bc..ff46c189c25009 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/ExpDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/ExpDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/FloorDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/FloorDouble.cs index 45d9848a3942ca..5178a55113ed9a 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/FloorDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/FloorDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Log10Double.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Log10Double.cs index 9b05b154fd4e27..764f05a51626f5 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Log10Double.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/Log10Double.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/PowDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/PowDouble.cs index 5847709cc4ee78..ab9399c0903113 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/PowDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/PowDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/RoundDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/RoundDouble.cs index ac91a3d3883880..97dbe912657f45 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/RoundDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/RoundDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinDouble.cs index 2c856d79d44aae..42891660f9b28b 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinhDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinhDouble.cs index 75d1d104acbe0b..f2f7c8fa5e0485 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinhDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SinhDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SqrtDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SqrtDouble.cs index 0738dc85204a7e..1a6f8a91d6f75f 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SqrtDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/SqrtDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanDouble.cs index f5639e052b8720..b97fba15d33136 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanhDouble.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanhDouble.cs index 290e2512940a7d..12fcf6ba5383e0 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanhDouble.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Double/TanhDouble.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.cs index aff91ba844ca32..2d820d2b10ed98 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Functions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/MathTests.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/MathTests.cs index c203cc0dffe154..8a1b9d254cb29b 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/MathTests.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/MathTests.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AbsSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AbsSingle.cs index 1f2d2808822d3e..5ff67deddecd40 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AbsSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AbsSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AcosSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AcosSingle.cs index d71e95167a7d19..de0ff90d6e2857 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AcosSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AcosSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AsinSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AsinSingle.cs index e6d203f040530b..0ab9b166cbb152 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AsinSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AsinSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Atan2Single.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Atan2Single.cs index 5bee16d4efde71..db599dce0e57d9 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Atan2Single.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Atan2Single.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AtanSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AtanSingle.cs index 0a5be9edaf2b6c..bb7dc72ed566ce 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AtanSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/AtanSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CeilingSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CeilingSingle.cs index 0ab25366c7394e..e3134d656f078f 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CeilingSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CeilingSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CosSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CosSingle.cs index ab43ea91406a96..2d71e5513ade99 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CosSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CosSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CoshSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CoshSingle.cs index 0f223f553e6767..f008266611995b 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CoshSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/CoshSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/ExpSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/ExpSingle.cs index b6d9d1d512d35b..b22fca81fb0f94 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/ExpSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/ExpSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/FloorSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/FloorSingle.cs index 0b2dd0403dae60..e3f55705f818b5 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/FloorSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/FloorSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Log10Single.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Log10Single.cs index 3c6ef0c9efe91f..3b30f7a3d966c1 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Log10Single.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/Log10Single.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/PowSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/PowSingle.cs index 6d47c6f75e9d5e..8ffd9f2d2d17f3 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/PowSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/PowSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/RoundSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/RoundSingle.cs index ca04ba0106bee3..a109ac77dc660f 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/RoundSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/RoundSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinSingle.cs index 71448703ea727b..fe93755831aed3 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinhSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinhSingle.cs index 0dcbdc1499ebbb..f805bcb1288d1d 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinhSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SinhSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SqrtSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SqrtSingle.cs index 62b493ff48d4e1..de898b902070a3 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SqrtSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/SqrtSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanSingle.cs index ec2b9a0acb5245..55ea983666dc34 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanhSingle.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanhSingle.cs index 10cb7e1cea4949..5fb9f857ba50e9 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanhSingle.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Math/Functions/Single/TanhSingle.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs index 56581616443e48..916640271c81dc 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs @@ -156,12 +156,11 @@ private void DeserializeJsonNetBinaryBench() private void DeserializeJsonNetBinaryBenchInner() { Newtonsoft.Json.JsonSerializer ds = new Newtonsoft.Json.JsonSerializer(); - TestObject t; Type ty = typeof(TestObject); for (int i = 0; i < JsonNetIterations; i++) { - BsonReader br = new BsonReader(new MemoryStream(JsonNetBinary)); - t = (TestObject) ds.Deserialize(br, ty); + BsonDataReader br = new BsonDataReader(new MemoryStream(JsonNetBinary)); + TestObject t = (TestObject)ds.Deserialize(br, ty); Escape(t.Name); } } diff --git a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs index 6e2c41a6d1f53e..53c7df82ad272a 100644 --- a/src/coreclr/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs +++ b/src/coreclr/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs @@ -149,7 +149,7 @@ private void SerializeJsonNetBinaryBenchInner(object o, MemoryStream ms) for (int i = 0; i < Iterations; i++) { var s = new Newtonsoft.Json.JsonSerializer(); - var w = new BsonWriter(ms); + var w = new BsonDataWriter(ms); s.Serialize(w, o); Escape(w); w.Flush(); diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/DevDiv_524309/DevDiv_524309.il b/src/coreclr/tests/src/JIT/Regression/JitBlue/DevDiv_524309/DevDiv_524309.il index 22159e24796fdc..529fb95169fbb3 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/DevDiv_524309/DevDiv_524309.il +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/DevDiv_524309/DevDiv_524309.il @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il b/src/coreclr/tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il index 1a63094f311139..29bfb86befcb14 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il index 4d35628ee45c1b..2a8e7507a9da18 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il @@ -3,15 +3,15 @@ // See the LICENSE file in the project root for more information. -.assembly extern System.Private.CoreLib { auto } +.assembly extern System.Runtime { auto } .assembly extern System.Numerics.Vectors { auto } .assembly extern System.Runtime.CompilerServices.Unsafe { auto } .assembly extern mscorlib { auto } .assembly GitHub_11804 { - .custom instance void [System.Private.CoreLib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) - .custom instance void [System.Private.CoreLib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. .hash algorithm 0x00008004 @@ -28,7 +28,7 @@ .class private abstract auto ansi sealed beforefieldinit C - extends [System.Private.CoreLib]System.Object + extends [System.Runtime]System.Object { .method private hidebysig static int32 UnsafeGrab() cil managed noinlining diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_13822/GitHub_13822.il b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_13822/GitHub_13822.il index 70ad08dd23a39d..8a22a7a80b6121 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_13822/GitHub_13822.il +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_13822/GitHub_13822.il @@ -4,7 +4,7 @@ .assembly extern mscorlib { auto } -.assembly extern System.Private.CoreLib { auto } +.assembly extern System.Runtime { auto } .assembly GitHub_13822 { @@ -14,7 +14,7 @@ // =============== CLASS MEMBERS DECLARATION =================== .class public sequential ansi sealed beforefieldinit GCStruct - extends [System.Private.CoreLib]System.ValueType + extends [System.Runtime]System.ValueType { .field public string str .field public int32 i @@ -44,7 +44,7 @@ // before calling the constructor on each iteration of the loop. .class public auto ansi beforefieldinit Test - extends [System.Private.CoreLib]System.Object + extends [System.Runtime]System.Object { .method public hidebysig static int32 Main() cil managed { @@ -94,7 +94,7 @@ // Code size 7 (0x7) .maxstack 8 ldarg.0 - call instance void [System.Private.CoreLib]System.Object::.ctor() + call instance void [System.Runtime]System.Object::.ctor() ret } // end of method Test::.ctor diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_14455/GitHub_14455.il b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_14455/GitHub_14455.il index 5573099702b08b..473e13273b7c0e 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_14455/GitHub_14455.il +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_14455/GitHub_14455.il @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_15319/GitHub_15319_1.il b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_15319/GitHub_15319_1.il index 6cdcc143aefba6..a4a1d159c7d675 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_15319/GitHub_15319_1.il +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_15319/GitHub_15319_1.il @@ -4,13 +4,13 @@ // Test for remorphing subexpressions in casts of long shifts. -.assembly extern System.Private.CoreLib { auto } +.assembly extern System.Runtime { auto } .assembly extern mscorlib { auto } .assembly GitHub_15319_1 {} .class private auto ansi beforefieldinit Q - extends [System.Private.CoreLib]System.Object + extends [System.Runtime]System.Object { .method public hidebysig static int32 P(int64 x) cil managed noinlining { diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19438/GitHub_19438.cs b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19438/GitHub_19438.cs index b57cae95489bfb..8f738fafa48936 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19438/GitHub_19438.cs +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19438/GitHub_19438.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19910/GitHub_19910.cs b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19910/GitHub_19910.cs index bb2d536bab5619..77ff921c1d308c 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19910/GitHub_19910.cs +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19910/GitHub_19910.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_21061/GitHub_21061_StackOverflowInFuncletProlog.tt b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_21061/GitHub_21061_StackOverflowInFuncletProlog.tt index 713019fa41fa72..a13a67555867e6 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_21061/GitHub_21061_StackOverflowInFuncletProlog.tt +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_21061/GitHub_21061_StackOverflowInFuncletProlog.tt @@ -13,7 +13,7 @@ // This test is similar to GitHub_21061_StackOverflowInFunctionProlog. The main difference is that StackOverflow is thrown from a funclet prolog. // -.assembly extern System.Private.CoreLib +.assembly extern System.Runtime { } @@ -34,7 +34,7 @@ #> .class private explicit ansi sealed beforefieldinit GitHub_21061.<#= structName #> - extends [System.Private.CoreLib]System.ValueType + extends [System.Runtime]System.ValueType { .field [0] private int32 _0 .field [<#= structSizeInBytes #>] private int32 <#= structName #> @@ -59,7 +59,7 @@ leave _Return } - catch [System.Private.CoreLib]System.DivideByZeroException + catch [System.Runtime]System.DivideByZeroException { pop @@ -92,7 +92,7 @@ #> .class private auto ansi beforefieldinit GitHub_21061.Program - extends [System.Private.CoreLib]System.Object + extends [System.Runtime]System.Object { .method public hidebysig static void Keep(int32 i) cil managed noinlining { diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_21061/GitHub_21061_StackOverflowInFunctionProlog.tt b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_21061/GitHub_21061_StackOverflowInFunctionProlog.tt index 566ae9c5de3c28..0befb01a016a4d 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_21061/GitHub_21061_StackOverflowInFunctionProlog.tt +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_21061/GitHub_21061_StackOverflowInFunctionProlog.tt @@ -14,7 +14,7 @@ // This test is designed to be run manually under debugger to validate different stack probing mechanisms implemented in CodeGen::genAllocLclFrame(). // For example, this can be used to check whether a debugger can unwind and show stack trace when StackOverflow occurs in a function prolog while doing stack probing. -.assembly extern System.Private.CoreLib +.assembly extern System.Runtime { } @@ -36,7 +36,7 @@ #> .class private explicit ansi sealed beforefieldinit GitHub_21061.<#= structName #> - extends [System.Private.CoreLib]System.ValueType + extends [System.Runtime]System.ValueType { .field [0] private int32 _0 .field [<#= structSizeInBytes #>] private int32 <#= structName #> @@ -61,7 +61,7 @@ #> .class private auto ansi beforefieldinit GitHub_21061.Program - extends [System.Private.CoreLib]System.Object + extends [System.Runtime]System.Object { .method public hidebysig static void Keep(int32 i) cil managed noinlining { diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.cs b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.cs index 0131eebd888086..22bd603edeb098 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.cs +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.cs b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.cs index 3ea3d97fa70253..c0731302823bd7 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.cs +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_25027/GitHub_25027.il b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_25027/GitHub_25027.il index 351af3ca642b9b..e4544bbc0ec33b 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_25027/GitHub_25027.il +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_25027/GitHub_25027.il @@ -5,12 +5,12 @@ // GitHub 25027: Tail call stress shouldn't cause asserts // in the presence of invalid IL -.assembly extern System.Private.CoreLib { auto } +.assembly extern System.Runtime { auto } .assembly extern mscorlib { auto } .assembly GitHub_25027 {} .class private auto ansi beforefieldinit X - extends [System.Private.CoreLib]System.Object + extends [System.Runtime]System.Object { .method public hidebysig static int32 Main() cil managed { @@ -26,7 +26,7 @@ leave.s join } - catch [System.Private.CoreLib]System.InvalidProgramException + catch [System.Runtime]System.InvalidProgramException { pop ldc.i4.s 100 diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_26311/GitHub_26311.il b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_26311/GitHub_26311.il index 30f20103b049e8..3c5216072b30df 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_26311/GitHub_26311.il +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_26311/GitHub_26311.il @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27169/GitHub_27169.il b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27169/GitHub_27169.il index 4e0a68c46c9a14..f1a22b848cbfa4 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27169/GitHub_27169.il +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27169/GitHub_27169.il @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27279/GitHub_27279.cs b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27279/GitHub_27279.cs index f400f4fafa805f..a313965839894c 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27279/GitHub_27279.cs +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27279/GitHub_27279.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27678/GitHub_27678.il b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27678/GitHub_27678.il index 93ccc35de6ddb7..da5c4163afe3da 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27678/GitHub_27678.il +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_27678/GitHub_27678.il @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_3539/GitHub_3539.cs b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_3539/GitHub_3539.cs index 8fc6c689b7cf87..f59f7e0406c0ab 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_3539/GitHub_3539.cs +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_3539/GitHub_3539.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31615/Runtime_31615.cs b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31615/Runtime_31615.cs new file mode 100644 index 00000000000000..0990e43a223262 --- /dev/null +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31615/Runtime_31615.cs @@ -0,0 +1,358 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; + +// Tests for the contiguous assignments from SIMD to memory +// optimization in morph + +struct V2 +{ + public float x; + public float y; +} + +struct V3 +{ + public float x; + public float y; + public float z; +} + +struct V4 +{ + public float x; + public float y; + public float z; + public float w; +} + +class Runtime_31615 +{ + static int s_checks; + static int s_errors; + + const float g2X = 33f; + const float g2Y = 67f; + + const float g3X = 11f; + const float g3Y = 65f; + const float g3Z = 24f; + + const float g4X = 10f; + const float g4Y = 20f; + const float g4Z = 30f; + const float g4W = 40f; + + const float f0 = -101f; + const float f1 = -7f; + + [MethodImpl(MethodImplOptions.NoInlining)] + static Vector2 G2() + { + Vector2 r = new Vector2(); + r.X = g2X; + r.Y = g2Y; + return r; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static Vector3 G3() + { + Vector3 r = new Vector3(); + r.X = g3X; + r.Y = g3Y; + r.Z = g3Z; + return r; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static Vector4 G4() + { + Vector4 r = new Vector4(); + r.X = g4X; + r.Y = g4Y; + r.Z = g4Z; + r.W = g4W; + return r; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void Check(V2 v2, float x, float y, [CallerLineNumber] int line = 0) + { + s_checks++; + if ((v2.x != x) || (v2.y != y)) + { + s_errors++; + Console.WriteLine($"Check at line {line} failed; have ({v2.x},{v2.y}); expected ({x},{y})"); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void Check(V3 v3, float x, float y, float z, [CallerLineNumber] int line = 0) + { + s_checks++; + if ((v3.x != x) || (v3.y != y) || (v3.z != z)) + { + s_errors++; + Console.WriteLine($"Check at line {line} failed; have ({v3.x},{v3.y},{v3.z}); expected ({x},{y},{z})"); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void Check(V4 v4, float x, float y, float z, float w, [CallerLineNumber] int line = 0) + { + s_checks++; + if ((v4.x != x) || (v4.y != y) || (v4.z != z) || (v4.w != w)) + { + s_errors++; + Console.WriteLine($"Check at line {line} failed; have ({v4.x},{v4.y},{v4.z},{v4.w}); expected ({x},{y},{z},{w})"); + } + } + + static void TestV2A() + { + Vector2 g2 = G2(); + V2 v2a = new V2(); + v2a.x = g2.X; + v2a.y = g2.Y; + Check(v2a, g2X, g2Y); + } + + static void TestV2B() + { + Vector2 g2 = G2(); + V2 v2b = new V2(); + v2b.x = g2.Y; + v2b.y = g2.X; + Check(v2b, g2Y, g2X); + } + + static void TestV2C() + { + Vector3 g3 = G3(); + V2 v2c = new V2(); + v2c.x = g3.X; + v2c.y = g3.Y; + Check(v2c, g3X, g3Y); + } + + static void TestV2D() + { + Vector3 g3 = G3(); + V2 v2d = new V2(); + v2d.x = g3.Y; + v2d.y = g3.Z; + Check(v2d, g3Y, g3Z); + } + + static void TestV2E() + { + Vector3 g3 = G3(); + V2 v2e = new V2(); + v2e.x = g3.X; + v2e.y = g3.Z; + Check(v2e, g3X, g3Z); + } + + static void TestV3A() + { + Vector2 g2 = G2(); + V3 v3a = new V3(); + v3a.x = g2.X; + v3a.y = g2.Y; + Check(v3a, g2X, g2Y, 0f); + } + + static void TestV3B() + { + Vector2 g2 = G2(); + V3 v3b = new V3(); + v3b.y = g2.X; + v3b.z = g2.Y; + Check(v3b, 0f, g2X, g2Y); + } + + static void TestV3C() + { + Vector3 g3 = G3(); + V3 v3c = new V3(); + v3c.x = g3.Y; + v3c.y = g3.Z; + Check(v3c, g3Y, g3Z, 0f); + } + + static void TestV3D() + { + Vector3 g3 = G3(); + V3 v3d = new V3(); + v3d.x = g3.X; + v3d.y = g3.Y; + v3d.z = g3.Z; + Check(v3d, g3X, g3Y, g3Z); + } + + static void TestV3E() + { + Vector3 g3 = G3(); + V3 v3e = new V3(); + v3e.x = g3.Z; + v3e.y = g3.X; + v3e.z = g3.Y; + Check(v3e, g3Z, g3X, g3Y); + } + + static void TestV3F() + { + Vector3 g3 = G3(); + V3 v3f = new V3(); + v3f.x = g3.X; + v3f.y = g3.Y; + v3f.z = g3.Y; + Check(v3f, g3X, g3Y, g3Y); + } + + static void TestV3G() + { + Vector3 g3 = G3(); + V3 v3g = new V3(); + v3g.x = g3.Y; + v3g.y = g3.Y; + v3g.z = g3.Z; + Check(v3g, g3Y, g3Y, g3Z); + } + + static void TestV4A() + { + Vector4 g4 = G4(); + V4 v4a = new V4(); + v4a.x = g4.X; + v4a.y = g4.Y; + v4a.z = g4.Z; + v4a.w = g4.W; + Check(v4a, g4X, g4Y, g4Z, g4W); + } + + static void TestV4B() + { + Vector4 g4 = G4(); + V4 v4b = new V4(); + v4b.x = g4.Y; + v4b.y = g4.X; + v4b.z = g4.W; + v4b.w = g4.Z; + Check(v4b, g4Y, g4X, g4W, g4Z); + } + + static void TestV4C() + + { + Vector2 g2 = G2(); + V4 v4c = new V4(); + v4c.x = g2.X; + v4c.y = g2.Y; + v4c.z = g2.X; + v4c.w = g2.Y; + Check(v4c, g2X, g2Y, g2X, g2Y); + } + + static void TestV4D() + { + Vector3 g3 = G3(); + V4 v4d = new V4(); + v4d.x = g3.X; + v4d.y = g3.Y; + v4d.z = g3.Z; + v4d.w = f1; + Check(v4d, g3X, g3Y, g3Z, f1); + } + + static void TestV4E() + { + Vector2 g2 = G2(); + V4 v4e = new V4(); + v4e.x = f0; + v4e.y = g2.X; + v4e.z = g2.Y; + v4e.w = f1; + Check(v4e, f0, g2X, g2Y, f1); + } + + static void TestV4F() + { + Vector2 g2 = G2(); + V4 v4f = new V4(); + v4f.x = f0; + v4f.y = f1; + v4f.z = g2.X; + v4f.w = g2.Y; + Check(v4f, f0, f1, g2X, g2Y); + } + + static void TestV4G() + { + Vector3 g3 = G3(); + V4 v4g = new V4(); + v4g.x = f1; + v4g.y = g3.X; + v4g.z = g3.Y; + v4g.w = g3.Z; + Check(v4g, f1, g3X, g3Y, g3Z); + } + + static void TestV4H() + { + Vector4 g4 = G4(); + V4 v4h = new V4(); + v4h.y = g4.Y; + v4h.x = g4.X; + v4h.w = g4.W; + v4h.z = g4.Z; + Check(v4h, g4X, g4Y, g4Z, g4W); + } + + public static int Main() + { + Vector2 g2 = G2(); + Vector3 g3 = G3(); + Vector4 g4 = G4(); + + TestV2A(); + TestV2B(); + TestV2C(); + TestV2D(); + TestV2E(); + + TestV3A(); + TestV3B(); + TestV3C(); + TestV3D(); + TestV3E(); + TestV3F(); + TestV3G(); + + TestV4A(); + TestV4B(); + TestV4C(); + TestV4D(); + TestV4E(); + TestV4F(); + TestV4G(); + TestV4H(); + + if (s_errors > 0) + { + Console.WriteLine($"Failed; {s_errors} errors in {s_checks} tests"); + return -1; + } + else + { + Console.WriteLine($"Passed all {s_checks} tests"); + return 100; + } + } +} + diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31615/Runtime_31615.csproj b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31615/Runtime_31615.csproj new file mode 100644 index 00000000000000..1100f420532dc8 --- /dev/null +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31615/Runtime_31615.csproj @@ -0,0 +1,10 @@ + + + Exe + None + True + + + + + diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31673/Runtime_31673.cs b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31673/Runtime_31673.cs new file mode 100644 index 00000000000000..0fd75ad42d4560 --- /dev/null +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31673/Runtime_31673.cs @@ -0,0 +1,35 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; + +namespace Runtime_31673 +{ + + class Program + { + [MethodImpl(MethodImplOptions.NoInlining)] + static Vector4 Test(Vector4 v) + { + return Vector4.Clamp(v, Vector4.Zero, Vector4.One); + } + + static int Main() + { + int returnVal = 100; + + Vector4 v1 = new Vector4(1,2,3,4); + Vector4 v2 = Test(v1); + if (!v2.Equals(Vector4.One)) + { + Console.WriteLine(v2); + returnVal = -1; + } + return returnVal; + } + } +} diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31673/Runtime_31673.csproj b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31673/Runtime_31673.csproj new file mode 100644 index 00000000000000..656bedde102452 --- /dev/null +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_31673/Runtime_31673.csproj @@ -0,0 +1,13 @@ + + + Exe + 1 + + + + True + + + + + diff --git a/src/coreclr/tests/src/JIT/Stress/ABI/ABIs.cs b/src/coreclr/tests/src/JIT/Stress/ABI/ABIs.cs index 62d45cb96a0fa0..f09f87cc95b2c1 100644 --- a/src/coreclr/tests/src/JIT/Stress/ABI/ABIs.cs +++ b/src/coreclr/tests/src/JIT/Stress/ABI/ABIs.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Stress/ABI/Callee.cs b/src/coreclr/tests/src/JIT/Stress/ABI/Callee.cs index d7f753cbf2925f..9da4e2a6987e01 100644 --- a/src/coreclr/tests/src/JIT/Stress/ABI/Callee.cs +++ b/src/coreclr/tests/src/JIT/Stress/ABI/Callee.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Stress/ABI/Config.cs b/src/coreclr/tests/src/JIT/Stress/ABI/Config.cs index 18da545afbcde6..de293e5d10f1b7 100644 --- a/src/coreclr/tests/src/JIT/Stress/ABI/Config.cs +++ b/src/coreclr/tests/src/JIT/Stress/ABI/Config.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Stress/ABI/Gen.cs b/src/coreclr/tests/src/JIT/Stress/ABI/Gen.cs index 3cccb1a0f4b39b..dcc1a08d654817 100644 --- a/src/coreclr/tests/src/JIT/Stress/ABI/Gen.cs +++ b/src/coreclr/tests/src/JIT/Stress/ABI/Gen.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Stress/ABI/PInvokes.cs b/src/coreclr/tests/src/JIT/Stress/ABI/PInvokes.cs index 0198dbf82d4d24..4c1ffe9f8b958c 100644 --- a/src/coreclr/tests/src/JIT/Stress/ABI/PInvokes.cs +++ b/src/coreclr/tests/src/JIT/Stress/ABI/PInvokes.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Stress/ABI/Program.cs b/src/coreclr/tests/src/JIT/Stress/ABI/Program.cs index 17ed3420697154..a9fbe0af64b2de 100644 --- a/src/coreclr/tests/src/JIT/Stress/ABI/Program.cs +++ b/src/coreclr/tests/src/JIT/Stress/ABI/Program.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Stress/ABI/Stubs.cs b/src/coreclr/tests/src/JIT/Stress/ABI/Stubs.cs index 11dbcc6edcde1d..f8aad97f1d9f33 100644 --- a/src/coreclr/tests/src/JIT/Stress/ABI/Stubs.cs +++ b/src/coreclr/tests/src/JIT/Stress/ABI/Stubs.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Stress/ABI/TailCallEventListener.cs b/src/coreclr/tests/src/JIT/Stress/ABI/TailCallEventListener.cs index 771271330ce855..5ae8ae0e110bb8 100644 --- a/src/coreclr/tests/src/JIT/Stress/ABI/TailCallEventListener.cs +++ b/src/coreclr/tests/src/JIT/Stress/ABI/TailCallEventListener.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Stress/ABI/TailCalls.cs b/src/coreclr/tests/src/JIT/Stress/ABI/TailCalls.cs index 9d3e5145104687..5836af7c8c4194 100644 --- a/src/coreclr/tests/src/JIT/Stress/ABI/TailCalls.cs +++ b/src/coreclr/tests/src/JIT/Stress/ABI/TailCalls.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/JIT/Stress/ABI/Types.cs b/src/coreclr/tests/src/JIT/Stress/ABI/Types.cs index d38f211cc26af7..ae4c118b9e0181 100644 --- a/src/coreclr/tests/src/JIT/Stress/ABI/Types.cs +++ b/src/coreclr/tests/src/JIT/Stress/ABI/Types.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/NativeDependencyTests.cs b/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/NativeDependencyTests.cs index e7ac906e027ec8..1a27734aa1a3a8 100644 --- a/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/NativeDependencyTests.cs +++ b/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/NativeDependencyTests.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; diff --git a/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/TestBase.cs b/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/TestBase.cs index 74532c6a78ec09..9ee437608f7af0 100644 --- a/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/TestBase.cs +++ b/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/TestBase.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; diff --git a/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/MissingHostPolicyTests/InvalidHostingTest.cs b/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/MissingHostPolicyTests/InvalidHostingTest.cs index 892fe7be483180..e542dc740dd0a0 100644 --- a/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/MissingHostPolicyTests/InvalidHostingTest.cs +++ b/src/coreclr/tests/src/Loader/AssemblyDependencyResolver/MissingHostPolicyTests/InvalidHostingTest.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; diff --git a/src/coreclr/tests/src/Loader/binding/tracing/BinderEventListener.cs b/src/coreclr/tests/src/Loader/binding/tracing/BinderEventListener.cs index 6d0276845bef7a..fee88563a200b6 100644 --- a/src/coreclr/tests/src/Loader/binding/tracing/BinderEventListener.cs +++ b/src/coreclr/tests/src/Loader/binding/tracing/BinderEventListener.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.Basic.cs b/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.Basic.cs index 9627e6ddda2b44..fcc7973db86724 100644 --- a/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.Basic.cs +++ b/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.Basic.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.DefaultProbing.cs b/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.DefaultProbing.cs index 54549243be8ba1..60372b4cc13b7b 100644 --- a/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.DefaultProbing.cs +++ b/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.DefaultProbing.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.EventHandlers.cs b/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.EventHandlers.cs index 463959ee03b565..0d35e4f01de5e8 100644 --- a/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.EventHandlers.cs +++ b/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.EventHandlers.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.cs b/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.cs index b71e6ae2b6e073..d7081c8ed1b6e6 100644 --- a/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.cs +++ b/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.cs b/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.cs index 2077aff3bd04dd..0b9314ed3b99c7 100644 --- a/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.cs +++ b/src/coreclr/tests/src/Loader/binding/tracing/BinderTracingTest.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Loader/binding/tracing/Helpers.cs b/src/coreclr/tests/src/Loader/binding/tracing/Helpers.cs index d69a08e468462e..9f05bb508afeaf 100644 --- a/src/coreclr/tests/src/Loader/binding/tracing/Helpers.cs +++ b/src/coreclr/tests/src/Loader/binding/tracing/Helpers.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/coreclr/tests/src/Loader/binding/tracing/Resource.fr-FR.resx b/src/coreclr/tests/src/Loader/binding/tracing/Resource.fr-FR.resx index f59158ef11a6a3..58449d5989987f 100644 --- a/src/coreclr/tests/src/Loader/binding/tracing/Resource.fr-FR.resx +++ b/src/coreclr/tests/src/Loader/binding/tracing/Resource.fr-FR.resx @@ -1,4 +1,4 @@ - + + true + @@ -312,8 +326,8 @@ .tar.gz .msi .pkg - .deb - .rpm + .deb + .rpm .exe $(InstallerExtension) diff --git a/src/installer/corehost/cli/CMakeLists.txt b/src/installer/corehost/cli/CMakeLists.txt index 06140f51258642..4945f6722598f9 100644 --- a/src/installer/corehost/cli/CMakeLists.txt +++ b/src/installer/corehost/cli/CMakeLists.txt @@ -1,3 +1,5 @@ +add_subdirectory(hostmisc) +add_subdirectory(hostcommon) add_subdirectory(apphost) add_subdirectory(dotnet) add_subdirectory(fxr) diff --git a/src/installer/corehost/cli/apphost/CMakeLists.txt b/src/installer/corehost/cli/apphost/CMakeLists.txt index eba5c232b0c5e0..580d585c16aea2 100644 --- a/src/installer/corehost/cli/apphost/CMakeLists.txt +++ b/src/installer/corehost/cli/apphost/CMakeLists.txt @@ -18,7 +18,6 @@ endif() set(SKIP_VERSIONING 1) set(SOURCES - ../fxr/fx_ver.cpp ./bundle/file_entry.cpp ./bundle/manifest.cpp ./bundle/header.cpp @@ -30,7 +29,6 @@ set(SOURCES ) set(HEADERS - ../fxr/fx_ver.h ./bundle/file_type.h ./bundle/file_entry.h ./bundle/manifest.h diff --git a/src/installer/corehost/cli/apphost/bundle/extractor.cpp b/src/installer/corehost/cli/apphost/bundle/extractor.cpp index 282e39695f62f7..6fd9b5fb753fac 100644 --- a/src/installer/corehost/cli/apphost/bundle/extractor.cpp +++ b/src/installer/corehost/cli/apphost/bundle/extractor.cpp @@ -19,15 +19,13 @@ void extractor_t::determine_extraction_dir() { if (!pal::getenv(_X("DOTNET_BUNDLE_EXTRACT_BASE_DIR"), &m_extraction_dir)) { - if (!pal::get_temp_directory(m_extraction_dir)) + if (!pal::get_default_bundle_extraction_base_dir(m_extraction_dir)) { trace::error(_X("Failure processing application bundle.")); trace::error(_X("Failed to determine location for extracting embedded files.")); - trace::error(_X("DOTNET_BUNDLE_EXTRACT_BASE_DIR is not set, and temp-directory doesn't exist or is not readable/writable.")); + trace::error(_X("DOTNET_BUNDLE_EXTRACT_BASE_DIR is not set, and a read-write temp-directory couldn't be created.")); throw StatusCode::BundleExtractionFailure; } - - append_path(&m_extraction_dir, _X(".net")); } pal::string_t host_name = strip_executable_ext(get_filename(m_bundle_path)); diff --git a/src/installer/corehost/cli/apphost/bundle/runner.cpp b/src/installer/corehost/cli/apphost/bundle/runner.cpp index ccae5ed294996a..14862046a95a1a 100644 --- a/src/installer/corehost/cli/apphost/bundle/runner.cpp +++ b/src/installer/corehost/cli/apphost/bundle/runner.cpp @@ -50,14 +50,12 @@ StatusCode runner_t::extract() m_extraction_dir = extractor.extraction_dir(); // Determine if embedded files are already extracted, and available for reuse - if (extractor.can_reuse_extraction()) + if (!extractor.can_reuse_extraction()) { - return StatusCode::Success; - } - - manifest_t manifest = manifest_t::read(reader, header.num_embedded_files()); + manifest_t manifest = manifest_t::read(reader, header.num_embedded_files()); - extractor.extract(manifest, reader); + extractor.extract(manifest, reader); + } unmap_host(); diff --git a/src/installer/corehost/cli/comhost/CMakeLists.txt b/src/installer/corehost/cli/comhost/CMakeLists.txt index a769f7c8eb0268..edbf3e77ea283b 100644 --- a/src/installer/corehost/cli/comhost/CMakeLists.txt +++ b/src/installer/corehost/cli/comhost/CMakeLists.txt @@ -16,14 +16,10 @@ set(SOURCES ../fxr_resolver.cpp clsidmap.cpp ../redirected_error_writer.cpp - ../fxr/fx_ver.cpp - ../json_parser.cpp ) set(HEADERS comhost.h - ../fxr/fx_ver.h - ../json_parser.h ) if(CLR_CMAKE_TARGET_WIN32) @@ -48,3 +44,4 @@ endif() install(TARGETS comhost DESTINATION corehost) install_symbols(comhost corehost) +target_link_libraries(comhost libhostcommon) diff --git a/src/installer/corehost/cli/common.cmake b/src/installer/corehost/cli/common.cmake index 865666ae074d99..f64377711a65e6 100644 --- a/src/installer/corehost/cli/common.cmake +++ b/src/installer/corehost/cli/common.cmake @@ -21,29 +21,7 @@ endif() include_directories(${CMAKE_CURRENT_SOURCE_DIR}/) include_directories(${CMAKE_CURRENT_LIST_DIR}/) include_directories(${CMAKE_CURRENT_LIST_DIR}/../) -include_directories(${CMAKE_CURRENT_LIST_DIR}/../common) - -list(APPEND SOURCES - ${CMAKE_CURRENT_LIST_DIR}/../common/trace.cpp - ${CMAKE_CURRENT_LIST_DIR}/../common/utils.cpp) - -list(APPEND HEADERS - ${CMAKE_CURRENT_LIST_DIR}/../common/trace.h - ${CMAKE_CURRENT_LIST_DIR}/../common/utils.h - ${CMAKE_CURRENT_LIST_DIR}/../common/pal.h - ${CMAKE_CURRENT_LIST_DIR}/../error_codes.h) - -if(CLR_CMAKE_TARGET_WIN32) - list(APPEND SOURCES - ${CMAKE_CURRENT_LIST_DIR}/../common/pal.windows.cpp - ${CMAKE_CURRENT_LIST_DIR}/../common/longfile.windows.cpp) - list(APPEND HEADERS - ${CMAKE_CURRENT_LIST_DIR}/../common/longfile.h) -else() - list(APPEND SOURCES - ${CMAKE_CURRENT_LIST_DIR}/../common/pal.unix.cpp - ${VERSION_FILE_PATH}) -endif() +include_directories(${CMAKE_CURRENT_LIST_DIR}/hostmisc) set(RESOURCES) if(CLR_CMAKE_TARGET_WIN32 AND NOT SKIP_VERSIONING) @@ -67,12 +45,14 @@ function(set_common_libs TargetType) endif() endif() - # Specify the import library to link against for Arm32 build since the default set is minimal - if (CLR_CMAKE_TARGET_ARCH_ARM) - if (CLR_CMAKE_TARGET_WIN32) - target_link_libraries(${DOTNET_PROJECT_NAME} shell32.lib) - else() - target_link_libraries(${DOTNET_PROJECT_NAME} atomic.a) + if (NOT ${TargetType} STREQUAL "lib-static") + # Specify the import library to link against for Arm32 build since the default set is minimal + if (CLR_CMAKE_TARGET_ARCH_ARM) + if (CLR_CMAKE_TARGET_WIN32) + target_link_libraries(${DOTNET_PROJECT_NAME} shell32.lib) + else() + target_link_libraries(${DOTNET_PROJECT_NAME} atomic.a) + endif() endif() endif() endfunction() diff --git a/src/installer/corehost/cli/dotnet/CMakeLists.txt b/src/installer/corehost/cli/dotnet/CMakeLists.txt index e88f40dab6a0d4..4527986acfe3c6 100644 --- a/src/installer/corehost/cli/dotnet/CMakeLists.txt +++ b/src/installer/corehost/cli/dotnet/CMakeLists.txt @@ -5,14 +5,6 @@ project(dotnet) set(DOTNET_PROJECT_NAME "dotnet") -set(SOURCES - ../fxr/fx_ver.cpp -) - -set(HEADERS - ../fxr/fx_ver.h -) - if(CLR_CMAKE_TARGET_WIN32) list(APPEND SOURCES dotnet.manifest) diff --git a/src/installer/corehost/cli/exe.cmake b/src/installer/corehost/cli/exe.cmake index f941cd7131523a..3728e05ff2014f 100644 --- a/src/installer/corehost/cli/exe.cmake +++ b/src/installer/corehost/cli/exe.cmake @@ -16,10 +16,10 @@ include_directories(${CMAKE_CURRENT_LIST_DIR}/fxr) list(APPEND SOURCES ${CMAKE_CURRENT_LIST_DIR}/fxr_resolver.cpp ${CMAKE_CURRENT_LIST_DIR}/../corehost.cpp - ${CMAKE_CURRENT_LIST_DIR}/../common/trace.cpp - ${CMAKE_CURRENT_LIST_DIR}/../common/utils.cpp) +) add_executable(${DOTNET_PROJECT_NAME} ${SOURCES} ${RESOURCES}) +target_link_libraries(${DOTNET_PROJECT_NAME} libhostmisc) if(NOT CLR_CMAKE_TARGET_WIN32) disable_pax_mprotect(${DOTNET_PROJECT_NAME}) diff --git a/src/installer/corehost/cli/fxr/CMakeLists.txt b/src/installer/corehost/cli/fxr/CMakeLists.txt index ee83dc4fee9887..3e14083a919e31 100644 --- a/src/installer/corehost/cli/fxr/CMakeLists.txt +++ b/src/installer/corehost/cli/fxr/CMakeLists.txt @@ -11,20 +11,9 @@ include_directories(../json) # CMake does not recommend using globbing since it messes with the freshness checks set(SOURCES - ../deps_format.cpp - ../deps_entry.cpp - ../host_startup_info.cpp - ../roll_forward_option.cpp - ../runtime_config.cpp - ../fx_definition.cpp - ../fx_reference.cpp - ../version.cpp - ../version_compatibility_range.cpp - ../json_parser.cpp ./command_line.cpp ./corehost_init.cpp ./hostfxr.cpp - ./fx_ver.cpp ./fx_muxer.cpp ./fx_resolver.cpp ./fx_resolver.messages.cpp @@ -37,21 +26,12 @@ set(SOURCES set(HEADERS ../corehost_context_contract.h - ../deps_format.h - ../deps_entry.h - ../host_startup_info.h ../hostpolicy.h - ../runtime_config.h ../fx_definition.h ../fx_reference.h - ../roll_forward_option.h ../roll_fwd_on_no_candidate_fx_option.h - ../version.h - ../version_compatibility_range.h - ../json_parser.h ./command_line.h ./corehost_init.h - ./fx_ver.h ./fx_muxer.h ./fx_resolver.h ./framework_info.h @@ -65,3 +45,4 @@ include(../lib.cmake) install(TARGETS hostfxr DESTINATION corehost) install_symbols(hostfxr corehost) +target_link_libraries(hostfxr libhostcommon) diff --git a/src/installer/corehost/cli/hostcommon/CMakeLists.txt b/src/installer/corehost/cli/hostcommon/CMakeLists.txt new file mode 100644 index 00000000000000..deac26114aa016 --- /dev/null +++ b/src/installer/corehost/cli/hostcommon/CMakeLists.txt @@ -0,0 +1,44 @@ +# Licensed to the .NET Foundation under one or more agreements. +# The .NET Foundation licenses this file to you under the MIT license. +# See the LICENSE file in the project root for more information. + +project(hostcommon) + +set(DOTNET_PROJECT_NAME "hostcommon") + +# Include directories +include_directories(../fxr) +include_directories(../json) + +# CMake does not recommend using globbing since it messes with the freshness checks +set(SOURCES + ../json_parser.cpp + ../deps_format.cpp + ../deps_entry.cpp + ../host_startup_info.cpp + ../roll_forward_option.cpp + ../fx_definition.cpp + ../fx_reference.cpp + ../fxr/fx_ver.cpp + ../version.cpp + ../version_compatibility_range.cpp + ../runtime_config.cpp +) + +set(HEADERS + ../json_parser.h + ../deps_format.h + ../deps_entry.h + ../host_startup_info.h + ../roll_forward_option.h + ../fx_definition.h + ../fx_reference.h + ../fxr/fx_ver.h + ../version.h + ../version_compatibility_range.h + ../runtime_config.h +) + +set(SKIP_VERSIONING 1) +include(../lib_static.cmake) + diff --git a/src/installer/corehost/cli/hostmisc/CMakeLists.txt b/src/installer/corehost/cli/hostmisc/CMakeLists.txt new file mode 100644 index 00000000000000..8e0c24c9e3394b --- /dev/null +++ b/src/installer/corehost/cli/hostmisc/CMakeLists.txt @@ -0,0 +1,38 @@ +# Licensed to the .NET Foundation under one or more agreements. +# The .NET Foundation licenses this file to you under the MIT license. +# See the LICENSE file in the project root for more information. + +project(hostmisc) + +set(DOTNET_PROJECT_NAME "hostmisc") + +# CMake does not recommend using globbing since it messes with the freshness checks +set(SOURCES + trace.cpp + utils.cpp + ../fxr/fx_ver.cpp +) + +set(HEADERS + trace.h + utils.h + pal.h + ../../error_codes.h + ../fxr/fx_ver.h +) + +if(CLR_CMAKE_TARGET_WIN32) + list(APPEND SOURCES + pal.windows.cpp + longfile.windows.cpp) + list(APPEND HEADERS + longfile.h) +else() + list(APPEND SOURCES + pal.unix.cpp + ${VERSION_FILE_PATH}) +endif() + +set(SKIP_VERSIONING 1) +include(../lib_static.cmake) + diff --git a/src/installer/corehost/common/longfile.h b/src/installer/corehost/cli/hostmisc/longfile.h similarity index 100% rename from src/installer/corehost/common/longfile.h rename to src/installer/corehost/cli/hostmisc/longfile.h diff --git a/src/installer/corehost/common/longfile.windows.cpp b/src/installer/corehost/cli/hostmisc/longfile.windows.cpp similarity index 100% rename from src/installer/corehost/common/longfile.windows.cpp rename to src/installer/corehost/cli/hostmisc/longfile.windows.cpp diff --git a/src/installer/corehost/common/pal.h b/src/installer/corehost/cli/hostmisc/pal.h similarity index 98% rename from src/installer/corehost/common/pal.h rename to src/installer/corehost/cli/hostmisc/pal.h index 3ead70158feee2..5e71932f1772bf 100644 --- a/src/installer/corehost/common/pal.h +++ b/src/installer/corehost/cli/hostmisc/pal.h @@ -289,6 +289,10 @@ namespace pal bool get_temp_directory(string_t& tmp_dir); + // Returns a platform-specific, user-private directory within get_temp_directory() + // that can be used for extracting out components of a single-file app. + bool get_default_bundle_extraction_base_dir(string_t& extraction_dir); + int xtoi(const char_t* input); bool get_loaded_library(const char_t *library_name, const char *symbol_name, /*out*/ dll_t *dll, /*out*/ string_t *path); diff --git a/src/installer/corehost/common/pal.unix.cpp b/src/installer/corehost/cli/hostmisc/pal.unix.cpp similarity index 93% rename from src/installer/corehost/common/pal.unix.cpp rename to src/installer/corehost/cli/hostmisc/pal.unix.cpp index 0fc00d268933fc..54488e6bfddaf3 100644 --- a/src/installer/corehost/common/pal.unix.cpp +++ b/src/installer/corehost/cli/hostmisc/pal.unix.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #if defined(__APPLE__) #include @@ -62,14 +63,14 @@ void* pal::map_file_readonly(const pal::string_t& path, size_t& length) int fd = open(path.c_str(), O_RDONLY, (S_IRUSR | S_IRGRP | S_IROTH)); if (fd == -1) { - trace::warning(_X("Failed to map file. open(%s) failed with error %d"), path.c_str(), errno); + trace::error(_X("Failed to map file. open(%s) failed with error %d"), path.c_str(), errno); return nullptr; } struct stat buf; if (fstat(fd, &buf) != 0) { - trace::warning(_X("Failed to map file. fstat(%s) failed with error %d"), path.c_str(), errno); + trace::error(_X("Failed to map file. fstat(%s) failed with error %d"), path.c_str(), errno); close(fd); return nullptr; } @@ -79,7 +80,7 @@ void* pal::map_file_readonly(const pal::string_t& path, size_t& length) if(address == nullptr) { - trace::warning(_X("Failed to map file. mmap(%s) failed with error %d"), path.c_str(), errno); + trace::error(_X("Failed to map file. mmap(%s) failed with error %d"), path.c_str(), errno); close(fd); return nullptr; } @@ -306,7 +307,7 @@ bool is_read_write_able_directory(pal::string_t& dir) bool pal::get_temp_directory(pal::string_t& tmp_dir) { // First, check for the POSIX standard environment variable - if (pal::getenv(_X("TMPDIR"), &tmp_dir)) + if (getenv(_X("TMPDIR"), &tmp_dir)) { return is_read_write_able_directory(tmp_dir); } @@ -331,6 +332,55 @@ bool pal::get_temp_directory(pal::string_t& tmp_dir) return false; } +bool pal::get_default_bundle_extraction_base_dir(pal::string_t& extraction_dir) +{ + if (!get_temp_directory(extraction_dir)) + { + return false; + } + + append_path(&extraction_dir, _X(".net")); + pal::string_t dotnetdir(extraction_dir); + + // getuid() is the real user ID, and the call has no defined errors. + struct passwd* passwd = getpwuid(getuid()); + if (passwd == nullptr || passwd->pw_name == nullptr) + { + return false; + } + + append_path(&extraction_dir, passwd->pw_name); + + if (is_read_write_able_directory(extraction_dir)) + { + return true; + } + + // Create $TMPDIR/.net accessible to everyone + if (::mkdir(dotnetdir.c_str(), S_IRWXU | S_IRWXG | S_IRWXO) == 0) + { + // In the above mkdir() system call, some permissions are strangely dropped! + // Linux drops S_IWO and Mac drops S_IWG | S_IWO. + // So these are again explicitly set by calling chmod() + if (chmod(dotnetdir.c_str(), S_IRWXU | S_IRWXG | S_IRWXO) != 0) + { + return false; + } + } + else if (errno != EEXIST) + { + return false; + } + + // Create $TMPDIR/.net/username accessible only to the user + if (::mkdir(extraction_dir.c_str(), S_IRWXU | S_ISVTX) != 0 && errno != EEXIST) + { + return false; + } + + return is_read_write_able_directory(extraction_dir); +} + bool pal::get_global_dotnet_dirs(std::vector* recv) { // No support for global directories in Unix. diff --git a/src/installer/corehost/common/pal.windows.cpp b/src/installer/corehost/cli/hostmisc/pal.windows.cpp similarity index 94% rename from src/installer/corehost/common/pal.windows.cpp rename to src/installer/corehost/cli/hostmisc/pal.windows.cpp index c32a8446bee77b..1e0ff1d985b491 100644 --- a/src/installer/corehost/common/pal.windows.cpp +++ b/src/installer/corehost/cli/hostmisc/pal.windows.cpp @@ -82,14 +82,14 @@ void* pal::map_file_readonly(const pal::string_t& path, size_t &length) if (file == INVALID_HANDLE_VALUE) { - trace::warning(_X("Failed to map file. CreateFileW(%s) failed with error %d"), path.c_str(), GetLastError()); + trace::error(_X("Failed to map file. CreateFileW(%s) failed with error %d"), path.c_str(), GetLastError()); return nullptr; } LARGE_INTEGER fileSize; if (GetFileSizeEx(file, &fileSize) == 0) { - trace::warning(_X("Failed to map file. GetFileSizeEx(%s) failed with error %d"), path.c_str(), GetLastError()); + trace::error(_X("Failed to map file. GetFileSizeEx(%s) failed with error %d"), path.c_str(), GetLastError()); CloseHandle(file); return nullptr; } @@ -99,20 +99,24 @@ void* pal::map_file_readonly(const pal::string_t& path, size_t &length) if (map == NULL) { - trace::warning(_X("Failed to map file. CreateFileMappingW(%s) failed with error %d"), path.c_str(), GetLastError()); + trace::error(_X("Failed to map file. CreateFileMappingW(%s) failed with error %d"), path.c_str(), GetLastError()); CloseHandle(file); return nullptr; } void *address = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0); - if (map == NULL) + if (address == NULL) { - trace::warning(_X("Failed to map file. MapViewOfFile(%s) failed with error %d"), path.c_str(), GetLastError()); - CloseHandle(file); - return nullptr; + trace::error(_X("Failed to map file. MapViewOfFile(%s) failed with error %d"), path.c_str(), GetLastError()); } + // The file-handle (file) and mapping object handle (map) can be safely closed + // once the file is mapped. The OS keeps the file open if there is an open mapping into the file. + + CloseHandle(map); + CloseHandle(file); + return address; } @@ -560,9 +564,35 @@ bool pal::get_temp_directory(pal::string_t& tmp_dir) assert(len < max_len); tmp_dir.assign(temp_path); - return pal::realpath(&tmp_dir); + return realpath(&tmp_dir); } +bool pal::get_default_bundle_extraction_base_dir(pal::string_t& extraction_dir) +{ + if (!get_temp_directory(extraction_dir)) + { + return false; + } + + append_path(&extraction_dir, _X(".net")); + // Windows Temp-Path is already user-private. + + if (realpath(&extraction_dir)) + { + return true; + } + + // Create the %TEMP%\.net directory + if (CreateDirectoryW(extraction_dir.c_str(), NULL) == 0 && + GetLastError() != ERROR_ALREADY_EXISTS) + { + return false; + } + + return realpath(&extraction_dir); +} + + static bool wchar_convert_helper(DWORD code_page, const char* cstr, int len, pal::string_t* out) { out->clear(); @@ -779,4 +809,4 @@ void pal::mutex_t::lock() void pal::mutex_t::unlock() { ::LeaveCriticalSection(&_impl); -} \ No newline at end of file +} diff --git a/src/installer/corehost/common/trace.cpp b/src/installer/corehost/cli/hostmisc/trace.cpp similarity index 100% rename from src/installer/corehost/common/trace.cpp rename to src/installer/corehost/cli/hostmisc/trace.cpp diff --git a/src/installer/corehost/common/trace.h b/src/installer/corehost/cli/hostmisc/trace.h similarity index 100% rename from src/installer/corehost/common/trace.h rename to src/installer/corehost/cli/hostmisc/trace.h diff --git a/src/installer/corehost/common/utils.cpp b/src/installer/corehost/cli/hostmisc/utils.cpp similarity index 100% rename from src/installer/corehost/common/utils.cpp rename to src/installer/corehost/cli/hostmisc/utils.cpp diff --git a/src/installer/corehost/common/utils.h b/src/installer/corehost/cli/hostmisc/utils.h similarity index 100% rename from src/installer/corehost/common/utils.h rename to src/installer/corehost/cli/hostmisc/utils.h diff --git a/src/installer/corehost/cli/hostpolicy/CMakeLists.txt b/src/installer/corehost/cli/hostpolicy/CMakeLists.txt index da157c93f8a1f9..b19c743bf76efc 100644 --- a/src/installer/corehost/cli/hostpolicy/CMakeLists.txt +++ b/src/installer/corehost/cli/hostpolicy/CMakeLists.txt @@ -16,44 +16,24 @@ set(SOURCES ./breadcrumbs.cpp ./coreclr.cpp ./deps_resolver.cpp - ./hostpolicy.cpp ./hostpolicy_context.cpp + ./hostpolicy.cpp ./hostpolicy_init.cpp - ../roll_forward_option.cpp - ../runtime_config.cpp - ../fxr/fx_ver.cpp - ../host_startup_info.cpp - ../deps_format.cpp - ../deps_entry.cpp - ../fx_definition.cpp - ../fx_reference.cpp - ../version.cpp - ../version_compatibility_range.cpp - ../json_parser.cpp ) set(HEADERS ./args.h ./breadcrumbs.h ./coreclr.h + ../corehost_context_contract.h ./deps_resolver.h ./hostpolicy_context.h - ./hostpolicy_init.h - ../corehost_context_contract.h ../hostpolicy.h - ../runtime_config.h - ../fxr/fx_ver.h - ../host_startup_info.h - ../deps_format.h - ../deps_entry.h - ../fx_definition.h - ../fx_reference.h - ../version.h - ../version_compatibility_range.h - ../json_parser.h + ./hostpolicy_init.h ) include(../lib.cmake) install(TARGETS hostpolicy DESTINATION corehost) install_symbols(hostpolicy corehost) +target_link_libraries(hostpolicy libhostcommon) diff --git a/src/installer/corehost/cli/ijwhost/CMakeLists.txt b/src/installer/corehost/cli/ijwhost/CMakeLists.txt index a56d2e44208ebe..c89996f6e1ce4c 100644 --- a/src/installer/corehost/cli/ijwhost/CMakeLists.txt +++ b/src/installer/corehost/cli/ijwhost/CMakeLists.txt @@ -15,9 +15,6 @@ set(SOURCES ijwthunk.cpp ijwhost.cpp ../fxr_resolver.cpp - ../../common/trace.cpp - ../../common/utils.cpp - ../fxr/fx_ver.cpp pedecoder.cpp bootstrap_thunk_chunk.cpp ${ARCH_SPECIFIC_FOLDER_NAME}/bootstrap_thunk.cpp diff --git a/src/installer/corehost/cli/lib.cmake b/src/installer/corehost/cli/lib.cmake index 18856b2cd11b79..d2305fdfe15a82 100644 --- a/src/installer/corehost/cli/lib.cmake +++ b/src/installer/corehost/cli/lib.cmake @@ -11,6 +11,7 @@ add_definitions(-D_NO_PPLXIMP) add_definitions(-DEXPORT_SHARED_API=1) add_library(${DOTNET_PROJECT_NAME} SHARED ${SOURCES} ${RESOURCES}) +target_link_libraries(${DOTNET_PROJECT_NAME} libhostmisc) set_target_properties(${DOTNET_PROJECT_NAME} PROPERTIES MACOSX_RPATH TRUE) diff --git a/src/installer/corehost/cli/lib_static.cmake b/src/installer/corehost/cli/lib_static.cmake index 6c4b5036cf9a6b..8135e9c19e0e09 100644 --- a/src/installer/corehost/cli/lib_static.cmake +++ b/src/installer/corehost/cli/lib_static.cmake @@ -15,4 +15,4 @@ add_library(lib${DOTNET_PROJECT_NAME} STATIC ${SOURCES} ${RESOURCES}) set_target_properties(lib${DOTNET_PROJECT_NAME} PROPERTIES MACOSX_RPATH TRUE) set_target_properties(lib${DOTNET_PROJECT_NAME} PROPERTIES PREFIX "") -set_common_libs("lib") +set_common_libs("lib-static") diff --git a/src/installer/corehost/cli/nethost/CMakeLists.txt b/src/installer/corehost/cli/nethost/CMakeLists.txt index aad5d0d04e6523..af3edaacd2b1b7 100644 --- a/src/installer/corehost/cli/nethost/CMakeLists.txt +++ b/src/installer/corehost/cli/nethost/CMakeLists.txt @@ -13,7 +13,6 @@ include_directories(../fxr) set(SOURCES nethost.cpp ../fxr_resolver.cpp - ../fxr/fx_ver.cpp ) if(CLR_CMAKE_TARGET_WIN32) diff --git a/src/installer/corehost/cli/test_fx_ver/CMakeLists.txt b/src/installer/corehost/cli/test_fx_ver/CMakeLists.txt index 72a4d576ba262f..87778202f25eb2 100644 --- a/src/installer/corehost/cli/test_fx_ver/CMakeLists.txt +++ b/src/installer/corehost/cli/test_fx_ver/CMakeLists.txt @@ -6,22 +6,11 @@ project(test_fx_ver) set(EXE_NAME "test_fx_ver") include_directories(../fxr) -include_directories(../../common) +include_directories(../hostmisc) set(SOURCES test_fx_ver.cpp - ../fxr/fx_ver.cpp - ../../common/trace.cpp - ../../common/utils.cpp) - -if(CLR_CMAKE_TARGET_WIN32) - list(APPEND SOURCES - ../../common/pal.windows.cpp - ../../common/longfile.windows.cpp) -else() - list(APPEND SOURCES - ../../common/pal.unix.cpp) -endif() +) if(CLR_CMAKE_HOST_WIN32) add_compile_options($<$:/MT>) @@ -32,6 +21,7 @@ else() endif() add_executable(${EXE_NAME} ${SOURCES}) +target_link_libraries(${EXE_NAME} libhostmisc libhostcommon) install(TARGETS ${EXE_NAME} DESTINATION corehost_test) diff --git a/src/installer/corehost/cli/winrthost/CMakeLists.txt b/src/installer/corehost/cli/winrthost/CMakeLists.txt index e364f3a06ac101..6b2816405254a0 100644 --- a/src/installer/corehost/cli/winrthost/CMakeLists.txt +++ b/src/installer/corehost/cli/winrthost/CMakeLists.txt @@ -14,9 +14,6 @@ set (SOURCES winrthost.cpp ../redirected_error_writer.cpp ../fxr_resolver.cpp - ../../common/trace.cpp - ../../common/utils.cpp - ../fxr/fx_ver.cpp ) if(CLR_CMAKE_TARGET_WIN32) @@ -33,7 +30,7 @@ if (CLR_CMAKE_TARGET_WIN32 AND (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_AR target_link_libraries(winrthost Advapi32.lib Ole32.lib OleAut32.lib) endif() -target_link_libraries(winrthost RuntimeObject.lib) +target_link_libraries(winrthost RuntimeObject.lib libhostmisc libhostcommon) install(TARGETS winrthost DESTINATION corehost) install_symbols(winrthost corehost) diff --git a/src/installer/managed/Microsoft.NET.HostModel/AppHost/RetryUtil.cs b/src/installer/managed/Microsoft.NET.HostModel/AppHost/RetryUtil.cs index ef64d1e5126843..cbd4ccc2c9750b 100644 --- a/src/installer/managed/Microsoft.NET.HostModel/AppHost/RetryUtil.cs +++ b/src/installer/managed/Microsoft.NET.HostModel/AppHost/RetryUtil.cs @@ -41,16 +41,43 @@ public static void RetryOnIOError(Action func) public static void RetryOnWin32Error(Action func) { - bool IsWin32FileLockError(int hresult) + bool IsKnownIrrecoverableError(int hresult) { // Error codes are defined in winerror.h - const int ErrorLockViolation = 33; - const int ErrorDriveLocked = 108; - // The error code is stored in the lowest 16 bits of the HResult - int errorCode = hresult & 0xffff; - return errorCode == ErrorLockViolation || errorCode == ErrorDriveLocked; + switch (hresult & 0xffff) + { + case 0x00000001: // ERROR_INVALID_FUNCTION + case 0x00000002: // ERROR_FILE_NOT_FOUND + case 0x00000003: // ERROR_PATH_NOT_FOUND + case 0x00000006: // ERROR_INVALID_HANDLE + case 0x00000008: // ERROR_NOT_ENOUGH_MEMORY + case 0x0000000B: // ERROR_BAD_FORMAT + case 0x0000000E: // ERROR_OUTOFMEMORY + case 0x0000000F: // ERROR_INVALID_DRIVE + case 0x00000012: // ERROR_NO_MORE_FILES + case 0x00000035: // ERROR_BAD_NETPATH + case 0x00000057: // ERROR_INVALID_PARAMETER + case 0x00000071: // ERROR_NO_MORE_SEARCH_HANDLES + case 0x00000072: // ERROR_INVALID_TARGET_HANDLE + case 0x00000078: // ERROR_CALL_NOT_IMPLEMENTED + case 0x0000007B: // ERROR_INVALID_NAME + case 0x0000007C: // ERROR_INVALID_LEVEL + case 0x0000007D: // ERROR_NO_VOLUME_LABEL + case 0x0000009A: // ERROR_LABEL_TOO_LONG + case 0x000000A0: // ERROR_BAD_ARGUMENTS + case 0x000000A1: // ERROR_BAD_PATHNAME + case 0x000000CE: // ERROR_FILENAME_EXCED_RANGE + case 0x000000DF: // ERROR_FILE_TOO_LARGE + case 0x000003ED: // ERROR_UNRECOGNIZED_VOLUME + case 0x000003EE: // ERROR_FILE_INVALID + case 0x00000651: // ERROR_DEVICE_REMOVED + return true; + + default: + return false; + } } for (int i = 1; i <= NumberOfRetries; i++) @@ -61,7 +88,7 @@ bool IsWin32FileLockError(int hresult) break; } catch (HResultException hrex) - when (i < NumberOfRetries && IsWin32FileLockError(hrex.Win32HResult)) + when (i < NumberOfRetries && !IsKnownIrrecoverableError(hrex.Win32HResult)) { Thread.Sleep(NumMilliSecondsToWait); } diff --git a/src/installer/pkg/Directory.Build.props b/src/installer/pkg/Directory.Build.props index f0208581754add..6e77e958d73db7 100644 --- a/src/installer/pkg/Directory.Build.props +++ b/src/installer/pkg/Directory.Build.props @@ -42,9 +42,11 @@ $(PackageTargetRid.StartsWith('debian')) or $(PackageTargetRid.StartsWith('linuxmint'))">true true + true true true + true + + + DepsRid=$(OutputRid);$(SharedProperties) + + + + + + + + + DepsRid=%(Rids.Identity);$(SharedProperties) + + + + + + + + + + $([System.String]::Copy('$(DotnetRuntimeDependenciesPackageInstallerFile)').Replace('$(OutputRid)', '$(DepsRid)')) $(RuntimeDependenciesRpmPkgName) $(RuntimeDepsRpmPackageVersion) - $(DotnetRuntimeDependenciesPackageInstallerFile) - dotnet-runtime-deps-rpm_config_$(OutputRid).json + dotnet-runtime-deps-rpm_config_$(DepsRid).json $(rpmPackagingConfigPath)$(ConfigJsonName) $(PackagesIntermediateDir)$(RpmPackageName)/$(RpmPackageVersion) @@ -355,7 +390,7 @@ - $(RuntimeDependenciesRpmPkgName) + $(RpmPackageName) $(RuntimeDepsRpmPackageVersion) diff --git a/src/installer/settings.cmake b/src/installer/settings.cmake index e17e44ab4e28d8..e8e4e84d0e2db8 100644 --- a/src/installer/settings.cmake +++ b/src/installer/settings.cmake @@ -174,6 +174,18 @@ else() add_compile_options(-Wno-unused-local-typedef) add_compile_options(-Wno-unused-macros) add_compile_options(-Wno-unused-parameter) + + if(CLR_CMAKE_TARGET_ARCH_ARM) + if (NOT DEFINED CLR_ARM_FPU_TYPE) + set(CLR_ARM_FPU_TYPE vfpv3) + endif(NOT DEFINED CLR_ARM_FPU_TYPE) + + if (NOT DEFINED CLR_ARM_FPU_CAPABILITY) + set(CLR_ARM_FPU_CAPABILITY 0x7) + endif(NOT DEFINED CLR_ARM_FPU_CAPABILITY) + + add_definitions(-DCLR_ARM_FPU_CAPABILITY=${CLR_ARM_FPU_CAPABILITY}) + endif() endif() # Older CMake doesn't support CMAKE_CXX_STANDARD and GCC/Clang need a switch to enable C++ 11 diff --git a/src/installer/test/Assets/TestProjects/AppWithWait/AppWithWait.csproj b/src/installer/test/Assets/TestProjects/AppWithWait/AppWithWait.csproj new file mode 100644 index 00000000000000..59e3b57746c12c --- /dev/null +++ b/src/installer/test/Assets/TestProjects/AppWithWait/AppWithWait.csproj @@ -0,0 +1,10 @@ + + + + $(NETCoreAppFramework) + Exe + $(TestTargetRid) + $(MNAVersion) + + + diff --git a/src/installer/test/Assets/TestProjects/AppWithWait/Program.cs b/src/installer/test/Assets/TestProjects/AppWithWait/Program.cs new file mode 100644 index 00000000000000..7a39929f707f00 --- /dev/null +++ b/src/installer/test/Assets/TestProjects/AppWithWait/Program.cs @@ -0,0 +1,35 @@ +using System; +using System.IO; +using System.Threading; + +namespace AppWithSubDirs +{ + public static class Program + { + public static void Main(string[] args) + { + Console.Write("Hello "); + + // If the caller wants the app to start and wait, + // it provides the name of a lock-file to write. + // In this case, this test app creates the lock file + // and waits until the file is deleted. + if (args.Length > 0) + { + string writeFile = args[0]; + + var fs = File.Create(writeFile); + fs.Close(); + + Thread.Sleep(200); + + while (File.Exists(writeFile)) + { + Thread.Sleep(100); + } + } + + Console.WriteLine("World!"); + } + } +} diff --git a/src/installer/test/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleRename.cs b/src/installer/test/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleRename.cs new file mode 100644 index 00000000000000..07efcceff6e74c --- /dev/null +++ b/src/installer/test/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleRename.cs @@ -0,0 +1,91 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.IO; +using Xunit; +using Microsoft.DotNet.Cli.Build.Framework; +using Microsoft.DotNet.CoreSetup.Test; +using BundleTests.Helpers; +using System.Threading; + +namespace AppHost.Bundle.Tests +{ + public class BundleRename : IClassFixture + { + private SharedTestState sharedTestState; + + public BundleRename(SharedTestState fixture) + { + sharedTestState = fixture; + } + + [Theory] + [InlineData(true)] // Test renaming the single-exe during the initial run, when contents are extracted + [InlineData(false)] // Test renaming the single-exe during subsequent runs, when contents are reused + private void Bundle_can_be_renamed_while_running(bool renameFirstRun) + { + var fixture = sharedTestState.TestFixture.Copy(); + string singleFile = BundleHelper.GetPublishedSingleFilePath(fixture); + string renameFile = Path.Combine(BundleHelper.GetPublishPath(fixture), Path.GetRandomFileName()); + string writeFile = Path.Combine(BundleHelper.GetPublishPath(fixture), "lock"); + + if (!renameFirstRun) + { + Command.Create(singleFile) + .CaptureStdErr() + .CaptureStdOut() + .Execute() + .Should() + .Pass() + .And + .HaveStdOutContaining("Hello World!"); + } + + var singleExe = Command.Create(singleFile, writeFile) + .CaptureStdErr() + .CaptureStdOut() + .Start(); + + // Once the App starts running, it creates the writeFile, and waits until the file is deleted. + while (!File.Exists(writeFile)) + { + Thread.Sleep(100); + } + + File.Move(singleFile, renameFile); + File.Delete(writeFile); + + var result = singleExe.WaitForExit(fExpectedToFail: false); + + result + .Should() + .Pass() + .And + .HaveStdOutContaining("Hello World!"); + } + + public class SharedTestState : IDisposable + { + public TestProjectFixture TestFixture { get; set; } + public RepoDirectoriesProvider RepoDirectories { get; set; } + + public SharedTestState() + { + RepoDirectories = new RepoDirectoriesProvider(); + TestFixture = new TestProjectFixture("AppWithWait", RepoDirectories); + TestFixture + .EnsureRestoredForRid(TestFixture.CurrentRid, RepoDirectories.CorehostPackages) + .PublishProject(runtime: TestFixture.CurrentRid, + singleFile: true, + outputDirectory: BundleHelper.GetPublishPath(TestFixture)); + } + + public void Dispose() + { + TestFixture.Dispose(); + } + } + } +} diff --git a/src/installer/test/Microsoft.NET.HostModel.Tests/Helpers/BundleHelper.cs b/src/installer/test/Microsoft.NET.HostModel.Tests/Helpers/BundleHelper.cs index 5d245740edb6ac..81b8a7ef2ed990 100644 --- a/src/installer/test/Microsoft.NET.HostModel.Tests/Helpers/BundleHelper.cs +++ b/src/installer/test/Microsoft.NET.HostModel.Tests/Helpers/BundleHelper.cs @@ -22,6 +22,11 @@ public static string GetAppPath(TestProjectFixture fixture) return Path.Combine(GetPublishPath(fixture), GetAppName(fixture)); } + public static string GetPublishedSingleFilePath(TestProjectFixture fixture) + { + return GetHostPath(fixture); + } + public static string GetHostName(TestProjectFixture fixture) { return Path.GetFileName(fixture.TestProject.AppExe); diff --git a/src/installer/test/TestUtils/ArgumentEscaper.cs b/src/installer/test/TestUtils/ArgumentEscaper.cs index 22727728e1b6ee..574fc450aec799 100644 --- a/src/installer/test/TestUtils/ArgumentEscaper.cs +++ b/src/installer/test/TestUtils/ArgumentEscaper.cs @@ -15,7 +15,7 @@ public static class ArgumentEscaper /// so that the next process will receive the same string[] args /// /// See here for more info: - /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx + /// https://docs.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way /// /// /// @@ -29,7 +29,7 @@ public static string EscapeAndConcatenateArgArrayForProcessStart(IEnumerable /// /// @@ -43,7 +43,7 @@ public static string EscapeAndConcatenateArgArrayForCmdProcessStart(IEnumerable< /// so that the next process will receive the same string[] args /// /// See here for more info: - /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx + /// https://docs.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way /// /// /// @@ -65,7 +65,7 @@ private static IEnumerable EscapeArgArray(IEnumerable args) /// be to do this only for cmd metacharacters. /// /// See here for more info: - /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx + /// https://docs.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way /// /// /// @@ -136,7 +136,7 @@ private static string EscapeArg(string arg) /// be to do this only for cmd metacharacters. /// /// See here for more info: - /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx + /// https://docs.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way /// /// /// @@ -180,7 +180,7 @@ private static string EscapeArgForCmd(string argument) /// be to do this only for cmd metacharacters. /// /// See here for more info: - /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx + /// https://docs.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way /// /// /// diff --git a/src/installer/test/TestUtils/TestProjectFixture.cs b/src/installer/test/TestUtils/TestProjectFixture.cs index a762d2930d431c..13f5b8b019983c 100644 --- a/src/installer/test/TestUtils/TestProjectFixture.cs +++ b/src/installer/test/TestUtils/TestProjectFixture.cs @@ -6,7 +6,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Text; namespace Microsoft.DotNet.CoreSetup.Test { @@ -252,7 +251,8 @@ public TestProjectFixture PublishProject( string runtime = null, string framework = null, string selfContained = null, - string outputDirectory = null) + string outputDirectory = null, + bool singleFile = false) { dotnet = dotnet ?? SdkDotnet; outputDirectory = outputDirectory ?? TestProject.OutputDirectory; @@ -291,6 +291,11 @@ public TestProjectFixture PublishProject( publishArgs.Add(outputDirectory); } + if (singleFile) + { + publishArgs.Add("/p:PublishSingleFile=true"); + } + publishArgs.Add($"/p:TestTargetRid={RepoDirProvider.TargetRID}"); publishArgs.Add($"/p:MNAVersion={RepoDirProvider.MicrosoftNETCoreAppVersion}"); diff --git a/src/libraries/Common/src/Internal/Cryptography/BasicSymmetricCipher.cs b/src/libraries/Common/src/Internal/Cryptography/BasicSymmetricCipher.cs index f4cd17431d5b55..59bf4af55abf3e 100644 --- a/src/libraries/Common/src/Internal/Cryptography/BasicSymmetricCipher.cs +++ b/src/libraries/Common/src/Internal/Cryptography/BasicSymmetricCipher.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Security.Cryptography; @@ -22,7 +23,7 @@ namespace Internal.Cryptography // internal abstract class BasicSymmetricCipher : IDisposable { - protected BasicSymmetricCipher(byte[] iv, int blockSizeInBytes) + protected BasicSymmetricCipher(byte[]? iv, int blockSizeInBytes) { IV = iv; BlockSizeInBytes = blockSizeInBytes; @@ -52,6 +53,6 @@ protected virtual void Dispose(bool disposing) } } - protected byte[] IV { get; private set; } + protected byte[]? IV { get; private set; } } } diff --git a/src/libraries/Common/src/Internal/Cryptography/BasicSymmetricCipherBCrypt.cs b/src/libraries/Common/src/Internal/Cryptography/BasicSymmetricCipherBCrypt.cs index 47fd299ca62ed1..e8ee331c6a7e38 100644 --- a/src/libraries/Common/src/Internal/Cryptography/BasicSymmetricCipherBCrypt.cs +++ b/src/libraries/Common/src/Internal/Cryptography/BasicSymmetricCipherBCrypt.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Security.Cryptography; @@ -13,10 +14,10 @@ internal sealed class BasicSymmetricCipherBCrypt : BasicSymmetricCipher { private readonly bool _encrypting; private SafeKeyHandle _hKey; - private byte[] _currentIv; // CNG mutates this with the updated IV for the next stage on each Encrypt/Decrypt call. - // The base IV holds a copy of the original IV for Reset(), until it is cleared by Dispose(). + private byte[]? _currentIv; // CNG mutates this with the updated IV for the next stage on each Encrypt/Decrypt call. + // The base IV holds a copy of the original IV for Reset(), until it is cleared by Dispose(). - public BasicSymmetricCipherBCrypt(SafeAlgorithmHandle algorithm, CipherMode cipherMode, int blockSizeInBytes, byte[] key, bool ownsParentHandle, byte[] iv, bool encrypting) + public BasicSymmetricCipherBCrypt(SafeAlgorithmHandle algorithm, CipherMode cipherMode, int blockSizeInBytes, byte[] key, bool ownsParentHandle, byte[]? iv, bool encrypting) : base(cipherMode.GetCipherIv(iv), blockSizeInBytes) { Debug.Assert(algorithm != null); @@ -43,13 +44,13 @@ protected override void Dispose(bool disposing) if (disposing) { SafeKeyHandle hKey = _hKey; - _hKey = null; + _hKey = null!; if (hKey != null) { hKey.Dispose(); } - byte[] currentIv = _currentIv; + byte[]? currentIv = _currentIv; _currentIv = null; if (currentIv != null) { @@ -115,7 +116,7 @@ private void Reset() { if (IV != null) { - Buffer.BlockCopy(IV, 0, _currentIv, 0, IV.Length); + Buffer.BlockCopy(IV, 0, _currentIv!, 0, IV.Length); } } } diff --git a/src/libraries/Common/src/Internal/Cryptography/HashProviderCng.cs b/src/libraries/Common/src/Internal/Cryptography/HashProviderCng.cs index ce4e1f58aca3aa..30e975e39b0a09 100644 --- a/src/libraries/Common/src/Internal/Cryptography/HashProviderCng.cs +++ b/src/libraries/Common/src/Internal/Cryptography/HashProviderCng.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using Microsoft.Win32.SafeHandles; @@ -21,7 +22,7 @@ internal sealed class HashProviderCng : HashProvider // // - "key" activates MAC hashing if present. If null, this HashProvider performs a regular old hash. // - public HashProviderCng(string hashAlgId, byte[] key) : this(hashAlgId, key, isHmac: key != null) + public HashProviderCng(string hashAlgId, byte[]? key) : this(hashAlgId, key, isHmac: key != null) { } @@ -39,7 +40,7 @@ internal HashProviderCng(string hashAlgId, ReadOnlySpan key, bool isHmac) // Win7 won't set hHash, Win8+ will; and both will set _hHash. // So keep hHash trapped in this scope to prevent (mis-)use of it. { - SafeBCryptHashHandle hHash = null; + SafeBCryptHashHandle? hHash = null; NTSTATUS ntStatus = Interop.BCrypt.BCryptCreateHash(_hAlgorithm, out hHash, IntPtr.Zero, 0, key, key == null ? 0 : key.Length, BCryptCreateHashFlags.BCRYPT_HASH_REUSABLE_FLAG); if (ntStatus == NTSTATUS.STATUS_INVALID_PARAMETER) { @@ -62,6 +63,7 @@ internal HashProviderCng(string hashAlgId, ReadOnlySpan key, bool isHmac) { int cbSizeOfHashSize; int hashSize; + Debug.Assert(_hHash != null); NTSTATUS ntStatus = Interop.BCrypt.BCryptGetProperty(_hHash, Interop.BCrypt.BCryptPropertyStrings.BCRYPT_HASH_LENGTH, &hashSize, sizeof(int), out cbSizeOfHashSize, 0); if (ntStatus != NTSTATUS.STATUS_SUCCESS) throw Interop.BCrypt.CreateCryptographicException(ntStatus); @@ -71,6 +73,7 @@ internal HashProviderCng(string hashAlgId, ReadOnlySpan key, bool isHmac) public sealed override unsafe void AppendHashData(ReadOnlySpan source) { + Debug.Assert(_hHash != null); NTSTATUS ntStatus = Interop.BCrypt.BCryptHashData(_hHash, source, source.Length, 0); if (ntStatus != NTSTATUS.STATUS_SUCCESS) { @@ -95,6 +98,7 @@ public override bool TryFinalizeHashAndReset(Span destination, out int byt return false; } + Debug.Assert(_hHash != null); NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(_hHash, destination, _hashSize, 0); if (ntStatus != NTSTATUS.STATUS_SUCCESS) { @@ -138,7 +142,7 @@ private void ResetHashObject() private void DestroyHash() { - SafeBCryptHashHandle hHash = _hHash; + SafeBCryptHashHandle? hHash = _hHash; _hHash = null; if (hHash != null) { @@ -149,8 +153,8 @@ private void DestroyHash() } private readonly SafeBCryptAlgorithmHandle _hAlgorithm; - private SafeBCryptHashHandle _hHash; - private byte[] _key; + private SafeBCryptHashHandle? _hHash; + private byte[]? _key; private readonly bool _reusable; private readonly int _hashSize; diff --git a/src/libraries/Common/src/Internal/Cryptography/UniversalCryptoDecryptor.cs b/src/libraries/Common/src/Internal/Cryptography/UniversalCryptoDecryptor.cs index 5ca2be5a91aa06..c7cdc14b2463da 100644 --- a/src/libraries/Common/src/Internal/Cryptography/UniversalCryptoDecryptor.cs +++ b/src/libraries/Common/src/Internal/Cryptography/UniversalCryptoDecryptor.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Security.Cryptography; @@ -77,7 +78,7 @@ protected sealed override byte[] UncheckedTransformFinalBlock(byte[] inputBuffer // Otherwise the decryption buffer is just the input data. // - byte[] ciphertext = null; + byte[]? ciphertext = null; if (_heldoverCipher == null) { @@ -123,7 +124,7 @@ protected sealed override void Dispose(bool disposing) { if (disposing) { - byte[] heldoverCipher = _heldoverCipher; + byte[]? heldoverCipher = _heldoverCipher; _heldoverCipher = null; if (heldoverCipher != null) { @@ -248,6 +249,6 @@ private byte[] DepadBlock(byte[] block, int offset, int count) // whether this is the final block that needs depadding. This block is held (in encrypted form) in _heldoverCipher. The next call to TransformBlock // or TransformFinalBlock must include the decryption of _heldoverCipher in the results. // - private byte[] _heldoverCipher; + private byte[]? _heldoverCipher; } } diff --git a/src/libraries/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs b/src/libraries/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs index e54b984d347aa5..287fc21ebedf0b 100644 --- a/src/libraries/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs +++ b/src/libraries/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs @@ -173,7 +173,7 @@ internal static bool TryFindHierarchyMount(string mountInfoFilePath, string subs // the end of the optional values. const string Separator = " - "; - int endOfOptionalFields = line.IndexOf(Separator); + int endOfOptionalFields = line.IndexOf(Separator, StringComparison.Ordinal); if (endOfOptionalFields == -1) { // Malformed line. diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFError.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFError.cs index af3b5cd4c3a63f..216b350fa58ade 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFError.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFError.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -29,7 +30,7 @@ internal static int GetErrorCode(SafeCFErrorHandle cfError) } } - internal static string GetErrorDescription(SafeCFErrorHandle cfError) + internal static string? GetErrorDescription(SafeCFErrorHandle cfError) { Debug.Assert(cfError != null); diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFString.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFString.cs index 17fb307d32d18b..98010faa6fa633 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFString.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFString.cs @@ -43,7 +43,7 @@ internal static string CFStringToString(SafeCFStringHandle cfString) if (interiorPointer != IntPtr.Zero) { - return Marshal.PtrToStringUTF8(interiorPointer); + return Marshal.PtrToStringUTF8(interiorPointer)!; } SafeCFDataHandle cfData = CFStringCreateExternalRepresentation( diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.KeyAgree.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.KeyAgree.cs index e213670a95bac1..f585b8210ac2f6 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.KeyAgree.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.KeyAgree.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -20,7 +21,7 @@ private static extern int AppleCryptoNative_EcdhKeyAgree( out SafeCFDataHandle cfDataOut, out SafeCFErrorHandle cfErrorOut); - internal static byte[] EcdhKeyAgree( + internal static byte[]? EcdhKeyAgree( SafeSecKeyRefHandle privateKey, SafeSecKeyRefHandle publicKey, Span opportunisticDestination, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.cs index c58c98d44e5b75..7ed270aed3ef2e 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Collections.Generic; using System.Diagnostics; @@ -371,7 +372,7 @@ internal static void TrackItem(SafeKeychainItemHandle keychainItem) lock (s_lookup) { - SafeTemporaryKeychainHandle temporaryHandle; + SafeTemporaryKeychainHandle? temporaryHandle; if (s_lookup.TryGetValue(keychain.DangerousGetHandle(), out temporaryHandle)) { @@ -393,7 +394,7 @@ internal static void UntrackItem(IntPtr keychainItem) lock (s_lookup) { - SafeTemporaryKeychainHandle temporaryHandle; + SafeTemporaryKeychainHandle? temporaryHandle; if (s_lookup.TryGetValue(keychain.DangerousGetHandle(), out temporaryHandle)) { diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErr.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErr.cs index 48154a22883621..0c6bb80ab7a0d2 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErr.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErr.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; internal static partial class Interop @@ -10,7 +11,7 @@ internal static partial class AppleCrypto { internal static Exception CreateExceptionForOSStatus(int osStatus) { - string msg = GetSecErrorString(osStatus); + string? msg = GetSecErrorString(osStatus); if (msg == null) { diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErrMessage.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErrMessage.cs index c8192f482d63ff..16d5beda4d906d 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErrMessage.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErrMessage.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Runtime.InteropServices; using Microsoft.Win32.SafeHandles; @@ -12,7 +13,7 @@ internal static partial class AppleCrypto [DllImport(Libraries.AppleCryptoNative)] private static extern SafeCFStringHandle AppleCryptoNative_SecCopyErrorMessageString(int osStatus); - internal static string GetSecErrorString(int osStatus) + internal static string? GetSecErrorString(int osStatus) { using (SafeCFStringHandle cfString = AppleCryptoNative_SecCopyErrorMessageString(osStatus)) { diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.Export.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.Export.cs index 2bf6bbe0170185..1a8b00c3e4b735 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.Export.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.Export.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -17,14 +18,14 @@ internal static partial class AppleCrypto [DllImport(Libraries.AppleCryptoNative)] private static extern int AppleCryptoNative_SecKeyExport( - SafeSecKeyRefHandle key, + SafeSecKeyRefHandle? key, int exportPrivate, SafeCreateHandle cfExportPassphrase, out SafeCFDataHandle cfDataOut, out int pOSStatus); internal static SafeCFDataHandle SecKeyExportData( - SafeSecKeyRefHandle key, + SafeSecKeyRefHandle? key, bool exportPrivate, ReadOnlySpan password) { @@ -70,7 +71,7 @@ internal static SafeCFDataHandle SecKeyExportData( } internal static byte[] SecKeyExport( - SafeSecKeyRefHandle key, + SafeSecKeyRefHandle? key, bool exportPrivate, string password) { diff --git a/src/libraries/Common/src/Interop/Unix/System.Globalization.Native/Interop.ICU.cs b/src/libraries/Common/src/Interop/Unix/System.Globalization.Native/Interop.ICU.cs index a16c813b2f5afe..f24c2607848b91 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Globalization.Native/Interop.ICU.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Globalization.Native/Interop.ICU.cs @@ -12,5 +12,8 @@ internal static partial class Globalization { [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICU")] internal static extern int LoadICU(); + + [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetICUVersion")] + internal static extern int GetICUVersion(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.EnumerateInterfaceAddresses.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.EnumerateInterfaceAddresses.cs index ada781b338324f..8e03a33b57db0a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.EnumerateInterfaceAddresses.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.EnumerateInterfaceAddresses.cs @@ -32,8 +32,8 @@ public unsafe struct IpAddressInfo public unsafe struct NetworkInterfaceInfo { public fixed byte Name[16]; + public long Speed; public int InterfaceIndex; - public int Speed; public int Mtu; public ushort HardwareType; public byte OperationalState; diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Bignum.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Bignum.cs index 6faf7f8915a6b4..02f5f13a556862 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Bignum.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Bignum.cs @@ -2,7 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using Microsoft.Win32.SafeHandles; @@ -45,7 +47,7 @@ internal static SafeBignumHandle CreateBignum(byte[] bigEndianValue) return new SafeBignumHandle(handle, true); } - internal static byte[] ExtractBignum(IntPtr bignum, int targetSize) + internal static byte[]? ExtractBignum(IntPtr bignum, int targetSize) { // Given that the only reference held to bignum is an IntPtr, create an unowned SafeHandle // to ensure that we don't destroy the key after extraction. @@ -55,7 +57,7 @@ internal static byte[] ExtractBignum(IntPtr bignum, int targetSize) } } - private static unsafe byte[] ExtractBignum(SafeBignumHandle bignum, int targetSize) + private static unsafe byte[]? ExtractBignum(SafeBignumHandle? bignum, int targetSize) { if (bignum == null || bignum.IsInvalid) { diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Dsa.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Dsa.cs index d22c641e49c8ae..0949efff44911c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Dsa.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Dsa.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -125,10 +126,10 @@ internal static DSAParameters ExportDsaParameters(SafeDsaHandle key, bool includ DSAParameters dsaParameters = new DSAParameters { - P = Crypto.ExtractBignum(p_bn, pgy_cb), - Q = Crypto.ExtractBignum(q_bn, qx_cb), - G = Crypto.ExtractBignum(g_bn, pgy_cb), - Y = Crypto.ExtractBignum(y_bn, pgy_cb), + P = Crypto.ExtractBignum(p_bn, pgy_cb)!, + Q = Crypto.ExtractBignum(q_bn, qx_cb)!, + G = Crypto.ExtractBignum(g_bn, pgy_cb)!, + Y = Crypto.ExtractBignum(y_bn, pgy_cb)!, }; if (includePrivateParameters) @@ -167,7 +168,7 @@ internal static extern bool DsaKeyCreateByExplicitParameters( int gLength, byte[] y, int yLength, - byte[] x, + byte[]? x, int xLength); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs index 2d945c7f33d076..a98241ca5417e4 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs @@ -2,12 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Security.Cryptography; -#nullable enable internal static partial class Interop { internal static partial class Crypto diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs index 578018400864dc..85c256da2d97c1 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using System.Runtime.InteropServices; using System.Security.Cryptography; @@ -18,13 +19,13 @@ private static extern int EcKeyCreateByKeyParameters( string oid, byte[] qx, int qxLength, byte[] qy, int qyLength, - byte[] d, int dLength); + byte[]? d, int dLength); internal static SafeEcKeyHandle EcKeyCreateByKeyParameters( string oid, byte[] qx, int qxLength, byte[] qy, int qyLength, - byte[] d, int dLength) + byte[]? d, int dLength) { SafeEcKeyHandle key; int rc = EcKeyCreateByKeyParameters(out key, oid, qx, qxLength, qy, qyLength, d, dLength); @@ -41,28 +42,28 @@ internal static SafeEcKeyHandle EcKeyCreateByKeyParameters( [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByExplicitParameters")] internal static extern SafeEcKeyHandle EcKeyCreateByExplicitParameters( ECCurve.ECCurveType curveType, - byte[] qx, int qxLength, - byte[] qy, int qyLength, - byte[] d, int dLength, + byte[]? qx, int qxLength, + byte[]? qy, int qyLength, + byte[]? d, int dLength, byte[] p, int pLength, byte[] a, int aLength, byte[] b, int bLength, byte[] gx, int gxLength, byte[] gy, int gyLength, byte[] order, int nLength, - byte[] cofactor, int cofactorLength, - byte[] seed, int seedLength); + byte[]? cofactor, int cofactorLength, + byte[]? seed, int seedLength); internal static SafeEcKeyHandle EcKeyCreateByExplicitCurve(ECCurve curve) { byte[] p; if (curve.IsPrime) { - p = curve.Prime; + p = curve.Prime!; } else if (curve.IsCharacteristic2) { - p = curve.Polynomial; + p = curve.Polynomial!; } else { @@ -75,12 +76,12 @@ internal static SafeEcKeyHandle EcKeyCreateByExplicitCurve(ECCurve curve) null, 0, null, 0, p, p.Length, - curve.A, curve.A.Length, - curve.B, curve.B.Length, - curve.G.X, curve.G.X.Length, - curve.G.Y, curve.G.Y.Length, - curve.Order, curve.Order.Length, - curve.Cofactor, curve.Cofactor.Length, + curve.A!, curve.A!.Length, + curve.B!, curve.B!.Length, + curve.G.X!, curve.G.X!.Length, + curve.G.Y!, curve.G.Y!.Length, + curve.Order!, curve.Order!.Length, + curve.Cofactor, curve.Cofactor!.Length, curve.Seed, curve.Seed == null ? 0 : curve.Seed.Length); if (key == null || key.IsInvalid) @@ -264,22 +265,22 @@ internal static ECParameters GetECCurveParameters( var curve = parameters.Curve; curve.CurveType = curveType; - curve.A = Crypto.ExtractBignum(a_bn, cbFieldLength); - curve.B = Crypto.ExtractBignum(b_bn, cbFieldLength); + curve.A = Crypto.ExtractBignum(a_bn, cbFieldLength)!; + curve.B = Crypto.ExtractBignum(b_bn, cbFieldLength)!; curve.G = new ECPoint { X = Crypto.ExtractBignum(gx_bn, cbFieldLength), Y = Crypto.ExtractBignum(gy_bn, cbFieldLength) }; - curve.Order = Crypto.ExtractBignum(order_bn, cbSubgroupOrder); + curve.Order = Crypto.ExtractBignum(order_bn, cbSubgroupOrder)!; if (curveType == ECCurve.ECCurveType.Characteristic2) { - curve.Polynomial = Crypto.ExtractBignum(p_bn, pFieldLength); + curve.Polynomial = Crypto.ExtractBignum(p_bn, pFieldLength)!; } else { - curve.Prime = Crypto.ExtractBignum(p_bn, pFieldLength); + curve.Prime = Crypto.ExtractBignum(p_bn, pFieldLength)!; } // Optional parameters diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcKey.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcKey.cs index b9e7c91d9e0cee..bf78e9c7cd229d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcKey.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcKey.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using Microsoft.Win32.SafeHandles; using System; using System.Diagnostics; @@ -13,7 +14,7 @@ internal static partial class Crypto { [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByOid")] private static extern SafeEcKeyHandle CryptoNative_EcKeyCreateByOid(string oid); - internal static SafeEcKeyHandle EcKeyCreateByOid(string oid) + internal static SafeEcKeyHandle? EcKeyCreateByOid(string oid) { SafeEcKeyHandle handle = CryptoNative_EcKeyCreateByOid(oid); if (handle == null || handle.IsInvalid) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Rsa.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Rsa.cs index bbf39bff0bfc65..425a493d8eaf34 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Rsa.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Rsa.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -153,8 +154,8 @@ internal static RSAParameters ExportRsaParameters(SafeRsaHandle key, bool includ RSAParameters rsaParameters = new RSAParameters { - Modulus = Crypto.ExtractBignum(n, modulusSize), - Exponent = Crypto.ExtractBignum(e, 0), + Modulus = Crypto.ExtractBignum(n, modulusSize)!, + Exponent = Crypto.ExtractBignum(e, 0)!, }; if (includePrivateParameters) @@ -193,21 +194,21 @@ private static extern bool GetRsaParameters( [return: MarshalAs(UnmanagedType.Bool)] internal static extern bool SetRsaParameters( SafeRsaHandle key, - byte[] n, + byte[]? n, int nLength, - byte[] e, + byte[]? e, int eLength, - byte[] d, + byte[]? d, int dLength, - byte[] p, + byte[]? p, int pLength, - byte[] dmp1, + byte[]? dmp1, int dmp1Length, - byte[] q, + byte[]? q, int qLength, - byte[] dmq1, + byte[]? dmq1, int dmq1Length, - byte[] iqmp, + byte[]? iqmp, int iqmpLength); internal enum RsaPadding : int diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs index 78c7d0d5a46eed..0b512e2c719f1f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Runtime.InteropServices; using System.Security.Cryptography; @@ -24,8 +25,8 @@ internal enum CryptAcquireContextFlags : uint [DllImport(Libraries.Advapi32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "CryptAcquireContextW")] public static extern bool CryptAcquireContext( out SafeProvHandle phProv, - string szContainer, - string szProvider, + string? szContainer, + string? szProvider, int dwProvType, uint dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.cs index 2f410497d35ce9..bd46df10e44004 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.cs @@ -15,7 +15,7 @@ public static extern bool CryptEncrypt( SafeHashHandle hHash, bool Final, int dwFlags, - byte[] pbData, + byte[]? pbData, ref int pdwDataLen, int dwBufLen); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptExportKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptExportKey.cs index 79d85b9a15b7d8..e6e3985ce6ee7f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptExportKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptExportKey.cs @@ -15,7 +15,7 @@ public static extern bool CryptExportKey( SafeKeyHandle hExpKey, int dwBlobType, int dwFlags, - [In, Out] byte[] pbData, + [In, Out] byte[]? pbData, ref int dwDataLen); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs index 89d44b19bad64c..c09bc9088c320d 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs @@ -21,7 +21,7 @@ public static extern bool CryptGetDefaultProvider( int dwProvType, IntPtr pdwReserved, GetDefaultProviderFlags dwFlags, - StringBuilder pszProvName, + StringBuilder? pszProvName, ref int pcbProvName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetKeyParam.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetKeyParam.cs index 1e7c9758159d16..13fefca5f12d58 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetKeyParam.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetKeyParam.cs @@ -22,7 +22,7 @@ internal enum CryptGetKeyParamFlags : int public static extern bool CryptGetKeyParam( SafeKeyHandle hKey, CryptGetKeyParamFlags dwParam, - byte[] pbData, + byte[]? pbData, ref int pdwDataLen, int dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSignHash.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSignHash.cs index 01f92bfb6f1047..46533d016ccc78 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSignHash.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSignHash.cs @@ -29,9 +29,9 @@ internal enum CryptSignAndVerifyHashFlags : int public static extern bool CryptSignHash( SafeHashHandle hHash, KeySpec dwKeySpec, - string szDescription, + string? szDescription, CryptSignAndVerifyHashFlags dwFlags, - [Out] byte[] pbSignature, + [Out] byte[]? pbSignature, [In, Out] ref int pdwSigLen); [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true, EntryPoint = "CryptVerifySignatureW")] @@ -40,7 +40,7 @@ public static extern bool CryptVerifySignature( byte[] pbSignature, int dwSigLen, SafeKeyHandle hPubKey, - string szDescription, + string? szDescription, CryptSignAndVerifyHashFlags dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/SafeHashHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/SafeHashHandle.cs index 6335af3f3925c1..cc792233a5bbb4 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/SafeHashHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/SafeHashHandle.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using Microsoft.Win32.SafeHandles; @@ -12,7 +13,7 @@ namespace System.Security.Cryptography /// internal sealed class SafeHashHandle : SafeHandleZeroOrMinusOneIsInvalid { - private SafeProvHandle _parent; + private SafeProvHandle? _parent; private SafeHashHandle() : base(true) { @@ -54,7 +55,7 @@ protected override bool ReleaseHandle() bool successfullyFreed = Interop.Advapi32.CryptDestroyHash(handle); Debug.Assert(successfullyFreed); - SafeProvHandle parent = _parent; + SafeProvHandle? parent = _parent; _parent = null; parent?.DangerousRelease(); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/SafeKeyHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/SafeKeyHandle.cs index cbde16bfe65037..261cd116527f6b 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/SafeKeyHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/SafeKeyHandle.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using Microsoft.Win32.SafeHandles; @@ -21,7 +22,7 @@ internal sealed class SafeKeyHandle : SafeHandleZeroOrMinusOneIsInvalid { private int _keySpec; private bool _fPublicOnly; - private SafeProvHandle _parent; + private SafeProvHandle? _parent; private SafeKeyHandle() : base(true) { @@ -89,7 +90,7 @@ protected override bool ReleaseHandle() bool successfullyFreed = Interop.Advapi32.CryptDestroyKey(handle); Debug.Assert(successfullyFreed); - SafeProvHandle parent = _parent; + SafeProvHandle? parent = _parent; _parent = null; parent?.DangerousRelease(); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/SafeProvHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/SafeProvHandle.cs index f8c116ae2672e2..e4e16ee7c29221 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/SafeProvHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/SafeProvHandle.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using Microsoft.Win32.SafeHandles; @@ -12,8 +13,8 @@ namespace System.Security.Cryptography /// internal sealed class SafeProvHandle : SafeHandleZeroOrMinusOneIsInvalid { - private string _containerName; - private string _providerName; + private string? _containerName; + private string? _providerName; private int _type; private uint _flags; private bool _fPersistKeyInCsp; @@ -28,7 +29,7 @@ private SafeProvHandle() : base(true) _fPersistKeyInCsp = true; } - internal string ContainerName + internal string? ContainerName { get { @@ -40,7 +41,7 @@ internal string ContainerName } } - internal string ProviderName + internal string? ProviderName { get { diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs index df8835d355dd06..bcb5bae2a13ebf 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Text; using System.Diagnostics; @@ -12,7 +13,6 @@ using static Interop.BCrypt; using Microsoft.Win32.SafeHandles; -#nullable enable namespace Internal.NativeCrypto { internal static partial class BCryptNative @@ -69,7 +69,7 @@ public enum OpenAlgorithmProviderFlags : int public const string BCRYPT_CHAIN_MODE_GCM = "ChainingModeGCM"; public const string BCRYPT_CHAIN_MODE_CCM = "ChainingModeCCM"; - public static SafeAlgorithmHandle BCryptOpenAlgorithmProvider(string pszAlgId, string pszImplementation, OpenAlgorithmProviderFlags dwFlags) + public static SafeAlgorithmHandle BCryptOpenAlgorithmProvider(string pszAlgId, string? pszImplementation, OpenAlgorithmProviderFlags dwFlags) { SafeAlgorithmHandle hAlgorithm; NTSTATUS ntStatus = Interop.BCryptOpenAlgorithmProvider(out hAlgorithm, pszAlgId, pszImplementation, (int)dwFlags); @@ -111,7 +111,7 @@ internal static partial class Cng internal static class Interop { [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - public static extern NTSTATUS BCryptOpenAlgorithmProvider(out SafeAlgorithmHandle phAlgorithm, string pszAlgId, string pszImplementation, int dwFlags); + public static extern NTSTATUS BCryptOpenAlgorithmProvider(out SafeAlgorithmHandle phAlgorithm, string pszAlgId, string? pszImplementation, int dwFlags); [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] public static extern unsafe NTSTATUS BCryptSetProperty(SafeAlgorithmHandle hObject, string pszProperty, string pbInput, int cbInput, int dwFlags); diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptEncryptDecrypt.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptEncryptDecrypt.cs index 572fcce0742aa1..b377d1f8cb9a97 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptEncryptDecrypt.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptEncryptDecrypt.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -13,7 +14,7 @@ internal static partial class Interop internal static partial class BCrypt { // Note: input and output are allowed to be the same buffer. BCryptEncrypt will correctly do the encryption in place according to CNG documentation. - internal static int BCryptEncrypt(SafeKeyHandle hKey, byte[] input, int inputOffset, int inputCount, byte[] iv, byte[] output, int outputOffset, int outputCount) + internal static int BCryptEncrypt(SafeKeyHandle hKey, byte[] input, int inputOffset, int inputCount, byte[]? iv, byte[] output, int outputOffset, int outputCount) { Debug.Assert(input != null); Debug.Assert(inputOffset >= 0); @@ -41,7 +42,7 @@ internal static int BCryptEncrypt(SafeKeyHandle hKey, byte[] input, int inputOff } // Note: input and output are allowed to be the same buffer. BCryptDecrypt will correctly do the decryption in place according to CNG documentation. - internal static int BCryptDecrypt(SafeKeyHandle hKey, byte[] input, int inputOffset, int inputCount, byte[] iv, byte[] output, int outputOffset, int outputCount) + internal static int BCryptDecrypt(SafeKeyHandle hKey, byte[] input, int inputOffset, int inputCount, byte[]? iv, byte[] output, int outputOffset, int outputCount) { Debug.Assert(input != null); Debug.Assert(inputOffset >= 0); @@ -69,9 +70,9 @@ internal static int BCryptDecrypt(SafeKeyHandle hKey, byte[] input, int inputOff } [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - public static extern unsafe NTSTATUS BCryptEncrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, [In, Out] byte[] pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags); + public static extern unsafe NTSTATUS BCryptEncrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, [In, Out] byte[]? pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags); [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - public static extern unsafe NTSTATUS BCryptDecrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, [In, Out] byte[] pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags); + public static extern unsafe NTSTATUS BCryptDecrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, [In, Out] byte[]? pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptOpenAlgorithmProvider.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptOpenAlgorithmProvider.cs index 829b6e356822b3..1d1372be1b4adb 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptOpenAlgorithmProvider.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptOpenAlgorithmProvider.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -13,7 +14,7 @@ internal partial class Interop internal partial class BCrypt { [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - internal static extern NTSTATUS BCryptOpenAlgorithmProvider(out SafeBCryptAlgorithmHandle phAlgorithm, string pszAlgId, string pszImplementation, BCryptOpenAlgorithmProviderFlags dwFlags); + internal static extern NTSTATUS BCryptOpenAlgorithmProvider(out SafeBCryptAlgorithmHandle phAlgorithm, string pszAlgId, string? pszImplementation, BCryptOpenAlgorithmProviderFlags dwFlags); [Flags] internal enum BCryptOpenAlgorithmProviderFlags : int diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptReleaseContext.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptReleaseContext.cs deleted file mode 100644 index 25c8f471097c9b..00000000000000 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptReleaseContext.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Crypt32 - { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptReleaseContext(IntPtr hCryptProv, uint dwFlags); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.cs b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.cs index 6705874d50200f..220ac34a823fc7 100644 --- a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.cs +++ b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Net.NetworkInformation; using System.Runtime.InteropServices; @@ -22,7 +23,7 @@ internal struct IPOptions internal byte optionsSize; internal IntPtr optionsData; - internal IPOptions(PingOptions options) + internal IPOptions(PingOptions? options) { ttl = 128; tos = 0; diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipeClient.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipeClient.cs index afdb1036e81438..05042ec870a0f8 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipeClient.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipeClient.cs @@ -13,7 +13,7 @@ internal partial class Kernel32 { [DllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)] internal static extern SafePipeHandle CreateNamedPipeClient( - string lpFileName, + string? lpFileName, int dwDesiredAccess, System.IO.FileShare dwShareMode, ref SECURITY_ATTRIBUTES secAttrs, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitNamedPipe.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitNamedPipe.cs index bb65acdc82f902..a4c7b0b2a3b7f0 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitNamedPipe.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitNamedPipe.cs @@ -10,6 +10,6 @@ internal partial class Kernel32 { [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false, EntryPoint = "WaitNamedPipeW")] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool WaitNamedPipe(string name, int timeout); + internal static extern bool WaitNamedPipe(string? name, int timeout); } } diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs index ee4f09cc64ed5a..212bfdef5f23bc 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Runtime.InteropServices; using System.Security.Cryptography; @@ -24,7 +25,7 @@ internal static partial class NCrypt internal static extern ErrorCode NCryptImportKey(SafeNCryptProviderHandle hProvider, IntPtr hImportKey, string pszBlobType, ref NCryptBufferDesc pParameterList, [Out] out SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags); [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static extern ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, [Out] byte[] pbOutput, int cbOutput, [Out] out int pcbResult, int dwFlags); + internal static extern ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, [Out] byte[]? pbOutput, int cbOutput, [Out] out int pcbResult, int dwFlags); [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] internal static extern ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, ref byte pbOutput, int cbOutput, [Out] out int pcbResult, int dwFlags); @@ -36,7 +37,7 @@ internal static partial class NCrypt internal static extern ErrorCode NCryptDeleteKey(SafeNCryptKeyHandle hKey, int dwFlags); [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static extern ErrorCode NCryptCreatePersistedKey(SafeNCryptProviderHandle hProvider, out SafeNCryptKeyHandle phKey, string pszAlgId, string pszKeyName, int dwLegacyKeySpec, CngKeyCreationOptions dwFlags); + internal static extern ErrorCode NCryptCreatePersistedKey(SafeNCryptProviderHandle hProvider, out SafeNCryptKeyHandle phKey, string pszAlgId, string? pszKeyName, int dwLegacyKeySpec, CngKeyCreationOptions dwFlags); [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] internal static extern ErrorCode NCryptFinalizeKey(SafeNCryptKeyHandle hKey, int dwFlags); diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs index 1aebafb6b2ba01..c8468d5849b4b6 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Runtime.InteropServices; using System.Security.Cryptography; @@ -21,7 +22,7 @@ private static extern ErrorCode NCryptDeriveKey( SafeNCryptSecretHandle hSharedSecret, string pwszKDF, [In] ref NCryptBufferDesc pParameterList, - [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbDerivedKey, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[]? pbDerivedKey, int cbDerivedKey, [Out] out int pcbResult, SecretAgreementFlags dwFlags); @@ -34,9 +35,9 @@ private static byte[] DeriveKeyMaterial( SafeNCryptSecretHandle secretAgreement, string kdf, string hashAlgorithm, - byte[] hmacKey, - byte[] secretPrepend, - byte[] secretAppend, + byte[]? hmacKey, + byte[]? secretPrepend, + byte[]? secretAppend, SecretAgreementFlags flags) { // First marshal the hash algoritm @@ -68,7 +69,7 @@ private static byte[] DeriveKeyMaterial( if (pHmacKey != null) { NCryptBuffer hmacKeyBuffer = default; - hmacKeyBuffer.cbBuffer = hmacKey.Length; + hmacKeyBuffer.cbBuffer = hmacKey!.Length; hmacKeyBuffer.BufferType = BufferType.KdfHmacKey; hmacKeyBuffer.pvBuffer = new IntPtr(pHmacKey); @@ -79,7 +80,7 @@ private static byte[] DeriveKeyMaterial( if (pSecretPrepend != null) { NCryptBuffer secretPrependBuffer = default; - secretPrependBuffer.cbBuffer = secretPrepend.Length; + secretPrependBuffer.cbBuffer = secretPrepend!.Length; secretPrependBuffer.BufferType = BufferType.KdfSecretPrepend; secretPrependBuffer.pvBuffer = new IntPtr(pSecretPrepend); @@ -90,7 +91,7 @@ private static byte[] DeriveKeyMaterial( if (pSecretAppend != null) { NCryptBuffer secretAppendBuffer = default; - secretAppendBuffer.cbBuffer = secretAppend.Length; + secretAppendBuffer.cbBuffer = secretAppend!.Length; secretAppendBuffer.BufferType = BufferType.KdfSecretAppend; secretAppendBuffer.pvBuffer = new IntPtr(pSecretAppend); @@ -175,8 +176,8 @@ private static unsafe byte[] DeriveKeyMaterial( internal static byte[] DeriveKeyMaterialHash( SafeNCryptSecretHandle secretAgreement, string hashAlgorithm, - byte[] secretPrepend, - byte[] secretAppend, + byte[]? secretPrepend, + byte[]? secretAppend, SecretAgreementFlags flags) { return DeriveKeyMaterial( @@ -195,9 +196,9 @@ internal static byte[] DeriveKeyMaterialHash( internal static byte[] DeriveKeyMaterialHmac( SafeNCryptSecretHandle secretAgreement, string hashAlgorithm, - byte[] hmacKey, - byte[] secretPrepend, - byte[] secretAppend, + byte[]? hmacKey, + byte[]? secretPrepend, + byte[]? secretAppend, SecretAgreementFlags flags) { return DeriveKeyMaterial( diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs index 2b50412e8fc6c9..20cd29588f9a10 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs @@ -15,8 +15,8 @@ internal interface ISSPIInterface int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, ref SafeSspiAuthDataHandle authdata, out SafeFreeCredentials outCredential); int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, ref Interop.SspiCli.SCHANNEL_CRED authdata, out SafeFreeCredentials outCredential); int AcquireDefaultCredential(string moduleName, Interop.SspiCli.CredentialUse usage, out SafeFreeCredentials outCredential); - int AcceptSecurityContext(SafeFreeCredentials credential, ref SafeDeleteSslContext context, ReadOnlySpan inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags); - int InitializeSecurityContext(ref SafeFreeCredentials credential, ref SafeDeleteSslContext context, string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ReadOnlySpan inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags); + int AcceptSecurityContext(SafeFreeCredentials credential, ref SafeDeleteSslContext context, InputSecurityBuffers inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags); + int InitializeSecurityContext(ref SafeFreeCredentials credential, ref SafeDeleteSslContext context, string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags); int EncryptMessage(SafeDeleteContext context, ref Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber); int DecryptMessage(SafeDeleteContext context, ref Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber); int MakeSignature(SafeDeleteContext context, ref Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber); diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs index de1b873ef43c86..10e9e6d0321dde 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs @@ -45,12 +45,12 @@ public int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.Credentia return SafeFreeCredentials.AcquireCredentialsHandle(moduleName, usage, ref authdata, out outCredential); } - public int AcceptSecurityContext(SafeFreeCredentials credential, ref SafeDeleteSslContext context, ReadOnlySpan inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) + public int AcceptSecurityContext(SafeFreeCredentials credential, ref SafeDeleteSslContext context, InputSecurityBuffers inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) { return SafeDeleteContext.AcceptSecurityContext(ref credential, ref context, inFlags, endianness, inputBuffers, ref outputBuffer, ref outFlags); } - public int InitializeSecurityContext(ref SafeFreeCredentials credential, ref SafeDeleteSslContext context, string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ReadOnlySpan inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) + public int InitializeSecurityContext(ref SafeFreeCredentials credential, ref SafeDeleteSslContext context, string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) { return SafeDeleteContext.InitializeSecurityContext(ref credential, ref context, targetName, inFlags, endianness, inputBuffers, ref outputBuffer, ref outFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs index 13e32d4d5e4fcc..e3832d8c3cdba5 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs @@ -45,12 +45,12 @@ public int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.Credentia return SafeFreeCredentials.AcquireCredentialsHandle(moduleName, usage, ref authdata, out outCredential); } - public int AcceptSecurityContext(SafeFreeCredentials credential, ref SafeDeleteSslContext context, ReadOnlySpan inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) + public int AcceptSecurityContext(SafeFreeCredentials credential, ref SafeDeleteSslContext context, InputSecurityBuffers inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) { return SafeDeleteContext.AcceptSecurityContext(ref credential, ref context, inFlags, endianness, inputBuffers, ref outputBuffer, ref outFlags); } - public int InitializeSecurityContext(ref SafeFreeCredentials credential, ref SafeDeleteSslContext context, string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ReadOnlySpan inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) + public int InitializeSecurityContext(ref SafeFreeCredentials credential, ref SafeDeleteSslContext context, string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) { return SafeDeleteContext.InitializeSecurityContext(ref credential, ref context, targetName, inFlags, endianness, inputBuffers, ref outputBuffer, ref outFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs index 30d705123c3ec0..79e004c6476fa2 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs @@ -140,24 +140,24 @@ public static SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secMod return outCredential; } - internal static int InitializeSecurityContext(ISSPIInterface secModule, ref SafeFreeCredentials credential, ref SafeDeleteSslContext context, string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness datarep, ReadOnlySpan inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) + internal static int InitializeSecurityContext(ISSPIInterface secModule, ref SafeFreeCredentials credential, ref SafeDeleteSslContext context, string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness datarep, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) { if (NetEventSource.IsEnabled) NetEventSource.Log.InitializeSecurityContext(credential, context, targetName, inFlags); int errorCode = secModule.InitializeSecurityContext(ref credential, ref context, targetName, inFlags, datarep, inputBuffers, ref outputBuffer, ref outFlags); - if (NetEventSource.IsEnabled) NetEventSource.Log.SecurityContextInputBuffers(nameof(InitializeSecurityContext), inputBuffers.Length, outputBuffer.size, (Interop.SECURITY_STATUS)errorCode); + if (NetEventSource.IsEnabled) NetEventSource.Log.SecurityContextInputBuffers(nameof(InitializeSecurityContext), inputBuffers.Count, outputBuffer.size, (Interop.SECURITY_STATUS)errorCode); return errorCode; } - internal static int AcceptSecurityContext(ISSPIInterface secModule, SafeFreeCredentials credential, ref SafeDeleteSslContext context, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness datarep, ReadOnlySpan inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) + internal static int AcceptSecurityContext(ISSPIInterface secModule, SafeFreeCredentials credential, ref SafeDeleteSslContext context, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness datarep, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) { if (NetEventSource.IsEnabled) NetEventSource.Log.AcceptSecurityContext(credential, context, inFlags); int errorCode = secModule.AcceptSecurityContext(credential, ref context, inputBuffers, inFlags, datarep, ref outputBuffer, ref outFlags); - if (NetEventSource.IsEnabled) NetEventSource.Log.SecurityContextInputBuffers(nameof(AcceptSecurityContext), inputBuffers.Length, outputBuffer.size, (Interop.SECURITY_STATUS)errorCode); + if (NetEventSource.IsEnabled) NetEventSource.Log.SecurityContextInputBuffers(nameof(AcceptSecurityContext), inputBuffers.Count, outputBuffer.size, (Interop.SECURITY_STATUS)errorCode); return errorCode; } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs index e5b024948ee541..02d939392b030e 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs @@ -396,7 +396,7 @@ internal static unsafe int InitializeSecurityContext( string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, - ReadOnlySpan inSecBuffers, + InputSecurityBuffers inSecBuffers, ref SecurityBuffer outSecBuffer, ref Interop.SspiCli.ContextFlags outFlags) { @@ -413,7 +413,8 @@ internal static unsafe int InitializeSecurityContext( throw new ArgumentNullException(nameof(inCredentials)); } - Interop.SspiCli.SecBufferDesc inSecurityBufferDescriptor = new Interop.SspiCli.SecBufferDesc(inSecBuffers.Length); + Debug.Assert(inSecBuffers.Count <= 3); + Interop.SspiCli.SecBufferDesc inSecurityBufferDescriptor = new Interop.SspiCli.SecBufferDesc(inSecBuffers.Count); Interop.SspiCli.SecBufferDesc outSecurityBufferDescriptor = new Interop.SspiCli.SecBufferDesc(1); // Actually, this is returned in outFlags. @@ -431,34 +432,41 @@ internal static unsafe int InitializeSecurityContext( SafeFreeContextBuffer outFreeContextBuffer = null; try { - Span inUnmanagedBuffer = stackalloc Interop.SspiCli.SecBuffer[inSecurityBufferDescriptor.cBuffers]; - inUnmanagedBuffer.Clear(); + Span inUnmanagedBuffer = stackalloc Interop.SspiCli.SecBuffer[3]; fixed (void* inUnmanagedBufferPtr = inUnmanagedBuffer) - fixed (void* pinnedToken0 = inSecBuffers.Length > 0 ? inSecBuffers[0].token : null) - fixed (void* pinnedToken1 = inSecBuffers.Length > 1 ? inSecBuffers[1].token : null) - fixed (void* pinnedToken2 = inSecBuffers.Length > 2 ? inSecBuffers[2].token : null) // pin all buffers, even if null or not used, to avoid needing to allocate GCHandles + fixed (void* pinnedToken0 = inSecBuffers._item0.Token) + fixed (void* pinnedToken1 = inSecBuffers._item1.Token) + fixed (void* pinnedToken2 = inSecBuffers._item2.Token) { - Debug.Assert(inSecBuffers.Length <= 3); - // Fix Descriptor pointer that points to unmanaged SecurityBuffers. inSecurityBufferDescriptor.pBuffers = inUnmanagedBufferPtr; - for (int index = 0; index < inSecurityBufferDescriptor.cBuffers; ++index) + // Updated pvBuffer with pinned address. UnmanagedToken takes precedence. + if (inSecBuffers.Count > 2) { - ref readonly SecurityBuffer securityBuffer = ref inSecBuffers[index]; + inUnmanagedBuffer[2].BufferType = inSecBuffers._item2.Type; + inUnmanagedBuffer[2].cbBuffer = inSecBuffers._item2.Token.Length; + inUnmanagedBuffer[2].pvBuffer = inSecBuffers._item2.UnmanagedToken != null ? + (IntPtr)inSecBuffers._item2.UnmanagedToken.DangerousGetHandle() : + (IntPtr)pinnedToken2; + } - // Copy the SecurityBuffer content into unmanaged place holder. - inUnmanagedBuffer[index].cbBuffer = securityBuffer.size; - inUnmanagedBuffer[index].BufferType = securityBuffer.type; - - // Use the unmanaged token if it's not null; otherwise use the managed buffer. - inUnmanagedBuffer[index].pvBuffer = - securityBuffer.unmanagedToken != null ? securityBuffer.unmanagedToken.DangerousGetHandle() : - securityBuffer.token == null || securityBuffer.token.Length == 0 ? IntPtr.Zero : - Marshal.UnsafeAddrOfPinnedArrayElement(securityBuffer.token, securityBuffer.offset); -#if TRACE_VERBOSE - if (NetEventSource.IsEnabled) NetEventSource.Info(null, $"SecBuffer: cbBuffer:{securityBuffer.size} BufferType:{securityBuffer.type}"); -#endif + if (inSecBuffers.Count > 1) + { + inUnmanagedBuffer[1].BufferType = inSecBuffers._item1.Type; + inUnmanagedBuffer[1].cbBuffer = inSecBuffers._item1.Token.Length; + inUnmanagedBuffer[1].pvBuffer = inSecBuffers._item1.UnmanagedToken != null ? + (IntPtr)inSecBuffers._item1.UnmanagedToken.DangerousGetHandle() : + (IntPtr)pinnedToken1; + } + + if (inSecBuffers.Count > 0) + { + inUnmanagedBuffer[0].BufferType = inSecBuffers._item0.Type; + inUnmanagedBuffer[0].cbBuffer = inSecBuffers._item0.Token.Length; + inUnmanagedBuffer[0].pvBuffer = inSecBuffers._item0.UnmanagedToken != null ? + (IntPtr)inSecBuffers._item0.UnmanagedToken.DangerousGetHandle() : + (IntPtr)pinnedToken0; } fixed (byte* pinnedOutBytes = outSecBuffer.token) @@ -626,7 +634,7 @@ internal static unsafe int AcceptSecurityContext( ref SafeDeleteSslContext refContext, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, - ReadOnlySpan inSecBuffers, + InputSecurityBuffers inSecBuffers, ref SecurityBuffer outSecBuffer, ref Interop.SspiCli.ContextFlags outFlags) { @@ -643,7 +651,8 @@ internal static unsafe int AcceptSecurityContext( throw new ArgumentNullException(nameof(inCredentials)); } - Interop.SspiCli.SecBufferDesc inSecurityBufferDescriptor = new Interop.SspiCli.SecBufferDesc(inSecBuffers.Length); + Debug.Assert(inSecBuffers.Count <= 3); + Interop.SspiCli.SecBufferDesc inSecurityBufferDescriptor = new Interop.SspiCli.SecBufferDesc(inSecBuffers.Count); Interop.SspiCli.SecBufferDesc outSecurityBufferDescriptor = new Interop.SspiCli.SecBufferDesc(count: 2); // Actually, this is returned in outFlags. @@ -663,35 +672,42 @@ internal static unsafe int AcceptSecurityContext( outUnmanagedBuffer[1].pvBuffer = IntPtr.Zero; try { - Span inUnmanagedBuffer = stackalloc Interop.SspiCli.SecBuffer[inSecurityBufferDescriptor.cBuffers]; - inUnmanagedBuffer.Clear(); + // Allocate always maximum to allow better code optimization. + Span inUnmanagedBuffer = stackalloc Interop.SspiCli.SecBuffer[3]; fixed (void* inUnmanagedBufferPtr = inUnmanagedBuffer) fixed (void* outUnmanagedBufferPtr = outUnmanagedBuffer) - fixed (void* pinnedToken0 = inSecBuffers.Length > 0 ? inSecBuffers[0].token : null) - fixed (void* pinnedToken1 = inSecBuffers.Length > 1 ? inSecBuffers[1].token : null) - fixed (void* pinnedToken2 = inSecBuffers.Length > 2 ? inSecBuffers[2].token : null) // pin all buffers, even if null or not used, to avoid needing to allocate GCHandles + fixed (void* pinnedToken0 = inSecBuffers._item0.Token) + fixed (void* pinnedToken1 = inSecBuffers._item1.Token) + fixed (void* pinnedToken2 = inSecBuffers._item2.Token) { - Debug.Assert(inSecBuffers.Length <= 3); - - // Fix Descriptor pointer that points to unmanaged SecurityBuffers. inSecurityBufferDescriptor.pBuffers = inUnmanagedBufferPtr; - for (int index = 0; index < inSecurityBufferDescriptor.cBuffers; ++index) + // Updated pvBuffer with pinned address. UnmanagedToken takes precedence. + if (inSecBuffers.Count > 2) { - ref readonly SecurityBuffer securityBuffer = ref inSecBuffers[index]; + inUnmanagedBuffer[2].BufferType = inSecBuffers._item2.Type; + inUnmanagedBuffer[2].cbBuffer = inSecBuffers._item2.Token.Length; + inUnmanagedBuffer[2].pvBuffer = inSecBuffers._item2.UnmanagedToken != null ? + (IntPtr)inSecBuffers._item2.UnmanagedToken.DangerousGetHandle() : + (IntPtr)pinnedToken2; + } - // Copy the SecurityBuffer content into unmanaged place holder. - inUnmanagedBuffer[index].cbBuffer = securityBuffer.size; - inUnmanagedBuffer[index].BufferType = securityBuffer.type; - - // Use the unmanaged token if it's not null; otherwise use the managed buffer. - inUnmanagedBuffer[index].pvBuffer = - securityBuffer.unmanagedToken != null ? securityBuffer.unmanagedToken.DangerousGetHandle() : - securityBuffer.token == null || securityBuffer.token.Length == 0 ? IntPtr.Zero : - Marshal.UnsafeAddrOfPinnedArrayElement(securityBuffer.token, securityBuffer.offset); -#if TRACE_VERBOSE - if (NetEventSource.IsEnabled) NetEventSource.Info(null, $"SecBuffer: cbBuffer:{securityBuffer.size} BufferType:{securityBuffer.type}"); -#endif + if (inSecBuffers.Count > 1) + { + inUnmanagedBuffer[1].BufferType = inSecBuffers._item1.Type; + inUnmanagedBuffer[1].cbBuffer = inSecBuffers._item1.Token.Length; + inUnmanagedBuffer[1].pvBuffer = inSecBuffers._item1.UnmanagedToken != null ? + (IntPtr)inSecBuffers._item1.UnmanagedToken.DangerousGetHandle() : + (IntPtr)pinnedToken1; + } + + if (inSecBuffers.Count > 0) + { + inUnmanagedBuffer[0].BufferType = inSecBuffers._item0.Type; + inUnmanagedBuffer[0].cbBuffer = inSecBuffers._item0.Token.Length; + inUnmanagedBuffer[0].pvBuffer = inSecBuffers._item0.UnmanagedToken != null ? + (IntPtr)inSecBuffers._item0.UnmanagedToken.DangerousGetHandle() : + (IntPtr)pinnedToken0; } fixed (byte* pinnedOutBytes = outSecBuffer.token) diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs index c0a48996328edf..430bd89e22fa10 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Net.Sockets; using System.Runtime.InteropServices; @@ -20,7 +21,7 @@ internal static partial class Winsock [DllImport(Libraries.Ws2_32, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] internal static extern unsafe int GetAddrInfoExW( [In] string pName, - [In] string pServiceName, + [In] string? pServiceName, [In] int dwNamespace, [In] IntPtr lpNspId, [In] AddressInfoEx* pHints, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoW.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoW.cs index 54fb797d226660..06eded1f265b6d 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoW.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoW.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Net.Sockets; using System.Runtime.InteropServices; @@ -13,7 +14,7 @@ internal static partial class Winsock [DllImport(Interop.Libraries.Ws2_32, ExactSpelling = true, CharSet = CharSet.Unicode, BestFitMapping = false, ThrowOnUnmappableChar = true, SetLastError = true)] internal static extern unsafe int GetAddrInfoW( [In] string pNameName, - [In] string pServiceName, + [In] string? pServiceName, [In] AddressInfo* pHints, [Out] AddressInfo** ppResult); diff --git a/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeHandleCache.cs b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeHandleCache.cs index eea60acedbed46..14edf5a9a94559 100644 --- a/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeHandleCache.cs +++ b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeHandleCache.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -13,7 +14,7 @@ namespace Microsoft.Win32.SafeHandles /// Specifies the type of SafeHandle. internal static class SafeHandleCache where T : SafeHandle { - private static T s_invalidHandle; + private static T? s_invalidHandle; /// /// Gets a cached, invalid handle. As the instance is cached, it should either never be Disposed @@ -22,7 +23,7 @@ internal static class SafeHandleCache where T : SafeHandle /// internal static T GetInvalidHandle(Func invalidHandleFactory) { - T currentHandle = Volatile.Read(ref s_invalidHandle); + T? currentHandle = Volatile.Read(ref s_invalidHandle); if (currentHandle == null) { T newHandle = invalidHandleFactory(); diff --git a/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeInteriorHandle.cs b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeInteriorHandle.cs index c1e14c32fd30fc..dcc03dcc262b23 100644 --- a/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeInteriorHandle.cs +++ b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeInteriorHandle.cs @@ -2,11 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Runtime.InteropServices; -#nullable enable namespace Microsoft.Win32.SafeHandles { internal abstract class SafeInteriorHandle : SafeHandle diff --git a/src/libraries/Common/src/System/Collections/Generic/ReferenceEqualityComparer.cs b/src/libraries/Common/src/System/Collections/Generic/ReferenceEqualityComparer.cs index a21c8d894b12d5..5502a9889090bc 100644 --- a/src/libraries/Common/src/System/Collections/Generic/ReferenceEqualityComparer.cs +++ b/src/libraries/Common/src/System/Collections/Generic/ReferenceEqualityComparer.cs @@ -2,27 +2,65 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable + using System.Runtime.CompilerServices; namespace System.Collections.Generic { - internal sealed class ReferenceEqualityComparer : IEqualityComparer - where T : class + /// + /// An that uses reference equality () + /// instead of value equality () when comparing two object instances. + /// + /// + /// The type cannot be instantiated. Instead, use the property + /// to access the singleton instance of this type. + /// +#if SYSTEM_PRIVATE_CORELIB + public +#else + internal +#endif + sealed class ReferenceEqualityComparer : IEqualityComparer, IEqualityComparer { - internal static readonly ReferenceEqualityComparer Instance = new ReferenceEqualityComparer(); + private ReferenceEqualityComparer() { } - private ReferenceEqualityComparer() - { - } + /// + /// Gets the singleton instance. + /// + public static ReferenceEqualityComparer Instance { get; } = new ReferenceEqualityComparer(); - public bool Equals(T x, T y) - { - return ReferenceEquals(x, y); - } + /// + /// Determines whether two object references refer to the same object instance. + /// + /// The first object to compare. + /// The second object to compare. + /// + /// if both and refer to the same object instance + /// or if both are ; otherwise, . + /// + /// + /// This API is a wrapper around . + /// It is not necessarily equivalent to calling . + /// + public new bool Equals(object? x, object? y) => ReferenceEquals(x, y); - public int GetHashCode(T obj) + /// + /// Returns a hash code for the specified object. The returned hash code is based on the object + /// identity, not on the contents of the object. + /// + /// The object for which to retrieve the hash code. + /// A hash code for the identity of . + /// + /// This API is a wrapper around . + /// It is not necessarily equivalent to calling . + /// + public int GetHashCode(object? obj) { - return RuntimeHelpers.GetHashCode(obj); + // Depending on target framework, RuntimeHelpers.GetHashCode might not be annotated + // with the proper nullability attribute. We'll suppress any warning that might + // result. + return RuntimeHelpers.GetHashCode(obj!); } } } diff --git a/src/libraries/Common/src/System/Data/Common/DbConnectionOptions.Common.cs b/src/libraries/Common/src/System/Data/Common/DbConnectionOptions.Common.cs index 939f62a3cc608c..b409b907c14fb1 100644 --- a/src/libraries/Common/src/System/Data/Common/DbConnectionOptions.Common.cs +++ b/src/libraries/Common/src/System/Data/Common/DbConnectionOptions.Common.cs @@ -153,7 +153,7 @@ private static string GetKeyName(StringBuilder buffer) { count--; // trailing whitespace } - return buffer.ToString(0, count).ToLower(CultureInfo.InvariantCulture); + return buffer.ToString(0, count).ToLowerInvariant(); } private static string GetKeyValue(StringBuilder buffer, bool trimWhitespace) @@ -445,7 +445,7 @@ private static Dictionary SplitConnectionString(string connectio CaptureCollection keyvalues = match.Groups[ValueIndex].Captures; foreach (Capture keypair in match.Groups[KeyIndex].Captures) { - string keyname = (firstKey ? keypair.Value : keypair.Value.Replace("==", "=")).ToLower(CultureInfo.InvariantCulture); + string keyname = (firstKey ? keypair.Value : keypair.Value.Replace("==", "=")).ToLowerInvariant(); string keyvalue = keyvalues[indexValue++].Value; if (0 < keyvalue.Length) { diff --git a/src/libraries/Common/src/System/Diagnostics/CodeAnalysis/ExcludeFromCodeCoverageAttribute.cs b/src/libraries/Common/src/System/Diagnostics/CodeAnalysis/ExcludeFromCodeCoverageAttribute.cs index 966370e80637e0..4d5b5890358b29 100644 --- a/src/libraries/Common/src/System/Diagnostics/CodeAnalysis/ExcludeFromCodeCoverageAttribute.cs +++ b/src/libraries/Common/src/System/Diagnostics/CodeAnalysis/ExcludeFromCodeCoverageAttribute.cs @@ -5,7 +5,7 @@ namespace System.Diagnostics.CodeAnalysis { [AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event, Inherited = false, AllowMultiple = false)] -#if NETCOREAPP +#if SYSTEM_PRIVATE_CORELIB public #else internal diff --git a/src/libraries/Common/src/System/Drawing/ColorTranslator.cs b/src/libraries/Common/src/System/Drawing/ColorTranslator.cs index 47763c3a53cdf4..92d47565659592 100644 --- a/src/libraries/Common/src/System/Drawing/ColorTranslator.cs +++ b/src/libraries/Common/src/System/Drawing/ColorTranslator.cs @@ -260,7 +260,7 @@ public static Color FromHtml(string htmlColor) InitializeHtmlSysColorTable(); } - s_htmlSysColorTable!.TryGetValue(htmlColor.ToLower(CultureInfo.InvariantCulture), out c); + s_htmlSysColorTable!.TryGetValue(htmlColor.ToLowerInvariant(), out c); } // resort to type converter which will handle named colors diff --git a/src/libraries/Common/src/System/Drawing/KnownColor.cs b/src/libraries/Common/src/System/Drawing/KnownColor.cs index f4297863106ad5..8f4694c5421ed3 100644 --- a/src/libraries/Common/src/System/Drawing/KnownColor.cs +++ b/src/libraries/Common/src/System/Drawing/KnownColor.cs @@ -7,7 +7,6 @@ namespace System.Drawing { - [SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")] [TypeForwardedFrom("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] #if NETCOREAPP2_0 internal diff --git a/src/libraries/Common/src/System/HexConverter.cs b/src/libraries/Common/src/System/HexConverter.cs new file mode 100644 index 00000000000000..a1d76cca277335 --- /dev/null +++ b/src/libraries/Common/src/System/HexConverter.cs @@ -0,0 +1,153 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Runtime.CompilerServices; + +namespace System +{ + internal static class HexConverter + { + public enum Casing : uint + { + // Output [ '0' .. '9' ] and [ 'A' .. 'F' ]. + Upper = 0, + + // Output [ '0' .. '9' ] and [ 'a' .. 'f' ]. + // This works because values in the range [ 0x30 .. 0x39 ] ([ '0' .. '9' ]) + // already have the 0x20 bit set, so ORing them with 0x20 is a no-op, + // while outputs in the range [ 0x41 .. 0x46 ] ([ 'A' .. 'F' ]) + // don't have the 0x20 bit set, so ORing them maps to + // [ 0x61 .. 0x66 ] ([ 'a' .. 'f' ]), which is what we want. + Lower = 0x2020U, + } + + // We want to pack the incoming byte into a single integer [ 0000 HHHH 0000 LLLL ], + // where HHHH and LLLL are the high and low nibbles of the incoming byte. Then + // subtract this integer from a constant minuend as shown below. + // + // [ 1000 1001 1000 1001 ] + // - [ 0000 HHHH 0000 LLLL ] + // ========================= + // [ *YYY **** *ZZZ **** ] + // + // The end result of this is that YYY is 0b000 if HHHH <= 9, and YYY is 0b111 if HHHH >= 10. + // Similarly, ZZZ is 0b000 if LLLL <= 9, and ZZZ is 0b111 if LLLL >= 10. + // (We don't care about the value of asterisked bits.) + // + // To turn a nibble in the range [ 0 .. 9 ] into hex, we calculate hex := nibble + 48 (ascii '0'). + // To turn a nibble in the range [ 10 .. 15 ] into hex, we calculate hex := nibble - 10 + 65 (ascii 'A'). + // => hex := nibble + 55. + // The difference in the starting ASCII offset is (55 - 48) = 7, depending on whether the nibble is <= 9 or >= 10. + // Since 7 is 0b111, this conveniently matches the YYY or ZZZ value computed during the earlier subtraction. + + // The commented out code below is code that directly implements the logic described above. + + // uint packedOriginalValues = (((uint)value & 0xF0U) << 4) + ((uint)value & 0x0FU); + // uint difference = 0x8989U - packedOriginalValues; + // uint add7Mask = (difference & 0x7070U) >> 4; // line YYY and ZZZ back up with the packed values + // uint packedResult = packedOriginalValues + add7Mask + 0x3030U /* ascii '0' */; + + // The code below is equivalent to the commented out code above but has been tweaked + // to allow codegen to make some extra optimizations. + + // The low byte of the packed result contains the hex representation of the incoming byte's low nibble. + // The adjacent byte of the packed result contains the hex representation of the incoming byte's high nibble. + + // Finally, write to the output buffer starting with the *highest* index so that codegen can + // elide all but the first bounds check. (This only works if 'startingIndex' is a compile-time constant.) + + // The JIT can elide bounds checks if 'startingIndex' is constant and if the caller is + // writing to a span of known length (or the caller has already checked the bounds of the + // furthest access). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ToBytesBuffer(byte value, Span buffer, int startingIndex = 0, Casing casing = Casing.Upper) + { + uint difference = (((uint)value & 0xF0U) << 4) + ((uint)value & 0x0FU) - 0x8989U; + uint packedResult = ((((uint)(-(int)difference) & 0x7070U) >> 4) + difference + 0xB9B9U) | (uint)casing; + + buffer[startingIndex + 1] = (byte)packedResult; + buffer[startingIndex] = (byte)(packedResult >> 8); + } + +#if ALLOW_PARTIALLY_TRUSTED_CALLERS + [System.Security.SecuritySafeCriticalAttribute] +#endif + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ToCharsBuffer(byte value, Span buffer, int startingIndex = 0, Casing casing = Casing.Upper) + { + uint difference = (((uint)value & 0xF0U) << 4) + ((uint)value & 0x0FU) - 0x8989U; + uint packedResult = ((((uint)(-(int)difference) & 0x7070U) >> 4) + difference + 0xB9B9U) | (uint)casing; + + buffer[startingIndex + 1] = (char)(packedResult & 0xFF); + buffer[startingIndex] = (char)(packedResult >> 8); + } + +#if ALLOW_PARTIALLY_TRUSTED_CALLERS + [System.Security.SecuritySafeCriticalAttribute] +#endif + public static unsafe string ToString(ReadOnlySpan bytes, Casing casing = Casing.Upper) + { +#if NET45 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472 || NETSTANDARD1_0 || NETSTANDARD1_3 || NETSTANDARD2_0 + Span result = stackalloc char[0]; + if (bytes.Length > 16) + { + var array = new char[bytes.Length * 2]; + result = array.AsSpan(); + } + else + { + result = stackalloc char[bytes.Length * 2]; + } + + int pos = 0; + foreach (byte b in bytes) + { + ToCharsBuffer(b, result, pos, casing); + pos += 2; + } + return result.ToString(); +#else + fixed (byte* bytesPtr = bytes) + { + return string.Create(bytes.Length * 2, (Ptr: (IntPtr)bytesPtr, bytes.Length, casing), (chars, args) => + { + var ros = new ReadOnlySpan((byte*)args.Ptr, args.Length); + for (int pos = 0; pos < ros.Length; ++pos) + { + ToCharsBuffer(ros[pos], chars, pos * 2, args.casing); + } + }); + } +#endif + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static char ToCharUpper(int value) + { + value &= 0xF; + value += '0'; + + if (value > '9') + { + value += ('A' - ('9' + 1)); + } + + return (char)value; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static char ToCharLower(int value) + { + value &= 0xF; + value += '0'; + + if (value > '9') + { + value += ('a' - ('9' + 1)); + } + + return (char)value; + } + } +} diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ArrayBuffer.cs b/src/libraries/Common/src/System/Net/ArrayBuffer.cs similarity index 96% rename from src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ArrayBuffer.cs rename to src/libraries/Common/src/System/Net/ArrayBuffer.cs index 52cd2f40b221f0..3ed340eb04e219 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ArrayBuffer.cs +++ b/src/libraries/Common/src/System/Net/ArrayBuffer.cs @@ -6,7 +6,7 @@ using System.Diagnostics; using System.Runtime.InteropServices; -namespace System.Net.Http +namespace System.Net { // Warning: Mutable struct! // The purpose of this struct is to simplify buffer management. @@ -56,6 +56,7 @@ public void Dispose() public int ActiveLength => _availableStart - _activeStart; public Span ActiveSpan => new Span(_bytes, _activeStart, _availableStart - _activeStart); + public ReadOnlySpan ActiveReadOnlySpan => new ReadOnlySpan(_bytes, _activeStart, _availableStart - _activeStart); public int AvailableLength => _bytes.Length - _availableStart; public Span AvailableSpan => new Span(_bytes, _availableStart, AvailableLength); public Memory ActiveMemory => new Memory(_bytes, _activeStart, _availableStart - _activeStart); diff --git a/src/libraries/Common/src/System/Net/CookieParser.cs b/src/libraries/Common/src/System/Net/CookieParser.cs index 8dcad72de01005..d602ffe58d67da 100644 --- a/src/libraries/Common/src/System/Net/CookieParser.cs +++ b/src/libraries/Common/src/System/Net/CookieParser.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Globalization; using System.Reflection; +using System.Runtime.InteropServices; namespace System.Net { @@ -39,7 +40,7 @@ internal enum CookieToken // // Used to split a single or multi-cookie (header) string into individual // tokens. - internal class CookieTokenizer + internal struct CookieTokenizer { private bool _eofCookie; private int _index; @@ -54,7 +55,7 @@ internal class CookieTokenizer private int _cookieStartIndex; private int _cookieLength; - internal CookieTokenizer(string tokenStream) + internal CookieTokenizer(string tokenStream) : this() { _length = tokenStream.Length; _tokenStream = tokenStream; @@ -506,14 +507,15 @@ internal CookieToken TokenFromName(bool parseResponseCookies) // CookieParser // // Takes a cookie header, makes cookies. - internal class CookieParser + internal struct CookieParser { - private readonly CookieTokenizer _tokenizer; + private CookieTokenizer _tokenizer; private Cookie _savedCookie; internal CookieParser(string cookieString) { _tokenizer = new CookieTokenizer(cookieString); + _savedCookie = null; } #if SYSTEM_NET_PRIMITIVES_DLL @@ -529,7 +531,7 @@ private static Func InternalSetNameMethod { if (s_internalSetNameMethod == null) { - // TODO https://github.com/dotnet/corefx/issues/13607: + // TODO https://github.com/dotnet/runtime/issues/19348: // We need to use Cookie.InternalSetName instead of the Cookie.set_Name wrapped in a try catch block, as // Cookie.set_Name keeps the original name if the string is empty or null. // Unfortunately this API is internal so we use reflection to access it. The method is cached for performance reasons. @@ -550,7 +552,7 @@ private static FieldInfo IsQuotedDomainField { if (s_isQuotedDomainField == null) { - // TODO https://github.com/dotnet/corefx/issues/13607: + // TODO https://github.com/dotnet/runtime/issues/19348: FieldInfo field = typeof(Cookie).GetField("IsQuotedDomain", BindingFlags.Instance | BindingFlags.NonPublic); Debug.Assert(field != null, "We need to use an internal field named IsQuotedDomain that is declared on Cookie."); s_isQuotedDomainField = field; @@ -567,7 +569,7 @@ private static FieldInfo IsQuotedVersionField { if (s_isQuotedVersionField == null) { - // TODO https://github.com/dotnet/corefx/issues/13607: + // TODO https://github.com/dotnet/runtime/issues/19348: FieldInfo field = typeof(Cookie).GetField("IsQuotedVersion", BindingFlags.Instance | BindingFlags.NonPublic); Debug.Assert(field != null, "We need to use an internal field named IsQuotedVersion that is declared on Cookie."); s_isQuotedVersionField = field; diff --git a/src/libraries/Common/src/System/Net/DebugSafeHandle.cs b/src/libraries/Common/src/System/Net/DebugSafeHandle.cs index ad41a64da514bb..8cbe492a886c25 100644 --- a/src/libraries/Common/src/System/Net/DebugSafeHandle.cs +++ b/src/libraries/Common/src/System/Net/DebugSafeHandle.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using Microsoft.Win32.SafeHandles; namespace System.Net @@ -13,7 +14,7 @@ namespace System.Net // internal abstract class DebugSafeHandle : SafeHandleZeroOrMinusOneIsInvalid { - private string _trace; + private string? _trace; protected DebugSafeHandle(bool ownsHandle) : base(ownsHandle) { diff --git a/src/libraries/Common/src/System/Net/Http/Http2/CopyToAspNetCore.cmd b/src/libraries/Common/src/System/Net/Http/Http2/CopyToAspNetCore.cmd deleted file mode 100644 index 17859299514d99..00000000000000 --- a/src/libraries/Common/src/System/Net/Http/Http2/CopyToAspNetCore.cmd +++ /dev/null @@ -1,14 +0,0 @@ -@ECHO OFF -SETLOCAL - -if not [%1] == [] (set remote_repo=%1) else (set remote_repo=%ASPNETCORE_REPO%) - -IF [%remote_repo%] == [] ( - echo The 'ASPNETCORE_REPO' environment variable or command line parameter is not set, aborting. - exit /b 1 -) - -echo ASPNETCORE_REPO: %remote_repo% - -robocopy . %remote_repo%\src\Shared\Http2 /MIR -robocopy .\..\..\..\..\..\tests\Tests\System\Net\Http2\ %remote_repo%\src\Shared\test\Shared.Tests\Http2 /MIR diff --git a/src/libraries/Common/src/System/Net/Http/Http2/CopyToAspNetCore.sh b/src/libraries/Common/src/System/Net/Http/Http2/CopyToAspNetCore.sh deleted file mode 100644 index f8d073366e2631..00000000000000 --- a/src/libraries/Common/src/System/Net/Http/Http2/CopyToAspNetCore.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -if [[ -n "$1" ]]; then - remote_repo="$1" -else - remote_repo="$ASPNETCORE_REPO" -fi - -if [[ -z "$remote_repo" ]]; then - echo The 'ASPNETCORE_REPO' environment variable or command line parameter is not set, aborting. - exit 1 -fi - -cd "$(dirname "$0")" || exit 1 - -echo "ASPNETCORE_REPO: $remote_repo" - -rsync -av --delete ./ "$remote_repo"/src/Shared/Http2 -rsync -av --delete ./../../../../../tests/Tests/System/Net/Http2/ "$remote_repo"/src/Shared/test/Shared.Tests/Http2 diff --git a/src/libraries/Common/src/System/Net/Http/Http2/CopyToRuntime.cmd b/src/libraries/Common/src/System/Net/Http/Http2/CopyToRuntime.cmd deleted file mode 100644 index 7497eadd522099..00000000000000 --- a/src/libraries/Common/src/System/Net/Http/Http2/CopyToRuntime.cmd +++ /dev/null @@ -1,14 +0,0 @@ -@ECHO OFF -SETLOCAL - -if not [%1] == [] (set remote_repo=%1) else (set remote_repo=%RUNTIME_REPO%) - -IF [%remote_repo%] == [] ( - echo The 'RUNTIME_REPO' environment variable or command line parameter is not set, aborting. - exit /b 1 -) - -echo RUNTIME_REPO: %remote_repo% - -robocopy . %remote_repo%\src\libraries\Common\src\System\Net\Http\Http2 /MIR -robocopy .\..\test\Shared.Tests\Http2 %remote_repo%\src\libraries\Common\tests\Tests\System\Net\Http2 /MIR diff --git a/src/libraries/Common/src/System/Net/Http/Http3/CopyToAspNetCore.cmd b/src/libraries/Common/src/System/Net/Http/Http3/CopyToAspNetCore.cmd deleted file mode 100644 index f94a7609fe7882..00000000000000 --- a/src/libraries/Common/src/System/Net/Http/Http3/CopyToAspNetCore.cmd +++ /dev/null @@ -1,14 +0,0 @@ -@ECHO OFF -SETLOCAL - -if not [%1] == [] (set remote_repo=%1) else (set remote_repo=%ASPNETCORE_REPO%) - -IF [%remote_repo%] == [] ( - echo The 'ASPNETCORE_REPO' environment variable or command line parameter is not set, aborting. - exit /b 1 -) - -echo ASPNETCORE_REPO: %remote_repo% - -robocopy . %remote_repo%\src\Shared\Http3 /MIR -robocopy .\..\..\..\..\..\tests\Tests\System\Net\Http3\ %remote_repo%\src\Shared\test\Shared.Tests\Http3 /MIR diff --git a/src/libraries/Common/src/System/Net/Http/Http3/CopyToRuntime.cmd b/src/libraries/Common/src/System/Net/Http/Http3/CopyToRuntime.cmd deleted file mode 100644 index b6edcf89e4d998..00000000000000 --- a/src/libraries/Common/src/System/Net/Http/Http3/CopyToRuntime.cmd +++ /dev/null @@ -1,14 +0,0 @@ -@ECHO OFF -SETLOCAL - -if not [%1] == [] (set remote_repo=%1) else (set remote_repo=%RUNTIME_REPO%) - -IF [%remote_repo%] == [] ( - echo The 'RUNTIME_REPO' environment variable or command line parameter is not set, aborting. - exit /b 1 -) - -echo RUNTIME_REPO: %remote_repo% - -robocopy . %remote_repo%\src\libraries\Common\src\System\Net\Http\Http3 /MIR -robocopy .\..\test\Shared.Tests\Http3 %remote_repo%\src\libraries\Common\tests\Tests\System\Net\Http3 /MIR diff --git a/src/libraries/Common/src/System/Net/Http/Http3/CopyToRuntime.sh b/src/libraries/Common/src/System/Net/Http/Http3/CopyToRuntime.sh deleted file mode 100644 index b562659da6e2ff..00000000000000 --- a/src/libraries/Common/src/System/Net/Http/Http3/CopyToRuntime.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -if [[ -n "$1" ]]; then - remote_repo="$1" -else - remote_repo="$RUNTIME_REPO" -fi - -if [[ -z "$remote_repo" ]]; then - echo The 'RUNTIME_REPO' environment variable or command line parameter is not set, aborting. - exit 1 -fi - -cd "$(dirname "$0")" || exit 1 - -echo "RUNTIME_REPO: $remote_repo" - -rsync -av --delete ./ "$remote_repo"/src/libraries/Common/src/System/Net/Http/Http3 -rsync -av --delete ./../test/Shared.Tests/Http3/ "$remote_repo"/src/libraries/Common/tests/Tests/System/Net/Http3 diff --git a/src/libraries/Common/src/System/Net/Http/Http3/ReadMe.SharedCode.md b/src/libraries/Common/src/System/Net/Http/Http3/ReadMe.SharedCode.md deleted file mode 100644 index bbb04284ad4420..00000000000000 --- a/src/libraries/Common/src/System/Net/Http/Http3/ReadMe.SharedCode.md +++ /dev/null @@ -1,36 +0,0 @@ -The code in this directory is shared between dotnet/runtime and aspnet/AspNetCore. This contains HTTP/3 protocol infrastructure such as a QPACK implementation. Any changes to this dir need to be checked into both repositories. - -dotnet/runtime code paths: -- runtime\src\libraries\Common\src\System\Net\Http\Http3 -- runtime\src\libraries\Common\tests\Tests\System\Net\Http3 -aspnet/AspNetCore code paths: -- AspNetCore\src\Shared\Http3 -- AspNetCore\src\Shared\test\Shared.Tests\Http3 - -## Copying code -To copy code from dotnet/runtime to aspnet/AspNetCore, set ASPNETCORE_REPO to the AspNetCore repo root and then run CopyToAspNetCore.cmd. -To copy code from aspnet/AspNetCore to dotnet/runtime, set RUNTIME_REPO to the runtime repo root and then run CopyToRuntime.cmd. - -## Building dotnet/runtime code: -- https://github.com/dotnet/runtime/blob/master/docs/libraries/building/windows-instructions.md -- https://github.com/dotnet/runtime/blob/master/docs/libraries/project-docs/developer-guide.md -- Run libraries.cmd from the root once: `PS D:\github\runtime> .\libraries.cmd` -- Build the individual projects: -- `PS D:\github\dotnet\src\libraries\Common\tests> dotnet msbuild /t:rebuild` -- `PS D:\github\dotnet\src\libraries\System.Net.Http\src> dotnet msbuild /t:rebuild` - -### Running dotnet/runtime tests: -- `PS D:\github\runtime\src\libraries\Common\tests> dotnet msbuild /t:rebuildandtest` -- `PS D:\github\runtime\src\libraries\System.Net.Http\tests\UnitTests> dotnet msbuild /t:rebuildandtest` - -## Building aspnet/AspNetCore code: -- https://github.com/aspnet/AspNetCore/blob/master/docs/BuildFromSource.md -- Run restore in the root once: `PS D:\github\AspNetCore> .\restore.cmd` -- Activate to use the repo local runtime: `PS D:\github\AspNetCore> . .\activate.ps1` -- Build the individual projects: -- `(AspNetCore) PS D:\github\AspNetCore\src\Shared\test\Shared.Tests> dotnet msbuild` -- `(AspNetCore) PS D:\github\AspNetCore\src\servers\Kestrel\core\src> dotnet msbuild` - -### Running aspnet/AspNetCore tests: -- `(AspNetCore) PS D:\github\AspNetCore\src\Shared\test\Shared.Tests> dotnet test` -- `(AspNetCore) PS D:\github\AspNetCore\src\servers\Kestrel\core\test> dotnet test` diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToAspNetCore.cmd b/src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToAspNetCore.cmd new file mode 100644 index 00000000000000..65a341b3cc2f17 --- /dev/null +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToAspNetCore.cmd @@ -0,0 +1,15 @@ +@ECHO OFF +SETLOCAL + +if not [%1] == [] (set remote_repo=%1) else (set remote_repo=%ASPNETCORE_REPO%) + +IF [%remote_repo%] == [] ( + echo The 'ASPNETCORE_REPO' environment variable or command line parameter is not set, aborting. + exit /b 1 +) + +echo ASPNETCORE_REPO: %remote_repo% + +REM https://superuser.com/questions/280425/getting-robocopy-to-return-a-proper-exit-code +(robocopy . %remote_repo%\src\Shared\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 +(robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 diff --git a/src/libraries/Common/src/System/Net/Http/Http3/CopyToAspNetCore.sh b/src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToAspNetCore.sh similarity index 64% rename from src/libraries/Common/src/System/Net/Http/Http3/CopyToAspNetCore.sh rename to src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToAspNetCore.sh index 053a620a5e5bb0..28d1cb9083e65a 100644 --- a/src/libraries/Common/src/System/Net/Http/Http3/CopyToAspNetCore.sh +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToAspNetCore.sh @@ -15,5 +15,5 @@ cd "$(dirname "$0")" || exit 1 echo "ASPNETCORE_REPO: $remote_repo" -rsync -av --delete ./ "$remote_repo"/src/Shared/Http3 -rsync -av --delete ./../../../../../tests/Tests/System/Net/Http3/ "$remote_repo"/src/Shared/test/Shared.Tests/Http3 +rsync -av --delete ./ "$remote_repo"/src/Shared/runtime +rsync -av --delete ./../../../../../tests/Tests/System/Net/aspnetcore/ "$remote_repo"/src/Shared/test/Shared.Tests/runtime diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToRuntime.cmd b/src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToRuntime.cmd new file mode 100644 index 00000000000000..f1cb32df8501cb --- /dev/null +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToRuntime.cmd @@ -0,0 +1,15 @@ +@ECHO OFF +SETLOCAL + +if not [%1] == [] (set remote_repo=%1) else (set remote_repo=%RUNTIME_REPO%) + +IF [%remote_repo%] == [] ( + echo The 'RUNTIME_REPO' environment variable or command line parameter is not set, aborting. + exit /b 1 +) + +echo RUNTIME_REPO: %remote_repo% + +REM https://superuser.com/questions/280425/getting-robocopy-to-return-a-proper-exit-code +(robocopy . %remote_repo%\src\libraries\Common\src\System\Net\Http\aspnetcore /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 +(robocopy .\..\test\Shared.Tests\runtime %remote_repo%\src\libraries\Common\tests\Tests\System\Net\aspnetcore /MIR) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 diff --git a/src/libraries/Common/src/System/Net/Http/Http2/CopyToRuntime.sh b/src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToRuntime.sh similarity index 72% rename from src/libraries/Common/src/System/Net/Http/Http2/CopyToRuntime.sh rename to src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToRuntime.sh index baf10f3b8616c4..d0f44f411e6adf 100644 --- a/src/libraries/Common/src/System/Net/Http/Http2/CopyToRuntime.sh +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/CopyToRuntime.sh @@ -15,5 +15,5 @@ cd "$(dirname "$0")" || exit 1 echo "RUNTIME_REPO: $remote_repo" -rsync -av --delete ./ "$remote_repo"/src/libraries/Common/src/System/Net/Http/Http2 -rsync -av --delete ./../test/Shared.Tests/Http2/ "$remote_repo"/src/libraries/Common/tests/Tests/System/Net/Http2 +rsync -av --delete ./ "$remote_repo"/src/libraries/Common/src/System/Net/Http/aspnetcore +rsync -av --delete ./../test/Shared.Tests/runtime/ "$remote_repo"/src/libraries/Common/tests/Tests/System/Net/aspnetcore diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/DynamicTable.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/DynamicTable.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/DynamicTable.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/DynamicTable.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/H2StaticTable.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/H2StaticTable.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/H2StaticTable.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/H2StaticTable.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/HPackDecoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecoder.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/HPackDecoder.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecoder.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/HPackDecodingException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecodingException.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/HPackDecodingException.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecodingException.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/HPackEncoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncoder.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/HPackEncoder.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncoder.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/HPackEncodingException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncodingException.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/HPackEncodingException.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncodingException.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/HeaderField.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HeaderField.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/HeaderField.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HeaderField.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/Huffman.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/Huffman.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/Huffman.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/Huffman.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/HuffmanDecodingException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HuffmanDecodingException.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/HuffmanDecodingException.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HuffmanDecodingException.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/IntegerDecoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/IntegerDecoder.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/IntegerDecoder.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/IntegerDecoder.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/IntegerEncoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/IntegerEncoder.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/IntegerEncoder.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/IntegerEncoder.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/Hpack/StatusCodes.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/StatusCodes.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/Hpack/StatusCodes.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/StatusCodes.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http3/Frames/Http3ErrorCode.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Frames/Http3ErrorCode.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http3/Frames/Http3ErrorCode.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Frames/Http3ErrorCode.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http3/Frames/Http3Frame.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Frames/Http3Frame.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http3/Frames/Http3Frame.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Frames/Http3Frame.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http3/Frames/Http3FrameType.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Frames/Http3FrameType.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http3/Frames/Http3FrameType.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Frames/Http3FrameType.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http3/Helpers/VariableLengthIntegerHelper.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Helpers/VariableLengthIntegerHelper.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http3/Helpers/VariableLengthIntegerHelper.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Helpers/VariableLengthIntegerHelper.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http3/Http3SettingType.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Http3SettingType.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http3/Http3SettingType.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Http3SettingType.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http3/Http3StreamType.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Http3StreamType.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http3/Http3StreamType.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Http3StreamType.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http3/QPack/H3StaticTable.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/H3StaticTable.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http3/QPack/H3StaticTable.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/H3StaticTable.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http3/QPack/HeaderField.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/HeaderField.cs similarity index 85% rename from src/libraries/Common/src/System/Net/Http/Http3/QPack/HeaderField.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/HeaderField.cs index 5f9e34a85d556e..12594381bd1899 100644 --- a/src/libraries/Common/src/System/Net/Http/Http3/QPack/HeaderField.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/HeaderField.cs @@ -8,8 +8,8 @@ internal readonly struct HeaderField { public HeaderField(byte[] name, byte[] value) { - Name = new byte[name.Length]; - Value = new byte[value.Length]; + Name = name; + Value = value; } public byte[] Name { get; } diff --git a/src/libraries/Common/src/System/Net/Http/Http3/QPack/QPackDecoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs similarity index 96% rename from src/libraries/Common/src/System/Net/Http/Http3/QPack/QPackDecoder.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs index e8c40064ba2a38..958dfac303e8dc 100644 --- a/src/libraries/Common/src/System/Net/Http/Http3/QPack/QPackDecoder.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs @@ -7,6 +7,10 @@ using System.Net.Http.HPack; using System.Numerics; +#if KESTREL +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +#endif + namespace System.Net.Http.QPack { internal class QPackDecoder : IDisposable @@ -220,7 +224,7 @@ private void OnByte(byte b, IHttpHeadersHandler handler) } break; case State.CompressedHeaders: - switch (BitOperations.LeadingZeroCount(b)) + switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s. { case 0: // Indexed Header Field prefixInt = IndexedHeaderFieldPrefixMask & b; @@ -265,6 +269,10 @@ private void OnByte(byte b, IHttpHeadersHandler handler) if (_integerDecoder.BeginTryDecode((byte)prefixInt, LiteralHeaderFieldWithoutNameReferencePrefix, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, State.HeaderName); } else @@ -299,6 +307,10 @@ private void OnByte(byte b, IHttpHeadersHandler handler) case State.HeaderNameLength: if (_integerDecoder.TryDecode(b, out intResult)) { + if (intResult == 0) + { + throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, "")); + } OnStringLength(intResult, nextState: State.HeaderName); } break; @@ -402,6 +414,8 @@ private void ProcessHeaderValue(IHttpHeadersHandler handler) { Debug.Assert(index >= 0 && index <= H3StaticTable.Instance.Count, $"The index should be a valid static index here. {nameof(QPackDecoder)} should have previously thrown if it read a dynamic index."); handler.OnStaticIndexedHeader(index, headerValueSpan); + _index = null; + return; } else diff --git a/src/libraries/Common/src/System/Net/Http/Http3/QPack/QPackDecodingException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecodingException.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http3/QPack/QPackDecodingException.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecodingException.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http3/QPack/QPackEncoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncoder.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http3/QPack/QPackEncoder.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncoder.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http3/QPack/QPackEncodingException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncodingException.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http3/QPack/QPackEncodingException.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncodingException.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/IHttpHeadersHandler.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/IHttpHeadersHandler.cs similarity index 86% rename from src/libraries/Common/src/System/Net/Http/Http2/IHttpHeadersHandler.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/IHttpHeadersHandler.cs index 311afa8c395042..11a7e3473e23e6 100644 --- a/src/libraries/Common/src/System/Net/Http/Http2/IHttpHeadersHandler.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/IHttpHeadersHandler.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +// Don't ever change this unless we are explicitly trying to remove IHttpHeadersHandler as public API. #if KESTREL using System; diff --git a/src/libraries/Common/src/System/Net/Http/Http2/ReadMe.SharedCode.md b/src/libraries/Common/src/System/Net/Http/aspnetcore/ReadMe.SharedCode.md similarity index 62% rename from src/libraries/Common/src/System/Net/Http/Http2/ReadMe.SharedCode.md rename to src/libraries/Common/src/System/Net/Http/aspnetcore/ReadMe.SharedCode.md index 20e88283f4186a..b9f480361725af 100644 --- a/src/libraries/Common/src/System/Net/Http/Http2/ReadMe.SharedCode.md +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/ReadMe.SharedCode.md @@ -1,20 +1,20 @@ -The code in this directory is shared between dotnet/runtime and aspnet/AspNetCore. This contains HTTP/2 protocol infrastructure such as an HPACK implementation. Any changes to this dir need to be checked into both repositories. +The code in this directory is shared between dotnet/runtime and dotnet/AspNetCore. This contains HTTP/2 and HTTP/3 protocol infrastructure such as an HPACK implementation. Any changes to this dir need to be checked into both repositories. dotnet/runtime code paths: -- runtime\src\libraries\Common\src\System\Net\Http\Http2 -- runtime\src\libraries\Common\tests\Tests\System\Net\Http2 +- runtime\src\libraries\Common\src\System\Net\Http\aspnetcore +- runtime\src\libraries\Common\tests\Tests\System\Net\aspnetcore -aspnet/AspNetCore code paths: -- AspNetCore\src\Shared\Http2 -- AspNetCore\src\Shared\test\Shared.Tests\Http2 +dotnet/AspNetCore code paths: +- AspNetCore\src\Shared\runtime +- AspNetCore\src\Shared\test\Shared.Tests\runtime ## Copying code -- To copy code from dotnet/runtime to aspnet/AspNetCore, set ASPNETCORE_REPO to the AspNetCore repo root and then run CopyToAspNetCore.cmd. -- To copy code from aspnet/AspNetCore to dotnet/runtime, set RUNTIME_REPO to the runtime repo root and then run CopyToRuntime.cmd. +- To copy code from dotnet/runtime to dotnet/AspNetCore, set ASPNETCORE_REPO to the AspNetCore repo root and then run CopyToAspNetCore.cmd. +- To copy code from dotnet/AspNetCore to dotnet/runtime, set RUNTIME_REPO to the runtime repo root and then run CopyToRuntime.cmd. ## Building dotnet/runtime code: - https://github.com/dotnet/runtime/tree/master/docs/workflow -- Run libraries.cmd from the root once: `PS D:\github\runtime> .\libraries.cmd` +- Run *build.cmd* from the root once: `PS D:\github\runtime> .\build.cmd -subsetCategory libraries` - Build the individual projects: - `PS D:\github\dotnet\src\libraries\Common\tests> dotnet msbuild /t:rebuild` - `PS D:\github\dotnet\src\libraries\System.Net.Http\src> dotnet msbuild /t:rebuild` @@ -23,14 +23,14 @@ aspnet/AspNetCore code paths: - `PS D:\github\runtime\src\libraries\Common\tests> dotnet msbuild /t:rebuildandtest` - `PS D:\github\runtime\src\libraries\System.Net.Http\tests\UnitTests> dotnet msbuild /t:rebuildandtest` -## Building aspnet/AspNetCore code: -- https://github.com/aspnet/AspNetCore/blob/master/docs/BuildFromSource.md +## Building dotnet/AspNetCore code: +- https://github.com/dotnet/AspNetCore/blob/master/docs/BuildFromSource.md - Run restore in the root once: `PS D:\github\AspNetCore> .\restore.cmd` - Activate to use the repo local runtime: `PS D:\github\AspNetCore> . .\activate.ps1` - Build the individual projects: - `(AspNetCore) PS D:\github\AspNetCore\src\Shared\test\Shared.Tests> dotnet msbuild` - `(AspNetCore) PS D:\github\AspNetCore\src\servers\Kestrel\core\src> dotnet msbuild` -### Running aspnet/AspNetCore tests: +### Running dotnet/AspNetCore tests: - `(AspNetCore) PS D:\github\AspNetCore\src\Shared\test\Shared.Tests> dotnet test` - `(AspNetCore) PS D:\github\AspNetCore\src\servers\Kestrel\core\test> dotnet test` diff --git a/src/libraries/Common/src/System/Net/Http/Http2/SR.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.cs similarity index 100% rename from src/libraries/Common/src/System/Net/Http/Http2/SR.cs rename to src/libraries/Common/src/System/Net/Http/aspnetcore/SR.cs diff --git a/src/libraries/Common/src/System/Net/Http/Http2/SR.resx b/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.resx similarity index 98% rename from src/libraries/Common/src/System/Net/Http/Http2/SR.resx rename to src/libraries/Common/src/System/Net/Http/aspnetcore/SR.resx index 9e785e371f3225..bcd721a2c5f824 100644 --- a/src/libraries/Common/src/System/Net/Http/Http2/SR.resx +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.resx @@ -150,6 +150,9 @@ Received an invalid header name: '{0}'. + + No dynamic table support + Request headers must contain only ASCII characters. diff --git a/src/libraries/Common/src/System/Net/InternalException.cs b/src/libraries/Common/src/System/Net/InternalException.cs index 271bb47a1afdb3..676da377c9a7f1 100644 --- a/src/libraries/Common/src/System/Net/InternalException.cs +++ b/src/libraries/Common/src/System/Net/InternalException.cs @@ -2,11 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable namespace System.Net { internal sealed class InternalException : Exception { - private readonly object _unexpectedValue; + private readonly object? _unexpectedValue; internal InternalException() { diff --git a/src/libraries/Common/src/System/Net/Internals/IPEndPointExtensions.cs b/src/libraries/Common/src/System/Net/Internals/IPEndPointExtensions.cs index 72a2d4ecac5f75..4c095f7b3559a4 100644 --- a/src/libraries/Common/src/System/Net/Internals/IPEndPointExtensions.cs +++ b/src/libraries/Common/src/System/Net/Internals/IPEndPointExtensions.cs @@ -44,11 +44,6 @@ public static EndPoint Create(this EndPoint thisObj, Internals.SocketAddress soc return thisObj.Create(address); } - internal static IPEndPoint Snapshot(this IPEndPoint thisObj) - { - return new IPEndPoint(thisObj.Address.Snapshot(), thisObj.Port); - } - private static Internals.SocketAddress GetInternalSocketAddress(System.Net.SocketAddress address) { var result = new Internals.SocketAddress(address.Family, address.Size); diff --git a/src/libraries/Common/src/System/Net/Internals/SocketExceptionFactory.cs b/src/libraries/Common/src/System/Net/Internals/SocketExceptionFactory.cs index 3f2396b52f450a..217ff1a49dd8e3 100644 --- a/src/libraries/Common/src/System/Net/Internals/SocketExceptionFactory.cs +++ b/src/libraries/Common/src/System/Net/Internals/SocketExceptionFactory.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Net.Sockets; namespace System.Net.Internals @@ -10,7 +11,7 @@ internal static partial class SocketExceptionFactory { private sealed class ExtendedSocketException : SocketException { - private readonly EndPoint _endPoint; + private readonly EndPoint? _endPoint; public ExtendedSocketException(int errorCode, EndPoint endPoint) : base(errorCode) diff --git a/src/libraries/Common/src/System/Net/Logging/DebugThreadTracking.cs b/src/libraries/Common/src/System/Net/Logging/DebugThreadTracking.cs index c2b3e03474ef3f..eba97da8e3b20e 100644 --- a/src/libraries/Common/src/System/Net/Logging/DebugThreadTracking.cs +++ b/src/libraries/Common/src/System/Net/Logging/DebugThreadTracking.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Collections.Generic; namespace System.Net @@ -9,13 +10,13 @@ namespace System.Net internal static class DebugThreadTracking { [ThreadStatic] - private static Stack t_threadKindStack; + private static Stack? t_threadKindStack; private static Stack ThreadKindStack => t_threadKindStack ?? (t_threadKindStack = new Stack()); internal static ThreadKinds CurrentThreadKind => ThreadKindStack.Count > 0 ? ThreadKindStack.Peek() : ThreadKinds.Other; - internal static IDisposable SetThreadKind(ThreadKinds kind) + internal static IDisposable? SetThreadKind(ThreadKinds kind) { if ((kind & ThreadKinds.SourceMask) != ThreadKinds.Unknown) { diff --git a/src/libraries/Common/src/System/Net/Logging/NetEventSource.Common.cs b/src/libraries/Common/src/System/Net/Logging/NetEventSource.Common.cs index 191cdb834df641..46cd2ee685c8f0 100644 --- a/src/libraries/Common/src/System/Net/Logging/NetEventSource.Common.cs +++ b/src/libraries/Common/src/System/Net/Logging/NetEventSource.Common.cs @@ -100,7 +100,7 @@ public class Keywords /// A description of the entrance, including any arguments to the call. /// The calling member. [NonEvent] - public static void Enter(object thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null) + public static void Enter(object? thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(formattableString); @@ -112,7 +112,7 @@ public static void Enter(object thisOrContextObject, FormattableString? formatta /// The object to log. /// The calling member. [NonEvent] - public static void Enter(object thisOrContextObject, object arg0, [CallerMemberName] string? memberName = null) + public static void Enter(object? thisOrContextObject, object arg0, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(arg0); @@ -125,7 +125,7 @@ public static void Enter(object thisOrContextObject, object arg0, [CallerMemberN /// The second object to log. /// The calling member. [NonEvent] - public static void Enter(object thisOrContextObject, object arg0, object arg1, [CallerMemberName] string? memberName = null) + public static void Enter(object? thisOrContextObject, object arg0, object arg1, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(arg0); @@ -140,7 +140,7 @@ public static void Enter(object thisOrContextObject, object arg0, object arg1, [ /// The third object to log. /// The calling member. [NonEvent] - public static void Enter(object thisOrContextObject, object arg0, object arg1, object arg2, [CallerMemberName] string? memberName = null) + public static void Enter(object? thisOrContextObject, object arg0, object arg1, object arg2, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(arg0); @@ -160,7 +160,7 @@ private void Enter(string thisOrContextObject, string? memberName, string parame /// A description of the exit operation, including any return values. /// The calling member. [NonEvent] - public static void Exit(object thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null) + public static void Exit(object? thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(formattableString); @@ -172,7 +172,7 @@ public static void Exit(object thisOrContextObject, FormattableString? formattab /// A return value from the member. /// The calling member. [NonEvent] - public static void Exit(object thisOrContextObject, object arg0, [CallerMemberName] string? memberName = null) + public static void Exit(object? thisOrContextObject, object arg0, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(arg0); @@ -185,7 +185,7 @@ public static void Exit(object thisOrContextObject, object arg0, [CallerMemberNa /// A second return value from the member. /// The calling member. [NonEvent] - public static void Exit(object thisOrContextObject, object arg0, object arg1, [CallerMemberName] string? memberName = null) + public static void Exit(object? thisOrContextObject, object arg0, object arg1, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(arg0); @@ -204,7 +204,7 @@ private void Exit(string thisOrContextObject, string? memberName, string? result /// The message to be logged. /// The calling member. [NonEvent] - public static void Info(object thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null) + public static void Info(object? thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(formattableString); @@ -216,7 +216,7 @@ public static void Info(object thisOrContextObject, FormattableString? formattab /// The message to be logged. /// The calling member. [NonEvent] - public static void Info(object thisOrContextObject, object message, [CallerMemberName] string? memberName = null) + public static void Info(object? thisOrContextObject, object? message, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(message); @@ -234,7 +234,7 @@ private void Info(string thisOrContextObject, string? memberName, string? messag /// The message to be logged. /// The calling member. [NonEvent] - public static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string? memberName = null) + public static void Error(object? thisOrContextObject, FormattableString formattableString, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(formattableString); @@ -246,7 +246,7 @@ public static void Error(object thisOrContextObject, FormattableString formattab /// The message to be logged. /// The calling member. [NonEvent] - public static void Error(object thisOrContextObject, object message, [CallerMemberName] string? memberName = null) + public static void Error(object? thisOrContextObject, object message, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(message); @@ -264,7 +264,7 @@ private void ErrorMessage(string thisOrContextObject, string? memberName, string /// The message to be logged. /// The calling member. [NonEvent] - public static void Fail(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string? memberName = null) + public static void Fail(object? thisOrContextObject, FormattableString formattableString, [CallerMemberName] string? memberName = null) { // Don't call DebugValidateArg on args, as we expect Fail to be used in assert/failure situations // that should never happen in production, and thus we don't care about extra costs. @@ -278,7 +278,7 @@ public static void Fail(object thisOrContextObject, FormattableString formattabl /// The message to be logged. /// The calling member. [NonEvent] - public static void Fail(object thisOrContextObject, object message, [CallerMemberName] string? memberName = null) + public static void Fail(object? thisOrContextObject, object message, [CallerMemberName] string? memberName = null) { // Don't call DebugValidateArg on args, as we expect Fail to be used in assert/failure situations // that should never happen in production, and thus we don't care about extra costs. @@ -298,7 +298,7 @@ private void CriticalFailure(string thisOrContextObject, string? memberName, str /// The buffer to be logged. /// The calling member. [NonEvent] - public static void DumpBuffer(object thisOrContextObject, byte[] buffer, [CallerMemberName] string? memberName = null) + public static void DumpBuffer(object? thisOrContextObject, byte[] buffer, [CallerMemberName] string? memberName = null) { DumpBuffer(thisOrContextObject, buffer, 0, buffer.Length, memberName); } @@ -310,7 +310,7 @@ public static void DumpBuffer(object thisOrContextObject, byte[] buffer, [Caller /// The number of bytes to log. /// The calling member. [NonEvent] - public static void DumpBuffer(object thisOrContextObject, byte[] buffer, int offset, int count, [CallerMemberName] string? memberName = null) + public static void DumpBuffer(object? thisOrContextObject, byte[] buffer, int offset, int count, [CallerMemberName] string? memberName = null) { if (IsEnabled) { @@ -339,7 +339,7 @@ public static void DumpBuffer(object thisOrContextObject, byte[] buffer, int off /// The number of bytes to log. /// The calling member. [NonEvent] - public static unsafe void DumpBuffer(object thisOrContextObject, IntPtr bufferPtr, int count, [CallerMemberName] string? memberName = null) + public static unsafe void DumpBuffer(object? thisOrContextObject, IntPtr bufferPtr, int count, [CallerMemberName] string? memberName = null) { Debug.Assert(bufferPtr != IntPtr.Zero); Debug.Assert(count >= 0); @@ -379,7 +379,7 @@ public static void Associate(object first, object second, [CallerMemberName] str /// The second object. /// The calling member. [NonEvent] - public static void Associate(object thisOrContextObject, object first, object second, [CallerMemberName] string? memberName = null) + public static void Associate(object? thisOrContextObject, object first, object second, [CallerMemberName] string? memberName = null) { DebugValidateArg(thisOrContextObject); DebugValidateArg(first); @@ -395,7 +395,7 @@ private void Associate(string thisOrContextObject, string? memberName, string fi #region Helpers [Conditional("DEBUG_NETEVENTSOURCE_MISUSE")] - private static void DebugValidateArg(object arg) + private static void DebugValidateArg(object? arg) { if (!IsEnabled) { @@ -414,7 +414,7 @@ private static void DebugValidateArg(FormattableString? arg) Log.IsEnabled(); [NonEvent] - public static string IdOf(object value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; + public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; [NonEvent] public static int GetHashCode(object value) => value?.GetHashCode() ?? 0; @@ -498,7 +498,7 @@ private static string Format(FormattableString s) #region Custom WriteEvent overloads [NonEvent] - private unsafe void WriteEvent(int eventId, string arg1, string arg2, string arg3, string arg4) + private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3, string? arg4) { if (IsEnabled()) { @@ -542,7 +542,7 @@ private unsafe void WriteEvent(int eventId, string arg1, string arg2, string arg } [NonEvent] - private unsafe void WriteEvent(int eventId, string arg1, string arg2, byte[] arg3) + private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, byte[]? arg3) { if (IsEnabled()) { @@ -585,7 +585,7 @@ private unsafe void WriteEvent(int eventId, string arg1, string arg2, byte[] arg } [NonEvent] - private unsafe void WriteEvent(int eventId, string arg1, int arg2, int arg3, int arg4) + private unsafe void WriteEvent(int eventId, string? arg1, int arg2, int arg3, int arg4) { if (IsEnabled()) { @@ -623,7 +623,7 @@ private unsafe void WriteEvent(int eventId, string arg1, int arg2, int arg3, int } [NonEvent] - private unsafe void WriteEvent(int eventId, string arg1, int arg2, string arg3) + private unsafe void WriteEvent(int eventId, string? arg1, int arg2, string? arg3) { if (IsEnabled()) { @@ -658,7 +658,7 @@ private unsafe void WriteEvent(int eventId, string arg1, int arg2, string arg3) } [NonEvent] - private unsafe void WriteEvent(int eventId, string arg1, string arg2, int arg3) + private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, int arg3) { if (IsEnabled()) { @@ -693,7 +693,7 @@ private unsafe void WriteEvent(int eventId, string arg1, string arg2, int arg3) } [NonEvent] - private unsafe void WriteEvent(int eventId, string arg1, string arg2, string arg3, int arg4) + private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3, int arg4) { if (IsEnabled()) { diff --git a/src/libraries/Common/src/System/Net/Mail/DomainLiteralReader.cs b/src/libraries/Common/src/System/Net/Mail/DomainLiteralReader.cs index 51f0caab99828d..edd014b05a3ade 100644 --- a/src/libraries/Common/src/System/Net/Mail/DomainLiteralReader.cs +++ b/src/libraries/Common/src/System/Net/Mail/DomainLiteralReader.cs @@ -25,11 +25,11 @@ internal static class DomainLiteralReader // - The next index past the terminating bracket (data[index + 1] == StartSquareBracket). // e.g. In (user@[domain]), starting at index=12 (]) returns index=4 (@). // - // A FormatException will be thrown if: + // A FormatException will be thrown or false is returned if: // - A non-escaped character is encountered that is not valid in a domain literal, including Unicode. // - The final bracket is not found. // - internal static int ReadReverse(string data, int index) + internal static bool TryReadReverse(string data, int index, out int outIndex, bool throwExceptionIfFail) { Debug.Assert(0 <= index && index < data.Length, "index was outside the bounds of the string: " + index); Debug.Assert(data[index] == MailBnfHelper.EndSquareBracket, "data did not end with a square bracket"); @@ -40,28 +40,48 @@ internal static int ReadReverse(string data, int index) do { // Check for valid whitespace - index = WhitespaceReader.ReadFwsReverse(data, index); + if (!WhitespaceReader.TryReadFwsReverse(data, index, out index, throwExceptionIfFail)) + { + outIndex = default; + return false; + } + if (index < 0) { break; } + // Check for escaped characters - int quotedCharCount = QuotedPairReader.CountQuotedChars(data, index, false); + if (!QuotedPairReader.TryCountQuotedChars(data, index, false, out int quotedCharCount, throwExceptionIfFail)) + { + outIndex = default; + return false; + } + if (quotedCharCount > 0) { // Skip quoted pairs - index = index - quotedCharCount; + index -= quotedCharCount; } // Check for the terminating bracket else if (data[index] == MailBnfHelper.StartSquareBracket) { // We're done parsing - return index - 1; + outIndex = index - 1; + return true; } // Check for invalid characters else if (data[index] > MailBnfHelper.Ascii7bitMaxValue || !MailBnfHelper.Dtext[data[index]]) { - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + if (throwExceptionIfFail) + { + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + } + else + { + outIndex = default; + return false; + } } // Valid char else @@ -71,9 +91,17 @@ internal static int ReadReverse(string data, int index) } while (index >= 0); - // We didn't find a matching '[', throw. - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, - MailBnfHelper.EndSquareBracket)); + if (throwExceptionIfFail) + { + // We didn't find a matching '[', throw. + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, + MailBnfHelper.EndSquareBracket)); + } + else + { + outIndex = default; + return false; + } } } } diff --git a/src/libraries/Common/src/System/Net/Mail/DotAtomReader.cs b/src/libraries/Common/src/System/Net/Mail/DotAtomReader.cs index 8af13fc01e4d6d..ac0962568d25f0 100644 --- a/src/libraries/Common/src/System/Net/Mail/DotAtomReader.cs +++ b/src/libraries/Common/src/System/Net/Mail/DotAtomReader.cs @@ -29,17 +29,18 @@ internal static class DotAtomReader // - -1 if the dot-atom section terminated at the start of the data string. // e.g. "user.name@domain.com", starting at index 8 (e) returns -1. // - // A FormatException will be thrown if: + // Throws FormatException or returns false if: // - The initial character at data[index] is invalid in a dot-atom. // e.g. "a@b.com", starting at index 1 (@). // - The leading character is a dot. // e.g. "a@.b.com", starting at index 7 (m), throws because the leading char (index 2) is a dot. // - internal static int ReadReverse(string data, int index) + internal static bool TryReadReverse(string data, int index, out int outIndex, bool throwExceptionIfFail) { Debug.Assert(0 <= index && index < data.Length, "index was outside the bounds of the string: " + index); int startIndex = index; + // Scan for the first invalid chars (including whitespace) for (; 0 <= index; index--) { @@ -53,14 +54,32 @@ internal static int ReadReverse(string data, int index) // Check for empty/invalid dot-atom if (startIndex == index) { - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + if (throwExceptionIfFail) + { + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + } + else + { + outIndex = default; + return false; + } } // Check for leading dot else if (data[index + 1] == MailBnfHelper.Dot) { - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, MailBnfHelper.Dot)); + if (throwExceptionIfFail) + { + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, MailBnfHelper.Dot)); + } + else + { + outIndex = default; + return false; + } } - return index; + + outIndex = index; + return true; } } } diff --git a/src/libraries/Common/src/System/Net/Mail/MailAddress.cs b/src/libraries/Common/src/System/Net/Mail/MailAddress.cs index 560701d5528ff9..6c61c58b4f3a34 100644 --- a/src/libraries/Common/src/System/Net/Mail/MailAddress.cs +++ b/src/libraries/Common/src/System/Net/Mail/MailAddress.cs @@ -2,16 +2,18 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Text; + namespace System.Net.Mail { internal class MailAddress { public MailAddress(string address) { - MailAddressParser.ParseAddress(address); + MailAddressParser.TryParseAddress(address, out ParseAddressInfo _, throwExceptionIfFail: true); } - internal MailAddress(string displayName, string localPart, string domain) + internal MailAddress(string displayName, string localPart, string domain, Encoding displayNameEncoding) { } } diff --git a/src/libraries/Common/src/System/Net/Mail/MailAddressParser.cs b/src/libraries/Common/src/System/Net/Mail/MailAddressParser.cs index 51bfbc0d975279..6b1e8e5bb36c64 100644 --- a/src/libraries/Common/src/System/Net/Mail/MailAddressParser.cs +++ b/src/libraries/Common/src/System/Net/Mail/MailAddressParser.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Collections.Generic; using System.Diagnostics; using System.Net.Mime; -using System.Collections.Generic; namespace System.Net.Mail { @@ -22,18 +22,18 @@ internal static class MailAddressParser { // Parse a single MailAddress from the given string. // - // Throws a FormatException if any part of the MailAddress is invalid. - internal static MailAddress ParseAddress(string data) + // Throws a FormatException or returns false if any part of the MailAddress is invalid. + internal static bool TryParseAddress(string data, out ParseAddressInfo parsedAddress, bool throwExceptionIfFail) { int index = data.Length - 1; - MailAddress parsedAddress = MailAddressParser.ParseAddress(data, false, ref index); - Debug.Assert(index == -1, "The index indicates that part of the address was not parsed: " + index); - return parsedAddress; + bool parseSuccess = TryParseAddress(data, false, ref index, out parsedAddress, throwExceptionIfFail); + Debug.Assert(!parseSuccess || index == -1, "The index indicates that part of the address was not parsed: " + index); + return parseSuccess; } // Parse a comma separated list of MailAddress's // - // Throws a FormatException if any MailAddress is invalid. + // Throws a FormatException or false is returned if any MailAddress is invalid. internal static List ParseMultipleAddresses(string data) { List results = new List(); @@ -41,7 +41,8 @@ internal static List ParseMultipleAddresses(string data) while (index >= 0) { // Because we're parsing in reverse, we must make an effort to preserve the order of the addresses. - results.Insert(0, MailAddressParser.ParseAddress(data, true, ref index)); + TryParseAddress(data, true, ref index, out ParseAddressInfo parsedAddress, throwExceptionIfFail: true); + results.Insert(0, new MailAddress(parsedAddress.DisplayName, parsedAddress.User, parsedAddress.Host, null)); Debug.Assert(index == -1 || data[index] == MailBnfHelper.Comma, "separator not found while parsing multiple addresses"); index--; @@ -61,19 +62,21 @@ internal static List ParseMultipleAddresses(string data) // - For a single MailAddress index is set to -1 // - For a list data[index] is the comma separator or -1 if the end of the data string was reached. // - // Throws a FormatException if any part of the MailAddress is invalid. - private static MailAddress ParseAddress(string data, bool expectMultipleAddresses, ref int index) + // Throws a FormatException or false is returned if any part of the MailAddress is invalid. + private static bool TryParseAddress(string data, bool expectMultipleAddresses, ref int index, out ParseAddressInfo parseAddressInfo, bool throwExceptionIfFail) { Debug.Assert(!string.IsNullOrEmpty(data)); Debug.Assert(index >= 0 && index < data.Length, "Index out of range: " + index + ", " + data.Length); // Parsed components to be assembled as a MailAddress later - string domain = null; - string localPart = null; - string displayName = null; + string displayName; // Skip comments and whitespace - index = ReadCfwsAndThrowIfIncomplete(data, index); + if (!TryReadCfwsAndThrowIfIncomplete(data, index, out index, throwExceptionIfFail)) + { + parseAddressInfo = default; + return false; + } // Do we expect angle brackets around the address? // e.g. ("display name" ) @@ -84,18 +87,34 @@ private static MailAddress ParseAddress(string data, bool expectMultipleAddresse index--; } - domain = ParseDomain(data, ref index); + if (!TryParseDomain(data, ref index, out string domain, throwExceptionIfFail)) + { + parseAddressInfo = default; + return false; + } // The next character after the domain must be the '@' symbol if (data[index] != MailBnfHelper.At) { - throw new FormatException(SR.MailAddressInvalidFormat); + if (throwExceptionIfFail) + { + throw new FormatException(SR.MailAddressInvalidFormat); + } + else + { + parseAddressInfo = default; + return false; + } } // Skip the '@' symbol index--; - localPart = ParseLocalPart(data, ref index, expectAngleBracket, expectMultipleAddresses); + if (!TryParseLocalPart(data, ref index, expectAngleBracket, expectMultipleAddresses, out string localPart, throwExceptionIfFail)) + { + parseAddressInfo = default; + return false; + } // Check for a matching angle bracket around the address if (expectAngleBracket) @@ -104,13 +123,25 @@ private static MailAddress ParseAddress(string data, bool expectMultipleAddresse { index--; // Skip the angle bracket // Skip whitespace, but leave comments, as they may be part of the display name. - index = WhitespaceReader.ReadFwsReverse(data, index); + if (!WhitespaceReader.TryReadFwsReverse(data, index, out index, throwExceptionIfFail)) + { + parseAddressInfo = default; + return false; + } } else { - // Mismatched angle brackets, throw - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, - (index >= 0 ? data[index] : MailBnfHelper.EndAngleBracket))); + // Mismatched angle brackets + if (throwExceptionIfFail) + { + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, + (index >= 0 ? data[index] : MailBnfHelper.EndAngleBracket))); + } + else + { + parseAddressInfo = default; + return false; + } } } @@ -118,27 +149,47 @@ private static MailAddress ParseAddress(string data, bool expectMultipleAddresse // There could still be a display name or another address if (index >= 0 && !(expectMultipleAddresses && data[index] == MailBnfHelper.Comma)) { - displayName = ParseDisplayName(data, ref index, expectMultipleAddresses); + if (!TryParseDisplayName(data, ref index, expectMultipleAddresses, out displayName, throwExceptionIfFail)) + { + parseAddressInfo = default; + return false; + } } else { displayName = string.Empty; } - return new MailAddress(displayName, localPart, domain); + parseAddressInfo = new ParseAddressInfo(displayName, localPart, domain); + return true; } // Read through a section of CFWS. If we reach the end of the data string then throw because not enough of the // MailAddress components were found. - private static int ReadCfwsAndThrowIfIncomplete(string data, int index) + private static bool TryReadCfwsAndThrowIfIncomplete(string data, int index, out int outIndex, bool throwExceptionIfFail) { - index = WhitespaceReader.ReadCfwsReverse(data, index); + if (!WhitespaceReader.TryReadCfwsReverse(data, index, out index, throwExceptionIfFail)) + { + outIndex = default; + return false; + } + if (index < 0) { // More components were expected. Incomplete address, invalid - throw new FormatException(SR.MailAddressInvalidFormat); + if (throwExceptionIfFail) + { + throw new FormatException(SR.MailAddressInvalidFormat); + } + else + { + outIndex = default; + return false; + } } - return index; + + outIndex = index; + return true; } // Parses the domain section of an address. The domain may be in dot-atom format or surrounded by square @@ -152,13 +203,17 @@ private static int ReadCfwsAndThrowIfIncomplete(string data, int index) // - data[index] should refer to the '@' symbol // - returns the parsed domain, including any square brackets for domain-literals // - // Throws a FormatException: + // Throws a FormatException or returns false: // - For invalid un-escaped chars, including Unicode // - If the start of the data string is reached - private static string ParseDomain(string data, ref int index) + private static bool TryParseDomain(string data, ref int index, out string domain, bool throwExceptionIfFail) { // Skip comments and whitespace - index = ReadCfwsAndThrowIfIncomplete(data, index); + if (!TryReadCfwsAndThrowIfIncomplete(data, index, out index, throwExceptionIfFail)) + { + domain = default; + return false; + } // Mark one end of the domain component int startingIndex = index; @@ -166,19 +221,35 @@ private static string ParseDomain(string data, ref int index) // Is the domain component in domain-literal format or dot-atom format? if (data[index] == MailBnfHelper.EndSquareBracket) { - index = DomainLiteralReader.ReadReverse(data, index); + if (!DomainLiteralReader.TryReadReverse(data, index, out index, throwExceptionIfFail)) + { + domain = default; + return false; + } } else { - index = DotAtomReader.ReadReverse(data, index); + if (!DotAtomReader.TryReadReverse(data, index, out index, throwExceptionIfFail)) + { + domain = default; + return false; + } } - string domain = data.Substring(index + 1, startingIndex - index); + domain = data.Substring(index + 1, startingIndex - index); // Skip comments and whitespace - index = ReadCfwsAndThrowIfIncomplete(data, index); + if (!TryReadCfwsAndThrowIfIncomplete(data, index, out index, throwExceptionIfFail)) + { + return false; + } - return NormalizeOrThrow(domain); + if (!TryNormalizeOrThrow(domain, out domain, throwExceptionIfFail)) + { + return false; + } + + return true; } // Parses the local-part section of an address. The local-part may be in dot-atom format or @@ -193,14 +264,18 @@ private static string ParseDomain(string data, ref int index) // - index == -1 if the beginning of the data string has been reached. // - returns the parsed local-part, including any bounding quotes around quoted-strings // - // Throws a FormatException: + // Throws a FormatException or false is returned: // - For invalid un-escaped chars, including Unicode // - If the final value of data[index] is not a valid character to precede the local-part - private static string ParseLocalPart(string data, ref int index, bool expectAngleBracket, - bool expectMultipleAddresses) + private static bool TryParseLocalPart(string data, ref int index, bool expectAngleBracket, + bool expectMultipleAddresses, out string localPart, bool throwExceptionIfFail) { // Skip comments and whitespace - index = ReadCfwsAndThrowIfIncomplete(data, index); + if (!TryReadCfwsAndThrowIfIncomplete(data, index, out index, throwExceptionIfFail)) + { + localPart = default; + return false; + } // Mark the start of the local-part int startingIndex = index; @@ -208,11 +283,19 @@ private static string ParseLocalPart(string data, ref int index, bool expectAngl // Is the local-part component in quoted-string format or dot-atom format? if (data[index] == MailBnfHelper.Quote) { - index = QuotedStringFormatReader.ReadReverseQuoted(data, index, true); + if (!QuotedStringFormatReader.TryReadReverseQuoted(data, index, true, out index, throwExceptionIfFail)) + { + localPart = default; + return false; + } } else { - index = DotAtomReader.ReadReverse(data, index); + if (!DotAtomReader.TryReadReverse(data, index, out index, throwExceptionIfFail)) + { + localPart = default; + return false; + } // Check that the local-part is properly separated from the next component. It may be separated by a // comment, whitespace, an expected angle bracket, a quote for the display-name, or an expected comma @@ -229,15 +312,31 @@ private static string ParseLocalPart(string data, ref int index, bool expectAngl ) ) { - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + if (throwExceptionIfFail) + { + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + } + else + { + localPart = default; + return false; + } } } - string localPart = data.Substring(index + 1, startingIndex - index); + localPart = data.Substring(index + 1, startingIndex - index); - index = WhitespaceReader.ReadCfwsReverse(data, index); + if (!WhitespaceReader.TryReadCfwsReverse(data, index, out index, throwExceptionIfFail)) + { + return false; + } - return NormalizeOrThrow(localPart); + if (!TryNormalizeOrThrow(localPart, out localPart, throwExceptionIfFail)) + { + return false; + } + + return true; } // Parses the display-name section of an address. In departure from the RFC, we attempt to read data in the @@ -252,26 +351,32 @@ private static string ParseLocalPart(string data, ref int index, bool expectAngl // - index == -1 if the beginning of the data string has been reached. // - returns the parsed display-name, excluding any bounding quotes around quoted-strings // - // Throws a FormatException: + // Throws a FormatException or false is returned: // - For invalid un-escaped chars, except Unicode // - If the postconditions cannot be met. - private static string ParseDisplayName(string data, ref int index, bool expectMultipleAddresses) + private static bool TryParseDisplayName(string data, ref int index, bool expectMultipleAddresses, out string displayName, bool throwExceptionIfFail) { - string displayName; - // Whatever is left over must be the display name. The display name should be a single word/atom or a // quoted string, but for robustness we allow the quotes to be omitted, so long as we can find the comma // separator before the next address. // Read the comment (if any). If the display name is contained in quotes, the surrounding comments are // omitted. Otherwise, mark this end of the comment so we can include it as part of the display name. - int firstNonCommentIndex = WhitespaceReader.ReadCfwsReverse(data, index); + if (!WhitespaceReader.TryReadCfwsReverse(data, index, out int firstNonCommentIndex, throwExceptionIfFail)) + { + displayName = default; + return false; + } // Check to see if there's a quoted-string display name if (firstNonCommentIndex >= 0 && data[firstNonCommentIndex] == MailBnfHelper.Quote) { // The preceding comment was not part of the display name. Read just the quoted string. - index = QuotedStringFormatReader.ReadReverseQuoted(data, firstNonCommentIndex, true); + if (!QuotedStringFormatReader.TryReadReverseQuoted(data, firstNonCommentIndex, true, out index, throwExceptionIfFail)) + { + displayName = default; + return false; + } Debug.Assert(data[index + 1] == MailBnfHelper.Quote, "Mis-aligned index: " + index); @@ -280,14 +385,24 @@ private static string ParseDisplayName(string data, ref int index, bool expectMu displayName = data.Substring(leftIndex, firstNonCommentIndex - leftIndex); // Skip any CFWS after the display name - index = WhitespaceReader.ReadCfwsReverse(data, index); + if (!WhitespaceReader.TryReadCfwsReverse(data, index, out index, throwExceptionIfFail)) + { + return false; + } // Check for completion. We are valid if we hit the end of the data string or if the rest of the data // belongs to another address. if (index >= 0 && !(expectMultipleAddresses && data[index] == MailBnfHelper.Comma)) { // If there was still data, only a comma could have been the next valid character - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + if (throwExceptionIfFail) + { + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + } + else + { + return false; + } } } else @@ -296,7 +411,11 @@ private static string ParseDisplayName(string data, ref int index, bool expectMu int startingIndex = index; // Read until the dividing comma or the end of the line. - index = QuotedStringFormatReader.ReadReverseUnQuoted(data, index, true, expectMultipleAddresses); + if (!QuotedStringFormatReader.TryReadReverseUnQuoted(data, index, true, expectMultipleAddresses, out index, throwExceptionIfFail)) + { + displayName = default; + return false; + } Debug.Assert(index < 0 || data[index] == MailBnfHelper.Comma, "Mis-aligned index: " + index); @@ -304,19 +423,42 @@ private static string ParseDisplayName(string data, ref int index, bool expectMu // trim extra whitespace. displayName = data.SubstringTrim(index + 1, startingIndex - index); } - return NormalizeOrThrow(displayName); + + if (!TryNormalizeOrThrow(displayName, out displayName, throwExceptionIfFail)) + { + return false; + } + + return true; } - internal static string NormalizeOrThrow(string input) + internal static bool TryNormalizeOrThrow(string input, out string normalizedString, bool throwExceptionIfFail) { try { - return input.Normalize(Text.NormalizationForm.FormC); + normalizedString = input.Normalize(Text.NormalizationForm.FormC); + return true; } catch (ArgumentException e) { - throw new FormatException(SR.MailAddressInvalidFormat, e); + if (throwExceptionIfFail) + { + throw new FormatException(SR.MailAddressInvalidFormat, e); + } + else + { + normalizedString = default; + return false; + } } } } + + internal readonly struct ParseAddressInfo + { + public readonly string DisplayName { get; } + public readonly string User { get; } + public readonly string Host { get; } + public ParseAddressInfo(string displayName, string userName, string domain) => (DisplayName, User, Host) = (displayName, userName, domain); + } } diff --git a/src/libraries/Common/src/System/Net/Mail/QuotedPairReader.cs b/src/libraries/Common/src/System/Net/Mail/QuotedPairReader.cs index ff470ca4a2b566..183fba2405dc87 100644 --- a/src/libraries/Common/src/System/Net/Mail/QuotedPairReader.cs +++ b/src/libraries/Common/src/System/Net/Mail/QuotedPairReader.cs @@ -31,14 +31,15 @@ internal static class QuotedPairReader // - The number of consecutive quoted chars, including multiple preceding quoted backslashes // e.g. (a\\\b) given index=4 returns 4, as 'b' is quoted, and so are the previous backslashes // - // Throws a FormatException if the an escaped Unicode character is found but was not permitted. - internal static int CountQuotedChars(string data, int index, bool permitUnicodeEscaping) + // Throws a FormatException or false is returned if the an escaped Unicode character is found but was not permitted. + internal static bool TryCountQuotedChars(string data, int index, bool permitUnicodeEscaping, out int outIndex, bool throwExceptionIfFail) { Debug.Assert(0 <= index && index < data.Length, "Index out of range: " + index + ", " + data.Length); if (index <= 0 || data[index - 1] != MailBnfHelper.Backslash) { - return 0; + outIndex = 0; + return true; } // Count the preceding backslashes @@ -47,17 +48,27 @@ internal static int CountQuotedChars(string data, int index, bool permitUnicodeE // For an even number of backslashes, the original character was NOT escaped/quoted if (backslashCount % 2 == 0) { - return 0; // No quoted pair to skip + outIndex = 0; // No quoted pair to skip + return true; } else { if (!permitUnicodeEscaping && data[index] > MailBnfHelper.Ascii7bitMaxValue) { - // Cannot accept quoted Unicode - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + if (throwExceptionIfFail) + { + // Cannot accept quoted Unicode + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + } + else + { + outIndex = default; + return false; + } } // Skip the quoted char, and the odd number of backslashes preceding it - return backslashCount + 1; + outIndex = backslashCount + 1; + return true; } } diff --git a/src/libraries/Common/src/System/Net/Mail/QuotedStringFormatReader.cs b/src/libraries/Common/src/System/Net/Mail/QuotedStringFormatReader.cs index 80079b5f3188eb..ce0cdf753cab9a 100644 --- a/src/libraries/Common/src/System/Net/Mail/QuotedStringFormatReader.cs +++ b/src/libraries/Common/src/System/Net/Mail/QuotedStringFormatReader.cs @@ -28,12 +28,12 @@ internal static class QuotedStringFormatReader // Return value: The next index past the terminating-quote (data[index + 1] == Quote). // e.g. In (bob "user name"@domain), starting at index=14 (") returns index=3 (space). // - // A FormatException will be thrown if: + // A FormatException will be thrown or false is returned if: // - A non-escaped character is encountered that is not valid in a quoted string. // - A Unicode character is encountered and Unicode has not been allowed. // - The final double quote is not found. // - internal static int ReadReverseQuoted(string data, int index, bool permitUnicode) + internal static bool TryReadReverseQuoted(string data, int index, bool permitUnicode, out int outIndex, bool throwExceptionIfFail) { Debug.Assert(0 <= index && index < data.Length, "Index out of range: " + index + ", " + data.Length); // Check for the first bounding quote @@ -45,29 +45,48 @@ internal static int ReadReverseQuoted(string data, int index, bool permitUnicode do { // Check for valid whitespace - index = WhitespaceReader.ReadFwsReverse(data, index); + if (!WhitespaceReader.TryReadFwsReverse(data, index, out index, throwExceptionIfFail)) + { + outIndex = default; + return false; + } + if (index < 0) { break; } // Check for escaped characters - int quotedCharCount = QuotedPairReader.CountQuotedChars(data, index, permitUnicode); + if (!QuotedPairReader.TryCountQuotedChars(data, index, permitUnicode, out int quotedCharCount, throwExceptionIfFail)) + { + outIndex = default; + return false; + } + if (quotedCharCount > 0) { // Skip quoted pairs - index = index - quotedCharCount; + index -= quotedCharCount; } // Check for the terminating quote else if (data[index] == MailBnfHelper.Quote) { // Skip the final bounding quote - return index - 1; + outIndex = index - 1; + return true; } // Check invalid characters else if (!IsValidQtext(permitUnicode, data[index])) { - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + if (throwExceptionIfFail) + { + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + } + else + { + outIndex = default; + return false; + } } // Valid char else @@ -77,8 +96,16 @@ internal static int ReadReverseQuoted(string data, int index, bool permitUnicode } while (index >= 0); - // We started with a quote, but did not end with one - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, MailBnfHelper.Quote)); + if (throwExceptionIfFail) + { + // We started with a quote, but did not end with one + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, MailBnfHelper.Quote)); + } + else + { + outIndex = default; + return false; + } } // @@ -93,27 +120,37 @@ internal static int ReadReverseQuoted(string data, int index, bool permitUnicode // - -1 if the terminating character was not found. // e.g. In (my name username@domain), starting at index=5 (e) returns index=-1. // - // A FormatException will be thrown if: + // A FormatException will be thrown or false is returned if: // - A non-escaped character is encountered that is not valid in a quoted string. This includes double quotes. // - A Unicode character is encountered and Unicode has not been allowed. // - internal static int ReadReverseUnQuoted(string data, int index, bool permitUnicode, bool expectCommaDelimiter) + internal static bool TryReadReverseUnQuoted(string data, int index, bool permitUnicode, bool expectCommaDelimiter, out int outIndex, bool throwExceptionIfFail) { Debug.Assert(0 <= index && index < data.Length, "Index out of range: " + index + ", " + data.Length); do { // Check for valid whitespace - index = WhitespaceReader.ReadFwsReverse(data, index); + if (!WhitespaceReader.TryReadFwsReverse(data, index, out index, throwExceptionIfFail)) + { + outIndex = default; + return false; + } + if (index < 0) { break; } // Check for escaped characters - int quotedCharCount = QuotedPairReader.CountQuotedChars(data, index, permitUnicode); + if (!QuotedPairReader.TryCountQuotedChars(data, index, permitUnicode, out int quotedCharCount, throwExceptionIfFail)) + { + outIndex = default; + return false; + } + if (quotedCharCount > 0) { - index = index - quotedCharCount; + index -= quotedCharCount; } // Check for the terminating char else if (expectCommaDelimiter && data[index] == MailBnfHelper.Comma) @@ -123,7 +160,15 @@ internal static int ReadReverseUnQuoted(string data, int index, bool permitUnico // Check invalid characters else if (!IsValidQtext(permitUnicode, data[index])) { - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + if (throwExceptionIfFail) + { + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + } + else + { + outIndex = default; + return false; + } } // Valid char else @@ -133,7 +178,8 @@ internal static int ReadReverseUnQuoted(string data, int index, bool permitUnico } while (index >= 0); - return index; + outIndex = index; + return true; } // Checks for Unicode characters and characters not allowed in quoted-strings. A quoted string may contain diff --git a/src/libraries/Common/src/System/Net/Mail/WhitespaceReader.cs b/src/libraries/Common/src/System/Net/Mail/WhitespaceReader.cs index 6230fee2333682..c8f22e435c457e 100644 --- a/src/libraries/Common/src/System/Net/Mail/WhitespaceReader.cs +++ b/src/libraries/Common/src/System/Net/Mail/WhitespaceReader.cs @@ -28,11 +28,12 @@ internal static class WhitespaceReader // - The index of the next character that is NOT a whitespace character. // - -1 if the beginning of the data string is reached. // - // A FormatException will be thrown if a CR or LF is found NOT in the sequence CRLF. - internal static int ReadFwsReverse(string data, int index) + // A FormatException will be thrown or false is returned if a CR or LF is found NOT in the sequence CRLF. + internal static bool TryReadFwsReverse(string data, int index, out int outIndex, bool throwExceptionIfFail) { Debug.Assert(!string.IsNullOrEmpty(data), "data was null or empty"); Debug.Assert(index < data.Length, "index was outside the bounds of the string"); + bool expectCR = false; for (; index >= 0; index--) @@ -45,7 +46,15 @@ internal static int ReadFwsReverse(string data, int index) // LF without CR, or CR without LF, invalid else if (data[index] == MailBnfHelper.CR || expectCR) { - throw new FormatException(SR.MailAddressInvalidFormat); + if (throwExceptionIfFail) + { + throw new FormatException(SR.MailAddressInvalidFormat); + } + else + { + outIndex = default; + return false; + } } // LF is only valid if preceded by a CR. // Skip both if they're found together. @@ -67,10 +76,20 @@ internal static int ReadFwsReverse(string data, int index) if (expectCR) { - // We found a LF without an immediately preceding CR, invalid. - throw new FormatException(SR.MailAddressInvalidFormat); + if (throwExceptionIfFail) + { + // We found a LF without an immediately preceding CR, invalid. + throw new FormatException(SR.MailAddressInvalidFormat); + } + else + { + outIndex = default; + return false; + } } - return index; + + outIndex = index; + return true; } // This method functions similarly to ReadFwsReverse but will also skip any comments. @@ -92,8 +111,8 @@ internal static int ReadFwsReverse(string data, int index) // - -1 if skipping the comments and/or whitespace moves you to the beginning of the data string. // e.g. " (comment) " returns -1 // - // Throws a FormatException for mismatched '(' and ')', or for unescaped characters not allowed in comments. - internal static int ReadCfwsReverse(string data, int index) + // Throws a FormatException or false is returned for mismatched '(' and ')', or for unescaped characters not allowed in comments. + internal static bool TryReadCfwsReverse(string data, int index, out int outIndex, bool throwExceptionIfFail) { Debug.Assert(!string.IsNullOrEmpty(data), "data was null or empty"); Debug.Assert(index < data.Length, "index was outside the bounds of the string"); @@ -101,15 +120,24 @@ internal static int ReadCfwsReverse(string data, int index) int commentDepth = 0; // Check for valid whitespace - index = ReadFwsReverse(data, index); + if (!TryReadFwsReverse(data, index, out index, throwExceptionIfFail)) + { + outIndex = default; + return false; + } while (index >= 0) { // Check for escaped characters. They must be within comments. - int quotedCharCount = QuotedPairReader.CountQuotedChars(data, index, true); + if (!QuotedPairReader.TryCountQuotedChars(data, index, true, out int quotedCharCount, throwExceptionIfFail)) + { + outIndex = default; + return false; + } + if (commentDepth > 0 && quotedCharCount > 0) { - index = index - quotedCharCount; + index -= quotedCharCount; } // Start a new comment else if (data[index] == MailBnfHelper.EndComment) @@ -123,9 +151,17 @@ internal static int ReadCfwsReverse(string data, int index) commentDepth--; if (commentDepth < 0) { - // Mismatched '(' - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, - MailBnfHelper.StartComment)); + if (throwExceptionIfFail) + { + // Mismatched '(' + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, + MailBnfHelper.StartComment)); + } + else + { + outIndex = default; + return false; + } } index--; } @@ -138,7 +174,15 @@ internal static int ReadCfwsReverse(string data, int index) // If we're still in a comment, this must be an invalid char else if (commentDepth > 0) { - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + if (throwExceptionIfFail) + { + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); + } + else + { + outIndex = default; + return false; + } } // We must no longer be in a comment, and this is not a whitespace char, return else @@ -147,16 +191,29 @@ internal static int ReadCfwsReverse(string data, int index) } // Check for valid whitespace - index = ReadFwsReverse(data, index); + if (!TryReadFwsReverse(data, index, out index, throwExceptionIfFail)) + { + outIndex = default; + return false; + } } if (commentDepth > 0) { - // Mismatched ')', throw - throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, MailBnfHelper.EndComment)); + if (throwExceptionIfFail) + { + // Mismatched ')', throw + throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, MailBnfHelper.EndComment)); + } + else + { + outIndex = default; + return false; + } } - return index; + outIndex = index; + return true; } } } diff --git a/src/libraries/Common/src/System/Net/NetworkInformation/UnixCommandLinePing.cs b/src/libraries/Common/src/System/Net/NetworkInformation/UnixCommandLinePing.cs index 3a5c413679f8ef..157986f7bf649b 100644 --- a/src/libraries/Common/src/System/Net/NetworkInformation/UnixCommandLinePing.cs +++ b/src/libraries/Common/src/System/Net/NetworkInformation/UnixCommandLinePing.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Globalization; using System.IO; using System.Runtime.InteropServices; @@ -16,14 +17,14 @@ internal static class UnixCommandLinePing private const string s_ipv4PingFile = "ping"; private const string s_ipv6PingFile = "ping6"; - private static readonly string s_discoveredPing4UtilityPath = GetPingUtilityPath(ipv4: true); - private static readonly string s_discoveredPing6UtilityPath = GetPingUtilityPath(ipv4: false); + private static readonly string? s_discoveredPing4UtilityPath = GetPingUtilityPath(ipv4: true); + private static readonly string? s_discoveredPing6UtilityPath = GetPingUtilityPath(ipv4: false); private static readonly bool s_isBSD = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")); private static readonly Lazy s_isBusybox = new Lazy(() => IsBusyboxPing(s_discoveredPing4UtilityPath)); // We don't want to pick up an arbitrary or malicious ping // command, so that's why we do the path probing ourselves. - private static string GetPingUtilityPath(bool ipv4) + private static string? GetPingUtilityPath(bool ipv4) { string fileName = ipv4 ? s_ipv4PingFile : s_ipv6PingFile; foreach (string folder in s_binFolders) @@ -39,14 +40,17 @@ private static string GetPingUtilityPath(bool ipv4) } // Check if found ping is symlink to busybox like alpine /bin/ping -> /bin/busybox - private static unsafe bool IsBusyboxPing(string pingBinary) + private static unsafe bool IsBusyboxPing(string? pingBinary) { - string linkedName = Interop.Sys.ReadLink(pingBinary); - - // If pingBinary is not link linkedName will be null - if (linkedName != null && linkedName.EndsWith("busybox", StringComparison.Ordinal)) + if (pingBinary != null) { - return true; + string? linkedName = Interop.Sys.ReadLink(pingBinary); + + // If pingBinary is not link linkedName will be null + if (linkedName != null && linkedName.EndsWith("busybox", StringComparison.Ordinal)) + { + return true; + } } return false; @@ -57,12 +61,12 @@ public enum PingFragmentOptions { Default, Do, Dont }; /// /// The location of the IPv4 ping utility on the current machine. /// - public static string Ping4UtilityPath { get { return s_discoveredPing4UtilityPath; } } + public static string? Ping4UtilityPath { get { return s_discoveredPing4UtilityPath; } } /// /// The location of the IPv6 ping utility on the current machine. /// - public static string Ping6UtilityPath { get { return s_discoveredPing6UtilityPath; } } + public static string? Ping6UtilityPath { get { return s_discoveredPing6UtilityPath; } } /// /// Constructs command line arguments appropriate for the ping or ping6 utility. @@ -150,10 +154,10 @@ public static long ParseRoundTripTime(string pingOutput) { int timeIndex = pingOutput.IndexOf("time=", StringComparison.Ordinal); int afterTime = timeIndex + "time=".Length; - int msIndex = pingOutput.IndexOf("ms", afterTime); + int msIndex = pingOutput.IndexOf("ms", afterTime, StringComparison.Ordinal); int numLength = msIndex - afterTime - 1; - string timeSubstring = pingOutput.Substring(afterTime, numLength); - double parsedRtt = double.Parse(timeSubstring, CultureInfo.InvariantCulture); + ReadOnlySpan timeSubstring = pingOutput.AsSpan(afterTime, numLength); + double parsedRtt = double.Parse(timeSubstring, provider: CultureInfo.InvariantCulture); return (long)Math.Round(parsedRtt); } } diff --git a/src/libraries/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs b/src/libraries/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs index f2f868b2da35cf..96690d1a3bc601 100644 --- a/src/libraries/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs +++ b/src/libraries/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs @@ -80,31 +80,17 @@ internal static SecurityStatusPal InitializeSecurityContext( ref byte[] resultBlob, ref ContextFlagsPal contextFlags) { -#if NETSTANDARD2_0 - Span inSecurityBufferSpan = new SecurityBuffer[2]; -#else - TwoSecurityBuffers twoSecurityBuffers = default; - Span inSecurityBufferSpan = MemoryMarshal.CreateSpan(ref twoSecurityBuffers._item0, 2); -#endif - int inSecurityBufferSpanLength = 0; - if (incomingBlob != null && channelBinding != null) + InputSecurityBuffers inputBuffers = default; + if (incomingBlob != null) { - inSecurityBufferSpan[0] = new SecurityBuffer(incomingBlob, SecurityBufferType.SECBUFFER_TOKEN); - inSecurityBufferSpan[1] = new SecurityBuffer(channelBinding); - inSecurityBufferSpanLength = 2; + inputBuffers.SetNextBuffer(new InputSecurityBuffer(incomingBlob, SecurityBufferType.SECBUFFER_TOKEN)); } - else if (incomingBlob != null) - { - inSecurityBufferSpan[0] = new SecurityBuffer(incomingBlob, SecurityBufferType.SECBUFFER_TOKEN); - inSecurityBufferSpanLength = 1; - } - else if (channelBinding != null) + + if (channelBinding != null) { - inSecurityBufferSpan[0] = new SecurityBuffer(channelBinding); - inSecurityBufferSpanLength = 1; + inputBuffers.SetNextBuffer(new InputSecurityBuffer(channelBinding)); } - inSecurityBufferSpan = inSecurityBufferSpan.Slice(0, inSecurityBufferSpanLength); var outSecurityBuffer = new SecurityBuffer(resultBlob, SecurityBufferType.SECBUFFER_TOKEN); @@ -118,7 +104,7 @@ internal static SecurityStatusPal InitializeSecurityContext( spn, ContextFlagsAdapterPal.GetInteropFromContextFlagsPal(requestedContextFlags), Interop.SspiCli.Endianness.SECURITY_NETWORK_DREP, - inSecurityBufferSpan, + inputBuffers, ref outSecurityBuffer, ref outContextFlags); securityContext = sslContext; @@ -151,31 +137,16 @@ internal static SecurityStatusPal AcceptSecurityContext( ref byte[] resultBlob, ref ContextFlagsPal contextFlags) { -#if NETSTANDARD2_0 - Span inSecurityBufferSpan = new SecurityBuffer[2]; -#else - TwoSecurityBuffers twoSecurityBuffers = default; - Span inSecurityBufferSpan = MemoryMarshal.CreateSpan(ref twoSecurityBuffers._item0, 2); -#endif - - int inSecurityBufferSpanLength = 0; - if (incomingBlob != null && channelBinding != null) + InputSecurityBuffers inputBuffers = default; + if (incomingBlob != null) { - inSecurityBufferSpan[0] = new SecurityBuffer(incomingBlob, SecurityBufferType.SECBUFFER_TOKEN); - inSecurityBufferSpan[1] = new SecurityBuffer(channelBinding); - inSecurityBufferSpanLength = 2; + inputBuffers.SetNextBuffer(new InputSecurityBuffer(incomingBlob, SecurityBufferType.SECBUFFER_TOKEN)); } - else if (incomingBlob != null) - { - inSecurityBufferSpan[0] = new SecurityBuffer(incomingBlob, SecurityBufferType.SECBUFFER_TOKEN); - inSecurityBufferSpanLength = 1; - } - else if (channelBinding != null) + + if (channelBinding != null) { - inSecurityBufferSpan[0] = new SecurityBuffer(channelBinding); - inSecurityBufferSpanLength = 1; + inputBuffers.SetNextBuffer(new InputSecurityBuffer(channelBinding)); } - inSecurityBufferSpan = inSecurityBufferSpan.Slice(0, inSecurityBufferSpanLength); var outSecurityBuffer = new SecurityBuffer(resultBlob, SecurityBufferType.SECBUFFER_TOKEN); @@ -188,7 +159,7 @@ internal static SecurityStatusPal AcceptSecurityContext( ref sslContext, ContextFlagsAdapterPal.GetInteropFromContextFlagsPal(requestedContextFlags), Interop.SspiCli.Endianness.SECURITY_NETWORK_DREP, - inSecurityBufferSpan, + inputBuffers, ref outSecurityBuffer, ref outContextFlags); diff --git a/src/libraries/Common/src/System/Net/Security/SecurityBuffer.Windows.cs b/src/libraries/Common/src/System/Net/Security/SecurityBuffer.Windows.cs index d076942ebbd35f..9ba6ed506cf538 100644 --- a/src/libraries/Common/src/System/Net/Security/SecurityBuffer.Windows.cs +++ b/src/libraries/Common/src/System/Net/Security/SecurityBuffer.Windows.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Diagnostics; using System.Runtime.InteropServices; using System.Security.Authentication.ExtendedProtection; @@ -28,6 +29,56 @@ internal ref struct ThreeSecurityBuffers private SecurityBuffer _item2; } + [StructLayout(LayoutKind.Sequential)] + internal ref struct InputSecurityBuffers + { + internal int Count; + internal InputSecurityBuffer _item0; + internal InputSecurityBuffer _item1; + internal InputSecurityBuffer _item2; + + internal void SetNextBuffer(InputSecurityBuffer buffer) + { + Debug.Assert(Count >= 0 && Count < 3); + if (Count == 0) + { + _item0 = buffer; + } + else if (Count == 1) + { + _item1 = buffer; + } + else + { + _item2 = buffer; + } + + Count++; + } + } + + [StructLayout(LayoutKind.Auto)] + internal readonly ref struct InputSecurityBuffer + { + public readonly SecurityBufferType Type; + public readonly ReadOnlySpan Token; + public readonly SafeHandle UnmanagedToken; + + public InputSecurityBuffer(ReadOnlySpan data, SecurityBufferType tokentype) + { + Token = data; + Type = tokentype; + UnmanagedToken = null; + } + + public InputSecurityBuffer(ChannelBinding binding) + { + Type = SecurityBufferType.SECBUFFER_CHANNEL_BINDINGS; + Token = default; + UnmanagedToken = binding; + } + } + [StructLayout(LayoutKind.Auto)] internal struct SecurityBuffer { diff --git a/src/libraries/Common/src/System/Net/SocketAddress.cs b/src/libraries/Common/src/System/Net/SocketAddress.cs index 310b8fc147cc4c..a3a93bdb3bedba 100644 --- a/src/libraries/Common/src/System/Net/SocketAddress.cs +++ b/src/libraries/Common/src/System/Net/SocketAddress.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using System.Globalization; using System.Net.Sockets; @@ -179,9 +180,9 @@ internal int GetAddressSizeOffset() return Buffer.Length - IntPtr.Size; } - public override bool Equals(object comparand) + public override bool Equals(object? comparand) { - SocketAddress castedComparand = comparand as SocketAddress; + SocketAddress? castedComparand = comparand as SocketAddress; if (castedComparand == null || this.Size != castedComparand.Size) { return false; diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Unix.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Unix.cs index c89881118e0d35..1483ec2951f081 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Unix.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Unix.cs @@ -2,68 +2,29 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Diagnostics; using System.Net.Internals; using System.Net.Sockets; using System.Runtime.InteropServices; -using System.Threading; namespace System.Net { - internal class SocketProtocolSupportPal + internal static class SocketProtocolSupportPal { - private static bool s_ipv4 = true; - private static bool s_ipv6 = true; + public static bool OSSupportsIPv6 { get; } = IsSupported(AddressFamily.InterNetworkV6); + public static bool OSSupportsIPv4 { get; } = IsSupported(AddressFamily.InterNetwork); + public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix); - private static bool s_initialized; - private static readonly object s_initializedLock = new object(); - - public static bool OSSupportsIPv6 - { - get - { - EnsureInitialized(); - return s_ipv6; - } - } - - public static bool OSSupportsIPv4 - { - get - { - EnsureInitialized(); - return s_ipv4; - } - } - - private static void EnsureInitialized() - { - if (!Volatile.Read(ref s_initialized)) - { - lock (s_initializedLock) - { - if (!s_initialized) - { - s_ipv4 = IsProtocolSupported(AddressFamily.InterNetwork); - s_ipv6 = IsProtocolSupported(AddressFamily.InterNetworkV6); - - Volatile.Write(ref s_initialized, true); - } - } - } - } - - private static unsafe bool IsProtocolSupported(AddressFamily af) + private static unsafe bool IsSupported(AddressFamily af) { - IntPtr socket = (IntPtr)(-1); + IntPtr invalid = (IntPtr)(-1); + IntPtr socket = invalid; try { - Interop.Error err = Interop.Sys.Socket(af, SocketType.Dgram, (ProtocolType)0, &socket); - return err != Interop.Error.EAFNOSUPPORT; + return Interop.Sys.Socket(af, SocketType.Dgram, 0, &socket) != Interop.Error.EAFNOSUPPORT; } finally { - if (socket != (IntPtr)(-1)) + if (socket == invalid) { Interop.Sys.Close(socket); } diff --git a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Windows.cs b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Windows.cs index 9ab7db46042512..c01b81c63e3bcc 100644 --- a/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Windows.cs +++ b/src/libraries/Common/src/System/Net/SocketProtocolSupportPal.Windows.cs @@ -2,94 +2,38 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Diagnostics; using System.Net.Sockets; using System.Runtime.InteropServices; -using System.Threading; #if !SYSTEM_NET_SOCKETS_DLL using SocketType = System.Net.Internals.SocketType; #endif namespace System.Net { - internal class SocketProtocolSupportPal + internal static class SocketProtocolSupportPal { - private static bool s_ipv4 = true; - private static bool s_ipv6 = true; + public static bool OSSupportsIPv6 { get; } = IsSupported(AddressFamily.InterNetworkV6); + public static bool OSSupportsIPv4 { get; } = IsSupported(AddressFamily.InterNetwork); + public static bool OSSupportsUnixDomainSockets { get; } = IsSupported(AddressFamily.Unix); - private static bool s_initialized; - private static readonly object s_initializedLock = new object(); - - public static bool OSSupportsIPv6 + private static bool IsSupported(AddressFamily af) { - get - { - EnsureInitialized(); - return s_ipv6; - } - } - - public static bool OSSupportsIPv4 - { - get - { - EnsureInitialized(); - return s_ipv4; - } - } - - private static void EnsureInitialized() - { - if (!Volatile.Read(ref s_initialized)) - { - lock (s_initializedLock) - { - if (!s_initialized) - { - s_ipv4 = IsProtocolSupported(AddressFamily.InterNetwork); - s_ipv6 = IsProtocolSupported(AddressFamily.InterNetworkV6); - - Volatile.Write(ref s_initialized, true); - } - } - } - } - - private static bool IsProtocolSupported(AddressFamily af) - { - SocketError errorCode; - IntPtr s = IntPtr.Zero; - bool ret = true; - + IntPtr INVALID_SOCKET = (IntPtr)(-1); + IntPtr socket = INVALID_SOCKET; try { - s = Interop.Winsock.WSASocketW(af, SocketType.Dgram, 0, IntPtr.Zero, 0, (int)Interop.Winsock.SocketConstructorFlags.WSA_FLAG_NO_HANDLE_INHERIT); - - if (s == IntPtr.Zero) - { - errorCode = (SocketError)Marshal.GetLastWin32Error(); - if (errorCode == SocketError.AddressFamilyNotSupported) - { - ret = false; - } - } + socket = Interop.Winsock.WSASocketW(af, SocketType.Stream, 0, IntPtr.Zero, 0, (int)Interop.Winsock.SocketConstructorFlags.WSA_FLAG_NO_HANDLE_INHERIT); + return + socket != INVALID_SOCKET || + (SocketError)Marshal.GetLastWin32Error() != SocketError.AddressFamilyNotSupported; } finally { - if (s != IntPtr.Zero) + if (socket != INVALID_SOCKET) { - SocketError closeResult = Interop.Winsock.closesocket(s); -#if DEBUG - if (closeResult != SocketError.Success) - { - errorCode = (SocketError)Marshal.GetLastWin32Error(); - Debug.Fail("Failed to detect " + af.ToString() + " protocol: " + errorCode.ToString()); - } -#endif + Interop.Winsock.closesocket(socket); } } - - return ret; } } } diff --git a/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs b/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs index 9c76f6fe040b7d..437c6eaff992cf 100644 --- a/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs +++ b/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs @@ -33,7 +33,7 @@ internal sealed partial class ManagedWebSocket : WebSocket /// The interval to use for keep-alive pings. /// The created instance. public static ManagedWebSocket CreateFromConnectedStream( - Stream stream, bool isServer, string subprotocol, TimeSpan keepAliveInterval) + Stream stream, bool isServer, string? subprotocol, TimeSpan keepAliveInterval) { return new ManagedWebSocket(stream, isServer, subprotocol, keepAliveInterval); } @@ -74,9 +74,9 @@ public static ManagedWebSocket CreateFromConnectedStream( /// private readonly bool _isServer = false; /// The agreed upon subprotocol with the server. - private readonly string _subprotocol; + private readonly string? _subprotocol; /// Timer used to send periodic pings to the server, at the interval specified - private readonly Timer _keepAliveTimer; + private readonly Timer? _keepAliveTimer; /// CancellationTokenSource used to abort all current and future operations when anything is canceled or any error occurs. private readonly CancellationTokenSource _abortSource = new CancellationTokenSource(); /// Buffer used for reading data from the network. @@ -106,7 +106,7 @@ public static ManagedWebSocket CreateFromConnectedStream( /// The reason for the close, as sent by the server, or null if not yet closed. private WebSocketCloseStatus? _closeStatus = null; /// A description of the close reason as sent by the server, or null if not yet closed. - private string _closeStatusDescription = null; + private string? _closeStatusDescription = null; /// /// The last header received in a ReceiveAsync. If ReceiveAsync got a header but then @@ -133,7 +133,7 @@ public static ManagedWebSocket CreateFromConnectedStream( /// field to minimize needing to pass it around and to avoid it becoming a field on /// various async state machine objects. /// - private byte[] _sendBuffer; + private byte[]? _sendBuffer; /// /// Whether the last SendAsync had endOfMessage==false. We need to track this so that we /// can send the subsequent message with a continuation opcode if the last message was a fragment. @@ -159,7 +159,7 @@ public static ManagedWebSocket CreateFromConnectedStream( /// true if this is the server-side of the connection; false if this is the client-side of the connection. /// The agreed upon subprotocol for the connection. /// The interval to use for keep-alive pings. - private ManagedWebSocket(Stream stream, bool isServer, string subprotocol, TimeSpan keepAliveInterval) + private ManagedWebSocket(Stream stream, bool isServer, string? subprotocol, TimeSpan keepAliveInterval) { Debug.Assert(StateUpdateLock != null, $"Expected {nameof(StateUpdateLock)} to be non-null"); Debug.Assert(ReceiveAsyncLock != null, $"Expected {nameof(ReceiveAsyncLock)} to be non-null"); @@ -185,7 +185,7 @@ private ManagedWebSocket(Stream stream, bool isServer, string subprotocol, TimeS // the CancellationTokenSource, and the lifetime of that CTS matches the lifetime of the registration. _abortSource.Token.UnsafeRegister(s => { - var thisRef = (ManagedWebSocket)s; + var thisRef = (ManagedWebSocket)s!; lock (thisRef.StateUpdateLock) { @@ -206,8 +206,8 @@ private ManagedWebSocket(Stream stream, bool isServer, string subprotocol, TimeS { _keepAliveTimer = new Timer(s => { - var wr = (WeakReference)s; - if (wr.TryGetTarget(out ManagedWebSocket thisRef)) + var wr = (WeakReference)s!; + if (wr.TryGetTarget(out ManagedWebSocket? thisRef)) { thisRef.SendKeepAliveFrameAsync(); } @@ -240,11 +240,11 @@ private void DisposeCore() public override WebSocketCloseStatus? CloseStatus => _closeStatus; - public override string CloseStatusDescription => _closeStatusDescription; + public override string? CloseStatusDescription => _closeStatusDescription; public override WebSocketState State => _state; - public override string SubProtocol => _subprotocol; + public override string? SubProtocol => _subprotocol; public override Task SendAsync(ArraySegment buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) { @@ -258,7 +258,7 @@ public override Task SendAsync(ArraySegment buffer, WebSocketMessageType m WebSocketValidate.ValidateArraySegment(buffer, nameof(buffer)); - return SendPrivateAsync((ReadOnlyMemory)buffer, messageType, endOfMessage, cancellationToken).AsTask(); + return SendPrivateAsync(buffer, messageType, endOfMessage, cancellationToken).AsTask(); } private ValueTask SendPrivateAsync(ReadOnlyMemory buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) @@ -313,7 +313,7 @@ public override Task ReceiveAsync(ArraySegment buf } } - public override Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) + public override Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) { WebSocketValidate.ValidateCloseStatus(closeStatus, statusDescription); @@ -329,13 +329,13 @@ public override Task CloseAsync(WebSocketCloseStatus closeStatus, string statusD return CloseAsyncPrivate(closeStatus, statusDescription, cancellationToken); } - public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) + public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) { WebSocketValidate.ValidateCloseStatus(closeStatus, statusDescription); return CloseOutputAsyncCore(closeStatus, statusDescription, cancellationToken); } - private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) + private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) { WebSocketValidate.ThrowIfInvalidState(_state, _disposed, s_validCloseOutputStates); @@ -449,7 +449,7 @@ private async ValueTask SendFrameFallbackAsync(MessageOpcode opcode, bool endOfM try { int sendBytes = WriteFrameToSendBuffer(opcode, endOfMessage, payloadBuffer.Span); - using (cancellationToken.Register(s => ((ManagedWebSocket)s).Abort(), this)) + using (cancellationToken.Register(s => ((ManagedWebSocket)s!).Abort(), this)) { await _stream.WriteAsync(new ReadOnlyMemory(_sendBuffer, 0, sendBytes), cancellationToken).ConfigureAwait(false); } @@ -472,6 +472,7 @@ private int WriteFrameToSendBuffer(MessageOpcode opcode, bool endOfMessage, Read { // Ensure we have a _sendBuffer. AllocateSendBuffer(payloadBuffer.Length + MaxMessageHeaderLength); + Debug.Assert(_sendBuffer != null); // Write the message header data to the buffer. int headerLength; @@ -632,7 +633,7 @@ private async ValueTask ReceiveAsyncPrivate ((ManagedWebSocket)s).Abort(), this); + CancellationTokenRegistration registration = cancellationToken.Register(s => ((ManagedWebSocket)s!).Abort(), this); try { while (true) // in case we get control frames that should be ignored from the user's perspective @@ -666,7 +667,7 @@ private async ValueTask ReceiveAsyncPrivate ((ManagedWebSocket)s).Abort(), this)) + using (finalCts.Token.Register(s => ((ManagedWebSocket)s!).Abort(), this)) { try { @@ -957,7 +958,7 @@ private static bool IsValidCloseStatus(WebSocketCloseStatus closeStatus) /// An optional error message to include in the thrown exception. /// An optional inner exception to include in the thrown exception. private async ValueTask CloseWithReceiveErrorAndThrowAsync( - WebSocketCloseStatus closeStatus, WebSocketError error, string errorMessage = null, Exception innerException = null) + WebSocketCloseStatus closeStatus, WebSocketError error, string? errorMessage = null, Exception? innerException = null) { // Close the connection if it hasn't already been closed if (!_sentCloseFrame) @@ -977,7 +978,7 @@ private async ValueTask CloseWithReceiveErrorAndThrowAsync( /// Parses a message header from the buffer. This assumes the header is in the buffer. /// The read header. /// null if a valid header was read; non-null containing the string error message to use if the header was invalid. - private string TryParseMessageHeaderFromReceiveBuffer(out MessageHeader resultHeader) + private string? TryParseMessageHeaderFromReceiveBuffer(out MessageHeader resultHeader) { Debug.Assert(_receiveBufferCount >= 2, $"Expected to at least have the first two bytes of the header."); @@ -1078,7 +1079,7 @@ private string TryParseMessageHeaderFromReceiveBuffer(out MessageHeader resultHe /// The close status to send. /// The close status description to send. /// The CancellationToken to use to cancel the websocket. - private async Task CloseAsyncPrivate(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) + private async Task CloseAsyncPrivate(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) { // Send the close message. Skip sending a close frame if we're currently in a CloseSent state, // for example having just done a CloseOutputAsync. @@ -1150,11 +1151,11 @@ private async Task CloseAsyncPrivate(WebSocketCloseStatus closeStatus, string st /// The close status to send. /// The close status description to send. /// The CancellationToken to use to cancel the websocket. - private async ValueTask SendCloseFrameAsync(WebSocketCloseStatus closeStatus, string closeStatusDescription, CancellationToken cancellationToken) + private async ValueTask SendCloseFrameAsync(WebSocketCloseStatus closeStatus, string? closeStatusDescription, CancellationToken cancellationToken) { // Close payload is two bytes containing the close status followed by a UTF8-encoding of the status description, if it exists. - byte[] buffer = null; + byte[]? buffer = null; try { int count = 2; @@ -1266,7 +1267,7 @@ private void AllocateSendBuffer(int minLength) /// Releases the send buffer to the pool. private void ReleaseSendBuffer() { - byte[] old = _sendBuffer; + byte[]? old = _sendBuffer; if (old != null) { _sendBuffer = null; @@ -1370,7 +1371,7 @@ private static unsafe int ApplyMask(Span toMask, int mask, int maskIndex) } /// Aborts the websocket and throws an exception if an existing operation is in progress. - private void ThrowIfOperationInProgress(bool operationCompleted, [CallerMemberName] string methodName = null) + private void ThrowIfOperationInProgress(bool operationCompleted, [CallerMemberName] string? methodName = null) { if (!operationCompleted) { @@ -1379,7 +1380,7 @@ private void ThrowIfOperationInProgress(bool operationCompleted, [CallerMemberNa } } - private void ThrowOperationInProgress(string methodName) => throw new InvalidOperationException(SR.Format(SR.net_Websockets_AlreadyOneOutstandingOperation, methodName)); + private void ThrowOperationInProgress(string? methodName) => throw new InvalidOperationException(SR.Format(SR.net_Websockets_AlreadyOneOutstandingOperation, methodName)); /// Creates an OperationCanceledException instance, using a default message and the specified inner exception and token. private static Exception CreateOperationCanceledException(Exception innerException, CancellationToken cancellationToken = default(CancellationToken)) @@ -1514,13 +1515,13 @@ private struct MessageHeader /// The type of the result private interface IWebSocketReceiveResultGetter { - TResult GetResult(int count, WebSocketMessageType messageType, bool endOfMessage, WebSocketCloseStatus? closeStatus, string closeDescription); + TResult GetResult(int count, WebSocketMessageType messageType, bool endOfMessage, WebSocketCloseStatus? closeStatus, string? closeDescription); } /// implementation for . private readonly struct WebSocketReceiveResultGetter : IWebSocketReceiveResultGetter { - public WebSocketReceiveResult GetResult(int count, WebSocketMessageType messageType, bool endOfMessage, WebSocketCloseStatus? closeStatus, string closeDescription) => + public WebSocketReceiveResult GetResult(int count, WebSocketMessageType messageType, bool endOfMessage, WebSocketCloseStatus? closeStatus, string? closeDescription) => new WebSocketReceiveResult(count, messageType, endOfMessage, closeStatus, closeDescription); } } diff --git a/src/libraries/Common/src/System/Net/WebSockets/WebSocketValidate.cs b/src/libraries/Common/src/System/Net/WebSockets/WebSocketValidate.cs index 5dec3c0c676e22..aabc25ccb78c7d 100644 --- a/src/libraries/Common/src/System/Net/WebSockets/WebSocketValidate.cs +++ b/src/libraries/Common/src/System/Net/WebSockets/WebSocketValidate.cs @@ -52,7 +52,7 @@ internal static void ValidateSubprotocol(string subProtocol) throw new ArgumentException(SR.net_WebSockets_InvalidEmptySubProtocol, nameof(subProtocol)); } - string invalidChar = null; + string? invalidChar = null; int i = 0; while (i < subProtocol.Length) { @@ -79,7 +79,7 @@ internal static void ValidateSubprotocol(string subProtocol) } } - internal static void ValidateCloseStatus(WebSocketCloseStatus closeStatus, string statusDescription) + internal static void ValidateCloseStatus(WebSocketCloseStatus closeStatus, string? statusDescription) { if (closeStatus == WebSocketCloseStatus.Empty && !string.IsNullOrEmpty(statusDescription)) { diff --git a/src/libraries/Common/src/System/Runtime/CompilerServices/PreserveDependencyAttribute.cs b/src/libraries/Common/src/System/Runtime/CompilerServices/PreserveDependencyAttribute.cs index de14ff35e0425f..6d04e94119eac7 100644 --- a/src/libraries/Common/src/System/Runtime/CompilerServices/PreserveDependencyAttribute.cs +++ b/src/libraries/Common/src/System/Runtime/CompilerServices/PreserveDependencyAttribute.cs @@ -4,7 +4,7 @@ #nullable enable -// TODO https://github.com/dotnet/corefx/issues/41201: Design and expose this publicly. +// TODO https://github.com/dotnet/runtime/issues/30902: Design and expose this publicly. namespace System.Runtime.CompilerServices { diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/AlgorithmIdentifierAsn.manual.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/AlgorithmIdentifierAsn.manual.cs index f35038735b4659..7235166ab5bee5 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/AlgorithmIdentifierAsn.manual.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/AlgorithmIdentifierAsn.manual.cs @@ -30,7 +30,7 @@ internal bool Equals(ref AlgorithmIdentifierAsn other) return true; } - return Parameters.Value.Span.SequenceEqual(other.Parameters.Value.Span); + return Parameters!.Value.Span.SequenceEqual(other.Parameters!.Value.Span); } internal bool HasNullEquivalentParameters() diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/DirectoryStringAsn.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/DirectoryStringAsn.xml.cs index 7310045bca4dea..2f420f8cc5c9a4 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/DirectoryStringAsn.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/DirectoryStringAsn.xml.cs @@ -2,13 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Security.Cryptography.Asn1; -#nullable enable namespace System.Security.Cryptography.Asn1 { [StructLayout(LayoutKind.Sequential)] diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/ECDomainParameters.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/ECDomainParameters.xml.cs index c76272966e9e79..4c89970450d32f 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/ECDomainParameters.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/ECDomainParameters.xml.cs @@ -2,13 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Security.Cryptography.Asn1; -#nullable enable namespace System.Security.Cryptography.Asn1 { [StructLayout(LayoutKind.Sequential)] diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/GeneralNameAsn.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/GeneralNameAsn.xml.cs index dfd311632120fd..79316b126f8e9d 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/GeneralNameAsn.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/GeneralNameAsn.xml.cs @@ -2,13 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Security.Cryptography.Asn1; -#nullable enable namespace System.Security.Cryptography.Asn1 { [StructLayout(LayoutKind.Sequential)] diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pbkdf2SaltChoice.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pbkdf2SaltChoice.xml.cs index 14b54496d733cf..0ff367aa30826d 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pbkdf2SaltChoice.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pbkdf2SaltChoice.xml.cs @@ -2,13 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Security.Cryptography.Asn1; -#nullable enable namespace System.Security.Cryptography.Asn1 { [StructLayout(LayoutKind.Sequential)] diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xslt b/src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xslt index 9313313bdf3fed..a182bd6ba865b0 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xslt +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xslt @@ -127,6 +127,7 @@ namespace // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Collections.Generic; @@ -134,7 +135,6 @@ using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Security.Cryptography.Asn1; -#nullable enable namespace { [StructLayout(LayoutKind.Sequential)] diff --git a/src/libraries/Common/src/System/Security/Cryptography/CngPkcs8.cs b/src/libraries/Common/src/System/Security/Cryptography/CngPkcs8.cs index 6316db7a815ed8..6f4beba67f06c5 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/CngPkcs8.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/CngPkcs8.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Buffers; using System.Diagnostics; using System.Runtime.InteropServices; @@ -151,7 +152,7 @@ internal static unsafe Pkcs8Response ImportEncryptedPkcs8PrivateKey( finally { CryptographicOperations.ZeroMemory(decryptedSpan); - CryptoPool.Return(decrypted.Array); + CryptoPool.Return(decrypted.Array!); } } } @@ -203,7 +204,7 @@ internal static unsafe Pkcs8Response ImportEncryptedPkcs8PrivateKey( finally { CryptographicOperations.ZeroMemory(decryptedSpan); - CryptoPool.Return(decrypted.Array, clearSize: 0); + CryptoPool.Return(decrypted.Array!, clearSize: 0); } } } diff --git a/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs b/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs index 3f7a4ac203083f..ded87debde3a1c 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using Internal.Cryptography; using System.Diagnostics; @@ -43,7 +44,7 @@ public override void ImportParameters(DSAParameters parameters) if (parameters.G.Length != keySizeInBytes || parameters.Y.Length != keySizeInBytes) throw new ArgumentException(SR.Cryptography_InvalidDsaParameters_MismatchedPGY); - if (hasPrivateKey && parameters.X.Length != parameters.Q.Length) + if (hasPrivateKey && parameters.X!.Length != parameters.Q.Length) throw new ArgumentException(SR.Cryptography_InvalidDsaParameters_MismatchedQX); byte[] blob; @@ -220,19 +221,19 @@ private static void GenerateV1DsaBlob(out byte[] blob, DSAParameters parameters, } // The Q length is hardcoded into BCRYPT_DSA_KEY_BLOB, so check it now we can give a nicer error message. - if (parameters.Q.Length != Sha1HashOutputSize) + if (parameters.Q!.Length != Sha1HashOutputSize) throw new ArgumentException(SR.Cryptography_InvalidDsaParameters_QRestriction_ShortKey); Interop.BCrypt.Emit(blob, ref offset, parameters.Q); Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB)}"); - Interop.BCrypt.Emit(blob, ref offset, parameters.P); - Interop.BCrypt.Emit(blob, ref offset, parameters.G); - Interop.BCrypt.Emit(blob, ref offset, parameters.Y); + Interop.BCrypt.Emit(blob, ref offset, parameters.P!); + Interop.BCrypt.Emit(blob, ref offset, parameters.G!); + Interop.BCrypt.Emit(blob, ref offset, parameters.Y!); if (includePrivate) { - Interop.BCrypt.Emit(blob, ref offset, parameters.X); + Interop.BCrypt.Emit(blob, ref offset, parameters.X!); } Debug.Assert(offset == blobSize, $"Expected offset = blobSize, got {offset} != {blobSize}"); @@ -256,12 +257,12 @@ private static void GenerateV2DsaBlob(out byte[] blob, DSAParameters parameters, { int blobSize = sizeof(BCRYPT_DSA_KEY_BLOB_V2) + - (parameters.Seed == null ? parameters.Q.Length : parameters.Seed.Length) + // Use Q size if Seed is not present - parameters.Q.Length + - parameters.P.Length + - parameters.G.Length + - parameters.Y.Length + - (includePrivateParameters ? parameters.X.Length : 0); + (parameters.Seed == null ? parameters.Q!.Length : parameters.Seed.Length) + // Use Q size if Seed is not present + parameters.Q!.Length + + parameters.P!.Length + + parameters.G!.Length + + parameters.Y!.Length + + (includePrivateParameters ? parameters.X!.Length : 0); blob = new byte[blobSize]; fixed (byte* pDsaBlob = &blob[0]) @@ -317,7 +318,7 @@ private static void GenerateV2DsaBlob(out byte[] blob, DSAParameters parameters, if (includePrivateParameters) { - Interop.BCrypt.Emit(blob, ref offset, parameters.X); + Interop.BCrypt.Emit(blob, ref offset, parameters.X!); } Debug.Assert(offset == blobSize, $"Expected offset = blobSize, got {offset} != {blobSize}"); diff --git a/src/libraries/Common/src/System/Security/Cryptography/DSACng.cs b/src/libraries/Common/src/System/Security/Cryptography/DSACng.cs index f9e716ab952bac..b92deb1c26b7a9 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/DSACng.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/DSACng.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using Internal.Cryptography; using System.Diagnostics; using System.IO; @@ -45,7 +46,7 @@ public override KeySizes[] LegalKeySizes } public override string SignatureAlgorithm => "DSA"; - public override string KeyExchangeAlgorithm => null; + public override string? KeyExchangeAlgorithm => null; // Need to override since base methods throw a "override me" exception: makes SignData/VerifyData function. protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) => diff --git a/src/libraries/Common/src/System/Security/Cryptography/DSAKeyFormatHelper.cs b/src/libraries/Common/src/System/Security/Cryptography/DSAKeyFormatHelper.cs index 12a128e1dc090d..7de0284da5cf40 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/DSAKeyFormatHelper.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/DSAKeyFormatHelper.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Buffers; using System.Diagnostics; using System.Numerics; @@ -183,7 +184,7 @@ private static void WriteAlgorithmId(AsnWriter writer, in DSAParameters dsaParam writer.PopSequence(); } - private static void WriteKeyComponent(AsnWriter writer, byte[] component, bool bitString) + private static void WriteKeyComponent(AsnWriter writer, byte[]? component, bool bitString) { using (AsnWriter inner = new AsnWriter(AsnEncodingRules.DER)) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/DSAOpenSsl.cs b/src/libraries/Common/src/System/Security/Cryptography/DSAOpenSsl.cs index 90bad69c4e2013..b2d01c1eb427ba 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/DSAOpenSsl.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/DSAOpenSsl.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using System.IO; using Internal.Cryptography; @@ -24,7 +25,7 @@ internal static partial class DSAImplementation public sealed partial class DSAOpenSsl : DSA { private const int BitsPerByte = 8; - private Lazy _key; + private Lazy _key = null!; public DSAOpenSsl() : this(2048) @@ -103,7 +104,7 @@ public override void ImportParameters(DSAParameters parameters) if (parameters.G.Length != keySize || parameters.Y.Length != keySize) throw new ArgumentException(SR.Cryptography_InvalidDsaParameters_MismatchedPGY); - if (hasPrivateKey && parameters.X.Length != parameters.Q.Length) + if (hasPrivateKey && parameters.X!.Length != parameters.Q.Length) throw new ArgumentException(SR.Cryptography_InvalidDsaParameters_MismatchedQX); ThrowIfDisposed(); @@ -146,7 +147,7 @@ protected override void Dispose(bool disposing) if (disposing) { FreeKey(); - _key = null; + _key = null!; } base.Dispose(disposing); diff --git a/src/libraries/Common/src/System/Security/Cryptography/DSASecurityTransforms.cs b/src/libraries/Common/src/System/Security/Cryptography/DSASecurityTransforms.cs index 92177fa0f7e3f2..6f4e111b1c59c6 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/DSASecurityTransforms.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/DSASecurityTransforms.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Buffers; using System.Diagnostics; using System.IO; @@ -26,7 +27,7 @@ internal static partial class DSAImplementation { public sealed partial class DSASecurityTransforms : DSA { - private SecKeyPair _keys; + private SecKeyPair? _keys; private bool _disposed; public DSASecurityTransforms() @@ -144,7 +145,7 @@ public override void ImportParameters(DSAParameters parameters) if (parameters.G.Length != keySize || parameters.Y.Length != keySize) throw new ArgumentException(SR.Cryptography_InvalidDsaParameters_MismatchedPGY); - if (hasPrivateKey && parameters.X.Length != parameters.Q.Length) + if (hasPrivateKey && parameters.X!.Length != parameters.Q.Length) throw new ArgumentException(SR.Cryptography_InvalidDsaParameters_MismatchedQX); if (!(8 * parameters.P.Length).IsLegalSize(LegalKeySizes)) @@ -353,7 +354,7 @@ internal SecKeyPair GetKeys() { ThrowIfDisposed(); - SecKeyPair current = _keys; + SecKeyPair? current = _keys; if (current != null) { @@ -372,7 +373,7 @@ private void SetKey(SecKeyPair newKeyPair) { ThrowIfDisposed(); - SecKeyPair current = _keys; + SecKeyPair? current = _keys; _keys = newKeyPair; current?.Dispose(); diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECCng.HashAlgorithm.cs b/src/libraries/Common/src/System/Security/Cryptography/ECCng.HashAlgorithm.cs index 1ab060284e9b96..799cc0bde54ef6 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECCng.HashAlgorithm.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECCng.HashAlgorithm.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using Internal.NativeCrypto; using static Interop.Crypt32; @@ -15,7 +16,7 @@ internal static partial class ECCng /// internal static Interop.BCrypt.ECC_CURVE_ALG_ID_ENUM GetHashAlgorithmId(HashAlgorithmName? name) { - if (name.HasValue == false || string.IsNullOrEmpty(name.Value.Name)) + if (name is null || string.IsNullOrEmpty(name.Value.Name)) { return Interop.BCrypt.ECC_CURVE_ALG_ID_ENUM.BCRYPT_NO_CURVE_GENERATION_ALG_ID; } @@ -52,7 +53,7 @@ internal static Interop.BCrypt.ECC_CURVE_ALG_ID_ENUM GetHashAlgorithmId(HashAlgo /// /// Is the curve named, or once of the special nist curves /// - internal static bool IsECNamedCurve(string algorithm) + internal static bool IsECNamedCurve(string? algorithm) { return (algorithm == BCryptNative.AlgorithmName.ECDH || algorithm == BCryptNative.AlgorithmName.ECDsa); @@ -61,7 +62,7 @@ internal static bool IsECNamedCurve(string algorithm) /// /// Maps algorithm to curve name accounting for the special nist curves /// - internal static string SpecialNistAlgorithmToCurveName(string algorithm, out string oidValue) + internal static string SpecialNistAlgorithmToCurveName(string? algorithm, out string oidValue) { switch (algorithm) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECCng.ImportExport.cs b/src/libraries/Common/src/System/Security/Cryptography/ECCng.ImportExport.cs index f1e98f9362316c..482f598cf00bed 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECCng.ImportExport.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECCng.ImportExport.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using Internal.Cryptography; using Microsoft.Win32.SafeHandles; using System.Diagnostics; @@ -34,11 +35,11 @@ internal static byte[] GetNamedCurveBlob(ref ECParameters parameters, bool ecdh) // byte[cbKey] D int blobSize = sizeof(BCRYPT_ECCKEY_BLOB) + - parameters.Q.X.Length + - parameters.Q.Y.Length; + parameters.Q.X!.Length + + parameters.Q.Y!.Length; if (includePrivateParameters) { - blobSize += parameters.D.Length; + blobSize += parameters.D!.Length; } blob = new byte[blobSize]; @@ -57,7 +58,7 @@ internal static byte[] GetNamedCurveBlob(ref ECParameters parameters, bool ecdh) Interop.BCrypt.Emit(blob, ref offset, parameters.Q.Y); if (includePrivateParameters) { - Interop.BCrypt.Emit(blob, ref offset, parameters.D); + Interop.BCrypt.Emit(blob, ref offset, parameters.D!); } // We better have computed the right allocation size above! @@ -92,20 +93,20 @@ internal static byte[] GetPrimeCurveBlob(ref ECParameters parameters, bool ecdh) // byte[cbSubgroupOrder] D int blobSize = sizeof(BCRYPT_ECCFULLKEY_BLOB) + - curve.Prime.Length + - curve.A.Length + - curve.B.Length + - curve.G.X.Length + - curve.G.Y.Length + - curve.Order.Length + - curve.Cofactor.Length + + curve.Prime!.Length + + curve.A!.Length + + curve.B!.Length + + curve.G.X!.Length + + curve.G.Y!.Length + + curve.Order!.Length + + curve.Cofactor!.Length + (curve.Seed == null ? 0 : curve.Seed.Length) + - parameters.Q.X.Length + - parameters.Q.Y.Length; + parameters.Q.X!.Length + + parameters.Q.Y!.Length; if (includePrivateParameters) { - blobSize += parameters.D.Length; + blobSize += parameters.D!.Length; } blob = new byte[blobSize]; @@ -141,7 +142,7 @@ internal static byte[] GetPrimeCurveBlob(ref ECParameters parameters, bool ecdh) Interop.BCrypt.Emit(blob, ref offset, parameters.Q.Y); if (includePrivateParameters) { - Interop.BCrypt.Emit(blob, ref offset, parameters.D); + Interop.BCrypt.Emit(blob, ref offset, parameters.D!); } // We better have computed the right allocation size above! @@ -278,13 +279,13 @@ internal static byte[] GetPrimeCurveParameterBlob(ref ECCurve curve) // byte[cbSeed] Seed int blobSize = sizeof(BCRYPT_ECC_PARAMETER_HEADER) + - curve.Prime.Length + - curve.A.Length + - curve.B.Length + - curve.G.X.Length + - curve.G.Y.Length + - curve.Order.Length + - curve.Cofactor.Length + + curve.Prime!.Length + + curve.A!.Length + + curve.B!.Length + + curve.G.X!.Length + + curve.G.Y!.Length + + curve.Order!.Length + + curve.Cofactor!.Length + (curve.Seed == null ? 0 : curve.Seed.Length); byte[] blob = new byte[blobSize]; @@ -386,7 +387,7 @@ private static bool IsMagicValueOfKeyPublic(KeyBlobMagicNumber magic) /// to the pre-Win10 magic numbers to support import on pre-Win10 environments /// that don't have the named curve functionality. /// - private static KeyBlobMagicNumber EcdsaCurveNameToMagicNumber(string name, bool includePrivateParameters) => + private static KeyBlobMagicNumber EcdsaCurveNameToMagicNumber(string? name, bool includePrivateParameters) => EcdsaCurveNameToAlgorithm(name) switch { AlgorithmName.ECDsaP256 => includePrivateParameters ? @@ -411,7 +412,7 @@ private static KeyBlobMagicNumber EcdsaCurveNameToMagicNumber(string name, bool /// to the pre-Win10 magic numbers to support import on pre-Win10 environments /// that don't have the named curve functionality. /// - private static KeyBlobMagicNumber EcdhCurveNameToMagicNumber(string name, bool includePrivateParameters) => + private static KeyBlobMagicNumber EcdhCurveNameToMagicNumber(string? name, bool includePrivateParameters) => EcdhCurveNameToAlgorithm(name) switch { AlgorithmName.ECDHP256 => includePrivateParameters ? @@ -520,7 +521,7 @@ ref MemoryMarshal.GetReference(keyBlob), /// Map a curve name to algorithm. This enables curves that worked pre-Win10 /// to work with newer APIs for import and export. /// - internal static string EcdsaCurveNameToAlgorithm(string algorithm) + internal static string EcdsaCurveNameToAlgorithm(string? algorithm) { switch (algorithm) { @@ -545,7 +546,7 @@ internal static string EcdsaCurveNameToAlgorithm(string algorithm) /// Map a curve name to algorithm. This enables curves that worked pre-Win10 /// to work with newer APIs for import and export. /// - internal static string EcdhCurveNameToAlgorithm(string algorithm) + internal static string EcdhCurveNameToAlgorithm(string? algorithm) { switch (algorithm) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanCng.ImportExport.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanCng.ImportExport.cs index ce4dae3ba98b72..54eb1efe318678 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanCng.ImportExport.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanCng.ImportExport.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using Internal.NativeCrypto; namespace System.Security.Cryptography @@ -64,8 +65,8 @@ public override ECParameters ExportParameters(bool includePrivateParameters) { ECParameters ecparams = default; - string curveName = GetCurveName(out string oidValue); - byte[] blob = null; + string? curveName = GetCurveName(out string? oidValue); + byte[]? blob = null; try { diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanCng.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanCng.cs index 14622329fef2fa..20cef431701161 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanCng.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanCng.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using Microsoft.Win32.SafeHandles; namespace System.Security.Cryptography @@ -74,8 +75,8 @@ public override KeySizes[] LegalKeySizes public override byte[] DeriveKeyFromHash( ECDiffieHellmanPublicKey otherPartyPublicKey, HashAlgorithmName hashAlgorithm, - byte[] secretPrepend, - byte[] secretAppend) + byte[]? secretPrepend, + byte[]? secretAppend) { if (otherPartyPublicKey == null) throw new ArgumentNullException(nameof(otherPartyPublicKey)); @@ -96,9 +97,9 @@ public override byte[] DeriveKeyFromHash( public override byte[] DeriveKeyFromHmac( ECDiffieHellmanPublicKey otherPartyPublicKey, HashAlgorithmName hashAlgorithm, - byte[] hmacKey, - byte[] secretPrepend, - byte[] secretAppend) + byte[]? hmacKey, + byte[]? secretPrepend, + byte[]? secretAppend) { if (otherPartyPublicKey == null) throw new ArgumentNullException(nameof(otherPartyPublicKey)); diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanDerivation.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanDerivation.cs index 636b26c2d22ea3..afa34b6cba6936 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanDerivation.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanDerivation.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using System.Runtime.InteropServices; @@ -12,7 +13,7 @@ internal static class ECDiffieHellmanDerivation /// /// Derive the raw ECDH value into , if present, otherwise returning the value. /// - internal delegate byte[] DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash hasher); + internal delegate byte[]? DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash? hasher); internal static byte[] DeriveKeyFromHash( ECDiffieHellmanPublicKey otherPartyPublicKey, @@ -28,7 +29,7 @@ internal static byte[] DeriveKeyFromHash( { hash.AppendData(secretPrepend); - byte[] secretAgreement = deriveSecretAgreement(otherPartyPublicKey, hash); + byte[]? secretAgreement = deriveSecretAgreement(otherPartyPublicKey, hash); // We want the side effect, and it should not have returned the answer. Debug.Assert(secretAgreement == null); @@ -41,7 +42,7 @@ internal static byte[] DeriveKeyFromHash( internal static unsafe byte[] DeriveKeyFromHmac( ECDiffieHellmanPublicKey otherPartyPublicKey, HashAlgorithmName hashAlgorithm, - byte[] hmacKey, + byte[]? hmacKey, ReadOnlySpan secretPrepend, ReadOnlySpan secretAppend, DeriveSecretAgreement deriveSecretAgreement) @@ -60,8 +61,8 @@ internal static unsafe byte[] DeriveKeyFromHmac( if (useSecretAsKey) { hmacKey = deriveSecretAgreement(otherPartyPublicKey, null); - Debug.Assert(hmacKey != null); } + Debug.Assert(hmacKey != null); // Reduce the likelihood of the value getting copied during heap compaction. fixed (byte* pinnedHmacKey = hmacKey) @@ -78,7 +79,7 @@ internal static unsafe byte[] DeriveKeyFromHmac( } else { - byte[] secretAgreement = deriveSecretAgreement(otherPartyPublicKey, hash); + byte[]? secretAgreement = deriveSecretAgreement(otherPartyPublicKey, hash); // We want the side effect, and it should not have returned the answer. Debug.Assert(secretAgreement == null); } @@ -117,7 +118,7 @@ internal static unsafe byte[] DeriveKeyTls( const int Sha1Size = 20; const int Md5Size = 16; - byte[] secretAgreement = deriveSecretAgreement(otherPartyPublicKey, null); + byte[]? secretAgreement = deriveSecretAgreement(otherPartyPublicKey, null); Debug.Assert(secretAgreement != null); // Reduce the likelihood of the value getting copied during heap compaction. diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.Derive.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.Derive.cs index 30a81b6fb9c37f..877d7367e58095 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.Derive.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.Derive.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using Microsoft.Win32.SafeHandles; @@ -22,8 +23,8 @@ public override byte[] DeriveKeyMaterial(ECDiffieHellmanPublicKey otherPartyPubl public override byte[] DeriveKeyFromHash( ECDiffieHellmanPublicKey otherPartyPublicKey, HashAlgorithmName hashAlgorithm, - byte[] secretPrepend, - byte[] secretAppend) + byte[]? secretPrepend, + byte[]? secretAppend) { if (otherPartyPublicKey == null) throw new ArgumentNullException(nameof(otherPartyPublicKey)); @@ -43,9 +44,9 @@ public override byte[] DeriveKeyFromHash( public override byte[] DeriveKeyFromHmac( ECDiffieHellmanPublicKey otherPartyPublicKey, HashAlgorithmName hashAlgorithm, - byte[] hmacKey, - byte[] secretPrepend, - byte[] secretAppend) + byte[]? hmacKey, + byte[]? secretPrepend, + byte[]? secretAppend) { if (otherPartyPublicKey == null) throw new ArgumentNullException(nameof(otherPartyPublicKey)); @@ -84,7 +85,7 @@ public override byte[] DeriveKeyTls(ECDiffieHellmanPublicKey otherPartyPublicKey /// /// Get the secret agreement generated between two parties /// - private byte[] DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash hasher) + private byte[]? DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash? hasher) { Debug.Assert(otherPartyPublicKey != null); @@ -92,7 +93,7 @@ private byte[] DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKe // which will throw an OpenSslCryptoException if no private key is available ECParameters thisKeyExplicit = ExportExplicitParameters(true); bool thisIsNamed = Interop.Crypto.EcKeyHasCurveName(_key.Value); - ECDiffieHellmanOpenSslPublicKey otherKey = otherPartyPublicKey as ECDiffieHellmanOpenSslPublicKey; + ECDiffieHellmanOpenSslPublicKey? otherKey = otherPartyPublicKey as ECDiffieHellmanOpenSslPublicKey; bool disposeOtherKey = false; if (otherKey == null) @@ -109,9 +110,9 @@ private byte[] DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKe bool otherIsNamed = otherKey.HasCurveName; - SafeEvpPKeyHandle ourKey = null; - SafeEvpPKeyHandle theirKey = null; - byte[] rented = null; + SafeEvpPKeyHandle? ourKey = null; + SafeEvpPKeyHandle? theirKey = null; + byte[]? rented = null; int secretLength = 0; try diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.cs index c82ece03658ff5..ffb24db56d42b3 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.cs @@ -42,7 +42,7 @@ protected override void Dispose(bool disposing) if (disposing) { _key?.Dispose(); - _key = null; + _key = null!; } base.Dispose(disposing); diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSslPublicKey.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSslPublicKey.cs index 3bde2dd38957e5..3977421402050b 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSslPublicKey.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSslPublicKey.cs @@ -70,7 +70,7 @@ protected override void Dispose(bool disposing) if (disposing) { _key?.Dispose(); - _key = null; + _key = null!; } base.Dispose(disposing); diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanSecurityTransforms.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanSecurityTransforms.cs index 347c55d59f3dfe..6c02379fd19be2 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanSecurityTransforms.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanSecurityTransforms.cs @@ -126,8 +126,8 @@ public override byte[] DeriveKeyMaterial(ECDiffieHellmanPublicKey otherPartyPubl public override byte[] DeriveKeyFromHash( ECDiffieHellmanPublicKey otherPartyPublicKey, HashAlgorithmName hashAlgorithm, - byte[] secretPrepend, - byte[] secretAppend) + byte[]? secretPrepend, + byte[]? secretAppend) { if (otherPartyPublicKey == null) throw new ArgumentNullException(nameof(otherPartyPublicKey)); @@ -147,9 +147,9 @@ public override byte[] DeriveKeyFromHash( public override byte[] DeriveKeyFromHmac( ECDiffieHellmanPublicKey otherPartyPublicKey, HashAlgorithmName hashAlgorithm, - byte[] hmacKey, - byte[] secretPrepend, - byte[] secretAppend) + byte[]? hmacKey, + byte[]? secretPrepend, + byte[]? secretAppend) { if (otherPartyPublicKey == null) throw new ArgumentNullException(nameof(otherPartyPublicKey)); @@ -186,7 +186,7 @@ public override byte[] DeriveKeyTls(ECDiffieHellmanPublicKey otherPartyPublicKey (pubKey, hasher) => DeriveSecretAgreement(pubKey, hasher)); } - private byte[] DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash hasher) + private byte[]? DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash? hasher) { if (!(otherPartyPublicKey is ECDiffieHellmanSecurityTransformsPublicKey secTransPubKey)) { @@ -205,7 +205,7 @@ private byte[] DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKe nameof(otherPartyPublicKey)); } - SafeSecKeyRefHandle thisPrivate = GetKeys().PrivateKey; + SafeSecKeyRefHandle? thisPrivate = GetKeys().PrivateKey; if (thisPrivate == null) { @@ -216,7 +216,7 @@ private byte[] DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKe // 66 bytes ((521 + 7) / 8), the Span path will always succeed. Span secretSpan = stackalloc byte[66]; - byte[] secret = Interop.AppleCrypto.EcdhKeyAgree( + byte[]? secret = Interop.AppleCrypto.EcdhKeyAgree( thisPrivate, otherPublic, secretSpan, diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDsaCng.ImportExport.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDsaCng.ImportExport.cs index 03814d89b9d6ec..4d538c214daf04 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDsaCng.ImportExport.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDsaCng.ImportExport.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using Internal.NativeCrypto; namespace System.Security.Cryptography @@ -44,7 +45,7 @@ public override void ImportParameters(ECParameters parameters) { // FriendlyName is required; an attempt was already made to default it in ECCurve if (string.IsNullOrEmpty(curve.Oid.FriendlyName)) - throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_InvalidCurveOid, curve.Oid.Value.ToString())); + throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_InvalidCurveOid, curve.Oid.Value!.ToString())); byte[] ecNamedCurveBlob = ECCng.GetNamedCurveBlob(ref parameters, ecdh: false); ImportKeyBlob(ecNamedCurveBlob, curve.Oid.FriendlyName, includePrivateParameters); @@ -85,7 +86,7 @@ public override ECParameters ExportParameters(bool includePrivateParameters) { ECParameters ecparams = default; - string curveName = GetCurveName(out string oidValue); + string? curveName = GetCurveName(out string? oidValue); if (string.IsNullOrEmpty(curveName)) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDsaOpenSsl.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDsaOpenSsl.cs index a87059ac1b63fb..a95b3dbb90142f 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDsaOpenSsl.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDsaOpenSsl.cs @@ -169,7 +169,7 @@ protected override void Dispose(bool disposing) if (disposing) { _key?.Dispose(); - _key = null; + _key = null!; } base.Dispose(disposing); diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECOpenSsl.ImportExport.cs b/src/libraries/Common/src/System/Security/Cryptography/ECOpenSsl.ImportExport.cs index f6b4bcb8493acb..609ec1125a4cf3 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECOpenSsl.ImportExport.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECOpenSsl.ImportExport.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using Microsoft.Win32.SafeHandles; using System.Diagnostics; @@ -109,12 +110,12 @@ private static SafeEcKeyHandle ImportNamedCurveParameters(ECParameters parameter // Use oid Value first if present, otherwise FriendlyName string oid = !string.IsNullOrEmpty(parameters.Curve.Oid.Value) ? - parameters.Curve.Oid.Value : parameters.Curve.Oid.FriendlyName; + parameters.Curve.Oid.Value : parameters.Curve.Oid.FriendlyName!; SafeEcKeyHandle key = Interop.Crypto.EcKeyCreateByKeyParameters( oid, - parameters.Q.X, parameters.Q.X.Length, - parameters.Q.Y, parameters.Q.Y.Length, + parameters.Q.X!, parameters.Q.X!.Length, + parameters.Q.Y!, parameters.Q.Y!.Length, parameters.D, parameters.D == null ? 0 : parameters.D.Length); return key; @@ -125,16 +126,16 @@ private static SafeEcKeyHandle ImportPrimeCurveParameters(ECParameters parameter Debug.Assert(parameters.Curve.IsPrime); SafeEcKeyHandle key = Interop.Crypto.EcKeyCreateByExplicitParameters( parameters.Curve.CurveType, - parameters.Q.X, parameters.Q.X.Length, - parameters.Q.Y, parameters.Q.Y.Length, + parameters.Q.X, parameters.Q.X!.Length, + parameters.Q.Y, parameters.Q.Y!.Length, parameters.D, parameters.D == null ? 0 : parameters.D.Length, - parameters.Curve.Prime, parameters.Curve.Prime.Length, - parameters.Curve.A, parameters.Curve.A.Length, - parameters.Curve.B, parameters.Curve.B.Length, - parameters.Curve.G.X, parameters.Curve.G.X.Length, - parameters.Curve.G.Y, parameters.Curve.G.Y.Length, - parameters.Curve.Order, parameters.Curve.Order.Length, - parameters.Curve.Cofactor, parameters.Curve.Cofactor.Length, + parameters.Curve.Prime!, parameters.Curve.Prime!.Length, + parameters.Curve.A!, parameters.Curve.A!.Length, + parameters.Curve.B!, parameters.Curve.B!.Length, + parameters.Curve.G.X!, parameters.Curve.G.X!.Length, + parameters.Curve.G.Y!, parameters.Curve.G.Y!.Length, + parameters.Curve.Order!, parameters.Curve.Order!.Length, + parameters.Curve.Cofactor, parameters.Curve.Cofactor!.Length, parameters.Curve.Seed, parameters.Curve.Seed == null ? 0 : parameters.Curve.Seed.Length); return key; @@ -145,16 +146,16 @@ private static SafeEcKeyHandle ImportCharacteristic2CurveParameters(ECParameters Debug.Assert(parameters.Curve.IsCharacteristic2); SafeEcKeyHandle key = Interop.Crypto.EcKeyCreateByExplicitParameters( parameters.Curve.CurveType, - parameters.Q.X, parameters.Q.X.Length, - parameters.Q.Y, parameters.Q.Y.Length, + parameters.Q.X, parameters.Q.X!.Length, + parameters.Q.Y, parameters.Q.Y!.Length, parameters.D, parameters.D == null ? 0 : parameters.D.Length, - parameters.Curve.Polynomial, parameters.Curve.Polynomial.Length, - parameters.Curve.A, parameters.Curve.A.Length, - parameters.Curve.B, parameters.Curve.B.Length, - parameters.Curve.G.X, parameters.Curve.G.X.Length, - parameters.Curve.G.Y, parameters.Curve.G.Y.Length, - parameters.Curve.Order, parameters.Curve.Order.Length, - parameters.Curve.Cofactor, parameters.Curve.Cofactor.Length, + parameters.Curve.Polynomial!, parameters.Curve.Polynomial!.Length, + parameters.Curve.A!, parameters.Curve.A!.Length, + parameters.Curve.B!, parameters.Curve.B!.Length, + parameters.Curve.G.X!, parameters.Curve.G.X!.Length, + parameters.Curve.G.Y!, parameters.Curve.G.Y!.Length, + parameters.Curve.Order!, parameters.Curve.Order!.Length, + parameters.Curve.Cofactor, parameters.Curve.Cofactor!.Length, parameters.Curve.Seed, parameters.Curve.Seed == null ? 0 : parameters.Curve.Seed.Length); return key; @@ -170,7 +171,7 @@ private static void CheckInvalidKey(SafeEcKeyHandle key) public static SafeEcKeyHandle GenerateKeyByKeySize(int keySize) { - string oid = null; + string oid; switch (keySize) { case 256: oid = ECDSA_P256_OID_VALUE; break; @@ -181,7 +182,7 @@ public static SafeEcKeyHandle GenerateKeyByKeySize(int keySize) throw new InvalidOperationException(SR.Cryptography_InvalidKeySize); } - SafeEcKeyHandle key = Interop.Crypto.EcKeyCreateByOid(oid); + SafeEcKeyHandle? key = Interop.Crypto.EcKeyCreateByOid(oid); if (key == null || key.IsInvalid) throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, oid)); diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECOpenSsl.cs b/src/libraries/Common/src/System/Security/Cryptography/ECOpenSsl.cs index b2e2eb4edf447c..d41b8016e71aee 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECOpenSsl.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECOpenSsl.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using Microsoft.Win32.SafeHandles; @@ -9,7 +10,7 @@ namespace System.Security.Cryptography { internal sealed partial class ECOpenSsl : IDisposable { - private Lazy _key; + private Lazy _key = null!; // Always initialized public ECOpenSsl(ECCurve curve) { @@ -86,12 +87,11 @@ internal int GenerateKey(ECCurve curve) if (curve.IsNamed) { - string oid = null; // Use oid Value first if present, otherwise FriendlyName because Oid maintains a hard-coded // cache that may have different casing for FriendlyNames than OpenSsl - oid = !string.IsNullOrEmpty(curve.Oid.Value) ? curve.Oid.Value : curve.Oid.FriendlyName; + string oid = !string.IsNullOrEmpty(curve.Oid.Value) ? curve.Oid.Value : curve.Oid.FriendlyName!; - SafeEcKeyHandle key = Interop.Crypto.EcKeyCreateByOid(oid); + SafeEcKeyHandle? key = Interop.Crypto.EcKeyCreateByOid(oid); if (key == null || key.IsInvalid) { @@ -132,7 +132,7 @@ private void FreeKey() _key.Value?.Dispose(); } - _key = null; + _key = null!; } } } diff --git a/src/libraries/Common/src/System/Security/Cryptography/EccKeyFormatHelper.cs b/src/libraries/Common/src/System/Security/Cryptography/EccKeyFormatHelper.cs index cae5d7c10f2f48..785fa560cf5e38 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/EccKeyFormatHelper.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/EccKeyFormatHelper.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Buffers; using System.Collections; using System.Diagnostics; @@ -138,7 +139,7 @@ internal static void FromECPrivateKey( } else { - domainParameters = ECDomainParameters.Decode(algId.Parameters.Value, AsnEncodingRules.DER); + domainParameters = ECDomainParameters.Decode(algId.Parameters!.Value, AsnEncodingRules.DER); } ret = new ECParameters @@ -488,10 +489,11 @@ private static void WriteEcParameters(ECParameters ecParameters, AsnWriter write // On Windows the FriendlyName is populated in places where the Value mightn't be. if (string.IsNullOrEmpty(oid.Value)) { + Debug.Assert(oid.FriendlyName != null); oid = Oid.FromFriendlyName(oid.FriendlyName, OidGroup.All); } - writer.WriteObjectIdentifier(oid.Value); + writer.WriteObjectIdentifier(oid.Value!); } else if (ecParameters.Curve.IsExplicit) { @@ -605,7 +607,7 @@ private static void DetermineChar2Parameters( ref int k2, ref int k3) { - byte[] polynomial = ecParameters.Curve.Polynomial; + byte[] polynomial = ecParameters.Curve.Polynomial!; int lastIndex = polynomial.Length - 1; // The most significant byte needs a set bit, and the least significant bit must be set. @@ -691,8 +693,8 @@ private static void DetermineChar2Parameters( private static void WriteCurve(in ECCurve curve, AsnWriter writer) { writer.PushSequence(); - WriteFieldElement(curve.A, writer); - WriteFieldElement(curve.B, writer); + WriteFieldElement(curve.A!, writer); + WriteFieldElement(curve.B!, writer); if (curve.Seed != null) { @@ -716,7 +718,7 @@ private static void WriteFieldElement(byte[] fieldElement, AsnWriter writer) private static void WriteUncompressedBasePoint(in ECParameters ecParameters, AsnWriter writer) { - int basePointLength = ecParameters.Curve.G.X.Length * 2 + 1; + int basePointLength = ecParameters.Curve.G.X!.Length * 2 + 1; byte[] tmp = CryptoPool.Rent(basePointLength); tmp[0] = 0x04; ecParameters.Curve.G.X.CopyTo(tmp.AsSpan(1)); @@ -728,7 +730,7 @@ private static void WriteUncompressedBasePoint(in ECParameters ecParameters, Asn private static void WriteUncompressedPublicKey(in ECParameters ecParameters, AsnWriter writer) { - int publicKeyLength = ecParameters.Q.X.Length * 2 + 1; + int publicKeyLength = ecParameters.Q.X!.Length * 2 + 1; writer.WriteBitString( publicKeyLength, @@ -737,7 +739,7 @@ private static void WriteUncompressedPublicKey(in ECParameters ecParameters, Asn { publicKeyBytes[0] = 0x04; point.X.AsSpan().CopyTo(publicKeyBytes.Slice(1)); - point.Y.AsSpan().CopyTo(publicKeyBytes.Slice(1 + point.X.Length)); + point.Y.AsSpan().CopyTo(publicKeyBytes.Slice(1 + point.X!.Length)); }); } diff --git a/src/libraries/Common/src/System/Security/Cryptography/EccSecurityTransforms.cs b/src/libraries/Common/src/System/Security/Cryptography/EccSecurityTransforms.cs index 97f2369c717ed4..d0957118122885 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/EccSecurityTransforms.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/EccSecurityTransforms.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Buffers; using System.Diagnostics; using System.Runtime.InteropServices; @@ -12,7 +13,7 @@ namespace System.Security.Cryptography { internal sealed class EccSecurityTransforms : IDisposable { - private SecKeyPair _keys; + private SecKeyPair? _keys; private bool _disposed; private readonly string _disposedName; @@ -90,7 +91,7 @@ internal SecKeyPair GetOrGenerateKeys(int keySizeInBits) { ThrowIfDisposed(); - SecKeyPair current = _keys; + SecKeyPair? current = _keys; if (current != null) { @@ -111,7 +112,7 @@ private void SetKey(SecKeyPair keyPair) { ThrowIfDisposed(); - SecKeyPair current = _keys; + SecKeyPair? current = _keys; _keys = keyPair; current?.Dispose(); } diff --git a/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.cs b/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.cs index 2647c3541dbdb9..5ec20090be9354 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.cs @@ -2,8 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Buffers; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security.Cryptography.Asn1; @@ -233,7 +235,7 @@ private static void ReadEncryptedPkcs8( if (innerRead != decryptedMemory.Length) { - ret = default; + ret = default!; throw new CryptographicException(SR.Cryptography_Der_Invalid_Encoding); } @@ -329,9 +331,9 @@ private static unsafe AsnWriter WriteEncryptedPkcs8( out string encryptionAlgorithmOid, out bool isPkcs12); - byte[] encryptedRent = null; + byte[]? encryptedRent = null; Span encryptedSpan = default; - AsnWriter writer = null; + AsnWriter? writer = null; try { @@ -385,7 +387,7 @@ private static unsafe AsnWriter WriteEncryptedPkcs8( finally { CryptographicOperations.ZeroMemory(encryptedSpan); - CryptoPool.Return(encryptedRent, clearSize: 0); + CryptoPool.Return(encryptedRent!, clearSize: 0); writer?.Dispose(); cipher.Dispose(); @@ -485,7 +487,7 @@ internal static AsnWriter ReencryptPkcs8( finally { CryptographicOperations.ZeroMemory(decrypted); - CryptoPool.Return(decrypted.Array, clearSize: 0); + CryptoPool.Return(decrypted.Array!, clearSize: 0); } } @@ -524,7 +526,7 @@ internal static AsnWriter ReencryptPkcs8( finally { CryptographicOperations.ZeroMemory(decrypted); - CryptoPool.Return(decrypted.Array, clearSize: 0); + CryptoPool.Return(decrypted.Array!, clearSize: 0); } } } diff --git a/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs b/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs index c5af8f15ac1b6f..5780e28eb74db7 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; @@ -77,7 +78,7 @@ internal static unsafe int Decrypt( // Maybe some future PBES3 will have one with a default. HashAlgorithmName digestAlgorithmName; - SymmetricAlgorithm cipher = null; + SymmetricAlgorithm? cipher = null; bool pkcs12 = false; @@ -161,8 +162,8 @@ internal static unsafe int Decrypt( { Span buf = stackalloc byte[128]; ReadOnlySpan effectivePasswordBytes = stackalloc byte[0]; - byte[] rented = null; - System.Text.Encoding encoding = null; + byte[]? rented = null; + System.Text.Encoding? encoding = null; if (passwordBytes.Length > 0 || password.Length == 0) { @@ -299,7 +300,7 @@ internal static unsafe int Encrypt( byte[] destination, Span ivDest) { - byte[] pwdTmpBytes = null; + byte[]? pwdTmpBytes = null; byte[] derivedKey; byte[] iv = cipher.IV; @@ -356,14 +357,14 @@ internal static unsafe int Encrypt( { if (passwordBytes.Length > 0) { - Debug.Assert(pwdTmpBytes.Length == passwordBytes.Length); + Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); passwordBytes.CopyTo(pwdTmpBytes); } else if (password.Length > 0) { int length = encoding.GetBytes(password, pwdTmpBytes); - if (length != pwdTmpBytes.Length) + if (length != pwdTmpBytes!.Length) { Debug.Fail($"UTF-8 encoding size changed between GetByteCount and GetBytes"); throw new CryptographicException(); @@ -371,7 +372,7 @@ internal static unsafe int Encrypt( } else { - Debug.Assert(pwdTmpBytes.Length == 0); + Debug.Assert(pwdTmpBytes!.Length == 0); } using (var pbkdf2 = new Rfc2898DeriveBytes(pwdTmpBytes, salt.ToArray(), iterationCount, prf)) @@ -436,8 +437,8 @@ private static unsafe int Pbes2Decrypt( { Span buf = stackalloc byte[128]; ReadOnlySpan effectivePasswordBytes = stackalloc byte[0]; - byte[] rented = null; - System.Text.Encoding encoding = null; + byte[]? rented = null; + System.Text.Encoding? encoding = null; if (passwordBytes.Length > 0 || password.Length == 0) { @@ -547,7 +548,7 @@ private static SymmetricAlgorithm OpenCipher( byte? requestedKeyLength, ref Span iv) { - string algId = encryptionScheme.Algorithm.Value; + string? algId = encryptionScheme.Algorithm.Value; if (algId == Oids.Aes128Cbc || algId == Oids.Aes192Cbc || diff --git a/src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs b/src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs index f7f76871fee800..c2c6188c1cac40 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Collections.Generic; using System.Diagnostics; using System.Text; @@ -85,7 +86,7 @@ private static void Derive( // https://tools.ietf.org/html/rfc7292#appendix-B.2 Debug.Assert(iterationCount >= 1); - if (!s_uvLookup.TryGetValue(hashAlgorithm, out Tuple uv)) + if (!s_uvLookup.TryGetValue(hashAlgorithm, out Tuple? uv)) { throw new CryptographicException(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithm.Name); } @@ -128,7 +129,7 @@ private static void Derive( // 4. Set I=S||P to be the concatenation of S and P. int ILen = SLen + PLen; Span I = stackalloc byte[0]; - byte[] IRented = null; + byte[]? IRented = null; if (ILen <= 1024) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSACng.ImportExport.cs b/src/libraries/Common/src/System/Security/Cryptography/RSACng.ImportExport.cs index 79fe528b3516dd..1e577f7437b8cb 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RSACng.ImportExport.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RSACng.ImportExport.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using Internal.Cryptography; using Internal.NativeCrypto; @@ -104,8 +105,8 @@ public override void ImportParameters(RSAParameters parameters) parameters.Modulus.Length; if (includePrivate) { - blobSize += parameters.P.Length + - parameters.Q.Length; + blobSize += parameters.P!.Length + + parameters.Q!.Length; } byte[] rsaBlob = new byte[blobSize]; @@ -120,8 +121,8 @@ public override void ImportParameters(RSAParameters parameters) if (includePrivate) { - pBcryptBlob->cbPrime1 = parameters.P.Length; - pBcryptBlob->cbPrime2 = parameters.Q.Length; + pBcryptBlob->cbPrime1 = parameters.P!.Length; + pBcryptBlob->cbPrime2 = parameters.Q!.Length; } int offset = sizeof(BCRYPT_RSAKEY_BLOB); @@ -131,8 +132,8 @@ public override void ImportParameters(RSAParameters parameters) if (includePrivate) { - Interop.BCrypt.Emit(rsaBlob, ref offset, parameters.P); - Interop.BCrypt.Emit(rsaBlob, ref offset, parameters.Q); + Interop.BCrypt.Emit(rsaBlob, ref offset, parameters.P!); + Interop.BCrypt.Emit(rsaBlob, ref offset, parameters.Q!); } // We better have computed the right allocation size above! diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSACng.SignVerify.cs b/src/libraries/Common/src/System/Security/Cryptography/RSACng.SignVerify.cs index 3560eff152ba9c..1c73ed5f3433dd 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RSACng.SignVerify.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RSACng.SignVerify.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Collections.Concurrent; using System.Collections.Generic; using System.Runtime.InteropServices; @@ -35,7 +36,7 @@ private static int GetHashSizeInBytes(HashAlgorithmName hashAlgorithm) hashAlgorithm, alg => { - using (HashProviderCng hashProvider = new HashProviderCng(alg.Name, null)) + using (HashProviderCng hashProvider = new HashProviderCng(alg.Name!, null)) { return hashProvider.HashSizeInBytes; } @@ -52,7 +53,7 @@ public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RS throw new ArgumentNullException(nameof(hash)); } - string hashAlgorithmName = hashAlgorithm.Name; + string? hashAlgorithmName = hashAlgorithm.Name; if (string.IsNullOrEmpty(hashAlgorithmName)) { throw new ArgumentException(SR.Cryptography_HashAlgorithmNameNullOrEmpty, nameof(hashAlgorithm)); @@ -99,7 +100,7 @@ public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RS public override unsafe bool TrySignHash(ReadOnlySpan hash, Span destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) { - string hashAlgorithmName = hashAlgorithm.Name; + string? hashAlgorithmName = hashAlgorithm.Name; if (string.IsNullOrEmpty(hashAlgorithmName)) { throw new ArgumentException(SR.Cryptography_HashAlgorithmNameNullOrEmpty, nameof(hashAlgorithm)); @@ -159,7 +160,7 @@ public override bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName public override unsafe bool VerifyHash(ReadOnlySpan hash, ReadOnlySpan signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) { - string hashAlgorithmName = hashAlgorithm.Name; + string? hashAlgorithmName = hashAlgorithm.Name; if (string.IsNullOrEmpty(hashAlgorithmName)) { throw new ArgumentException(SR.Cryptography_HashAlgorithmNameNullOrEmpty, nameof(hashAlgorithm)); diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs b/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs index cb0b92fd0b9741..8a135300080250 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Buffers; using System.Diagnostics; using System.IO; @@ -88,11 +89,11 @@ public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) if (padding == null) throw new ArgumentNullException(nameof(padding)); - Interop.Crypto.RsaPadding rsaPadding = GetInteropPadding(padding, out RsaPaddingProcessor oaepProcessor); + Interop.Crypto.RsaPadding rsaPadding = GetInteropPadding(padding, out RsaPaddingProcessor? oaepProcessor); SafeRsaHandle key = GetKey(); int rsaSize = Interop.Crypto.RsaSize(key); - byte[] buf = null; + byte[]? buf = null; Span destination = default; try @@ -111,7 +112,7 @@ public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) finally { CryptographicOperations.ZeroMemory(destination); - CryptoPool.Return(buf, clearSize: 0); + CryptoPool.Return(buf!, clearSize: 0); } } @@ -126,7 +127,7 @@ public override bool TryDecrypt( throw new ArgumentNullException(nameof(padding)); } - Interop.Crypto.RsaPadding rsaPadding = GetInteropPadding(padding, out RsaPaddingProcessor oaepProcessor); + Interop.Crypto.RsaPadding rsaPadding = GetInteropPadding(padding, out RsaPaddingProcessor? oaepProcessor); SafeRsaHandle key = GetKey(); int keySizeBytes = Interop.Crypto.RsaSize(key); @@ -136,7 +137,7 @@ public override bool TryDecrypt( if (destination.Length < keySizeBytes) { Span tmp = stackalloc byte[0]; - byte[] rent = null; + byte[]? rent = null; // RSA up through 4096 stackalloc if (keySizeBytes <= 512) @@ -185,7 +186,7 @@ private static bool TryDecrypt( ReadOnlySpan data, Span destination, Interop.Crypto.RsaPadding rsaPadding, - RsaPaddingProcessor rsaPaddingProcessor, + RsaPaddingProcessor? rsaPaddingProcessor, out int bytesWritten) { // If rsaPadding is PKCS1 or OAEP-SHA1 then no depadding method should be present. @@ -211,7 +212,7 @@ private static bool TryDecrypt( } Span decryptBuf = destination; - byte[] paddingBuf = null; + byte[]? paddingBuf = null; if (rsaPaddingProcessor != null) { @@ -259,7 +260,7 @@ public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) if (padding == null) throw new ArgumentNullException(nameof(padding)); - Interop.Crypto.RsaPadding rsaPadding = GetInteropPadding(padding, out RsaPaddingProcessor oaepProcessor); + Interop.Crypto.RsaPadding rsaPadding = GetInteropPadding(padding, out RsaPaddingProcessor? oaepProcessor); SafeRsaHandle key = GetKey(); byte[] buf = new byte[Interop.Crypto.RsaSize(key)]; @@ -288,7 +289,7 @@ public override bool TryEncrypt(ReadOnlySpan data, Span destination, throw new ArgumentNullException(nameof(padding)); } - Interop.Crypto.RsaPadding rsaPadding = GetInteropPadding(padding, out RsaPaddingProcessor oaepProcessor); + Interop.Crypto.RsaPadding rsaPadding = GetInteropPadding(padding, out RsaPaddingProcessor? oaepProcessor); SafeRsaHandle key = GetKey(); return TryEncrypt(key, data, destination, rsaPadding, oaepProcessor, out bytesWritten); @@ -299,7 +300,7 @@ private static bool TryEncrypt( ReadOnlySpan data, Span destination, Interop.Crypto.RsaPadding rsaPadding, - RsaPaddingProcessor rsaPaddingProcessor, + RsaPaddingProcessor? rsaPaddingProcessor, out int bytesWritten) { int rsaSize = Interop.Crypto.RsaSize(key); @@ -346,7 +347,7 @@ private static bool TryEncrypt( private static Interop.Crypto.RsaPadding GetInteropPadding( RSAEncryptionPadding padding, - out RsaPaddingProcessor rsaPaddingProcessor) + out RsaPaddingProcessor? rsaPaddingProcessor) { if (padding == RSAEncryptionPadding.Pkcs1) { @@ -487,7 +488,7 @@ protected override void Dispose(bool disposing) if (disposing) { FreeKey(); - _key = null; + _key = null!; } base.Dispose(disposing); @@ -641,7 +642,7 @@ public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RS hashAlgorithm, padding, true, out int bytesWritten, - out byte[] signature)) + out byte[]? signature)) { Debug.Fail("TrySignHash should not return false in allocation mode"); throw new CryptographicException(); @@ -674,7 +675,7 @@ public override bool TrySignHash( padding, false, out bytesWritten, - out byte[] alloced); + out byte[]? alloced); Debug.Assert(alloced == null); return ret; @@ -687,7 +688,7 @@ private bool TrySignHash( RSASignaturePadding padding, bool allocateSignature, out int bytesWritten, - out byte[] signature) + out byte[]? signature) { Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name)); Debug.Assert(padding != null); @@ -851,7 +852,7 @@ private static int GetAlgorithmNid(HashAlgorithmName hashAlgorithmName) { // All of the current HashAlgorithmName values correspond to the SN values in OpenSSL 0.9.8. // If there's ever a new one that doesn't, translate it here. - string sn = hashAlgorithmName.Name; + string sn = hashAlgorithmName.Name!; int nid = Interop.Crypto.ObjSn2Nid(sn); diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs b/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs index 683086e6ae9d05..a21db3de01c22a 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Buffers; using System.Diagnostics; using System.IO; @@ -27,7 +28,7 @@ internal static partial class RSAImplementation { public sealed partial class RSASecurityTransforms : RSA { - private SecKeyPair _keys; + private SecKeyPair? _keys; public RSASecurityTransforms() : this(2048) @@ -326,7 +327,7 @@ public override bool TryEncrypt(ReadOnlySpan data, Span destination, out bytesWritten); } - RsaPaddingProcessor processor; + RsaPaddingProcessor? processor; switch (padding.Mode) { @@ -558,7 +559,7 @@ public override bool TrySignHash(ReadOnlySpan hash, Span destination ThrowIfDisposed(); - RsaPaddingProcessor processor = null; + RsaPaddingProcessor? processor = null; if (padding.Mode == RSASignaturePaddingMode.Pss) { @@ -774,7 +775,7 @@ private static Interop.AppleCrypto.PAL_HashAlgorithm PalAlgorithmFromAlgorithmNa private void ThrowIfDisposed() { - SecKeyPair current = _keys; + SecKeyPair? current = _keys; if (current != null && current.PublicKey == null) { @@ -785,7 +786,7 @@ private void ThrowIfDisposed() internal SecKeyPair GetKeys() { ThrowIfDisposed(); - SecKeyPair current = _keys; + SecKeyPair? current = _keys; if (current != null) { @@ -806,7 +807,7 @@ private void SetKey(SecKeyPair newKeyPair) { ThrowIfDisposed(); - SecKeyPair current = _keys; + SecKeyPair? current = _keys; _keys = newKeyPair; current?.Dispose(); diff --git a/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs b/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs index 2f54f033c64b1c..c180a77b99e487 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Buffers.Binary; using System.Collections.Concurrent; using System.Diagnostics; @@ -10,8 +11,6 @@ namespace System.Security.Cryptography { internal sealed class RsaPaddingProcessor { - private static readonly byte[] s_eightZeros = new byte[8]; - private static readonly ConcurrentDictionary s_lookup = new ConcurrentDictionary(); @@ -29,6 +28,8 @@ internal static int BytesRequiredForBitCount(int keySizeInBits) return (int)(((uint)keySizeInBits + 7) / 8); } + private static ReadOnlySpan EightZeros => new byte[8]; // rely on C# compiler optimization to eliminate allocation + internal int HashLength => _hLen; internal static RsaPaddingProcessor OpenProcessor(HashAlgorithmName hashAlgorithmName) @@ -87,7 +88,7 @@ internal void PadOaep( { // https://tools.ietf.org/html/rfc3447#section-7.1.1 - byte[] dbMask = null; + byte[]? dbMask = null; Span dbMaskSpan = Span.Empty; try @@ -313,7 +314,7 @@ internal void EncodePss(ReadOnlySpan mHash, Span destination, int ke // 5. Let M' = an octet string of 8 zeros concat mHash concat salt // 6. Let H = Hash(M') - hasher.AppendData(s_eightZeros); + hasher.AppendData(EightZeros); hasher.AppendData(mHash); hasher.AppendData(salt); @@ -434,7 +435,7 @@ internal bool VerifyPss(ReadOnlySpan mHash, ReadOnlySpan em, int key ReadOnlySpan salt = dbMask.Slice(dbMask.Length - sLen); // 12/13. Let H' = Hash(eight zeros || mHash || salt) - hasher.AppendData(s_eightZeros); + hasher.AppendData(EightZeros); hasher.AppendData(mHash); hasher.AppendData(salt); diff --git a/src/libraries/Common/src/System/Security/Cryptography/SecKeyPair.cs b/src/libraries/Common/src/System/Security/Cryptography/SecKeyPair.cs index 45719a680b7192..219a03ec4ee746 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/SecKeyPair.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/SecKeyPair.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Security.Cryptography.Apple; namespace System.Security.Cryptography @@ -9,9 +10,9 @@ namespace System.Security.Cryptography internal sealed class SecKeyPair : IDisposable { internal SafeSecKeyRefHandle PublicKey { get; private set; } - internal SafeSecKeyRefHandle PrivateKey { get; private set; } + internal SafeSecKeyRefHandle? PrivateKey { get; private set; } - private SecKeyPair(SafeSecKeyRefHandle publicKey, SafeSecKeyRefHandle privateKey) + private SecKeyPair(SafeSecKeyRefHandle publicKey, SafeSecKeyRefHandle? privateKey) { PublicKey = publicKey; PrivateKey = privateKey; @@ -22,7 +23,7 @@ public void Dispose() PrivateKey?.Dispose(); PrivateKey = null; PublicKey?.Dispose(); - PublicKey = null; + PublicKey = null!; } internal static SecKeyPair PublicPrivatePair(SafeSecKeyRefHandle publicKey, SafeSecKeyRefHandle privateKey) diff --git a/src/libraries/Common/src/System/Security/IdentityHelper.cs b/src/libraries/Common/src/System/Security/IdentityHelper.cs index 73c70741fbfe54..9f77861890f1c3 100644 --- a/src/libraries/Common/src/System/Security/IdentityHelper.cs +++ b/src/libraries/Common/src/System/Security/IdentityHelper.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Diagnostics; using System.IO; using System.Reflection; @@ -38,9 +39,9 @@ internal static string GetNormalizedUriHash(Uri uri) /// Uses the AssemblyName's public key to generate a hash equivalent to what /// StrongName.Normalize() gives. /// - internal static string GetNormalizedStrongNameHash(AssemblyName name) + internal static string? GetNormalizedStrongNameHash(AssemblyName name) { - byte[] publicKey = name.GetPublicKey(); + byte[]? publicKey = name.GetPublicKey(); // If we don't have a key, we're not strong named if (publicKey == null || publicKey.Length == 0) @@ -51,8 +52,8 @@ internal static string GetNormalizedStrongNameHash(AssemblyName name) using (BinaryWriter bw = new BinaryWriter(ms)) { bw.Write(publicKey); - bw.Write(name.Version.Major); - bw.Write(name.Name); + bw.Write(name.Version!.Major); + bw.Write(name.Name!); ms.Position = 0; return GetStrongHashSuitableForObjectName(ms); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/TaskCompletionSourceWithCancellation.cs b/src/libraries/Common/src/System/Threading/Tasks/TaskCompletionSourceWithCancellation.cs similarity index 67% rename from src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/TaskCompletionSourceWithCancellation.cs rename to src/libraries/Common/src/System/Threading/Tasks/TaskCompletionSourceWithCancellation.cs index 4d2cba1a6750e8..c19e22fabe02ae 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/TaskCompletionSourceWithCancellation.cs +++ b/src/libraries/Common/src/System/Threading/Tasks/TaskCompletionSourceWithCancellation.cs @@ -2,11 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Threading; -using System.Threading.Tasks; - -namespace System.Net.Http +#nullable enable +namespace System.Threading.Tasks { + /// + /// A that supports cancellation registration so that any + /// s contain the relevant , + /// while also avoiding unnecessary allocations for closure captures. + /// internal class TaskCompletionSourceWithCancellation : TaskCompletionSource { private CancellationToken _cancellationToken; @@ -23,7 +26,7 @@ private void OnCancellation() public async ValueTask WaitWithCancellationAsync(CancellationToken cancellationToken) { _cancellationToken = cancellationToken; - using (cancellationToken.UnsafeRegister(s => ((TaskCompletionSourceWithCancellation)s).OnCancellation(), this)) + using (cancellationToken.UnsafeRegister(s => ((TaskCompletionSourceWithCancellation)s!).OnCancellation(), this)) { return await Task.ConfigureAwait(false); } diff --git a/src/libraries/Common/tests/Common.Tests.csproj b/src/libraries/Common/tests/Common.Tests.csproj index e6a20cf0f2fc32..2d094017848e5d 100644 --- a/src/libraries/Common/tests/Common.Tests.csproj +++ b/src/libraries/Common/tests/Common.Tests.csproj @@ -3,7 +3,7 @@ true false true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix @@ -54,44 +54,44 @@ Common\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs - - Common\System\Net\Http\Http2\IHttpHeadersHandler.cs + + Common\System\Net\Http\aspnetcore\IHttpHeadersHandler.cs - - Common\System\Net\Http\Http2\Hpack\DynamicTable.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs - - Common\System\Net\Http\Http2\Hpack\HeaderField.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs - - Common\System\Net\Http\Http2\Hpack\HPackDecoder.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs - - Common\System\Net\Http\Http2\Hpack\HPackDecodingException.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecodingException.cs - - Common\System\Net\Http\Http2\Hpack\HPackEncoder.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs - - Common\System\Net\Http\Http2\Hpack\HPackEncodingException.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncodingException.cs - - Common\System\Net\Http\Http2\Hpack\Huffman.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs - - Common\System\Net\Http\Http2\Hpack\HuffmanDecodingException.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\HuffmanDecodingException.cs - - Common\System\Net\Http\Http2\Hpack\IntegerDecoder.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs - - Common\System\Net\Http\Http2\Hpack\IntegerEncoder.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs - - Common\System\Net\Http\Http2\Hpack\H2StaticTable.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.cs - - Common\System\Net\Http\Http2\Hpack\StatusCodes.cs + + Common\System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs Common\System\Text\ReusableTextReader.cs @@ -124,10 +124,10 @@ - - - - + + + + System\Net\Sockets\Fletcher32.cs diff --git a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.Unix.cs b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.Unix.cs index 22a7046239bccb..b4a7c5638903e3 100644 --- a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.Unix.cs +++ b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.Unix.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Reflection; using System.Runtime.InteropServices; using System.Xml.Linq; @@ -113,18 +114,21 @@ public static string LibcVersion private static Version GetICUVersion() { - if (IsWindows) + int version = 0; + Type interopGlobalization = Type.GetType("Interop+Globalization"); + if (interopGlobalization != null) { - return new Version(0, 0, 0, 0); - } - else - { - int ver = libc.GlobalizationNative_GetICUVersion(); - return new Version( ver & 0xFF, - (ver >> 8) & 0xFF, - (ver >> 16) & 0xFF, - ver >> 24); + MethodInfo methodInfo = interopGlobalization.GetMethod("GetICUVersion", BindingFlags.NonPublic | BindingFlags.Static); + if (methodInfo != null) + { + version = (int)methodInfo.Invoke(null, null); + } } + + return new Version( version & 0xFF, + (version >> 8) & 0xFF, + (version >> 16) & 0xFF, + version >> 24); } private static Version GetOSXProductVersion() @@ -327,9 +331,6 @@ private static class libc [DllImport("libc", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr gnu_get_libc_version(); - - [DllImport("System.Globalization.Native", SetLastError = true)] - public static extern int GlobalizationNative_GetICUVersion(); } } } diff --git a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs index c5d4184533aab7..36187165837e41 100644 --- a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/PlatformDetection.cs @@ -33,6 +33,8 @@ public static partial class PlatformDetection public static bool IsArgIteratorNotSupported => !IsArgIteratorSupported; public static bool Is32BitProcess => IntPtr.Size == 4; + // Please make sure that you have the libgdiplus dependency installed. + // For details, see https://docs.microsoft.com/dotnet/core/install/dependencies?pivots=os-macos&tabs=netcore31#libgdiplus public static bool IsDrawingSupported { get @@ -102,7 +104,7 @@ public static bool IsNonZeroLowerBoundArraySupported // Windows - Schannel supports alpn from win8.1/2012 R2 and higher. // Linux - OpenSsl supports alpn from openssl 1.0.2 and higher. - // OSX - SecureTransport doesn't expose alpn APIs. TODO https://github.com/dotnet/corefx/issues/33016 + // OSX - SecureTransport doesn't expose alpn APIs. TODO https://github.com/dotnet/runtime/issues/27727 public static bool SupportsAlpn => (IsWindows && !IsWindows7) || ((!IsOSX && !IsWindows) && (OpenSslVersion.Major >= 1 && (OpenSslVersion.Minor >= 1 || OpenSslVersion.Build >= 2))); diff --git a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/TestEnvironment.cs b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/TestEnvironment.cs index 6852fbc998b866..0729b8d257893c 100644 --- a/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/TestEnvironment.cs +++ b/src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/TestEnvironment.cs @@ -9,12 +9,12 @@ public static class TestEnvironment /// /// Check if the stress mode is enabled. /// - /// true if the environment variable COREFX_STRESS set to '1' or 'true'. returns false otherwise + /// true if the environment variable DOTNET_TEST_STRESS set to '1' or 'true'. returns false otherwise public static bool IsStressModeEnabled { get { - string value = Environment.GetEnvironmentVariable("COREFX_STRESS"); + string value = Environment.GetEnvironmentVariable("DOTNET_TEST_STRESS"); return value != null && (value == "1" || value.Equals("true", StringComparison.OrdinalIgnoreCase)); } } diff --git a/src/libraries/Common/tests/Resources/Strings.Designer.cs b/src/libraries/Common/tests/Resources/Strings.Designer.cs index a4f700f12eb64f..73c0f1972ae0d2 100644 --- a/src/libraries/Common/tests/Resources/Strings.Designer.cs +++ b/src/libraries/Common/tests/Resources/Strings.Designer.cs @@ -29,7 +29,6 @@ internal class Strings { private static global::System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Strings() { } diff --git a/src/libraries/Common/tests/StaticTestGenerator/README.md b/src/libraries/Common/tests/StaticTestGenerator/README.md index 990bf45ee28fd8..429e1087ad4c29 100644 --- a/src/libraries/Common/tests/StaticTestGenerator/README.md +++ b/src/libraries/Common/tests/StaticTestGenerator/README.md @@ -9,7 +9,7 @@ generated per theory input. ## Prereqs -- Build runtime from root to ensure that the testhost directory of assemblies is published, e.g. `cd d:\repos\runtime & .\libraries.cmd`. +- Build runtime from root to ensure that the testhost directory of assemblies is published, e.g. `cd d:\repos\runtime & .\build.cmd -subsetCategory libraries`. - Build the test assembly desired, e.g `cd src\libraries\System.Runtime\tests & dotnet msbuild`. ## Running the StaticTestGenerator utility diff --git a/src/libraries/Common/tests/StaticTestGenerator/StaticTestGenerator.csproj b/src/libraries/Common/tests/StaticTestGenerator/StaticTestGenerator.csproj index b6c0d40114cd32..02be551619300a 100644 --- a/src/libraries/Common/tests/StaticTestGenerator/StaticTestGenerator.csproj +++ b/src/libraries/Common/tests/StaticTestGenerator/StaticTestGenerator.csproj @@ -1,7 +1,7 @@  Exe - netcoreapp3.0 + netcoreapp3.0 false preview true diff --git a/src/libraries/Common/tests/System/Drawing/Helpers.cs b/src/libraries/Common/tests/System/Drawing/Helpers.cs index 3f8001ec605386..d6dc87248470e9 100644 --- a/src/libraries/Common/tests/System/Drawing/Helpers.cs +++ b/src/libraries/Common/tests/System/Drawing/Helpers.cs @@ -13,6 +13,7 @@ namespace System.Drawing public static class Helpers { public const string IsDrawingSupported = nameof(Helpers) + "." + nameof(GetIsDrawingSupported); + public const string IsWindowsOrAtLeastLibgdiplus6 = nameof(Helpers) + "." + nameof(GetIsWindowsOrAtLeastLibgdiplus6); public const string RecentGdiplusIsAvailable = nameof(Helpers) + "." + nameof(GetRecentGdiPlusIsAvailable); public const string RecentGdiplusIsAvailable2 = nameof(Helpers) + "." + nameof(GetRecentGdiPlusIsAvailable2); public const string GdiPlusIsAvailableNotRedhat73 = nameof(Helpers) + "." + nameof(GetGdiPlusIsAvailableNotRedhat73); @@ -22,6 +23,32 @@ public static class Helpers public static bool GetIsDrawingSupported() => PlatformDetection.IsDrawingSupported; + public static bool GetIsWindowsOrAtLeastLibgdiplus6() + { + if (!PlatformDetection.IsDrawingSupported) + { + return false; + } + + if (PlatformDetection.IsWindows) + { + return true; + } + + Version installedVersion; + + try + { + installedVersion = new Version(GetLibgdiplusVersion()); + } + catch (EntryPointNotFoundException) + { + return false; + } + + return installedVersion.Major >= 6; + } + public static bool IsNotUnix => PlatformDetection.IsWindows; public static bool IsWindowsRS3OrEarlier => !PlatformDetection.IsWindows10Version1803OrGreater; @@ -139,6 +166,9 @@ private static Rectangle GetRectangle(RECT rect) private const int MONITOR_DEFAULTTOPRIMARY = 1; + [DllImport("libgdiplus", ExactSpelling = true)] + internal static extern string GetLibgdiplusVersion(); + [DllImport("user32.dll", SetLastError = true)] private static extern IntPtr MonitorFromWindow(IntPtr hWnd, int dwFlags); diff --git a/src/libraries/Common/tests/System/Net/Configuration.Certificates.cs b/src/libraries/Common/tests/System/Net/Configuration.Certificates.cs index 1481fd737fc85a..02462be7c6e61b 100644 --- a/src/libraries/Common/tests/System/Net/Configuration.Certificates.cs +++ b/src/libraries/Common/tests/System/Net/Configuration.Certificates.cs @@ -4,6 +4,8 @@ using System.Diagnostics; using System.IO; +using System.Runtime.InteropServices; +using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Threading; using Xunit; @@ -23,6 +25,7 @@ public static partial class Certificates private static readonly X509Certificate2 s_noEKUCertificate; private static readonly X509Certificate2 s_selfSignedServerCertificate; private static readonly X509Certificate2 s_selfSignedClientCertificate; + private static X509Certificate2 s_selfSigned13ServerCertificate; static Certificates() { @@ -69,6 +72,44 @@ static Certificates() public static X509Certificate2 GetNoEKUCertificate() => new X509Certificate2(s_noEKUCertificate); public static X509Certificate2 GetSelfSignedServerCertificate() => new X509Certificate2(s_selfSignedServerCertificate); public static X509Certificate2 GetSelfSignedClientCertificate() => new X509Certificate2(s_selfSignedClientCertificate); + + public static X509Certificate2 GetSelfSigned13ServerCertificate() + { + if (s_selfSigned13ServerCertificate == null) + { + X509Certificate2 cert; + + using (ECDsa dsa = ECDsa.Create()) + { + var certReq = new CertificateRequest("CN=testservereku.contoso.com", dsa, HashAlgorithmName.SHA256); + certReq.CertificateExtensions.Add(new X509BasicConstraintsExtension(false, false, 0, false)); + certReq.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, false)); + certReq.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.DigitalSignature, false)); + + X509Certificate2 innerCert = certReq.CreateSelfSigned(DateTimeOffset.UtcNow.AddMonths(-1), DateTimeOffset.UtcNow.AddMonths(1)); + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + using (innerCert) + { + cert = new X509Certificate2(innerCert.Export(X509ContentType.Pfx)); + } + } + else + { + cert = innerCert; + } + } + + if (Interlocked.CompareExchange(ref s_selfSigned13ServerCertificate, cert, null) != null) + { + // Lost a race to create. + cert.Dispose(); + } + } + + return new X509Certificate2(s_selfSigned13ServerCertificate); + } } } } diff --git a/src/libraries/Common/tests/System/Net/Configuration.Http.cs b/src/libraries/Common/tests/System/Net/Configuration.Http.cs index aa37c690349f2e..0c30c8a0151750 100644 --- a/src/libraries/Common/tests/System/Net/Configuration.Http.cs +++ b/src/libraries/Common/tests/System/Net/Configuration.Http.cs @@ -13,37 +13,37 @@ public static partial class Http { private static readonly string DefaultHttp2AzureServer = "corefx-net-http2.azurewebsites.net"; - public static string Host => GetValue("COREFX_HTTPHOST", DefaultAzureServer); + public static string Host => GetValue("DOTNET_TEST_HTTPHOST", DefaultAzureServer); - public static string SecureHost => GetValue("COREFX_SECUREHTTPHOST", DefaultAzureServer); + public static string SecureHost => GetValue("DOTNET_TEST_SECUREHTTPHOST", DefaultAzureServer); - public static string Http2Host => GetValue("COREFX_HTTP2HOST", DefaultHttp2AzureServer); + public static string Http2Host => GetValue("DOTNET_TEST_HTTP2HOST", DefaultHttp2AzureServer); // This server doesn't use HTTP/2 server push (push promise) feature. Some HttpClient implementations // don't support servers that use push right now. - public static string Http2NoPushHost => GetValue("COREFX_HTTP2NOPUSHHOST", "www.microsoft.com"); + public static string Http2NoPushHost => GetValue("DOTNET_TEST_HTTP2NOPUSHHOST", "www.microsoft.com"); // Domain server environment. - public static string DomainJoinedHttpHost => GetValue("COREFX_DOMAINJOINED_HTTPHOST"); - public static string DomainJoinedProxyHost => GetValue("COREFX_DOMAINJOINED_PROXYHOST"); - public static string DomainJoinedProxyPort => GetValue("COREFX_DOMAINJOINED_PROXYPORT"); + public static string DomainJoinedHttpHost => GetValue("DOTNET_TEST_DOMAINJOINED_HTTPHOST"); + public static string DomainJoinedProxyHost => GetValue("DOTNET_TEST_DOMAINJOINED_PROXYHOST"); + public static string DomainJoinedProxyPort => GetValue("DOTNET_TEST_DOMAINJOINED_PROXYPORT"); // Standalone server environment. - public static string WindowsServerHttpHost => GetValue("COREFX_WINDOWSSERVER_HTTPHOST"); + public static string WindowsServerHttpHost => GetValue("DOTNET_TEST_WINDOWSSERVER_HTTPHOST"); - public static string SSLv2RemoteServer => GetValue("COREFX_HTTPHOST_SSL2", "https://www.ssllabs.com:10200/"); - public static string SSLv3RemoteServer => GetValue("COREFX_HTTPHOST_SSL3", "https://www.ssllabs.com:10300/"); - public static string TLSv10RemoteServer => GetValue("COREFX_HTTPHOST_TLS10", "https://www.ssllabs.com:10301/"); - public static string TLSv11RemoteServer => GetValue("COREFX_HTTPHOST_TLS11", "https://www.ssllabs.com:10302/"); - public static string TLSv12RemoteServer => GetValue("COREFX_HTTPHOST_TLS12", "https://www.ssllabs.com:10303/"); + public static string SSLv2RemoteServer => GetValue("DOTNET_TEST_HTTPHOST_SSL2", "https://www.ssllabs.com:10200/"); + public static string SSLv3RemoteServer => GetValue("DOTNET_TEST_HTTPHOST_SSL3", "https://www.ssllabs.com:10300/"); + public static string TLSv10RemoteServer => GetValue("DOTNET_TEST_HTTPHOST_TLS10", "https://www.ssllabs.com:10301/"); + public static string TLSv11RemoteServer => GetValue("DOTNET_TEST_HTTPHOST_TLS11", "https://www.ssllabs.com:10302/"); + public static string TLSv12RemoteServer => GetValue("DOTNET_TEST_HTTPHOST_TLS12", "https://www.ssllabs.com:10303/"); - public static string ExpiredCertRemoteServer => GetValue("COREFX_HTTPHOST_EXPIREDCERT", "https://expired.badssl.com/"); - public static string WrongHostNameCertRemoteServer => GetValue("COREFX_HTTPHOST_WRONGHOSTNAME", "https://wrong.host.badssl.com/"); - public static string SelfSignedCertRemoteServer => GetValue("COREFX_HTTPHOST_SELFSIGNEDCERT", "https://self-signed.badssl.com/"); - public static string RevokedCertRemoteServer => GetValue("COREFX_HTTPHOST_REVOKEDCERT", "https://revoked.badssl.com/"); + public static string ExpiredCertRemoteServer => GetValue("DOTNET_TEST_HTTPHOST_EXPIREDCERT", "https://expired.badssl.com/"); + public static string WrongHostNameCertRemoteServer => GetValue("DOTNET_TEST_HTTPHOST_WRONGHOSTNAME", "https://wrong.host.badssl.com/"); + public static string SelfSignedCertRemoteServer => GetValue("DOTNET_TEST_HTTPHOST_SELFSIGNEDCERT", "https://self-signed.badssl.com/"); + public static string RevokedCertRemoteServer => GetValue("DOTNET_TEST_HTTPHOST_REVOKEDCERT", "https://revoked.badssl.com/"); - public static string EchoClientCertificateRemoteServer => GetValue("COREFX_HTTPHOST_ECHOCLIENTCERT", "https://corefx-net-tls.azurewebsites.net/EchoClientCertificate.ashx"); - public static string Http2ForceUnencryptedLoopback => GetValue("COREFX_HTTP2_FORCEUNENCRYPTEDLOOPBACK"); + public static string EchoClientCertificateRemoteServer => GetValue("DOTNET_TEST_HTTPHOST_ECHOCLIENTCERT", "https://corefx-net-tls.azurewebsites.net/EchoClientCertificate.ashx"); + public static string Http2ForceUnencryptedLoopback => GetValue("DOTNET_TEST_HTTP2_FORCEUNENCRYPTEDLOOPBACK"); private const string EchoHandler = "Echo.ashx"; private const string EmptyContentHandler = "EmptyContent.ashx"; diff --git a/src/libraries/Common/tests/System/Net/Configuration.Ping.cs b/src/libraries/Common/tests/System/Net/Configuration.Ping.cs index 8a27cd345f9520..1571f92333d17d 100644 --- a/src/libraries/Common/tests/System/Net/Configuration.Ping.cs +++ b/src/libraries/Common/tests/System/Net/Configuration.Ping.cs @@ -9,7 +9,7 @@ public static partial class Configuration public static partial class Ping { // Host not on same network with ability to respond to ICMP Echo - public static string PingHost => GetValue("COREFX_NET_PING_HOST", "www.microsoft.com"); + public static string PingHost => GetValue("DOTNET_TEST_NET_PING_HOST", "www.microsoft.com"); } } } diff --git a/src/libraries/Common/tests/System/Net/Configuration.Security.cs b/src/libraries/Common/tests/System/Net/Configuration.Security.cs index b09ad6785fe538..a2d77adc8cb02f 100644 --- a/src/libraries/Common/tests/System/Net/Configuration.Security.cs +++ b/src/libraries/Common/tests/System/Net/Configuration.Security.cs @@ -9,24 +9,24 @@ public static partial class Configuration public static partial class Security { // Domain server environment. - public static string ActiveDirectoryName => GetValue("COREFX_NET_AD_DOMAINNAME"); - public static string ActiveDirectoryUserName => GetValue("COREFX_NET_AD_USERNAME"); - public static string ActiveDirectoryUserPassword => GetValue("COREFX_NET_AD_PASSWORD"); + public static string ActiveDirectoryName => GetValue("DOTNET_TEST_NET_AD_DOMAINNAME"); + public static string ActiveDirectoryUserName => GetValue("DOTNET_TEST_NET_AD_USERNAME"); + public static string ActiveDirectoryUserPassword => GetValue("DOTNET_TEST_NET_AD_PASSWORD"); // Standalone server environment. - public static string WindowsServerRealmName => GetValue("COREFX_NET_SERVER_REALMNAME"); - public static string WindowsServerUserName => GetValue("COREFX_NET_SERVER_USERNAME"); - public static string WindowsServerUserPassword => GetValue("COREFX_NET_SERVER_PASSWORD"); + public static string WindowsServerRealmName => GetValue("DOTNET_TEST_NET_SERVER_REALMNAME"); + public static string WindowsServerUserName => GetValue("DOTNET_TEST_NET_SERVER_USERNAME"); + public static string WindowsServerUserPassword => GetValue("DOTNET_TEST_NET_SERVER_PASSWORD"); - public static Uri TlsServer => GetUriValue("COREFX_NET_SECURITY_TLSSERVERURI", new Uri("https://" + DefaultAzureServer)); + public static Uri TlsServer => GetUriValue("DOTNET_TEST_NET_SECURITY_TLSSERVERURI", new Uri("https://" + DefaultAzureServer)); - public static Uri NegotiateServer => GetUriValue("COREFX_NET_SECURITY_NEGOSERVERURI"); + public static Uri NegotiateServer => GetUriValue("DOTNET_TEST_NET_SECURITY_NEGOSERVERURI"); - public static Uri NegotiateClient => GetUriValue("COREFX_NET_SECURITY_NEGOCLIENTURI"); + public static Uri NegotiateClient => GetUriValue("DOTNET_TEST_NET_SECURITY_NEGOCLIENTURI"); - public static string NegotiateClientUser => GetValue("COREFX_NET_SECURITY_NEGOCLIENTUSER"); + public static string NegotiateClientUser => GetValue("DOTNET_TEST_NET_SECURITY_NEGOCLIENTUSER"); - public static string TlsRenegotiationServer => GetValue("COREFX_NET_SECURITY_TLSREGOTIATIONSERVER", "corefx-net-tls.azurewebsites.net"); + public static string TlsRenegotiationServer => GetValue("DOTNET_TEST_NET_SECURITY_TLSREGOTIATIONSERVER", "corefx-net-tls.azurewebsites.net"); // This should be set if hostnames for all certificates within runtime-assets have been set to point to 127.0.0.1. // Example: @@ -34,9 +34,9 @@ public static partial class Security // 127.0.0.1 testnoeku.contoso.com // 127.0.0.1 testclienteku.contoso.com - public static string HostsFileNamesInstalled => GetValue("COREFX_NET_SECURITY_HOSTS_FILE_INSTALLED"); + public static string HostsFileNamesInstalled => GetValue("DOTNET_TEST_NET_SECURITY_HOSTS_FILE_INSTALLED"); // Allows packet captures. - public static string SecurityForceSocketStreams => GetValue("COREFX_NET_SECURITY_FORCE_SOCKET_STREAMS"); + public static string SecurityForceSocketStreams => GetValue("DOTNET_TEST_NET_SECURITY_FORCE_SOCKET_STREAMS"); } } } diff --git a/src/libraries/Common/tests/System/Net/Configuration.Sockets.cs b/src/libraries/Common/tests/System/Net/Configuration.Sockets.cs index 8f5cb34c0fab54..05a91d57b93e86 100644 --- a/src/libraries/Common/tests/System/Net/Configuration.Sockets.cs +++ b/src/libraries/Common/tests/System/Net/Configuration.Sockets.cs @@ -8,9 +8,9 @@ public static partial class Configuration { public static partial class Sockets { - public static Uri SocketServer => GetUriValue("COREFX_NET_SOCKETS_SERVERURI", new Uri("http://" + DefaultAzureServer)); + public static Uri SocketServer => GetUriValue("DOTNET_TEST_NET_SOCKETS_SERVERURI", new Uri("http://" + DefaultAzureServer)); - public static string InvalidHost => GetValue("COREFX_NET_SOCKETS_INVALIDSERVER", "notahostname.invalid.corp.microsoft.com"); + public static string InvalidHost => GetValue("DOTNET_TEST_NET_SOCKETS_INVALIDSERVER", "notahostname.invalid.corp.microsoft.com"); } } } diff --git a/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs b/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs index 6f05798900be5a..d3eaf85942c1a5 100644 --- a/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs +++ b/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs @@ -8,11 +8,11 @@ public static partial class Configuration { public static partial class WebSockets { - public static string ProxyServerUri => GetValue("COREFX_WEBSOCKETPROXYSERVERURI"); + public static string ProxyServerUri => GetValue("DOTNET_TEST_WEBSOCKETPROXYSERVERURI"); - public static string Host => GetValue("COREFX_WEBSOCKETHOST", DefaultAzureServer); + public static string Host => GetValue("DOTNET_TEST_WEBSOCKETHOST", DefaultAzureServer); - public static string SecureHost => GetValue("COREFX_SECUREWEBSOCKETHOST", DefaultAzureServer); + public static string SecureHost => GetValue("DOTNET_TEST_SECUREWEBSOCKETHOST", DefaultAzureServer); private const string EchoHandler = "WebSocket/EchoWebSocket.ashx"; private const string EchoHeadersHandler = "WebSocket/EchoWebSocketHeaders.ashx"; diff --git a/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/README.md b/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/README.md index d5a3ee4fb74595..76e13614a3c366 100644 --- a/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/README.md +++ b/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/README.md @@ -49,7 +49,7 @@ Now build the repo as you would on a regular dev machine: ```bash cd /repo -./libraries.sh +./build.sh --subsetCategory libraries ``` Now you can run the enterprise tests. Currently, there are tests for System.Net.Http and System.Net.Security. You can run them in the same way you already run tests in the repo. diff --git a/src/libraries/Common/tests/System/Net/Http/DefaultCredentialsTest.cs b/src/libraries/Common/tests/System/Net/Http/DefaultCredentialsTest.cs index 11f9d8397721b4..40686b97bc519f 100644 --- a/src/libraries/Common/tests/System/Net/Http/DefaultCredentialsTest.cs +++ b/src/libraries/Common/tests/System/Net/Http/DefaultCredentialsTest.cs @@ -134,7 +134,7 @@ public async Task Credentials_SetToBadCredential_Unauthorized(string uri, bool u } [OuterLoop("Uses external server")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/10041")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/17845")] [ConditionalTheory(nameof(DomainJoinedTestsEnabled))] [InlineData(false)] [InlineData(true)] @@ -156,7 +156,7 @@ public async Task Credentials_SetToSpecificCredential_ConnectAsSpecificIdentity( } [OuterLoop("Uses external server")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/10041")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/17845")] [ConditionalFact(nameof(DomainProxyTestsEnabled))] public async Task Proxy_UseAuthenticatedProxyWithNoCredentials_ProxyAuthenticationRequired() { @@ -171,7 +171,7 @@ public async Task Proxy_UseAuthenticatedProxyWithNoCredentials_ProxyAuthenticati } [OuterLoop("Uses external server")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/10041")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/17845")] [ConditionalFact(nameof(DomainProxyTestsEnabled))] public async Task Proxy_UseAuthenticatedProxyWithDefaultCredentials_OK() { diff --git a/src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs b/src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs index 1b08fcaacb731b..9e505e37314b63 100644 --- a/src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs @@ -18,10 +18,7 @@ public abstract class LoopbackServerFactory public abstract GenericLoopbackServer CreateServer(GenericLoopbackOptions options = null); public abstract Task CreateServerAsync(Func funcAsync, int millisecondsTimeout = 60_000, GenericLoopbackOptions options = null); - // TODO: just expose a version property. - public abstract bool IsHttp11 { get; } - public abstract bool IsHttp2 { get; } - public abstract bool IsHttp3 { get; } + public abstract Version Version { get; } // Common helper methods diff --git a/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs b/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs index b8815f351effda..43be924c03550b 100644 --- a/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs +++ b/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs @@ -315,7 +315,7 @@ public async Task ReadRequestHeaderFrameAsync() private static (int bytesConsumed, int value) DecodeInteger(ReadOnlySpan headerBlock, byte prefixMask) { - return QPackDecoder.DecodeInteger(headerBlock, prefixMask); + return QPackTestDecoder.DecodeInteger(headerBlock, prefixMask); } private static (int bytesConsumed, string value) DecodeString(ReadOnlySpan headerBlock) diff --git a/src/libraries/Common/tests/System/Net/Http/Http2LoopbackServer.cs b/src/libraries/Common/tests/System/Net/Http/Http2LoopbackServer.cs index 92bbb6b0169dd8..f2aea4cfb4f234 100644 --- a/src/libraries/Common/tests/System/Net/Http/Http2LoopbackServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/Http2LoopbackServer.cs @@ -237,9 +237,7 @@ public override async Task CreateServerAsync(Func false; - public override bool IsHttp2 => true; - public override bool IsHttp3 => false; + public override Version Version => HttpVersion.Version20; } public enum ProtocolErrors diff --git a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs index a6b87cb74be569..ac2e4347e938d5 100644 --- a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs +++ b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs @@ -8,14 +8,33 @@ using System.Net.Quic; using System.Text; using System.Threading.Tasks; +using System.Linq; namespace System.Net.Test.Common { public sealed class Http3LoopbackConnection : GenericLoopbackConnection { + public const long H3_NO_ERROR = 0x100; + public const long H3_GENERAL_PROTOCOL_ERROR = 0x101; + public const long H3_INTERNAL_ERROR = 0x102; + public const long H3_STREAM_CREATION_ERROR = 0x103; + public const long H3_CLOSED_CRITICAL_STREAM = 0x104; + public const long H3_FRAME_UNEXPECTED = 0x105; + public const long H3_FRAME_ERROR = 0x106; + public const long H3_EXCESSIVE_LOAD = 0x107; + public const long H3_ID_ERROR = 0x108; + public const long H3_SETTINGS_ERROR = 0x109; + public const long H3_MISSING_SETTINGS = 0x10a; + public const long H3_REQUEST_REJECTED = 0x10b; + public const long H3_REQUEST_CANCELLED = 0x10c; + public const long H3_REQUEST_INCOMPLETE = 0x10d; + public const long H3_CONNECT_ERROR = 0x10f; + public const long H3_VERSION_FALLBACK = 0x110; + private readonly QuicConnection _connection; private readonly Dictionary _openStreams = new Dictionary(); private Http3LoopbackStream _currentStream; + private bool _closed; public Http3LoopbackConnection(QuicConnection connection) { @@ -29,7 +48,18 @@ public override void Dispose() stream.Dispose(); } - _connection.Dispose(); + if (!_closed) + { + // CloseAsync(H3_INTERNAL_ERROR).GetAwaiter().GetResult(); + } + + //_connection.Dispose(); + } + + public async Task CloseAsync(long errorCode) + { + await _connection.CloseAsync(errorCode).ConfigureAwait(false); + _closed = true; } public Http3LoopbackStream OpenUnidirectionalStream() @@ -73,13 +103,27 @@ public override async Task ReadRequestBodyAsync() public override async Task ReadRequestDataAsync(bool readBody = true) { - Http3LoopbackStream stream = await AcceptStreamAsync().ConfigureAwait(false); + Http3LoopbackStream stream; + + do + { + stream = await AcceptStreamAsync().ConfigureAwait(false); + } + while (!stream.CanWrite); // skip control stream. + return await stream.ReadRequestDataAsync(readBody).ConfigureAwait(false); } public override async Task SendResponseAsync(HttpStatusCode? statusCode = HttpStatusCode.OK, IList headers = null, string content = "", bool isFinal = true, int requestId = 0) { - await SendResponseHeadersAsync(statusCode, headers, requestId).ConfigureAwait(false); + IEnumerable newHeaders = headers ?? Enumerable.Empty(); + + if (content != null && !newHeaders.Any(x => x.Name == "Content-Length")) + { + newHeaders = newHeaders.Append(new HttpHeaderData("Content-Length", content.Length.ToString(CultureInfo.InvariantCulture))); + } + + await SendResponseHeadersAsync(statusCode, newHeaders, requestId).ConfigureAwait(false); await SendResponseBodyAsync(Encoding.UTF8.GetBytes(content ?? ""), isFinal, requestId).ConfigureAwait(false); } @@ -94,7 +138,7 @@ public override async Task SendResponseBodyAsync(byte[] content, bool isFinal = if (isFinal) { - stream.ShutdownSend(); + await stream.ShutdownSendAsync().ConfigureAwait(false); stream.Dispose(); } } @@ -104,18 +148,19 @@ public override Task SendResponseHeadersAsync(HttpStatusCode statusCode = HttpSt return SendResponseHeadersAsync(statusCode, headers, requestId); } - private async Task SendResponseHeadersAsync(HttpStatusCode? statusCode = HttpStatusCode.OK, IList headers = null, int requestId = 0) + private async Task SendResponseHeadersAsync(HttpStatusCode? statusCode = HttpStatusCode.OK, IEnumerable headers = null, int requestId = 0) { - var allHeaders = new List((headers?.Count ?? 0) + 1); + headers ??= Enumerable.Empty(); + + // Some tests use Content-Length with a null value to indicate Content-Length should not be set. + headers = headers.Where(x => x.Name != "Content-Length" || x.Value != null); if (statusCode != null) { - allHeaders.Add(new HttpHeaderData(":status", ((int)statusCode).ToString(CultureInfo.InvariantCulture))); + headers = headers.Prepend(new HttpHeaderData(":status", ((int)statusCode).ToString(CultureInfo.InvariantCulture))); } - allHeaders.AddRange(headers); - - await GetOpenRequest(requestId).SendHeadersFrameAsync(allHeaders).ConfigureAwait(false); + await GetOpenRequest(requestId).SendHeadersFrameAsync(headers).ConfigureAwait(false); } public override async Task WaitForCancellationAsync(bool ignoreIncomingData = true, int requestId = 0) diff --git a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackServer.cs b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackServer.cs index 7378fadab26f23..59d43d48413151 100644 --- a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackServer.cs @@ -22,17 +22,18 @@ public Http3LoopbackServer(GenericLoopbackOptions options = null) { options ??= new GenericLoopbackOptions(); - _cert = Configuration.Certificates.GetServerCertificate(); + _cert = Configuration.Certificates.GetSelfSigned13ServerCertificate(); var sslOpts = new SslServerAuthenticationOptions { EnabledSslProtocols = options.SslProtocols, ApplicationProtocols = new List { SslApplicationProtocol.Http3 }, - ServerCertificate = _cert, + //ServerCertificate = _cert, ClientCertificateRequired = false }; _listener = new QuicListener(new IPEndPoint(options.Address, 0), sslOpts); + _listener.Start(); } public override void Dispose() @@ -55,10 +56,11 @@ public override async Task AcceptConnectionAsync(Func HandleRequestAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "") { - using GenericLoopbackConnection con = await EstablishGenericConnectionAsync().ConfigureAwait(false); + using var con = (Http3LoopbackConnection)await EstablishGenericConnectionAsync().ConfigureAwait(false); HttpRequestData request = await con.ReadRequestDataAsync().ConfigureAwait(false); await con.SendResponseAsync(statusCode, headers, content).ConfigureAwait(false); + await con.CloseAsync(Http3LoopbackConnection.H3_NO_ERROR); return request; } } @@ -67,11 +69,7 @@ public sealed class Http3LoopbackServerFactory : LoopbackServerFactory { public static Http3LoopbackServerFactory Singleton { get; } = new Http3LoopbackServerFactory(); - public override bool IsHttp11 => false; - - public override bool IsHttp2 => false; - - public override bool IsHttp3 => true; + public override Version Version => HttpVersion.Version30; public override GenericLoopbackServer CreateServer(GenericLoopbackOptions options = null) { diff --git a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs index 1f7f80bd03617a..ad6ded10257fc4 100644 --- a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs +++ b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs @@ -59,24 +59,27 @@ public async Task SendSettingsFrameAsync(ICollection<(long settingId, long setti await SendFrameAsync(SettingsFrame, buffer.AsMemory(0, bytesWritten)).ConfigureAwait(false); } - public async Task SendHeadersFrameAsync(ICollection headers) + public async Task SendHeadersFrameAsync(IEnumerable headers) { - int bufferLength = QPackEncoder.MaxPrefixLength; + int bufferLength = QPackTestEncoder.MaxPrefixLength; foreach (HttpHeaderData header in headers) { + Debug.Assert(header.Name != null); + Debug.Assert(header.Value != null); + // Two varints for length, and double the name/value lengths to account for expanding Huffman coding. - bufferLength += QPackEncoder.MaxVarIntLength * 2 + header.Name.Length * 2 + header.Value.Length * 2; + bufferLength += QPackTestEncoder.MaxVarIntLength * 2 + header.Name.Length * 2 + header.Value.Length * 2; } var buffer = new byte[bufferLength]; int bytesWritten = 0; - bytesWritten += QPackEncoder.EncodePrefix(buffer.AsSpan(bytesWritten), 0, 0); + bytesWritten += QPackTestEncoder.EncodePrefix(buffer.AsSpan(bytesWritten), 0, 0); foreach (HttpHeaderData header in headers) { - bytesWritten += QPackEncoder.EncodeHeader(buffer.AsSpan(bytesWritten), header.Name, header.Value, header.HuffmanEncoded ? QPackFlags.HuffmanEncode : QPackFlags.None); + bytesWritten += QPackTestEncoder.EncodeHeader(buffer.AsSpan(bytesWritten), header.Name, header.Value, header.HuffmanEncoded ? QPackFlags.HuffmanEncode : QPackFlags.None); } await SendFrameAsync(HeadersFrame, buffer.AsMemory(0, bytesWritten)).ConfigureAwait(false); @@ -100,9 +103,10 @@ public async Task SendFrameAsync(long frameType, ReadOnlyMemory framePaylo await _stream.WriteAsync(framePayload).ConfigureAwait(false); } - public void ShutdownSend() + public async Task ShutdownSendAsync() { _stream.Shutdown(); + await _stream.ShutdownWriteCompleted().ConfigureAwait(false); } static int EncodeHttpInteger(long longToEncode, Span buffer) @@ -176,14 +180,14 @@ private HttpRequestData ParseHeaders(ReadOnlySpan buffer) { HttpRequestData request = new HttpRequestData { RequestId = Http3LoopbackConnection.GetRequestId(_stream) }; - (int prefixLength, int requiredInsertCount, int deltaBase) = QPackDecoder.DecodePrefix(buffer); + (int prefixLength, int requiredInsertCount, int deltaBase) = QPackTestDecoder.DecodePrefix(buffer); if (requiredInsertCount != 0 || deltaBase != 0) throw new Exception("QPack dynamic table not yet supported."); buffer = buffer.Slice(prefixLength); while (!buffer.IsEmpty) { - (int headerLength, HttpHeaderData header) = QPackDecoder.DecodeHeader(buffer); + (int headerLength, HttpHeaderData header) = QPackTestDecoder.DecodeHeader(buffer); request.Headers.Add(header); buffer = buffer.Slice(headerLength); @@ -247,7 +251,6 @@ public async Task WaitForCancellationAsync(bool ignoreIncomingData = true) public async Task ReadInteger() { byte[] buffer = new byte[MaximumVarIntBytes]; - int bufferAvailableOffset = -1; int bufferActiveLength = 0; long integerValue; @@ -255,14 +258,14 @@ public async Task WaitForCancellationAsync(bool ignoreIncomingData = true) do { - bytesRead = await _stream.ReadAsync(buffer.AsMemory(++bufferAvailableOffset, 1)).ConfigureAwait(false); + bytesRead = await _stream.ReadAsync(buffer.AsMemory(bufferActiveLength++, 1)).ConfigureAwait(false); if (bytesRead == 0) { - return bufferActiveLength == 0 ? (long?)null : throw new Exception("Unable to read varint; unexpected end of stream."); + return bufferActiveLength == 1 ? (long?)null : throw new Exception("Unable to read varint; unexpected end of stream."); } Debug.Assert(bytesRead == 1); } - while (!TryDecodeHttpInteger(buffer.AsSpan(0, ++bufferActiveLength), out integerValue, out bytesRead)); + while (!TryDecodeHttpInteger(buffer.AsSpan(0, bufferActiveLength), out integerValue, out bytesRead)); Debug.Assert(bytesRead == bufferActiveLength); diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.AutoRedirect.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.AutoRedirect.cs index d6954369b76f02..54c620cf0bb5bf 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.AutoRedirect.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.AutoRedirect.cs @@ -276,7 +276,7 @@ public async Task GetAsync_AllowAutoRedirectTrue_RedirectFromHttpsToHttp_StatusC [Fact] public async Task GetAsync_AllowAutoRedirectTrue_RedirectWithoutLocation_ReturnsOriginalResponse() { - if (IsWinHttpHandler) // see https://github.com/dotnet/corefx/issues/24819#issuecomment-338776074 for details + if (IsWinHttpHandler) // see https://github.com/dotnet/runtime/issues/23930#issuecomment-338776074 for details { return; } diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs index dba6b372218e67..d7e519fa202ed4 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs @@ -33,9 +33,9 @@ public HttpClientHandler_Cancellation_Test(ITestOutputHelper output) : base(outp [InlineData(true, CancellationMode.Token)] public async Task PostAsync_CancelDuringRequestContentSend_TaskCanceledQuickly(bool chunkedTransfer, CancellationMode mode) { - if (LoopbackServerFactory.IsHttp2 && chunkedTransfer) + if (LoopbackServerFactory.Version >= HttpVersion.Version20 && chunkedTransfer) { - // There is no chunked encoding in HTTP/2 + // There is no chunked encoding in HTTP/2 and later return; } @@ -80,9 +80,9 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => [MemberData(nameof(OneBoolAndCancellationMode))] public async Task GetAsync_CancelDuringResponseHeadersReceived_TaskCanceledQuickly(bool connectionClose, CancellationMode mode) { - if (LoopbackServerFactory.IsHttp2 && connectionClose) + if (LoopbackServerFactory.Version >= HttpVersion.Version20 && connectionClose) { - // There is no Connection header in HTTP/2 + // There is no Connection header in HTTP/2 and later return; } @@ -126,13 +126,13 @@ await ValidateClientCancellationAsync(async () => } [Theory] - [ActiveIssue("https://github.com/dotnet/corefx/issues/28805")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/25760")] [MemberData(nameof(TwoBoolsAndCancellationMode))] public async Task GetAsync_CancelDuringResponseBodyReceived_Buffered_TaskCanceledQuickly(bool chunkedTransfer, bool connectionClose, CancellationMode mode) { - if (LoopbackServerFactory.IsHttp2 && (chunkedTransfer || connectionClose)) + if (LoopbackServerFactory.Version >= HttpVersion.Version20 && (chunkedTransfer || connectionClose)) { - // There is no chunked encoding or connection header in HTTP/2 + // There is no chunked encoding or connection header in HTTP/2 and later return; } @@ -186,9 +186,9 @@ await ValidateClientCancellationAsync(async () => [MemberData(nameof(ThreeBools))] public async Task GetAsync_CancelDuringResponseBodyReceived_Unbuffered_TaskCanceledQuickly(bool chunkedTransfer, bool connectionClose, bool readOrCopyToAsync) { - if (LoopbackServerFactory.IsHttp2 && (chunkedTransfer || connectionClose)) + if (LoopbackServerFactory.Version >= HttpVersion.Version20 && (chunkedTransfer || connectionClose)) { - // There is no chunked encoding or connection header in HTTP/2 + // There is no chunked encoding or connection header in HTTP/2 and later return; } @@ -312,10 +312,10 @@ await LoopbackServerFactory.CreateServerAsync(async (server, url) => [ConditionalFact] public async Task MaxConnectionsPerServer_WaitingConnectionsAreCancelable() { - if (LoopbackServerFactory.IsHttp2) + if (LoopbackServerFactory.Version >= HttpVersion.Version20) { // HTTP/2 does not use connection limits. - throw new SkipTestException("Not supported on HTTP/2"); + throw new SkipTestException("Not supported on HTTP/2 and later"); } using (HttpClientHandler handler = CreateHttpClientHandler()) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ClientCertificates.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ClientCertificates.cs index a1984a50393147..b75156a6f2556c 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ClientCertificates.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ClientCertificates.cs @@ -183,7 +183,7 @@ await LoopbackServer.CreateServerAsync(async (server, url) => }, options); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/37336")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/29419")] [Theory] [InlineData(ClientCertificateOption.Manual)] [InlineData(ClientCertificateOption.Automatic)] diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs index 3716fcbcd806d6..75f440ac1bcdc9 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs @@ -182,7 +182,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync( private string GetCookieValue(HttpRequestData request) { - if (!LoopbackServerFactory.IsHttp2) + if (LoopbackServerFactory.Version < HttpVersion.Version20) { // HTTP/1.x must have only one value. return request.GetSingleHeaderValue("Cookie"); @@ -532,7 +532,7 @@ public async Task GetAsyncWithBasicAuth_ReceiveSetCookie_CookieSent() { if (IsWinHttpHandler) { - // Issue https://github.com/dotnet/corefx/issues/26986 + // Issue https://github.com/dotnet/runtime/issues/24979 // WinHttpHandler does not process the cookie. return; } diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.DefaultProxyCredentials.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.DefaultProxyCredentials.cs index 51ced54f0c7e30..dfc299c96bcbc5 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.DefaultProxyCredentials.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.DefaultProxyCredentials.cs @@ -81,7 +81,7 @@ await server.AcceptConnectionSendResponseAndCloseAsync( } #if !WINHTTPHANDLER_TEST - [ActiveIssue("https://github.com/dotnet/corefx/issues/42323")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/31380")] [OuterLoop("Uses external server")] [PlatformSpecific(TestPlatforms.AnyUnix)] // The default proxy is resolved via WinINet on Windows. [Theory] diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Proxy.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Proxy.cs index 2258c56df76d57..7402079d21593a 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Proxy.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Proxy.cs @@ -51,7 +51,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => Assert.False(proxy.Disposed); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/32809")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/1507")] [OuterLoop("Uses external server")] [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] [InlineData(AuthenticationSchemes.Ntlm, true, false)] @@ -129,7 +129,7 @@ public void Proxy_UseEnvironmentVariableToSetSystemProxy_RequestGoesThruProxy() }, UseVersion.ToString()).Dispose(); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/32809")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/1507")] [OuterLoop("Uses external server")] [Theory] [MemberData(nameof(CredentialsForProxy))] @@ -220,7 +220,7 @@ public async Task Proxy_HaveNoCredsAndUseAuthenticatedCustomProxy_ProxyAuthentic } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/11057")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/18258")] public async Task Proxy_SslProxyUnsupported_Throws() { using (HttpClientHandler handler = CreateHttpClientHandler()) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs index 8d78878e04f705..f4fb04146ea746 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs @@ -84,7 +84,7 @@ public async Task UseCallback_HaveCredsAndUseAuthenticatedCustomProxyAndPostToSe { if (IsWinHttpHandler && PlatformDetection.IsWindows7) { - // Issue https://github.com/dotnet/corefx/issues/27612 + // Issue https://github.com/dotnet/runtime/issues/25268 return; } @@ -201,7 +201,7 @@ public async Task UseCallback_ValidCertificate_ExpectedValuesDuringCallback(Conf Assert.NotNull(request); X509ChainStatusFlags flags = chain.ChainStatus.Aggregate(X509ChainStatusFlags.NoError, (cur, status) => cur | status.Status); - bool ignoreErrors = // https://github.com/dotnet/corefx/issues/21922#issuecomment-315555237 + bool ignoreErrors = // https://github.com/dotnet/runtime/issues/22644#issuecomment-315555237 RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && checkRevocation && errors == SslPolicyErrors.RemoteCertificateChainErrors && @@ -350,7 +350,7 @@ public async Task UseCallback_BadCertificate_ExpectedPolicyErrors(string url, Ss e.InnerException.HResult == SEC_E_BUFFER_TOO_SMALL && !PlatformDetection.IsWindows10Version1607OrGreater) { - // Testing on old Windows versions can hit https://github.com/dotnet/corefx/issues/7812 + // Testing on old Windows versions can hit https://github.com/dotnet/runtime/issues/17005 // Ignore SEC_E_BUFFER_TOO_SMALL error on such cases. } } diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.SslProtocols.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.SslProtocols.cs index efab02712696ba..b6bf8b5143c2cf 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.SslProtocols.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.SslProtocols.cs @@ -250,7 +250,7 @@ public async Task GetAsync_AllowedClientSslVersionDiffersFromServer_ThrowsExcept // Native WinHTTP sometimes uses multiple TCP connections to try other TLS protocols when // getting TLS protocol failures as part of its TLS fallback algorithm. The loopback server // doesn't expect this and stops listening for more connections. This causes unexpected test - // failures. See dotnet/corefx https://github.com/dotnet/corefx/issues/8538. + // failures. See https://github.com/dotnet/runtime/issues/17287. return; } diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs index 0f2a55a68fc056..9902da13afb180 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs @@ -479,9 +479,9 @@ public static IEnumerable SecureAndNonSecure_IPBasedUri_MemberData() = [MemberData(nameof(SecureAndNonSecure_IPBasedUri_MemberData))] public async Task GetAsync_SecureAndNonSecureIPBasedUri_CorrectlyFormatted(IPAddress address, bool useSsl) { - if (LoopbackServerFactory.IsHttp2) + if (LoopbackServerFactory.Version >= HttpVersion.Version20) { - throw new SkipTestException("Host header is not supported on HTTP/2."); + throw new SkipTestException("Host header is not supported on HTTP/2 and later."); } var options = new LoopbackServer.Options { Address = address, UseSsl= useSsl }; @@ -717,7 +717,7 @@ public async Task GetAsync_IncompleteData_ThrowsHttpRequestException(bool failDu { if (IsWinHttpHandler) { - return; // see https://github.com/dotnet/corefx/issues/39136#issuecomment-508330958 + return; // see https://github.com/dotnet/runtime/issues/30115#issuecomment-508330958 } await LoopbackServer.CreateClientAndServerAsync(async uri => @@ -871,9 +871,9 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => Assert.Equal("X-Underscore_Name", requestData.GetSingleHeaderValue("X-Underscore_Name")); Assert.Equal("End", requestData.GetSingleHeaderValue("X-End")); - if (LoopbackServerFactory.IsHttp2) + if (LoopbackServerFactory.Version >= HttpVersion.Version20) { - // HTTP/2 forbids certain headers or values. + // HTTP/2 and later forbids certain headers or values. Assert.Equal("trailers", requestData.GetSingleHeaderValue("TE")); Assert.Equal(0, requestData.GetHeaderValueCount("Upgrade")); Assert.Equal(0, requestData.GetHeaderValueCount("Proxy-Connection")); @@ -904,9 +904,9 @@ public static IEnumerable GetAsync_ManyDifferentResponseHeaders_Parsed [MemberData(nameof(GetAsync_ManyDifferentResponseHeaders_ParsedCorrectly_MemberData))] public async Task GetAsync_ManyDifferentResponseHeaders_ParsedCorrectly(string newline, string fold, bool dribble) { - if (LoopbackServerFactory.IsHttp2) + if (LoopbackServerFactory.Version >= HttpVersion.Version20) { - throw new SkipTestException("Folding is not supported on HTTP/2."); + throw new SkipTestException("Folding is not supported on HTTP/2 and later."); } // Using examples from https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields @@ -1035,9 +1035,9 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => [ConditionalFact] public async Task GetAsync_NonTraditionalChunkSizes_Accepted() { - if (LoopbackServerFactory.IsHttp2) + if (LoopbackServerFactory.Version >= HttpVersion.Version20) { - throw new SkipTestException("Chunking is not supported on HTTP/2."); + throw new SkipTestException("Chunking is not supported on HTTP/2 and later."); } await LoopbackServer.CreateServerAsync(async (server, url) => { @@ -1259,9 +1259,9 @@ await connection.ReadRequestHeaderAndSendCustomResponseAsync( [InlineData(null)] public async Task ReadAsStreamAsync_HandlerProducesWellBehavedResponseStream(bool? chunked) { - if (LoopbackServerFactory.IsHttp2 && chunked == true) + if (LoopbackServerFactory.Version >= HttpVersion.Version20 && chunked == true) { - throw new SkipTestException("Chunking is not supported on HTTP/2."); + throw new SkipTestException("Chunking is not supported on HTTP/2 and later."); } await LoopbackServerFactory.CreateClientAndServerAsync(async uri => @@ -2068,9 +2068,9 @@ public async Task SendAsync_101SwitchingProtocolsResponse_Success() return; } - if (LoopbackServerFactory.IsHttp2) + if (LoopbackServerFactory.Version >= HttpVersion.Version20) { - throw new SkipTestException("Upgrade is not supported on HTTP/2"); + throw new SkipTestException("Upgrade is not supported on HTTP/2 and later"); } var clientFinished = new TaskCompletionSource(); @@ -2238,9 +2238,9 @@ public async Task PostAsync_ReuseRequestContent_Success(Configuration.Http.Remot [InlineData(HttpStatusCode.MethodNotAllowed, "")] public async Task GetAsync_CallMethod_ExpectedStatusLine(HttpStatusCode statusCode, string reasonPhrase) { - if (LoopbackServerFactory.IsHttp2) + if (LoopbackServerFactory.Version >= HttpVersion.Version20) { - // Custom messages are not supported on HTTP2. + // Custom messages are not supported on HTTP2 and later. return; } @@ -2365,7 +2365,7 @@ public async Task SendAsync_SendRequestUsingNoBodyMethodToEchoServerWithContent_ { // .NET Framework also allows the HttpWebRequest and HttpClient APIs to send a request using 'TRACE' // verb and a request body. The usual response from a server is "400 Bad Request". - // See here for more info: https://github.com/dotnet/corefx/issues/9023 + // See here for more info: https://github.com/dotnet/runtime/issues/17475 Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); } else @@ -2541,7 +2541,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, rootUrl) => } #endregion - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/11057")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/18258")] public async Task GetAsync_InvalidUrl_ExpectedExceptionThrown() { string invalidUri = $"http://{Configuration.Sockets.InvalidHost}"; diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs index 0eed7dcf927102..49b20767e469fe 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs @@ -34,8 +34,8 @@ public HttpClientHandlerTestBase(ITestOutputHelper output) protected HttpClient CreateHttpClient(HttpMessageHandler handler) => new HttpClient(handler) { DefaultRequestVersion = UseVersion }; - protected static HttpClient CreateHttpClient(string useHttp2String) => - CreateHttpClient(CreateHttpClientHandler(useHttp2String), useHttp2String); + protected static HttpClient CreateHttpClient(string useVersionString) => + CreateHttpClient(CreateHttpClientHandler(useVersionString), useVersionString); protected static HttpClient CreateHttpClient(HttpMessageHandler handler, string useVersionString) => new HttpClient(handler) { DefaultRequestVersion = Version.Parse(useVersionString) }; diff --git a/src/libraries/Common/tests/System/Net/Http/IdnaProtocolTests.cs b/src/libraries/Common/tests/System/Net/Http/IdnaProtocolTests.cs index 4682b040ad9772..0d4167f7d7ce6d 100644 --- a/src/libraries/Common/tests/System/Net/Http/IdnaProtocolTests.cs +++ b/src/libraries/Common/tests/System/Net/Http/IdnaProtocolTests.cs @@ -55,7 +55,7 @@ await LoopbackServer.CreateServerAsync(async (server, serverUrl) => }); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/26355")] // We aren't doing IDNA encoding properly + [ActiveIssue("https://github.com/dotnet/runtime/issues/24679")] // We aren't doing IDNA encoding properly [Theory] [MemberData(nameof(InternationalHostNames))] public async Task InternationalRequestHeaderValues_UsesIdnaEncoding_Success(string hostname) @@ -87,7 +87,7 @@ await LoopbackServer.CreateServerAsync(async (server, serverUrl) => }); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/26355")] // We aren't doing IDNA decoding properly + [ActiveIssue("https://github.com/dotnet/runtime/issues/24679")] // We aren't doing IDNA decoding properly [Theory] [MemberData(nameof(InternationalHostNames))] public async Task InternationalResponseHeaderValues_UsesIdnaDecoding_Success(string hostname) diff --git a/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs b/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs index bab3d7203a122e..6433f539c0dc63 100644 --- a/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs @@ -673,7 +673,7 @@ public override async Task ReadRequestDataAsync(bool readBody = { if (requestData.GetHeaderValueCount("Content-Length") != 0) { - _contentLength = Int32.Parse(requestData.GetSingleHeaderValue("Content-Length")); + _contentLength = int.Parse(requestData.GetSingleHeaderValue("Content-Length")); } else if (requestData.GetHeaderValueCount("Transfer-Encoding") != 0 && requestData.GetSingleHeaderValue("Transfer-Encoding") == "chunked") { @@ -897,8 +897,6 @@ private static LoopbackServer.Options CreateOptions(GenericLoopbackOptions optio return newOptions; } - public override bool IsHttp11 => true; - public override bool IsHttp2 => false; - public override bool IsHttp3 => false; + public override Version Version => HttpVersion.Version11; } } diff --git a/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs b/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs index c7c343e3b7d37b..733b29f0c6d6bb 100644 --- a/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs +++ b/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs @@ -221,7 +221,7 @@ private async Task PostHelper( { if (useContentLengthUpload) { - // Ensure that Content-Length is populated (see https://github.com/dotnet/corefx/issues/27245) + // Ensure that Content-Length is populated (see https://github.com/dotnet/runtime/issues/25086) requestContent.Headers.ContentLength = requestContent.Headers.ContentLength; } else diff --git a/src/libraries/Common/tests/System/Net/Http/QPackDecoder.cs b/src/libraries/Common/tests/System/Net/Http/QPackTestDecoder.cs similarity index 73% rename from src/libraries/Common/tests/System/Net/Http/QPackDecoder.cs rename to src/libraries/Common/tests/System/Net/Http/QPackTestDecoder.cs index 3923d8d2ae6a88..da276e1ce9d654 100644 --- a/src/libraries/Common/tests/System/Net/Http/QPackDecoder.cs +++ b/src/libraries/Common/tests/System/Net/Http/QPackTestDecoder.cs @@ -7,7 +7,7 @@ namespace System.Net.Test.Common { - public static class QPackDecoder + public static class QPackTestDecoder { public static (int bytesConsumed, int requiredInsertCount, int deltaBase) DecodePrefix(ReadOnlySpan buffer) { @@ -18,84 +18,63 @@ public static (int bytesConsumed, int requiredInsertCount, int deltaBase) Decode return (2, 0, 0); } + public static (int bytesConsumed, HttpHeaderData) DecodeHeader(ReadOnlySpan buffer) { - int firstByte = buffer[0]; - - // Indexed Header Field, dynamic. - if ((firstByte & 0b1100_0000) == 0b1000_0000) - { - throw new Exception("QPack dynamic table is not yet supported."); - } - - // Indexed Header Field, static. - if ((firstByte & 0b1100_0000) == 0b1100_0000) + switch (BitOperations.LeadingZeroCount(buffer[0]) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s. { - (int bytesConsumed, int staticIndex) = DecodeInteger(buffer, 0b1100_0000); + case 0: // Indexed Header Field + { + if ((buffer[0] & 0b0100_0000) == 0) throw new Exception("QPack dynamic table is not yet supported."); - var staticHeader = s_staticTable[staticIndex]; - var header = new HttpHeaderData(staticHeader.Name, staticHeader.Value, raw: buffer.Slice(0, bytesConsumed).ToArray()); + (int bytesConsumed, int staticIndex) = DecodeInteger(buffer, 0b0011_1111); - return (bytesConsumed, header); - } + var staticHeader = s_staticTable[staticIndex]; + var header = new HttpHeaderData(staticHeader.Name, staticHeader.Value, raw: buffer.Slice(0, bytesConsumed).ToArray()); - // Indexed Header Field With Post-Base Index - if ((firstByte & 0b1111_0000) == 0b0001_0000) - { - throw new Exception("QPack dynamic table is not yet supported."); - } - - // Literal Header Field With Name Reference - if ((firstByte & 0b1100_0000) == 0b0100_0000) - { - if ((firstByte & 0b0001_0000) != 0) - { - throw new Exception("QPack dynamic table is not yet supported."); + return (bytesConsumed, header); } + case 1: // Literal Header Field With Name Reference + { + if ((buffer[0] & 0b0001_0000) == 0) throw new Exception("QPack dynamic table is not yet supported."); - (int nameLength, int staticIndex) = DecodeInteger(buffer, 0b1111_0000); - (int valueLength, string value) = DecodeString(buffer.Slice(nameLength), 0b1000_0000); - - int headerLength = nameLength + valueLength; - var header = new HttpHeaderData(s_staticTable[staticIndex].Name, value, raw: buffer.Slice(0, headerLength).ToArray()); - - return (headerLength, header); - } + (int nameLength, int staticIndex) = DecodeInteger(buffer, 0b0000_1111); + (int valueLength, string value) = DecodeString(buffer.Slice(nameLength), 0b0111_1111); - // Literal Header Field With Post-Base Name Reference. - if ((firstByte & 0b1111_0000) == 0b0000_0000) - { - throw new Exception("QPack dynamic table is not yet supported."); - } + int headerLength = nameLength + valueLength; + var header = new HttpHeaderData(s_staticTable[staticIndex].Name, value, raw: buffer.Slice(0, headerLength).ToArray()); - // Literal Header Field Without Name Reference. - if ((firstByte & 0b1110_0000) == 0b0010_0000) - { - (int nameLength, string name) = DecodeString(buffer, 0b1111_1000); - (int valueLength, string value) = DecodeString(buffer.Slice(nameLength), 0b1000_0000); + return (headerLength, header); + } + case 2: // Literal Header Field Without Name Reference + { + (int nameLength, string name) = DecodeString(buffer, 0b0000_0111); + (int valueLength, string value) = DecodeString(buffer.Slice(nameLength), 0b0111_1111); - int headerLength = nameLength + valueLength; - var header = new HttpHeaderData(name, value, raw: buffer.Slice(0, headerLength).ToArray()); + int headerLength = nameLength + valueLength; + var header = new HttpHeaderData(name, value, raw: buffer.Slice(0, headerLength).ToArray()); - return (headerLength, header); + return (headerLength, header); + } + case 3: // Indexed Header Field With Post-Base Index + default: // Literal Header Field With Post-Base Name Reference (at least 4 zeroes, maybe more) + throw new Exception("QPack dynamic table is not yet supported."); } - - throw new Exception("Invalid QPack."); } private static (int bytesConsumed, string value) DecodeString(ReadOnlySpan buffer, byte prefixMask) { - bool huffman = (buffer[0] & (1 << BitOperations.TrailingZeroCount(prefixMask))) != 0; + bool huffman = (buffer[0] & (1 << BitOperations.TrailingZeroCount(~prefixMask))) != 0; if (huffman) { throw new Exception("Huffman coding not yet supported."); } - (int nameLength, int stringLength) = DecodeInteger(buffer, prefixMask); - string value = Encoding.ASCII.GetString(buffer.Slice(nameLength)); + (int varIntLength, int stringLength) = DecodeInteger(buffer, prefixMask); + string value = Encoding.ASCII.GetString(buffer.Slice(varIntLength, stringLength)); - return (nameLength + stringLength, value); + return (varIntLength + stringLength, value); } public static (int bytesConsumed, int value) DecodeInteger(ReadOnlySpan headerBlock, byte prefixMask) @@ -106,13 +85,20 @@ public static (int bytesConsumed, int value) DecodeInteger(ReadOnlySpan he return (1, value); } - byte b = headerBlock[1]; - if ((b & 0b10000000) != 0) + ulong extra = 0; + int length = 1; + byte b; + + do { - throw new Exception("long integers currently not supported"); + b = headerBlock[length++]; + extra = checked(extra << 7) | b; } + while ((b & 0b10000000) != 0); + + value = checked((int)(prefixMask + extra)); - return (2, prefixMask + b); + return (length, value); } private static readonly HttpHeaderData[] s_staticTable = new HttpHeaderData[] diff --git a/src/libraries/Common/tests/System/Net/Http/QPackEncoder.cs b/src/libraries/Common/tests/System/Net/Http/QPackTestEncoder.cs similarity index 99% rename from src/libraries/Common/tests/System/Net/Http/QPackEncoder.cs rename to src/libraries/Common/tests/System/Net/Http/QPackTestEncoder.cs index f70ca725454151..a05ce29eb0c0f5 100644 --- a/src/libraries/Common/tests/System/Net/Http/QPackEncoder.cs +++ b/src/libraries/Common/tests/System/Net/Http/QPackTestEncoder.cs @@ -7,7 +7,7 @@ namespace System.Net.Test.Common { - public static class QPackEncoder + public static class QPackTestEncoder { public const int MaxVarIntLength = 6; public const int MaxPrefixLength = MaxVarIntLength * 2; diff --git a/src/libraries/Common/tests/System/Net/Http/SchSendAuxRecordHttpTest.cs b/src/libraries/Common/tests/System/Net/Http/SchSendAuxRecordHttpTest.cs index cd5b1790662e3c..8eb4108aaba178 100644 --- a/src/libraries/Common/tests/System/Net/Http/SchSendAuxRecordHttpTest.cs +++ b/src/libraries/Common/tests/System/Net/Http/SchSendAuxRecordHttpTest.cs @@ -15,7 +15,7 @@ namespace System.Net.Http.Functional.Tests using HttpClientHandler = System.Net.Http.WinHttpClientHandler; #endif - [ActiveIssue("https://github.com/dotnet/corefx/issues/26539")] // Flaky test + [ActiveIssue("https://github.com/dotnet/runtime/issues/24776")] // Flaky test public abstract class SchSendAuxRecordHttpTest : HttpClientHandlerTestBase { public SchSendAuxRecordHttpTest(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/Deployment/setup_common.ps1 b/src/libraries/Common/tests/System/Net/Prerequisites/Deployment/setup_common.ps1 index 9a28524414aa59..7464241597029f 100644 --- a/src/libraries/Common/tests/System/Net/Prerequisites/Deployment/setup_common.ps1 +++ b/src/libraries/Common/tests/System/Net/Prerequisites/Deployment/setup_common.ps1 @@ -8,35 +8,35 @@ $script:ClientConfiguration = @( # Configuration.Http: - @{Name = "COREFX_HTTPHOST"; Value = $script:iisServerFQDN}, - @{Name = "COREFX_SECUREHTTPHOST"; Value = $script:iisServerFQDN}, - @{Name = "COREFX_HTTP2HOST"; Value = $script:iisServerFQDN}, # Requires Windows 10 and above. - @{Name = "COREFX_DOMAINJOINED_HTTPHOST"; Value = $script:iisServerFQDN}, - @{Name = "COREFX_DOMAINJOINED_PROXYHOST"; Value = $null}, - @{Name = "COREFX_DOMAINJOINED_PROXYPORT"; Value = $null}, - @{Name = "COREFX_HTTPHOST_SSL2"; Value = $null}, - @{Name = "COREFX_HTTPHOST_SSL3"; Value = $null}, - @{Name = "COREFX_HTTPHOST_TLS10"; Value = $null}, - @{Name = "COREFX_HTTPHOST_TLS11"; Value = $null}, - @{Name = "COREFX_HTTPHOST_TLS12"; Value = $null}, - @{Name = "COREFX_HTTPHOST_EXPIREDCERT"; Value = $null}, - @{Name = "COREFX_HTTPHOST_WRONGHOSTNAME"; Value = $null}, - @{Name = "COREFX_HTTPHOST_SELFSIGNEDCERT"; Value = $null}, - @{Name = "COREFX_HTTPHOST_REVOKEDCERT"; Value = $null}, - @{Name = "COREFX_STRESS_HTTP"; Value = "1"}, + @{Name = "DOTNET_TEST_HTTPHOST"; Value = $script:iisServerFQDN}, + @{Name = "DOTNET_TEST_SECUREHTTPHOST"; Value = $script:iisServerFQDN}, + @{Name = "DOTNET_TEST_HTTP2HOST"; Value = $script:iisServerFQDN}, # Requires Windows 10 and above. + @{Name = "DOTNET_TEST_DOMAINJOINED_HTTPHOST"; Value = $script:iisServerFQDN}, + @{Name = "DOTNET_TEST_DOMAINJOINED_PROXYHOST"; Value = $null}, + @{Name = "DOTNET_TEST_DOMAINJOINED_PROXYPORT"; Value = $null}, + @{Name = "DOTNET_TEST_HTTPHOST_SSL2"; Value = $null}, + @{Name = "DOTNET_TEST_HTTPHOST_SSL3"; Value = $null}, + @{Name = "DOTNET_TEST_HTTPHOST_TLS10"; Value = $null}, + @{Name = "DOTNET_TEST_HTTPHOST_TLS11"; Value = $null}, + @{Name = "DOTNET_TEST_HTTPHOST_TLS12"; Value = $null}, + @{Name = "DOTNET_TEST_HTTPHOST_EXPIREDCERT"; Value = $null}, + @{Name = "DOTNET_TEST_HTTPHOST_WRONGHOSTNAME"; Value = $null}, + @{Name = "DOTNET_TEST_HTTPHOST_SELFSIGNEDCERT"; Value = $null}, + @{Name = "DOTNET_TEST_HTTPHOST_REVOKEDCERT"; Value = $null}, + @{Name = "DOTNET_TEST_STRESS_HTTP"; Value = "1"}, # Configuration.WebSockets: - @{Name = "COREFX_WEBSOCKETHOST"; Value = $script:iisServerFQDN}, - @{Name = "COREFX_SECUREWEBSOCKETHOST"; Value = $script:iisServerFQDN}, + @{Name = "DOTNET_TEST_WEBSOCKETHOST"; Value = $script:iisServerFQDN}, + @{Name = "DOTNET_TEST_SECUREWEBSOCKETHOST"; Value = $script:iisServerFQDN}, # Configuration.Security: - @{Name = "COREFX_NET_AD_DOMAINNAME"; Value = $script:domainNetbios}, - @{Name = "COREFX_NET_AD_USERNAME"; Value = $script:domainUserName}, - @{Name = "COREFX_NET_AD_PASSWORD"; Value = $script:domainUserPassword}, - @{Name = "COREFX_NET_SECURITY_NEGOSERVERURI"; Value = "http://$($script:iisServerFQDN)"}, - @{Name = "COREFX_NET_SECURITY_TLSSERVERURI"; Value = "https://$($script:iisServerFQDN)"}, + @{Name = "DOTNET_TEST_NET_AD_DOMAINNAME"; Value = $script:domainNetbios}, + @{Name = "DOTNET_TEST_NET_AD_USERNAME"; Value = $script:domainUserName}, + @{Name = "DOTNET_TEST_NET_AD_PASSWORD"; Value = $script:domainUserPassword}, + @{Name = "DOTNET_TEST_NET_SECURITY_NEGOSERVERURI"; Value = "http://$($script:iisServerFQDN)"}, + @{Name = "DOTNET_TEST_NET_SECURITY_TLSSERVERURI"; Value = "https://$($script:iisServerFQDN)"}, - @{Name = "COREFX_NET_SOCKETS_SERVERURI"; Value = "http://$($script:iisServerFQDN)"} + @{Name = "DOTNET_TEST_NET_SOCKETS_SERVERURI"; Value = "http://$($script:iisServerFQDN)"} ) Function GetRoleForMachine($machineName) @@ -58,7 +58,7 @@ Function CheckPreRebootMachineInfo { $role = GetPreRebootRoleForMachine $Env:COMPUTERNAME - if ($role.Name -ne $script:COREFX_ROLE_NAME) + if ($role.Name -ne $script:DOTNET_TEST_ROLE_NAME) { throw "This script needs to run on machines part of the $($role.Name) role." } @@ -73,7 +73,7 @@ Function CheckMachineInfo { $role = GetRoleForMachine $Env:COMPUTERNAME - if ($role.Name -ne $script:COREFX_ROLE_NAME) + if ($role.Name -ne $script:DOTNET_TEST_ROLE_NAME) { throw "This script needs to run on machines part of the $($role.Name) role." } @@ -86,7 +86,7 @@ Function CheckMachineInfo Function EnvironmentAddRoleStatus($status) { - [Environment]::SetEnvironmentVariable($script:COREFX_ROLE_NAME, $status, "Machine") + [Environment]::SetEnvironmentVariable($script:DOTNET_TEST_ROLE_NAME, $status, "Machine") } Function EnvironmentSetInstalledRoleStatus @@ -101,14 +101,14 @@ Function EnvironmentSetRebootPendingRoleStatus Function EnvironmentRemoveRoleStatus { - [Environment]::SetEnvironmentVariable($script:COREFX_ROLE_NAME, $null, "Machine") + [Environment]::SetEnvironmentVariable($script:DOTNET_TEST_ROLE_NAME, $null, "Machine") } Function EnvironmentCheckUninstallRoleStatus { - if ([Environment]::GetEnvironmentVariable($script:COREFX_ROLE_NAME, "Machine") -ne "Installed") + if ([Environment]::GetEnvironmentVariable($script:DOTNET_TEST_ROLE_NAME, "Machine") -ne "Installed") { - Write-Warning "The machine doesn't appear to be in the $($script:COREFX_ROLE_NAME) role." + Write-Warning "The machine doesn't appear to be in the $($script:DOTNET_TEST_ROLE_NAME) role." $continue = Read-Host "Do you want to continue? [Y/N]" if ($continue.ToUpper() -ne "Y") { @@ -120,12 +120,12 @@ Function EnvironmentCheckUninstallRoleStatus Function EnvironmentIsRoleRebootPending { - return [Environment]::GetEnvironmentVariable($script:COREFX_ROLE_NAME, "Machine") -eq "PendingReboot" + return [Environment]::GetEnvironmentVariable($script:DOTNET_TEST_ROLE_NAME, "Machine") -eq "PendingReboot" } Function EnvironmentIsRoleInstalled { - return [Environment]::GetEnvironmentVariable($script:COREFX_ROLE_NAME, "Machine") -eq "Installed" + return [Environment]::GetEnvironmentVariable($script:DOTNET_TEST_ROLE_NAME, "Machine") -eq "Installed" } Function DownloadFile($source, $destination) diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/README.md b/src/libraries/Common/tests/System/Net/Prerequisites/README.md index 37b95ba818d46a..cd1e217b9d1f08 100644 --- a/src/libraries/Common/tests/System/Net/Prerequisites/README.md +++ b/src/libraries/Common/tests/System/Net/Prerequisites/README.md @@ -12,7 +12,7 @@ Note: the `config.ps1` file has been added to .gitignore to prevent it being upd ### Build the server applications -Prepare the $COREFX_NET_CLIENT_Machine as any Dev station following the instructions at https://github.com/dotnet/runtime/blob/master/docs/workflow/requirements/windows-requirements.md. Ensure that you can build and test CoreFX on this machine. +Prepare the $DOTNET_TEST_NET_CLIENT_Machine as any Dev station following the instructions at https://github.com/dotnet/runtime/blob/master/docs/workflow/requirements/windows-requirements.md. Ensure that you can build and test CoreFX on this machine. In addition, you will also need to install the _Azure development_ workload for Visual Studio 2017. From a Visual Studio command prompt: diff --git a/src/libraries/Common/tests/System/Net/Sockets/SocketTestExtensions.cs b/src/libraries/Common/tests/System/Net/Sockets/SocketTestExtensions.cs index 76043a3d3653e9..f386473f06f81f 100644 --- a/src/libraries/Common/tests/System/Net/Sockets/SocketTestExtensions.cs +++ b/src/libraries/Common/tests/System/Net/Sockets/SocketTestExtensions.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Threading; + namespace System.Net.Sockets.Tests { internal static class SocketTestExtensions @@ -49,5 +51,32 @@ public static (Socket, Socket) CreateConnectedSocketPair() return (client, server); } + + // Tries to connect within the provided timeout interval + // Useful to speed up "can not connect" assertions on Windows + public static bool TryConnect(this Socket socket, EndPoint remoteEndpoint, int millisecondsTimeout) + { + var mre = new ManualResetEventSlim(false); + using var sea = new SocketAsyncEventArgs() + { + RemoteEndPoint = remoteEndpoint, + UserToken = mre + }; + + sea.Completed += (s, e) => ((ManualResetEventSlim)e.UserToken).Set(); + + bool pending = socket.ConnectAsync(sea); + if (!pending || mre.Wait(millisecondsTimeout)) + { + mre.Dispose(); + return sea.SocketError == SocketError.Success; + } + + Socket.CancelConnectAsync(sea); // this will close the socket! + + // In case of time-out, ManualResetEventSlim is left undisposed to avoid race conditions, + // letting SafeHandle's finalizer to do the cleanup. + return false; + } } } diff --git a/src/libraries/Common/tests/System/Net/WebSockets/WebSocketCreateTest.cs b/src/libraries/Common/tests/System/Net/WebSockets/WebSocketCreateTest.cs index f2b4d05e43cac0..391c41eeee693f 100644 --- a/src/libraries/Common/tests/System/Net/WebSockets/WebSocketCreateTest.cs +++ b/src/libraries/Common/tests/System/Net/WebSockets/WebSocketCreateTest.cs @@ -45,7 +45,7 @@ public async Task WebSocketProtocol_CreateFromConnectedStream_CanSendReceiveData { if (PlatformDetection.IsWindows7) { - // https://github.com/dotnet/corefx/issues/42339 + // https://github.com/dotnet/runtime/issues/31382 return; } @@ -204,7 +204,7 @@ public async Task WebSocketProtocol_CreateFromConnectedStream_CloseAsyncClosesSt { if (PlatformDetection.IsWindows7) { - // https://github.com/dotnet/corefx/issues/42339 + // https://github.com/dotnet/runtime/issues/31382 return; } @@ -237,7 +237,7 @@ public async Task WebSocketProtocol_CreateFromConnectedStream_CloseAsyncClosesSt } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/36016")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/28957")] [OuterLoop("Uses external servers")] [Theory] [MemberData(nameof(EchoServersAndBoolean))] diff --git a/src/libraries/Common/tests/System/RealFormatterTestsBase.cs b/src/libraries/Common/tests/System/RealFormatterTestsBase.cs index 197b467bc0f975..179c07dbd86205 100644 --- a/src/libraries/Common/tests/System/RealFormatterTestsBase.cs +++ b/src/libraries/Common/tests/System/RealFormatterTestsBase.cs @@ -15,7 +15,7 @@ public abstract class RealFormatterTestsBase protected abstract string InvariantToStringSingle(float f, string format); [Theory] - [InlineData(1.23E+22, "1.23E+22")] // [ActiveIssue("https://github.com/dotnet/corefx/issues/42576")] + [InlineData(1.23E+22, "1.23E+22")] // [ActiveIssue("https://github.com/dotnet/runtime/issues/31483")] public void TestFormatterDouble_Shortest(double value, string expectedResult) => TestFormatterDouble_Standard(value, "R", expectedResult); [Theory] diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/AES/AesContractTests.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/AES/AesContractTests.cs index 08530667a7189d..82aa0fc75c9b89 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/AES/AesContractTests.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/AES/AesContractTests.cs @@ -62,7 +62,7 @@ public static void LegalKeySizes() [InlineData(64, false)] // too small [InlineData(129, false)] // in valid range but not valid increment [InlineData(384, false)] // too large - // Skip on .NET Framework because change is not ported https://github.com/dotnet/corefx/issues/18690 + // Skip on .NET Framework because change is not ported https://github.com/dotnet/runtime/issues/21236 [InlineData(536870928, true)] // number of bits overflows and wraps around to a valid size public static void InvalidKeySizes(int invalidKeySize, bool skipOnNetfx) { @@ -97,7 +97,7 @@ public static void InvalidKeySizes(int invalidKeySize, bool skipOnNetfx) [Theory] [InlineData(64, false)] // smaller than default BlockSize [InlineData(129, false)] // larger than default BlockSize - // Skip on .NET Framework because change is not ported https://github.com/dotnet/corefx/issues/18690 + // Skip on .NET Framework because change is not ported https://github.com/dotnet/runtime/issues/21236 [InlineData(536870928, true)] // number of bits overflows and wraps around to default BlockSize public static void InvalidIVSizes(int invalidIvSize, bool skipOnNetfx) { @@ -195,7 +195,7 @@ public static void ValidateEncryptorProperties() } [Fact] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "In .NET Framework AesCryptoServiceProvider requires a set key and throws otherwise. See https://github.com/dotnet/corefx/issues/19023.")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "In .NET Framework AesCryptoServiceProvider requires a set key and throws otherwise. See https://github.com/dotnet/runtime/issues/21393.")] public static void ValidateDecryptorProperties() { using (Aes aes = AesFactory.Create()) diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/AES/DecryptorReusability.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/AES/DecryptorReusability.cs index 9abd3b72079a18..03c2c4ac4e0330 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/AES/DecryptorReusability.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/AES/DecryptorReusability.cs @@ -10,7 +10,7 @@ namespace System.Security.Cryptography.Encryption.Aes.Tests public static class DecryptorReusabilty { - // See https://github.com/dotnet/corefx/issues/18903 for details + // See https://github.com/dotnet/runtime/issues/21354 for details [ConditionalFact(nameof(ShouldDecryptorBeReusable))] public static void TestDecryptorReusability() { diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/ImportExport.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/ImportExport.cs index 5ec61d09c9ce95..7c8d9509397c23 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/ImportExport.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/ImportExport.cs @@ -274,7 +274,7 @@ public static void ImportNoModulus() [Fact] #if TESTING_CNG_IMPLEMENTATION - [ActiveIssue("https://github.com/dotnet/corefx/issues/18882", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21341", TargetFrameworkMonikers.NetFramework)] #endif public static void ImportNoDP() { diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/RSAXml.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/RSAXml.cs index 2467fcb9cfacc7..37ad05997f06ed 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/RSAXml.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/RSAXml.cs @@ -1340,7 +1340,7 @@ public static void FromInvalidXml() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/37595", TestPlatforms.OSX)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/29515", TestPlatforms.OSX)] public static void FromNonsenseXml() { // This is DiminishedDPParameters XML, but with a P that is way too long. diff --git a/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs b/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs index 734b57e9544cdb..cf0129be3adf04 100644 --- a/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs +++ b/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs @@ -6,7 +6,7 @@ using System.Diagnostics; /// -/// Task timeout helper based on http://blogs.msdn.com/b/pfxteam/archive/2011/11/10/10235834.aspx +/// Task timeout helper based on https://devblogs.microsoft.com/pfxteam/crafting-a-task-timeoutafter-method/ /// namespace System.Threading.Tasks { diff --git a/src/libraries/Common/tests/Tests/System/IO/PathInternal.Unix.Tests.cs b/src/libraries/Common/tests/Tests/System/IO/PathInternal.Unix.Tests.cs index 31b50266ca2387..bf9d2a165f9909 100644 --- a/src/libraries/Common/tests/Tests/System/IO/PathInternal.Unix.Tests.cs +++ b/src/libraries/Common/tests/Tests/System/IO/PathInternal.Unix.Tests.cs @@ -47,7 +47,7 @@ public void NormalizeDirectorySeparatorTests(string path, string expected) public void IsCaseInsensitive_OSX() { // There have been reports of casing handling not being appropriate on MacOS - // https://github.com/dotnet/corefx/issues/26797 + // https://github.com/dotnet/runtime/issues/24898 Assert.False(PathInternal.IsCaseSensitive); } } diff --git a/src/libraries/Common/tests/Tests/System/Net/Http2/ReadMe.SharedCode.md b/src/libraries/Common/tests/Tests/System/Net/Http2/ReadMe.SharedCode.md deleted file mode 100644 index 8cb8d8d2ab5ee2..00000000000000 --- a/src/libraries/Common/tests/Tests/System/Net/Http2/ReadMe.SharedCode.md +++ /dev/null @@ -1,5 +0,0 @@ -The code in this directory is shared between the runtime libraries and AspNetCore. This contains tests for HTTP/2 protocol infrastructure such as HPACK. Any changes to this dir need to be checked into both repositories. - -For additional details see: -- runtime/src/libraries/Common/src/System/Net/Http/Http2/ReadMe.SharedCode.md -- AspNetCore/src/Shared/Http2/ReadMe.SharedCode.md diff --git a/src/libraries/Common/tests/Tests/System/Net/Http2/DynamicTableTest.cs b/src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http2/DynamicTableTest.cs similarity index 100% rename from src/libraries/Common/tests/Tests/System/Net/Http2/DynamicTableTest.cs rename to src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http2/DynamicTableTest.cs diff --git a/src/libraries/Common/tests/Tests/System/Net/Http2/HPackDecoderTest.cs b/src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http2/HPackDecoderTest.cs similarity index 100% rename from src/libraries/Common/tests/Tests/System/Net/Http2/HPackDecoderTest.cs rename to src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http2/HPackDecoderTest.cs diff --git a/src/libraries/Common/tests/Tests/System/Net/Http2/HPackIntegerTest.cs b/src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http2/HPackIntegerTest.cs similarity index 100% rename from src/libraries/Common/tests/Tests/System/Net/Http2/HPackIntegerTest.cs rename to src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http2/HPackIntegerTest.cs diff --git a/src/libraries/Common/tests/Tests/System/Net/Http2/HuffmanDecodingTests.cs b/src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http2/HuffmanDecodingTests.cs similarity index 100% rename from src/libraries/Common/tests/Tests/System/Net/Http2/HuffmanDecodingTests.cs rename to src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http2/HuffmanDecodingTests.cs diff --git a/src/libraries/Common/tests/Tests/System/Net/aspnetcore/ReadMe.SharedCode.md b/src/libraries/Common/tests/Tests/System/Net/aspnetcore/ReadMe.SharedCode.md new file mode 100644 index 00000000000000..cd18bcb663f682 --- /dev/null +++ b/src/libraries/Common/tests/Tests/System/Net/aspnetcore/ReadMe.SharedCode.md @@ -0,0 +1,5 @@ +The code in this directory is shared between the runtime libraries and AspNetCore. This contains tests for HTTP/2 and HTTP/3 protocol infrastructure such as HPACK. Any changes to this dir need to be checked into both repositories. + +For additional details see: +- runtime/src/libraries/Common/src/System/Net/Http/aspnetcore/ReadMe.SharedCode.md +- AspNetCore/src/Shared/runtime/ReadMe.SharedCode.md diff --git a/src/libraries/Common/tests/Tests/System/StringTests.cs b/src/libraries/Common/tests/Tests/System/StringTests.cs index 80cee6578e044d..fd24ad5e544362 100644 --- a/src/libraries/Common/tests/Tests/System/StringTests.cs +++ b/src/libraries/Common/tests/Tests/System/StringTests.cs @@ -22,6 +22,7 @@ namespace System.Tests public partial class StringTests { private const string SoftHyphen = "\u00AD"; + private const string ZeroWidthJoiner = "\u200D"; // weightless in both ICU and NLS private static readonly char[] s_whiteSpaceCharacters = { '\u0009', '\u000a', '\u000b', '\u000c', '\u000d', '\u0020', '\u0085', '\u00a0', '\u1680' }; [Theory] @@ -1678,7 +1679,7 @@ public static void EndsWith(string s, string value, StringComparison comparisonT } [Theory] - [ActiveIssue("https://github.com/dotnet/coreclr/issues/2051", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/4673", TestPlatforms.AnyUnix)] [InlineData(StringComparison.CurrentCulture)] [InlineData(StringComparison.CurrentCultureIgnoreCase)] [InlineData(StringComparison.Ordinal)] @@ -1700,7 +1701,7 @@ public static void EndsWith_NullInStrings(StringComparison comparison) // NOTE: This is by design. Unix ignores the null characters (i.e. null characters have no weights for the string comparison). // For desired behavior, use ordinal comparison instead of linguistic comparison. - // This is a known difference between Windows and Unix (https://github.com/dotnet/coreclr/issues/2051). + // This is a known difference between Windows and Unix (https://github.com/dotnet/runtime/issues/4673). [Theory] [PlatformSpecific(TestPlatforms.Windows)] [InlineData(StringComparison.InvariantCulture)] @@ -1865,7 +1866,7 @@ public static void EndsWithNoMatch_Char() //For example null character on Linux will be ignored if it is compared to anything //while on Windows null will be always compared as ordinal. //For desired behavior, use ordinal comparison instead of linguistic comparison. - //This is a known difference between Windows and Unix (https://github.com/dotnet/coreclr/issues/2051). + //This is a known difference between Windows and Unix (https://github.com/dotnet/runtime/issues/4673). bool b = s1.EndsWith(s2, StringComparison.Ordinal); Assert.False(b); @@ -2628,7 +2629,7 @@ public static void Format_Invalid() [InlineData("Hello", 'o', 5, 0, -1)] [InlineData("H" + SoftHyphen + "ello", 'e', 0, 3, 2)] // For some reason, this is failing on *nix with ordinal comparisons. - // Possibly related issue: https://github.com/dotnet/coreclr/issues/2051 + // Possibly related issue: https://github.com/dotnet/runtime/issues/4673 // [InlineData("Hello", '\0', 0, 5, -1)] // .NET strings are terminated with a null character, but they should not be included as part of the string [InlineData("\ud800\udfff", '\ud800', 0, 1, 0)] // Surrogate characters [InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 'A', 0, 26, 0)] @@ -2774,7 +2775,7 @@ private static bool IsSafeForCurrentCultureComparisons(string str) } [Theory] - [ActiveIssue("https://github.com/dotnet/coreclr/issues/2051", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/4673", TestPlatforms.AnyUnix)] [InlineData("He\0lo", "He\0lo", 0)] [InlineData("He\0lo", "He\0", 0)] [InlineData("He\0lo", "\0", 2)] @@ -3864,7 +3865,7 @@ public static void LastIndexOf_Match_SingleLetter() } [Theory] - [ActiveIssue("https://github.com/dotnet/coreclr/issues/2051", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/4673", TestPlatforms.AnyUnix)] [InlineData("He\0lo", "He\0lo", 0)] [InlineData("He\0lo", "He\0", 0)] [InlineData("He\0lo", "\0", 2)] @@ -4650,7 +4651,7 @@ public static void StartsWith(string s, string value, StringComparison compariso } [Theory] - [ActiveIssue("https://github.com/dotnet/coreclr/issues/2051", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/4673", TestPlatforms.AnyUnix)] [InlineData(StringComparison.CurrentCulture)] [InlineData(StringComparison.CurrentCultureIgnoreCase)] [InlineData(StringComparison.Ordinal)] @@ -7077,7 +7078,7 @@ public static void StartsWithNoMatchNonOrdinal_StringComparison() // NOTE: This is by design. Unix ignores the null characters (i.e. null characters have no weights for the string comparison). // For desired behavior, use ordinal comparison instead of linguistic comparison. - // This is a known difference between Windows and Unix (https://github.com/dotnet/coreclr/issues/2051). + // This is a known difference between Windows and Unix (https://github.com/dotnet/runtime/issues/4673). [Theory] [PlatformSpecific(TestPlatforms.Windows)] [InlineData(StringComparison.CurrentCulture)] diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index ab1a1887624eef..7464cbe3360da4 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -11,6 +11,7 @@ $([MSBuild]::NormalizePath('$(ArtifactsDir)', 'tmp', '$(Configuration)', 'RuntimeOS.props')) $(LibrariesProjectRoot)\OSGroups.json netcoreapp5.0 + false $(AdditionalBuildTargetFrameworks);$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-NetBSD;$(NetCoreAppCurrent)-FreeBSD diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index db925e0412732d..b801599bc5927c 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -66,6 +66,10 @@ ILLinkTrimAssembly=true + + C:\CodeHub\runtime\artifacts\bin\pkg\aspnetcore\runtime + C:\CodeHub\runtime\artifacts\bin\pkg\aspnetcore\ref + @@ -144,6 +148,8 @@ + + @@ -201,7 +207,14 @@ - true - true + true + true + + + + + diff --git a/src/libraries/Microsoft.CSharp/ref/Microsoft.CSharp.cs b/src/libraries/Microsoft.CSharp/ref/Microsoft.CSharp.cs index c52717ae5aa458..e40f70fa301d63 100644 --- a/src/libraries/Microsoft.CSharp/ref/Microsoft.CSharp.cs +++ b/src/libraries/Microsoft.CSharp/ref/Microsoft.CSharp.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace Microsoft.CSharp.RuntimeBinder diff --git a/src/libraries/Microsoft.CSharp/tests/AccessTests.cs b/src/libraries/Microsoft.CSharp/tests/AccessTests.cs index f1606b8d946e1e..e2a6914556ba76 100644 --- a/src/libraries/Microsoft.CSharp/tests/AccessTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/AccessTests.cs @@ -254,7 +254,7 @@ public void AccessNestedInternalOnlySameAssembly() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void AccessNestedPrivateProtectedAssembly() { dynamic d = Container.PrivateProtectedValueTypeArray(); @@ -272,7 +272,7 @@ public void AccessibleFields() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void InaccessibleFields() { dynamic d = new TypeWithFields(); diff --git a/src/libraries/Microsoft.CSharp/tests/ArrayHandling.cs b/src/libraries/Microsoft.CSharp/tests/ArrayHandling.cs index 80b2e2a0417d5e..2470a76f11c78e 100644 --- a/src/libraries/Microsoft.CSharp/tests/ArrayHandling.cs +++ b/src/libraries/Microsoft.CSharp/tests/ArrayHandling.cs @@ -12,7 +12,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Tests public class ArrayHandling { [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void SingleRankNonSZArray() { dynamic d = Array.CreateInstance(typeof(int), new[] { 8 }, new[] { -2 }); @@ -23,7 +23,7 @@ public void SingleRankNonSZArray() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void ArrayTypeNames() { dynamic d; @@ -42,7 +42,7 @@ public void ArrayTypeNames() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void MultiDimArrayTypeNames() { dynamic d = new int[3, 2, 1]; @@ -58,7 +58,7 @@ public void MultiDimArrayTypeNames() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void IncorrectNumberOfIndices() { dynamic d = new int[2, 2, 2]; @@ -116,7 +116,7 @@ public void MDArrayLength() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void NonSZ1RArrayLenght() { dynamic d = Array.CreateInstance(typeof(int), new[] {23}, new[] {-2}); diff --git a/src/libraries/Microsoft.CSharp/tests/BindingErrors.cs b/src/libraries/Microsoft.CSharp/tests/BindingErrors.cs index 7b2bb9b9f708a8..19f8cda2e481fc 100644 --- a/src/libraries/Microsoft.CSharp/tests/BindingErrors.cs +++ b/src/libraries/Microsoft.CSharp/tests/BindingErrors.cs @@ -439,7 +439,7 @@ public void DoNothing() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void TryInvokeOrAccessNestedClassAsMember() { dynamic dFirst = new Outer.Inner(); @@ -456,7 +456,7 @@ public void TryInvokeOrAccessNestedClassAsMember() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void TryInvokeTypeParameterAsMember() { dynamic d = new List(); @@ -485,7 +485,7 @@ public void DoNothing() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void AccessMethodHiddenByNested() { dynamic dFirst = new DerivedOuterHidingMethod.Inner(); diff --git a/src/libraries/Microsoft.CSharp/tests/EnumArithmeticTests.cs b/src/libraries/Microsoft.CSharp/tests/EnumArithmeticTests.cs index 0ed1eb79008410..d87ae69d378747 100644 --- a/src/libraries/Microsoft.CSharp/tests/EnumArithmeticTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/EnumArithmeticTests.cs @@ -239,7 +239,7 @@ public void EnumAddition(dynamic enumVal, dynamic integralVal, object expected) } [Theory, MemberData(nameof(ByteEnumAdditions))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void LiftedEnumAdditionByte(ByteEnum? enumVal, byte? integralVal, ByteEnum expected) { dynamic d = enumVal; @@ -259,7 +259,7 @@ public void LiftedEnumAdditionByte(ByteEnum? enumVal, byte? integralVal, ByteEnu } [Theory, MemberData(nameof(SByteEnumAdditions))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void LiftedEnumAdditionSByte(SByteEnum? enumVal, sbyte? integralVal, SByteEnum expected) { dynamic d = enumVal; @@ -428,7 +428,7 @@ public void CheckedEnumAddition(dynamic enumVal, dynamic integralVal, object exp [MemberData(nameof(UInt32EnumSubtractions))] [MemberData(nameof(Int64EnumSubtractions))] [MemberData(nameof(UInt64EnumSubtractions))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void EnumSubtraction(dynamic enumVal, dynamic integralVal, object enMinusIn, object inMinusEn) { object result = unchecked(enumVal - integralVal); @@ -440,7 +440,7 @@ public void EnumSubtraction(dynamic enumVal, dynamic integralVal, object enMinus } [Theory, MemberData(nameof(ByteEnumSubtractions))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void LiftedEnumSubtraction(ByteEnum? enumVal, byte? integralVal, ByteEnum? enMinusIn, ByteEnum? inMinusEn) { dynamic d = enumVal; @@ -460,7 +460,7 @@ public void LiftedEnumSubtraction(ByteEnum? enumVal, byte? integralVal, ByteEnum } [Theory, MemberData(nameof(SByteEnumSubtractions))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void LiftedEnumSubtractionSByte(SByteEnum? enumVal, sbyte? integralVal, SByteEnum? enMinusIn, SByteEnum? inMinusEn) { dynamic d = enumVal; @@ -594,7 +594,7 @@ public void LiftedEnumSubtractionUInt64(UInt64Enum? enumVal, ulong? integralVal, } [Theory, MemberData(nameof(ByteEnumSelfSubtraction))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void EnumSubtractionByte(ByteEnum? x, ByteEnum? y, byte expected, bool overflows) { dynamic d = x; @@ -614,7 +614,7 @@ public void EnumSubtractionByte(ByteEnum? x, ByteEnum? y, byte expected, bool ov } [Theory, MemberData(nameof(SByteEnumSelfSubtraction))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void EnumSubtractionSByte(SByteEnum? x, SByteEnum? y, sbyte expected, bool overflows) { dynamic d = x; @@ -756,7 +756,7 @@ public void EnumSubtractionUInt64(UInt64Enum? x, UInt64Enum? y, ulong expected, [MemberData(nameof(UInt32EnumValueArguments))] [MemberData(nameof(Int64EnumValueArguments))] [MemberData(nameof(UInt64EnumValueArguments))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void WithLiteralNull(dynamic value) { object result = value + null; @@ -788,7 +788,7 @@ public void WithNonLiteralNull(dynamic value) } [Theory, MemberData(nameof(ByteEnumValueArguments))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void WithTypedNullNullableByte(dynamic value) { object result = value + (byte?)null; @@ -802,7 +802,7 @@ public void WithTypedNullNullableByte(dynamic value) } [Theory, MemberData(nameof(SByteEnumValueArguments))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void WithTypedNullNullableSByte(dynamic value) { object result = value + (sbyte?)null; diff --git a/src/libraries/Microsoft.CSharp/tests/EnumUnaryOperationTests.cs b/src/libraries/Microsoft.CSharp/tests/EnumUnaryOperationTests.cs index 02573e8220173d..f9f9a334246831 100644 --- a/src/libraries/Microsoft.CSharp/tests/EnumUnaryOperationTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/EnumUnaryOperationTests.cs @@ -115,7 +115,7 @@ public void CheckedEnumOnesComplement(dynamic operand, dynamic result) [MemberData(nameof(Int32Enums))] [MemberData(nameof(UInt32Enums))] [MemberData(nameof(Int64Enums))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void ConstantEnumOnesComplement(object operand, object result) { CallSite> cs = CallSite>.Create( @@ -131,7 +131,7 @@ public void ConstantEnumOnesComplement(object operand, object result) [MemberData(nameof(Int32Enums))] [MemberData(nameof(UInt32Enums))] [MemberData(nameof(Int64Enums))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void ConstantCheckedEnumOnesComplement(object operand, object result) { CallSite> cs = CallSite>.Create( diff --git a/src/libraries/Microsoft.CSharp/tests/ExplicitConversionTests.cs b/src/libraries/Microsoft.CSharp/tests/ExplicitConversionTests.cs index cac734c362c1a9..62f459efb98b3e 100644 --- a/src/libraries/Microsoft.CSharp/tests/ExplicitConversionTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/ExplicitConversionTests.cs @@ -79,7 +79,7 @@ private struct ImplementingStruct : IInterface } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void ClassInterfaceExplicitConversion() { AssertExplicitConvert(new SealedClass(), default(IInterface), ExpectedConversionResult.CompileError); @@ -110,7 +110,7 @@ public void InterfaceClassExplicitConversion() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void ClassInterfaceArrayElementExplicitConversions() { AssertExplicitConvert(new SealedClass[0], default(IInterface[]), ExpectedConversionResult.CompileError); @@ -131,7 +131,7 @@ public void ClassInterfaceArrayElementExplicitConversionsCoreFX() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void ClassInterfaceArrayIListElementExplicitConversions() { AssertExplicitConvert(new SealedClass[0], default(IList), ExpectedConversionResult.CompileError); diff --git a/src/libraries/Microsoft.CSharp/tests/ImplicitConversionTests.cs b/src/libraries/Microsoft.CSharp/tests/ImplicitConversionTests.cs index 6f6d567acf8665..d0fe6217fc7816 100644 --- a/src/libraries/Microsoft.CSharp/tests/ImplicitConversionTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/ImplicitConversionTests.cs @@ -340,7 +340,7 @@ public void StructToInterfacesAndBase() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void ArraysToInterfaces() { int[] intArray = {1, 2, 3}; diff --git a/src/libraries/Microsoft.CSharp/tests/IndexingTests.cs b/src/libraries/Microsoft.CSharp/tests/IndexingTests.cs index fc0ea6c2a7ff5d..c990893d567c0a 100644 --- a/src/libraries/Microsoft.CSharp/tests/IndexingTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/IndexingTests.cs @@ -44,7 +44,7 @@ private class Implementation : IC } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void CustomIndexerName() { dynamic d = new AllTheIntegers(); @@ -53,7 +53,7 @@ public void CustomIndexerName() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void CustomIndexerNameDynamicArgument() { AllTheIntegers all = new AllTheIntegers(); @@ -72,7 +72,7 @@ public void TargetClassClaimsNonExistentMemberIsIndexer() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void DeepInheritingIndexingInterface() { IC ifaceTyped = new Implementation(); @@ -128,7 +128,7 @@ public IEnumerator GetEnumerator() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void GetIndexWithNonRepeatingArgumentInfos() { CallSiteBinder binder = Binder.GetIndex(CSharpBinderFlags.None, GetType(), new ArgumentEnumerable(2)); @@ -140,7 +140,7 @@ public void GetIndexWithNonRepeatingArgumentInfos() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void SetIndexWithNonRepeatingArgumentInfos() { CallSiteBinder binder = Binder.SetIndex(CSharpBinderFlags.None, GetType(), new ArgumentEnumerable(3)); diff --git a/src/libraries/Microsoft.CSharp/tests/IntegerBinaryOperationTests.cs b/src/libraries/Microsoft.CSharp/tests/IntegerBinaryOperationTests.cs index 82f69637e31f35..b872fb282695fa 100644 --- a/src/libraries/Microsoft.CSharp/tests/IntegerBinaryOperationTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/IntegerBinaryOperationTests.cs @@ -498,7 +498,7 @@ public void RuntimeExpression(object x, object y, ExpressionType type, object re [MemberData(nameof(UInt64TestMultiplications))] [MemberData(nameof(UInt64TestNotEquals))] [MemberData(nameof(UInt64TestSubtractions))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void ConstantExpressions(object x, object y, ExpressionType type, object result, bool shouldSucceedChecked) { var callsite = GetBinaryOperationCallSite(type, false, true, true); @@ -533,7 +533,7 @@ public void RuntimeDivideByZero(ExpressionType type, object x) [MemberData(nameof(UInt32DivisionByZero))] [MemberData(nameof(Int64DivisionByZero))] [MemberData(nameof(UInt64DivisionByZero))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void ConstantDivideByZero(ExpressionType type, object x) { var callsite = GetBinaryOperationCallSite(type, false, true, true); @@ -609,7 +609,7 @@ public void ConstantModuloSignedMinimumByMinusOne(object dividend, object diviso } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void NullDMO() { BinaryOperationBinder binder = Binder.BinaryOperation( diff --git a/src/libraries/Microsoft.CSharp/tests/IntegerUnaryOperationTests.cs b/src/libraries/Microsoft.CSharp/tests/IntegerUnaryOperationTests.cs index 338b48af39a64d..7409cb0cc1a1c0 100644 --- a/src/libraries/Microsoft.CSharp/tests/IntegerUnaryOperationTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/IntegerUnaryOperationTests.cs @@ -104,7 +104,7 @@ public void RuntimeExpressions(object x, ExpressionType type, object result, boo [MemberData(nameof(Int64TestOnesComplements))] [MemberData(nameof(UInt64TestUnaryPluses))] [MemberData(nameof(UInt64TestOnesComplements))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void ConstantExpressions(object x, ExpressionType type, object result, bool shouldSucceedChecked) { var callsite = GetUnaryOperationCallSite(type, false, true); diff --git a/src/libraries/Microsoft.CSharp/tests/RuntimeBinderExceptionTests.cs b/src/libraries/Microsoft.CSharp/tests/RuntimeBinderExceptionTests.cs index 4ea969f551291c..55bddd059b3e81 100644 --- a/src/libraries/Microsoft.CSharp/tests/RuntimeBinderExceptionTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/RuntimeBinderExceptionTests.cs @@ -44,7 +44,7 @@ public void InnerExceptionCtor() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void InstanceArgumentInsteadOfTypeForStaticCall() { CallSite> site = @@ -62,7 +62,7 @@ public void InstanceArgumentInsteadOfTypeForStaticCall() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void InstanceArgumentInsteadOfTypeForStaticCallNamedArgument() { CallSite> site = @@ -80,7 +80,7 @@ public void InstanceArgumentInsteadOfTypeForStaticCallNamedArgument() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void NullArgumentInsteadOfTypeForStaticCallNamedArgument() { CallSite> site = @@ -98,7 +98,7 @@ public void NullArgumentInsteadOfTypeForStaticCallNamedArgument() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void NonTypeToCtor() { CallSite> site = CallSite>.Create( diff --git a/src/libraries/Microsoft.CSharp/tests/RuntimeBinderTests.cs b/src/libraries/Microsoft.CSharp/tests/RuntimeBinderTests.cs index 95dfe7bd6b22a2..b94eb5f382ef00 100644 --- a/src/libraries/Microsoft.CSharp/tests/RuntimeBinderTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/RuntimeBinderTests.cs @@ -14,7 +14,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Tests { - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public class RuntimeBinderTests { [Fact] @@ -75,7 +75,7 @@ internal void Foo() } } - // https://github.com/dotnet/coreclr/issues/7103 + // https://github.com/dotnet/runtime/issues/6625 [Fact] public void InternalsVisibleToTest() { diff --git a/src/libraries/Microsoft.CSharp/tests/VarArgsTests.cs b/src/libraries/Microsoft.CSharp/tests/VarArgsTests.cs index 7adc1480c1770f..98aa55d99661b0 100644 --- a/src/libraries/Microsoft.CSharp/tests/VarArgsTests.cs +++ b/src/libraries/Microsoft.CSharp/tests/VarArgsTests.cs @@ -58,7 +58,7 @@ public VarArgCtorOption(int i, __arglist) } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void FailBindOnlyVarargsAvailable() { dynamic d = new HasVarargs(); @@ -74,7 +74,7 @@ public void FailBindOnlyVarargsAvailable() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void CorrectNullaryOverload() { dynamic d = new HasVarargs(); @@ -82,7 +82,7 @@ public void CorrectNullaryOverload() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void CorrectUnaryOverload() { dynamic d = new HasVarargs(); @@ -97,7 +97,7 @@ public void CorrectUnaryOverloadNeedingImplicitConversion() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void CorrectBinaryOverload() { dynamic d = new HasVarargs(); @@ -106,7 +106,7 @@ public void CorrectBinaryOverload() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/31032", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26798", TargetFrameworkMonikers.NetFramework)] public void CorrectCtor() { dynamic d = 19; diff --git a/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft.Diagnostics.Tracing.EventSource.Redist.csproj b/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft.Diagnostics.Tracing.EventSource.Redist.csproj index cbaae2dfc31c4f..0a543cc4d18947 100644 --- a/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft.Diagnostics.Tracing.EventSource.Redist.csproj +++ b/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft.Diagnostics.Tracing.EventSource.Redist.csproj @@ -3,8 +3,8 @@ Microsoft.Diagnostics.Tracing.EventSource $(NoWarn);CS1573 $(DefineConstants);NO_EVENTCOMMANDEXECUTED_SUPPORT;ES_BUILD_STANDALONE;FEATURE_MANAGED_ETW;TARGET_WINDOWS - net461-Windows_NT;$(NetFrameworkCurrent)-Windows_NT - true + $(NetFrameworkCurrent)-Windows_NT;net461-Windows_NT + true enable diff --git a/src/libraries/System.Json/Directory.Build.props b/src/libraries/Microsoft.Extensions.Primitives/Directory.Build.props similarity index 77% rename from src/libraries/System.Json/Directory.Build.props rename to src/libraries/Microsoft.Extensions.Primitives/Directory.Build.props index bdcfca3b543cbb..763a577edd6f1b 100644 --- a/src/libraries/System.Json/Directory.Build.props +++ b/src/libraries/Microsoft.Extensions.Primitives/Directory.Build.props @@ -2,5 +2,6 @@ Open + true \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Primitives/Microsoft.Extensions.Primitives.sln b/src/libraries/Microsoft.Extensions.Primitives/Microsoft.Extensions.Primitives.sln new file mode 100644 index 00000000000000..7fab925f1a9f88 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/Microsoft.Extensions.Primitives.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29521.150 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D69C4529-128C-4A51-AD5A-659872A4F405}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Primitives", "src\Microsoft.Extensions.Primitives.csproj", "{31785605-3555-4D71-8B24-59DC43F7439A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0EB2C914-0873-4AF8-9262-75B1405C842A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{33BE7927-9C98-425D-97F5-D68510163F6C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Primitives", "ref\Microsoft.Extensions.Primitives.csproj", "{7A3952AC-BA1B-4A00-B45B-92DE4D3B36E5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Primitives.Tests", "tests\Microsoft.Extensions.Primitives.Tests.csproj", "{E5CBC6DD-9C09-483A-A27A-F1F1FA2DFBAA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {31785605-3555-4D71-8B24-59DC43F7439A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {31785605-3555-4D71-8B24-59DC43F7439A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {31785605-3555-4D71-8B24-59DC43F7439A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {31785605-3555-4D71-8B24-59DC43F7439A}.Release|Any CPU.Build.0 = Release|Any CPU + {7A3952AC-BA1B-4A00-B45B-92DE4D3B36E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A3952AC-BA1B-4A00-B45B-92DE4D3B36E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A3952AC-BA1B-4A00-B45B-92DE4D3B36E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A3952AC-BA1B-4A00-B45B-92DE4D3B36E5}.Release|Any CPU.Build.0 = Release|Any CPU + {E5CBC6DD-9C09-483A-A27A-F1F1FA2DFBAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5CBC6DD-9C09-483A-A27A-F1F1FA2DFBAA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5CBC6DD-9C09-483A-A27A-F1F1FA2DFBAA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5CBC6DD-9C09-483A-A27A-F1F1FA2DFBAA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {31785605-3555-4D71-8B24-59DC43F7439A} = {D69C4529-128C-4A51-AD5A-659872A4F405} + {7A3952AC-BA1B-4A00-B45B-92DE4D3B36E5} = {33BE7927-9C98-425D-97F5-D68510163F6C} + {E5CBC6DD-9C09-483A-A27A-F1F1FA2DFBAA} = {0EB2C914-0873-4AF8-9262-75B1405C842A} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EC9E15A7-A8F7-486B-B7EA-59341203A4D3} + EndGlobalSection +EndGlobal diff --git a/src/libraries/Microsoft.Extensions.Primitives/pkg/Microsoft.Extensions.Primitives.pkgproj b/src/libraries/Microsoft.Extensions.Primitives/pkg/Microsoft.Extensions.Primitives.pkgproj new file mode 100644 index 00000000000000..07273ae288cef3 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/pkg/Microsoft.Extensions.Primitives.pkgproj @@ -0,0 +1,9 @@ + + + + + net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks) + + + + \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Primitives/ref/Microsoft.Extensions.Primitives.cs b/src/libraries/Microsoft.Extensions.Primitives/ref/Microsoft.Extensions.Primitives.cs new file mode 100644 index 00000000000000..70bbe5e841de6c --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/ref/Microsoft.Extensions.Primitives.cs @@ -0,0 +1,206 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// ------------------------------------------------------------------------------ +// Changes to this file must follow the http://aka.ms/api-review process. +// ------------------------------------------------------------------------------ + +namespace Microsoft.Extensions.Primitives +{ + public partial class CancellationChangeToken : Microsoft.Extensions.Primitives.IChangeToken + { + public CancellationChangeToken(System.Threading.CancellationToken cancellationToken) { } + public bool ActiveChangeCallbacks { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } + public bool HasChanged { get { throw null; } } + public System.IDisposable RegisterChangeCallback(System.Action callback, object state) { throw null; } + } + public static partial class ChangeToken + { + public static System.IDisposable OnChange(System.Func changeTokenProducer, System.Action changeTokenConsumer) { throw null; } + public static System.IDisposable OnChange(System.Func changeTokenProducer, System.Action changeTokenConsumer, TState state) { throw null; } + } + public partial class CompositeChangeToken : Microsoft.Extensions.Primitives.IChangeToken + { + public CompositeChangeToken(System.Collections.Generic.IReadOnlyList changeTokens) { } + public bool ActiveChangeCallbacks { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } + public System.Collections.Generic.IReadOnlyList ChangeTokens { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } + public bool HasChanged { get { throw null; } } + public System.IDisposable RegisterChangeCallback(System.Action callback, object state) { throw null; } + } + public static partial class Extensions + { + public static System.Text.StringBuilder Append(this System.Text.StringBuilder builder, Microsoft.Extensions.Primitives.StringSegment segment) { throw null; } + } + public partial interface IChangeToken + { + bool ActiveChangeCallbacks { get; } + bool HasChanged { get; } + System.IDisposable RegisterChangeCallback(System.Action callback, object state); + } + [System.Diagnostics.DebuggerDisplayAttribute("Value = {_value}")] + [System.ObsoleteAttribute("This type is obsolete and will be removed in a future version.")] + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public partial struct InplaceStringBuilder + { + private object _dummy; + private int _dummyPrimitive; + public InplaceStringBuilder(int capacity) { throw null; } + public int Capacity { get { throw null; } set { } } + public void Append(Microsoft.Extensions.Primitives.StringSegment segment) { } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public void Append(char c) { } + public void Append(string value) { } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public void Append(string value, int offset, int count) { } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StringSegment : System.IEquatable, System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public static readonly Microsoft.Extensions.Primitives.StringSegment Empty; + public StringSegment(string buffer) { throw null; } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public StringSegment(string buffer, int offset, int length) { throw null; } + public string Buffer { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } + public bool HasValue { get { throw null; } } + public char this[int index] { get { throw null; } } + public int Length { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } + public int Offset { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } + public string Value { get { throw null; } } + public System.ReadOnlyMemory AsMemory() { throw null; } + public System.ReadOnlySpan AsSpan() { throw null; } + public static int Compare(Microsoft.Extensions.Primitives.StringSegment a, Microsoft.Extensions.Primitives.StringSegment b, System.StringComparison comparisonType) { throw null; } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public bool EndsWith(string text, System.StringComparison comparisonType) { throw null; } + public bool Equals(Microsoft.Extensions.Primitives.StringSegment other) { throw null; } + public static bool Equals(Microsoft.Extensions.Primitives.StringSegment a, Microsoft.Extensions.Primitives.StringSegment b, System.StringComparison comparisonType) { throw null; } + public bool Equals(Microsoft.Extensions.Primitives.StringSegment other, System.StringComparison comparisonType) { throw null; } + public override bool Equals(object obj) { throw null; } + public bool Equals(string text) { throw null; } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public bool Equals(string text, System.StringComparison comparisonType) { throw null; } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public override int GetHashCode() { throw null; } + public int IndexOf(char c) { throw null; } + public int IndexOf(char c, int start) { throw null; } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public int IndexOf(char c, int start, int count) { throw null; } + public int IndexOfAny(char[] anyOf) { throw null; } + public int IndexOfAny(char[] anyOf, int startIndex) { throw null; } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public int IndexOfAny(char[] anyOf, int startIndex, int count) { throw null; } + public static bool IsNullOrEmpty(Microsoft.Extensions.Primitives.StringSegment value) { throw null; } + public int LastIndexOf(char value) { throw null; } + public static bool operator ==(Microsoft.Extensions.Primitives.StringSegment left, Microsoft.Extensions.Primitives.StringSegment right) { throw null; } + public static implicit operator System.ReadOnlyMemory (Microsoft.Extensions.Primitives.StringSegment segment) { throw null; } + public static implicit operator System.ReadOnlySpan (Microsoft.Extensions.Primitives.StringSegment segment) { throw null; } + public static implicit operator Microsoft.Extensions.Primitives.StringSegment (string value) { throw null; } + public static bool operator !=(Microsoft.Extensions.Primitives.StringSegment left, Microsoft.Extensions.Primitives.StringSegment right) { throw null; } + public Microsoft.Extensions.Primitives.StringTokenizer Split(char[] chars) { throw null; } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public bool StartsWith(string text, System.StringComparison comparisonType) { throw null; } + public Microsoft.Extensions.Primitives.StringSegment Subsegment(int offset) { throw null; } + public Microsoft.Extensions.Primitives.StringSegment Subsegment(int offset, int length) { throw null; } + public string Substring(int offset) { throw null; } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public string Substring(int offset, int length) { throw null; } + public override string ToString() { throw null; } + public Microsoft.Extensions.Primitives.StringSegment Trim() { throw null; } + public Microsoft.Extensions.Primitives.StringSegment TrimEnd() { throw null; } + public Microsoft.Extensions.Primitives.StringSegment TrimStart() { throw null; } + } + public partial class StringSegmentComparer : System.Collections.Generic.IComparer, System.Collections.Generic.IEqualityComparer + { + internal StringSegmentComparer() { } + public static Microsoft.Extensions.Primitives.StringSegmentComparer Ordinal { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } + public static Microsoft.Extensions.Primitives.StringSegmentComparer OrdinalIgnoreCase { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } + public int Compare(Microsoft.Extensions.Primitives.StringSegment x, Microsoft.Extensions.Primitives.StringSegment y) { throw null; } + public bool Equals(Microsoft.Extensions.Primitives.StringSegment x, Microsoft.Extensions.Primitives.StringSegment y) { throw null; } + public int GetHashCode(Microsoft.Extensions.Primitives.StringSegment obj) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StringTokenizer : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StringTokenizer(Microsoft.Extensions.Primitives.StringSegment value, char[] separators) { throw null; } + public StringTokenizer(string value, char[] separators) { throw null; } + public Microsoft.Extensions.Primitives.StringTokenizer.Enumerator GetEnumerator() { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public partial struct Enumerator : System.Collections.Generic.IEnumerator, System.Collections.IEnumerator, System.IDisposable + { + private object _dummy; + private int _dummyPrimitive; + public Enumerator(ref Microsoft.Extensions.Primitives.StringTokenizer tokenizer) { throw null; } + public Microsoft.Extensions.Primitives.StringSegment Current { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } + object System.Collections.IEnumerator.Current { get { throw null; } } + public void Dispose() { } + public bool MoveNext() { throw null; } + public void Reset() { } + } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StringValues : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable, System.IEquatable, System.IEquatable, System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public static readonly Microsoft.Extensions.Primitives.StringValues Empty; + public StringValues(string value) { throw null; } + public StringValues(string[] values) { throw null; } + public int Count { [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]get { throw null; } } + public string this[int index] { [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]get { throw null; } } + bool System.Collections.Generic.ICollection.IsReadOnly { get { throw null; } } + string System.Collections.Generic.IList.this[int index] { get { throw null; } set { } } + public static Microsoft.Extensions.Primitives.StringValues Concat(Microsoft.Extensions.Primitives.StringValues values1, Microsoft.Extensions.Primitives.StringValues values2) { throw null; } + public static Microsoft.Extensions.Primitives.StringValues Concat(in Microsoft.Extensions.Primitives.StringValues values, string value) { throw null; } + public static Microsoft.Extensions.Primitives.StringValues Concat(string value, in Microsoft.Extensions.Primitives.StringValues values) { throw null; } + public bool Equals(Microsoft.Extensions.Primitives.StringValues other) { throw null; } + public static bool Equals(Microsoft.Extensions.Primitives.StringValues left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + public static bool Equals(Microsoft.Extensions.Primitives.StringValues left, string right) { throw null; } + public static bool Equals(Microsoft.Extensions.Primitives.StringValues left, string[] right) { throw null; } + public override bool Equals(object obj) { throw null; } + public bool Equals(string other) { throw null; } + public static bool Equals(string left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + public bool Equals(string[] other) { throw null; } + public static bool Equals(string[] left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + public Microsoft.Extensions.Primitives.StringValues.Enumerator GetEnumerator() { throw null; } + public override int GetHashCode() { throw null; } + public static bool IsNullOrEmpty(Microsoft.Extensions.Primitives.StringValues value) { throw null; } + public static bool operator ==(Microsoft.Extensions.Primitives.StringValues left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + public static bool operator ==(Microsoft.Extensions.Primitives.StringValues left, object right) { throw null; } + public static bool operator ==(Microsoft.Extensions.Primitives.StringValues left, string right) { throw null; } + public static bool operator ==(Microsoft.Extensions.Primitives.StringValues left, string[] right) { throw null; } + public static bool operator ==(object left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + public static bool operator ==(string left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + public static bool operator ==(string[] left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + public static implicit operator string (Microsoft.Extensions.Primitives.StringValues values) { throw null; } + public static implicit operator string[] (Microsoft.Extensions.Primitives.StringValues value) { throw null; } + public static implicit operator Microsoft.Extensions.Primitives.StringValues (string value) { throw null; } + public static implicit operator Microsoft.Extensions.Primitives.StringValues (string[] values) { throw null; } + public static bool operator !=(Microsoft.Extensions.Primitives.StringValues left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + public static bool operator !=(Microsoft.Extensions.Primitives.StringValues left, object right) { throw null; } + public static bool operator !=(Microsoft.Extensions.Primitives.StringValues left, string right) { throw null; } + public static bool operator !=(Microsoft.Extensions.Primitives.StringValues left, string[] right) { throw null; } + public static bool operator !=(object left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + public static bool operator !=(string left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + public static bool operator !=(string[] left, Microsoft.Extensions.Primitives.StringValues right) { throw null; } + void System.Collections.Generic.ICollection.Add(string item) { } + void System.Collections.Generic.ICollection.Clear() { } + bool System.Collections.Generic.ICollection.Contains(string item) { throw null; } + void System.Collections.Generic.ICollection.CopyTo(string[] array, int arrayIndex) { } + bool System.Collections.Generic.ICollection.Remove(string item) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + int System.Collections.Generic.IList.IndexOf(string item) { throw null; } + void System.Collections.Generic.IList.Insert(int index, string item) { } + void System.Collections.Generic.IList.RemoveAt(int index) { } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + public string[] ToArray() { throw null; } + public override string ToString() { throw null; } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public partial struct Enumerator : System.Collections.Generic.IEnumerator, System.Collections.IEnumerator, System.IDisposable + { + private object _dummy; + private int _dummyPrimitive; + public Enumerator(ref Microsoft.Extensions.Primitives.StringValues values) { throw null; } + public string Current { get { throw null; } } + object System.Collections.IEnumerator.Current { get { throw null; } } + public void Dispose() { } + public bool MoveNext() { throw null; } + void System.Collections.IEnumerator.Reset() { } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/ref/Microsoft.Extensions.Primitives.csproj b/src/libraries/Microsoft.Extensions.Primitives/ref/Microsoft.Extensions.Primitives.csproj new file mode 100644 index 00000000000000..99c135f7df251a --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/ref/Microsoft.Extensions.Primitives.csproj @@ -0,0 +1,12 @@ + + + + netstandard2.0;netstandard2.1 + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/CancellationChangeToken.cs b/src/libraries/Microsoft.Extensions.Primitives/src/CancellationChangeToken.cs new file mode 100644 index 00000000000000..1df95d5a66a74a --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/CancellationChangeToken.cs @@ -0,0 +1,84 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Threading; + +namespace Microsoft.Extensions.Primitives +{ + /// + /// A implementation using . + /// + public class CancellationChangeToken : IChangeToken + { + /// + /// Initializes a new instance of . + /// + /// The . + public CancellationChangeToken(CancellationToken cancellationToken) + { + Token = cancellationToken; + } + + /// + public bool ActiveChangeCallbacks { get; private set; } = true; + + /// + public bool HasChanged => Token.IsCancellationRequested; + + private CancellationToken Token { get; } + + /// + public IDisposable RegisterChangeCallback(Action callback, object state) + { +#if NETCOREAPP || NETSTANDARD2_1 + try + { + return Token.UnsafeRegister(callback, state); + } + catch (ObjectDisposedException) + { + // Reset the flag so that we can indicate to future callers that this wouldn't work. + ActiveChangeCallbacks = false; + } +#else + // Don't capture the current ExecutionContext and its AsyncLocals onto the token registration causing them to live forever + var restoreFlow = false; + if (!ExecutionContext.IsFlowSuppressed()) + { + ExecutionContext.SuppressFlow(); + restoreFlow = true; + } + + try + { + return Token.Register(callback, state); + } + catch (ObjectDisposedException) + { + // Reset the flag so that we can indicate to future callers that this wouldn't work. + ActiveChangeCallbacks = false; + } + finally + { + // Restore the current ExecutionContext + if (restoreFlow) + { + ExecutionContext.RestoreFlow(); + } + } +#endif + return NullDisposable.Instance; + } + + private class NullDisposable : IDisposable + { + public static readonly NullDisposable Instance = new NullDisposable(); + + public void Dispose() + { + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/ChangeToken.cs b/src/libraries/Microsoft.Extensions.Primitives/src/ChangeToken.cs new file mode 100644 index 00000000000000..55232803d85efe --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/ChangeToken.cs @@ -0,0 +1,152 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Diagnostics; +using System.Threading; + +namespace Microsoft.Extensions.Primitives +{ + /// + /// Propagates notifications that a change has occurred. + /// + public static class ChangeToken + { + /// + /// Registers the action to be called whenever the token produced changes. + /// + /// Produces the change token. + /// Action called when the token changes. + /// + public static IDisposable OnChange(Func changeTokenProducer, Action changeTokenConsumer) + { + if (changeTokenProducer == null) + { + throw new ArgumentNullException(nameof(changeTokenProducer)); + } + if (changeTokenConsumer == null) + { + throw new ArgumentNullException(nameof(changeTokenConsumer)); + } + + return new ChangeTokenRegistration(changeTokenProducer, callback => callback(), changeTokenConsumer); + } + + /// + /// Registers the action to be called whenever the token produced changes. + /// + /// Produces the change token. + /// Action called when the token changes. + /// state for the consumer. + /// + public static IDisposable OnChange(Func changeTokenProducer, Action changeTokenConsumer, TState state) + { + if (changeTokenProducer == null) + { + throw new ArgumentNullException(nameof(changeTokenProducer)); + } + if (changeTokenConsumer == null) + { + throw new ArgumentNullException(nameof(changeTokenConsumer)); + } + + return new ChangeTokenRegistration(changeTokenProducer, changeTokenConsumer, state); + } + + private class ChangeTokenRegistration : IDisposable + { + private readonly Func _changeTokenProducer; + private readonly Action _changeTokenConsumer; + private readonly TState _state; + private IDisposable _disposable; + + private static readonly NoopDisposable _disposedSentinel = new NoopDisposable(); + + public ChangeTokenRegistration(Func changeTokenProducer, Action changeTokenConsumer, TState state) + { + _changeTokenProducer = changeTokenProducer; + _changeTokenConsumer = changeTokenConsumer; + _state = state; + + var token = changeTokenProducer(); + + RegisterChangeTokenCallback(token); + } + + private void OnChangeTokenFired() + { + // The order here is important. We need to take the token and then apply our changes BEFORE + // registering. This prevents us from possible having two change updates to process concurrently. + // + // If the token changes after we take the token, then we'll process the update immediately upon + // registering the callback. + var token = _changeTokenProducer(); + + try + { + _changeTokenConsumer(_state); + } + finally + { + // We always want to ensure the callback is registered + RegisterChangeTokenCallback(token); + } + } + + private void RegisterChangeTokenCallback(IChangeToken token) + { + var registraton = token.RegisterChangeCallback(s => ((ChangeTokenRegistration)s).OnChangeTokenFired(), this); + + SetDisposable(registraton); + } + + private void SetDisposable(IDisposable disposable) + { + // We don't want to transition from _disposedSentinel => anything since it's terminal + // but we want to allow going from previously assigned disposable, to another + // disposable. + var current = Volatile.Read(ref _disposable); + + // If Dispose was called, then immediately dispose the disposable + if (current == _disposedSentinel) + { + disposable.Dispose(); + return; + } + + // Otherwise, try to update the disposable + var previous = Interlocked.CompareExchange(ref _disposable, disposable, current); + + if (previous == _disposedSentinel) + { + // The subscription was disposed so we dispose immediately and return + disposable.Dispose(); + } + else if (previous == current) + { + // We successfuly assigned the _disposable field to disposable + } + else + { + // Sets can never overlap with other SetDisposable calls so we should never get into this situation + throw new InvalidOperationException("Somebody else set the _disposable field"); + } + } + + public void Dispose() + { + // If the previous value is disposable then dispose it, otherwise, + // now we've set the disposed sentinel + Interlocked.Exchange(ref _disposable, _disposedSentinel).Dispose(); + } + + private class NoopDisposable : IDisposable + { + public void Dispose() + { + } + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/CompositeChangeToken.cs b/src/libraries/Microsoft.Extensions.Primitives/src/CompositeChangeToken.cs new file mode 100644 index 00000000000000..9578bbc0bd5a2f --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/CompositeChangeToken.cs @@ -0,0 +1,134 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; + +namespace Microsoft.Extensions.Primitives +{ + /// + /// An which represents one or more instances. + /// + public class CompositeChangeToken : IChangeToken + { + private static readonly Action _onChangeDelegate = OnChange; + private readonly object _callbackLock = new object(); + private CancellationTokenSource _cancellationTokenSource; + private bool _registeredCallbackProxy; + private List _disposables; + + /// + /// Creates a new instance of . + /// + /// The list of to compose. + public CompositeChangeToken(IReadOnlyList changeTokens) + { + ChangeTokens = changeTokens ?? throw new ArgumentNullException(nameof(changeTokens)); + for (var i = 0; i < ChangeTokens.Count; i++) + { + if (ChangeTokens[i].ActiveChangeCallbacks) + { + ActiveChangeCallbacks = true; + break; + } + } + } + + /// + /// Returns the list of which compose the current . + /// + public IReadOnlyList ChangeTokens { get; } + + /// + public IDisposable RegisterChangeCallback(Action callback, object state) + { + EnsureCallbacksInitialized(); + return _cancellationTokenSource.Token.Register(callback, state); + } + + /// + public bool HasChanged + { + get + { + if (_cancellationTokenSource != null && _cancellationTokenSource.Token.IsCancellationRequested) + { + return true; + } + + for (var i = 0; i < ChangeTokens.Count; i++) + { + if (ChangeTokens[i].HasChanged) + { + OnChange(this); + return true; + } + } + + return false; + } + } + + /// + public bool ActiveChangeCallbacks { get; } + + private void EnsureCallbacksInitialized() + { + if (_registeredCallbackProxy) + { + return; + } + + lock (_callbackLock) + { + if (_registeredCallbackProxy) + { + return; + } + + _cancellationTokenSource = new CancellationTokenSource(); + _disposables = new List(); + for (var i = 0; i < ChangeTokens.Count; i++) + { + if (ChangeTokens[i].ActiveChangeCallbacks) + { + var disposable = ChangeTokens[i].RegisterChangeCallback(_onChangeDelegate, this); + _disposables.Add(disposable); + } + } + _registeredCallbackProxy = true; + } + } + + private static void OnChange(object state) + { + var compositeChangeTokenState = (CompositeChangeToken)state; + if (compositeChangeTokenState._cancellationTokenSource == null) + { + return; + } + + lock (compositeChangeTokenState._callbackLock) + { + try + { + compositeChangeTokenState._cancellationTokenSource.Cancel(); + } + catch + { + } + } + + var disposables = compositeChangeTokenState._disposables; + Debug.Assert(disposables != null); + for (var i = 0; i < disposables.Count; i++) + { + disposables[i].Dispose(); + } + + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/Extensions.cs b/src/libraries/Microsoft.Extensions.Primitives/src/Extensions.cs new file mode 100644 index 00000000000000..5ab0f84ba32818 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/Extensions.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Text; + +namespace Microsoft.Extensions.Primitives +{ + public static class Extensions + { + /// + /// Add the given to the . + /// + /// The to add to. + /// The to add. + /// The original . + public static StringBuilder Append(this StringBuilder builder, StringSegment segment) + { + return builder.Append(segment.Buffer, segment.Offset, segment.Length); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/IChangeToken.cs b/src/libraries/Microsoft.Extensions.Primitives/src/IChangeToken.cs new file mode 100644 index 00000000000000..958a0dbc24eab2 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/IChangeToken.cs @@ -0,0 +1,34 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Microsoft.Extensions.Primitives +{ + /// + /// Propagates notifications that a change has occurred. + /// + public interface IChangeToken + { + /// + /// Gets a value that indicates if a change has occurred. + /// + bool HasChanged { get; } + + /// + /// Indicates if this token will pro-actively raise callbacks. If false, the token consumer must + /// poll to detect changes. + /// + bool ActiveChangeCallbacks { get; } + + /// + /// Registers for a callback that will be invoked when the entry has changed. + /// MUST be set before the callback is invoked. + /// + /// The to invoke. + /// State to be passed into the callback. + /// An that is used to unregister the callback. + IDisposable RegisterChangeCallback(Action callback, object state); + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/InplaceStringBuilder.cs b/src/libraries/Microsoft.Extensions.Primitives/src/InplaceStringBuilder.cs new file mode 100644 index 00000000000000..2a55fa98bcffb8 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/InplaceStringBuilder.cs @@ -0,0 +1,137 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; + +namespace Microsoft.Extensions.Primitives +{ + [DebuggerDisplay("Value = {_value}")] + [Obsolete("This type is obsolete and will be removed in a future version.")] + public struct InplaceStringBuilder + { + private int _offset; + private int _capacity; + private string _value; + + public InplaceStringBuilder(int capacity) : this() + { + if (capacity < 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.capacity); + } + + _capacity = capacity; + } + + public int Capacity + { + get => _capacity; + set + { + if (value < 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.value); + } + + // _offset > 0 indicates writing state + if (_offset > 0) + { + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.Capacity_CannotChangeAfterWriteStarted); + } + + _capacity = value; + } + } + + public void Append(string value) + { + if (value == null) + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value); + } + + Append(value, 0, value.Length); + } + + public void Append(StringSegment segment) + { + Append(segment.Buffer, segment.Offset, segment.Length); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Append(string value, int offset, int count) + { + EnsureValueIsInitialized(); + + if (value == null + || offset < 0 + || value.Length - offset < count + || Capacity - _offset < count) + { + ThrowValidationError(value, offset, count); + } + + fixed (char* destination = _value) + fixed (char* source = value) + { + Unsafe.CopyBlockUnaligned(destination + _offset, source + offset, (uint)count * 2); + _offset += count; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Append(char c) + { + EnsureValueIsInitialized(); + + if (_offset >= Capacity) + { + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.Capacity_NotEnough, 1, Capacity - _offset); + } + + fixed (char* destination = _value) + { + destination[_offset++] = c; + } + } + + public override string ToString() + { + if (Capacity != _offset) + { + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.Capacity_NotUsedEntirely, Capacity, _offset); + } + + return _value; + } + + private void EnsureValueIsInitialized() + { + if (_value == null) + { + _value = new string('\0', _capacity); + } + } + + private void ThrowValidationError(string value, int offset, int count) + { + if (value == null) + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value); + } + + if (offset < 0 || value.Length - offset < count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.offset); + } + + if (Capacity - _offset < count) + { + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.Capacity_NotEnough, value.Length, Capacity - _offset); + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/Microsoft.Extensions.Primitives.csproj b/src/libraries/Microsoft.Extensions.Primitives/src/Microsoft.Extensions.Primitives.csproj new file mode 100644 index 00000000000000..9a2b586818791a --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/Microsoft.Extensions.Primitives.csproj @@ -0,0 +1,37 @@ + + + $(NetCoreAppCurrent);netcoreapp3.0;netstandard2.0 + $(NoWarn);CS1591;CA1200;SA1121;SA1028;SA1129;SA1027 + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/Resources/Strings.resx b/src/libraries/Microsoft.Extensions.Primitives/src/Resources/Strings.resx new file mode 100644 index 00000000000000..197852e21f0f9f --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/Resources/Strings.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Offset and length are out of bounds for the string or length is greater than the number of characters from index to the end of the string. + + + Offset and length are out of bounds for this StringSegment or length is greater than the number of characters to the end of this StringSegment. + + + Cannot change capacity after write started. + + + Not enough capacity to write '{0}' characters, only '{1}' left. + + + Entire reserved capacity was not used. Capacity: '{0}', written '{1}'. + + \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/Shared/HashCodeCombiner.cs b/src/libraries/Microsoft.Extensions.Primitives/src/Shared/HashCodeCombiner.cs new file mode 100644 index 00000000000000..ccff4df8340779 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/Shared/HashCodeCombiner.cs @@ -0,0 +1,85 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Microsoft.Extensions.Internal +{ + internal struct HashCodeCombiner + { + private long _combinedHash64; + + public int CombinedHash + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return _combinedHash64.GetHashCode(); } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private HashCodeCombiner(long seed) + { + _combinedHash64 = seed; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(IEnumerable e) + { + if (e == null) + { + Add(0); + } + else + { + var count = 0; + foreach (object o in e) + { + Add(o); + count++; + } + Add(count); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int(HashCodeCombiner self) + { + return self.CombinedHash; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(int i) + { + _combinedHash64 = ((_combinedHash64 << 5) + _combinedHash64) ^ i; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(string s) + { + var hashCode = (s != null) ? s.GetHashCode() : 0; + Add(hashCode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(object o) + { + var hashCode = (o != null) ? o.GetHashCode() : 0; + Add(hashCode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(TValue value, IEqualityComparer comparer) + { + var hashCode = value != null ? comparer.GetHashCode(value) : 0; + Add(hashCode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static HashCodeCombiner Start() + { + return new HashCodeCombiner(0x1505L); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs new file mode 100644 index 00000000000000..68150af110c04f --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs @@ -0,0 +1,721 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.CompilerServices; + +namespace Microsoft.Extensions.Primitives +{ + /// + /// An optimized representation of a substring. + /// + public readonly struct StringSegment : IEquatable, IEquatable + { + /// + /// A for . + /// + public static readonly StringSegment Empty = string.Empty; + + /// + /// Initializes an instance of the struct. + /// + /// + /// The original . The includes the whole . + /// + public StringSegment(string buffer) + { + Buffer = buffer; + Offset = 0; + Length = buffer?.Length ?? 0; + } + + /// + /// Initializes an instance of the struct. + /// + /// The original used as buffer. + /// The offset of the segment within the . + /// The length of the segment. + /// + /// is . + /// + /// + /// or is less than zero, or + + /// is greater than the number of characters in . + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public StringSegment(string buffer, int offset, int length) + { + // Validate arguments, check is minimal instructions with reduced branching for inlinable fast-path + // Negative values discovered though conversion to high values when converted to unsigned + // Failure should be rare and location determination and message is delegated to failure functions + if (buffer == null || (uint)offset > (uint)buffer.Length || (uint)length > (uint)(buffer.Length - offset)) + { + ThrowInvalidArguments(buffer, offset, length); + } + + Buffer = buffer; + Offset = offset; + Length = length; + } + + /// + /// Gets the buffer for this . + /// + public string Buffer { get; } + + /// + /// Gets the offset within the buffer for this . + /// + public int Offset { get; } + + /// + /// Gets the length of this . + /// + public int Length { get; } + + /// + /// Gets the value of this segment as a . + /// + public string Value + { + get + { + if (HasValue) + { + return Buffer.Substring(Offset, Length); + } + else + { + return null; + } + } + } + + /// + /// Gets whether this contains a valid value. + /// + public bool HasValue + { + get { return Buffer != null; } + } + + /// + /// Gets the at a specified position in the current . + /// + /// The offset into the + /// The at a specified position. + /// + /// is greater than or equal to or less than zero. + /// + public char this[int index] + { + get + { + if ((uint)index >= (uint)Length) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index); + } + + return Buffer[Offset + index]; + } + } + + /// + /// Gets a from the current . + /// + /// The from this . + public ReadOnlySpan AsSpan() => Buffer.AsSpan(Offset, Length); + + /// + /// Gets a from the current . + /// + /// The from this . + public ReadOnlyMemory AsMemory() => Buffer.AsMemory(Offset, Length); + + /// + /// Compares substrings of two specified objects using the specified rules, + /// and returns an integer that indicates their relative position in the sort order. + /// + /// The first to compare. + /// The second to compare. + /// One of the enumeration values that specifies the rules for the comparison. + /// + /// A 32-bit signed integer indicating the lexical relationship between the two comparands. + /// The value is negative if is less than , 0 if the two comparands are equal, + /// and positive if is greater than . + /// + public static int Compare(StringSegment a, StringSegment b, StringComparison comparisonType) + { + var minLength = Math.Min(a.Length, b.Length); + var diff = string.Compare(a.Buffer, a.Offset, b.Buffer, b.Offset, minLength, comparisonType); + if (diff == 0) + { + diff = a.Length - b.Length; + } + + return diff; + } + + /// + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + + return obj is StringSegment segment && Equals(segment); + } + + /// + /// Indicates whether the current object is equal to another object of the same type. + /// + /// An object to compare with this object. + /// if the current object is equal to the other parameter; otherwise, . + public bool Equals(StringSegment other) => Equals(other, StringComparison.Ordinal); + + /// + /// Indicates whether the current object is equal to another object of the same type. + /// + /// An object to compare with this object. + /// One of the enumeration values that specifies the rules to use in the comparison. + /// if the current object is equal to the other parameter; otherwise, . + public bool Equals(StringSegment other, StringComparison comparisonType) + { + if (Length != other.Length) + { + return false; + } + + return string.Compare(Buffer, Offset, other.Buffer, other.Offset, other.Length, comparisonType) == 0; + } + + // This handles StringSegment.Equals(string, StringSegment, StringComparison) and StringSegment.Equals(StringSegment, string, StringComparison) + // via the implicit type converter + /// + /// Determines whether two specified objects have the same value. A parameter specifies the culture, case, and + /// sort rules used in the comparison. + /// + /// The first to compare. + /// The second to compare. + /// One of the enumeration values that specifies the rules for the comparison. + /// if the objects are equal; otherwise, . + public static bool Equals(StringSegment a, StringSegment b, StringComparison comparisonType) + { + return a.Equals(b, comparisonType); + } + + /// + /// Checks if the specified is equal to the current . + /// + /// The to compare with the current . + /// if the specified is equal to the current ; otherwise, . + public bool Equals(string text) + { + return Equals(text, StringComparison.Ordinal); + } + + /// + /// Checks if the specified is equal to the current . + /// + /// The to compare with the current . + /// One of the enumeration values that specifies the rules to use in the comparison. + /// if the specified is equal to the current ; otherwise, . + /// + /// is . + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(string text, StringComparison comparisonType) + { + if (text == null) + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.text); + } + + var textLength = text.Length; + if (!HasValue || Length != textLength) + { + return false; + } + + return string.Compare(Buffer, Offset, text, 0, textLength, comparisonType) == 0; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() + { +#if NETCOREAPP || NETSTANDARD2_1 + return string.GetHashCode(AsSpan()); +#elif NETSTANDARD2_0 + // This GetHashCode is expensive since it allocates on every call. + // However this is required to ensure we retain any behavior (such as hash code randomization) that + // string.GetHashCode has. + return Value?.GetHashCode() ?? 0; +#else +#error Target frameworks need to be updated. +#endif + + } + + /// + /// Checks if two specified have the same value. + /// + /// The first to compare, or . + /// The second to compare, or . + /// if the value of is the same as the value of ; otherwise, . + public static bool operator ==(StringSegment left, StringSegment right) => left.Equals(right); + + /// + /// Checks if two specified have different values. + /// + /// The first to compare, or . + /// The second to compare, or . + /// if the value of is different from the value of ; otherwise, . + public static bool operator !=(StringSegment left, StringSegment right) => !left.Equals(right); + + // PERF: Do NOT add a implicit converter from StringSegment to String. That would negate most of the perf safety. + /// + /// Creates a new from the given . + /// + /// The to convert to a + public static implicit operator StringSegment(string value) => new StringSegment(value); + + /// + /// Creates a see from the given . + /// + /// The to convert to a . + public static implicit operator ReadOnlySpan(StringSegment segment) => segment.AsSpan(); + + /// + /// Creates a see from the given . + /// + /// The to convert to a . + public static implicit operator ReadOnlyMemory(StringSegment segment) => segment.AsMemory(); + + /// + /// Checks if the beginning of this matches the specified when compared using the specified . + /// + /// The to compare. + /// One of the enumeration values that specifies the rules to use in the comparison. + /// if matches the beginning of this ; otherwise, . + /// + /// is . + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool StartsWith(string text, StringComparison comparisonType) + { + if (text == null) + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.text); + } + + var result = false; + var textLength = text.Length; + + if (HasValue && Length >= textLength) + { + result = string.Compare(Buffer, Offset, text, 0, textLength, comparisonType) == 0; + } + + return result; + } + + /// + /// Checks if the end of this matches the specified when compared using the specified . + /// + /// The to compare. + /// One of the enumeration values that specifies the rules to use in the comparison. + /// if matches the end of this ; otherwise, . + /// + /// is . + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool EndsWith(string text, StringComparison comparisonType) + { + if (text == null) + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.text); + } + + var result = false; + var textLength = text.Length; + var comparisonLength = Offset + Length - textLength; + + if (HasValue && comparisonLength > 0) + { + result = string.Compare(Buffer, comparisonLength, text, 0, textLength, comparisonType) == 0; + } + + return result; + } + + /// + /// Retrieves a substring from this . + /// The substring starts at the position specified by and has the remaining length. + /// + /// The zero-based starting character position of a substring in this . + /// A that is equivalent to the substring of remaining length that begins at + /// in this + /// + /// is greater than or equal to or less than zero. + /// + public string Substring(int offset) => Substring(offset, Length - offset); + + /// + /// Retrieves a substring from this . + /// The substring starts at the position specified by and has the specified . + /// + /// The zero-based starting character position of a substring in this . + /// The number of characters in the substring. + /// A that is equivalent to the substring of length that begins at + /// in this + /// + /// or is less than zero, or + is + /// greater than . + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string Substring(int offset, int length) + { + if (!HasValue || offset < 0 || length < 0 || (uint)(offset + length) > (uint)Length) + { + ThrowInvalidArguments(offset, length); + } + + return Buffer.Substring(Offset + offset, length); + } + + /// + /// Retrieves a that represents a substring from this . + /// The starts at the position specified by . + /// + /// The zero-based starting character position of a substring in this . + /// A that begins at in this + /// whose length is the remainder. + /// + /// is greater than or equal to or less than zero. + /// + public StringSegment Subsegment(int offset) => Subsegment(offset, Length - offset); + + /// + /// Retrieves a that represents a substring from this . + /// The starts at the position specified by and has the specified . + /// + /// The zero-based starting character position of a substring in this . + /// The number of characters in the substring. + /// A that is equivalent to the substring of length that begins at in this + /// + /// or is less than zero, or + is + /// greater than . + /// + public StringSegment Subsegment(int offset, int length) + { + if (!HasValue || offset < 0 || length < 0 || (uint)(offset + length) > (uint)Length) + { + ThrowInvalidArguments(offset, length); + } + + return new StringSegment(Buffer, Offset + offset, length); + } + + /// + /// Gets the zero-based index of the first occurrence of the character in this . + /// The search starts at and examines a specified number of character positions. + /// + /// The Unicode character to seek. + /// The zero-based index position at which the search starts. + /// The number of characters to examine. + /// The zero-based index position of from the beginning of the if that character is found, or -1 if it is not. + /// + /// or is less than zero, or + is + /// greater than . + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int IndexOf(char c, int start, int count) + { + var offset = Offset + start; + + if (!HasValue || start < 0 || (uint)offset > (uint)Buffer.Length) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start); + } + + if (count < 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.count); + } + + var index = Buffer.IndexOf(c, offset, count); + if (index != -1) + { + index -= Offset; + } + + return index; + } + + /// + /// Gets the zero-based index of the first occurrence of the character in this . + /// The search starts at . + /// + /// The Unicode character to seek. + /// The zero-based index position at which the search starts. + /// The zero-based index position of from the beginning of the if that character is found, or -1 if it is not. + /// + /// is greater than or equal to or less than zero. + /// + public int IndexOf(char c, int start) => IndexOf(c, start, Length - start); + + /// + /// Gets the zero-based index of the first occurrence of the character in this . + /// + /// The Unicode character to seek. + /// The zero-based index position of from the beginning of the if that character is found, or -1 if it is not. + public int IndexOf(char c) => IndexOf(c, 0, Length); + + /// + /// Reports the zero-based index of the first occurrence in this instance of any character in a specified array + /// of Unicode characters. The search starts at a specified character position and examines a specified number + /// of character positions. + /// + /// A Unicode character array containing one or more characters to seek. + /// The search starting position. + /// The number of character positions to examine. + /// The zero-based index position of the first occurrence in this instance where any character in + /// was found; -1 if no character in was found. + /// + /// is . + /// + /// + /// or is less than zero, or + is + /// greater than . + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int IndexOfAny(char[] anyOf, int startIndex, int count) + { + var index = -1; + + if (HasValue) + { + if (startIndex < 0 || Offset + startIndex > Buffer.Length) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start); + } + + if (count < 0 || Offset + startIndex + count > Buffer.Length) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.count); + } + + index = Buffer.IndexOfAny(anyOf, Offset + startIndex, count); + if (index != -1) + { + index -= Offset; + } + } + + return index; + } + + /// + /// Reports the zero-based index of the first occurrence in this instance of any character in a specified array + /// of Unicode characters. The search starts at a specified character position. + /// + /// A Unicode character array containing one or more characters to seek. + /// The search starting position. + /// The zero-based index position of the first occurrence in this instance where any character in + /// was found; -1 if no character in was found. + /// + /// is greater than or equal to or less than zero. + /// + public int IndexOfAny(char[] anyOf, int startIndex) + { + return IndexOfAny(anyOf, startIndex, Length - startIndex); + } + + /// + /// Reports the zero-based index of the first occurrence in this instance of any character in a specified array + /// of Unicode characters. + /// + /// A Unicode character array containing one or more characters to seek. + /// The zero-based index position of the first occurrence in this instance where any character in + /// was found; -1 if no character in was found. + public int IndexOfAny(char[] anyOf) + { + return IndexOfAny(anyOf, 0, Length); + } + + /// + /// Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance. + /// + /// The Unicode character to seek. + /// The zero-based index position of value if that character is found, or -1 if it is not. + public int LastIndexOf(char value) + { + var index = -1; + + if (HasValue) + { + index = Buffer.LastIndexOf(value, Offset + Length - 1, Length); + if (index != -1) + { + index -= Offset; + } + } + + return index; + } + + /// + /// Removes all leading and trailing whitespaces. + /// + /// The trimmed . + public StringSegment Trim() => TrimStart().TrimEnd(); + + /// + /// Removes all leading whitespaces. + /// + /// The trimmed . + public unsafe StringSegment TrimStart() + { + var trimmedStart = Offset; + var length = Offset + Length; + + fixed (char* p = Buffer) + { + while (trimmedStart < length) + { + var c = p[trimmedStart]; + + if (!char.IsWhiteSpace(c)) + { + break; + } + + trimmedStart++; + } + } + + return new StringSegment(Buffer, trimmedStart, length - trimmedStart); + } + + /// + /// Removes all trailing whitespaces. + /// + /// The trimmed . + public unsafe StringSegment TrimEnd() + { + var offset = Offset; + var trimmedEnd = offset + Length - 1; + + fixed (char* p = Buffer) + { + while (trimmedEnd >= offset) + { + var c = p[trimmedEnd]; + + if (!char.IsWhiteSpace(c)) + { + break; + } + + trimmedEnd--; + } + } + + return new StringSegment(Buffer, offset, trimmedEnd - offset + 1); + } + + /// + /// Splits a string into s that are based on the characters in an array. + /// + /// A character array that delimits the substrings in this string, an empty array that + /// contains no delimiters, or null. + /// An whose elements contain the s from this instance + /// that are delimited by one or more characters in . + public StringTokenizer Split(char[] chars) + { + return new StringTokenizer(this, chars); + } + + /// + /// Indicates whether the specified is null or an Empty string. + /// + /// The to test. + /// + public static bool IsNullOrEmpty(StringSegment value) + { + var res = false; + + if (!value.HasValue || value.Length == 0) + { + res = true; + } + + return res; + } + + /// + /// Returns the represented by this or if the does not contain a value. + /// + /// The represented by this or if the does not contain a value. + public override string ToString() + { + return Value ?? string.Empty; + } + + // Methods that do no return (i.e. throw) are not inlined + // https://github.com/dotnet/coreclr/pull/6103 + private static void ThrowInvalidArguments(string buffer, int offset, int length) + { + // Only have single throw in method so is marked as "does not return" and isn't inlined to caller + throw GetInvalidArgumentsException(); + + Exception GetInvalidArgumentsException() + { + if (buffer == null) + { + return ThrowHelper.GetArgumentNullException(ExceptionArgument.buffer); + } + + if (offset < 0) + { + return ThrowHelper.GetArgumentOutOfRangeException(ExceptionArgument.offset); + } + + if (length < 0) + { + return ThrowHelper.GetArgumentOutOfRangeException(ExceptionArgument.length); + } + + return ThrowHelper.GetArgumentException(ExceptionResource.Argument_InvalidOffsetLength); + } + } + + private void ThrowInvalidArguments(int offset, int length) + { + throw GetInvalidArgumentsException(HasValue); + + Exception GetInvalidArgumentsException(bool hasValue) + { + if (!hasValue) + { + return ThrowHelper.GetArgumentOutOfRangeException(ExceptionArgument.offset); + } + + if (offset < 0) + { + return ThrowHelper.GetArgumentOutOfRangeException(ExceptionArgument.offset); + } + + if (length < 0) + { + return ThrowHelper.GetArgumentOutOfRangeException(ExceptionArgument.length); + } + + return ThrowHelper.GetArgumentException(ExceptionResource.Argument_InvalidOffsetLengthStringSegment); + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs new file mode 100644 index 00000000000000..5e8fb3a518da9d --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs @@ -0,0 +1,52 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; + +namespace Microsoft.Extensions.Primitives +{ + public class StringSegmentComparer : IComparer, IEqualityComparer + { + public static StringSegmentComparer Ordinal { get; } + = new StringSegmentComparer(StringComparison.Ordinal, StringComparer.Ordinal); + + public static StringSegmentComparer OrdinalIgnoreCase { get; } + = new StringSegmentComparer(StringComparison.OrdinalIgnoreCase, StringComparer.OrdinalIgnoreCase); + + private StringSegmentComparer(StringComparison comparison, StringComparer comparer) + { + Comparison = comparison; + Comparer = comparer; + } + + private StringComparison Comparison { get; } + private StringComparer Comparer { get; } + + public int Compare(StringSegment x, StringSegment y) + { + return StringSegment.Compare(x, y, Comparison); + } + + public bool Equals(StringSegment x, StringSegment y) + { + return StringSegment.Equals(x, y, Comparison); + } + + public int GetHashCode(StringSegment obj) + { +#if NETCOREAPP || NETSTANDARD2_1 + return string.GetHashCode(obj.AsSpan(), Comparison); +#else + if (!obj.HasValue) + { + return 0; + } + + // .NET Core strings use randomized hash codes for security reasons. Consequently we must materialize the StringSegment as a string + return Comparer.GetHashCode(obj.Value); +#endif + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringTokenizer.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringTokenizer.cs new file mode 100644 index 00000000000000..817562746a7c88 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringTokenizer.cs @@ -0,0 +1,125 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Extensions.Primitives +{ + /// + /// Tokenizes a into s. + /// + public readonly struct StringTokenizer : IEnumerable + { + private readonly StringSegment _value; + private readonly char[] _separators; + + /// + /// Initializes a new instance of . + /// + /// The to tokenize. + /// The characters to tokenize by. + public StringTokenizer(string value, char[] separators) + { + if (value == null) + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value); + } + + if (separators == null) + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.separators); + } + + _value = value; + _separators = separators; + } + + /// + /// Initializes a new instance of . + /// + /// The to tokenize. + /// The characters to tokenize by. + public StringTokenizer(StringSegment value, char[] separators) + { + if (!value.HasValue) + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value); + } + + if (separators == null) + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.separators); + } + + _value = value; + _separators = separators; + } + + public Enumerator GetEnumerator() => new Enumerator(in _value, _separators); + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + public struct Enumerator : IEnumerator + { + private readonly StringSegment _value; + private readonly char[] _separators; + private int _index; + + internal Enumerator(in StringSegment value, char[] separators) + { + _value = value; + _separators = separators; + Current = default; + _index = 0; + } + + public Enumerator(ref StringTokenizer tokenizer) + { + _value = tokenizer._value; + _separators = tokenizer._separators; + Current = default(StringSegment); + _index = 0; + } + + public StringSegment Current { get; private set; } + + object IEnumerator.Current => Current; + + public void Dispose() + { + } + + public bool MoveNext() + { + if (!_value.HasValue || _index > _value.Length) + { + Current = default(StringSegment); + return false; + } + + var next = _value.IndexOfAny(_separators, _index); + if (next == -1) + { + // No separator found. Consume the remainder of the string. + next = _value.Length; + } + + Current = _value.Subsegment(_index, next - _index); + _index = next + 1; + + return true; + } + + public void Reset() + { + Current = default(StringSegment); + _index = 0; + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs new file mode 100644 index 00000000000000..213e80b02300c2 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs @@ -0,0 +1,824 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using Microsoft.Extensions.Internal; + +namespace Microsoft.Extensions.Primitives +{ + /// + /// Represents zero/null, one, or many strings in an efficient way. + /// + public readonly struct StringValues : IList, IReadOnlyList, IEquatable, IEquatable, IEquatable + { + /// + /// A readonly instance of the struct whose value is an empty string array. + /// + /// + /// In application code, this field is most commonly used to safely represent a that has null string values. + /// + public static readonly StringValues Empty = new StringValues(Array.Empty()); + + private readonly object _values; + + /// + /// Initializes a new instance of the structure using the specified string. + /// + /// A string value. + public StringValues(string value) + { + _values = value; + } + + /// + /// Initializes a new instance of the structure using the specified array of strings. + /// + /// A string array. + public StringValues(string[] values) + { + _values = values; + } + + /// + /// Defines an implicit conversion of a given string to a . + /// + /// A string to implicitly convert. + public static implicit operator StringValues(string value) + { + return new StringValues(value); + } + + /// + /// Defines an implicit conversion of a given string array to a . + /// + /// A string array to implicitly convert. + public static implicit operator StringValues(string[] values) + { + return new StringValues(values); + } + + /// + /// Defines an implicit conversion of a given to a string, with multiple values joined as a comma separated string. + /// + /// + /// Returns null where has been initialized from an empty string array or is . + /// + /// A to implicitly convert. + public static implicit operator string (StringValues values) + { + return values.GetStringValue(); + } + + /// + /// Defines an implicit conversion of a given to a string array. + /// + /// A to implicitly convert. + public static implicit operator string[] (StringValues value) + { + return value.GetArrayValue(); + } + + /// + /// Gets the number of elements contained in this . + /// + public int Count + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + // Take local copy of _values so type checks remain valid even if the StringValues is overwritten in memory + var value = _values; + if (value is string) + { + return 1; + } + if (value is null) + { + return 0; + } + else + { + // Not string, not null, can only be string[] + return Unsafe.As(value).Length; + } + } + } + + bool ICollection.IsReadOnly + { + get { return true; } + } + + /// + /// Gets the at index. + /// + /// The string at the specified index. + /// The zero-based index of the element to get. + /// Set operations are not supported on readonly . + string IList.this[int index] + { + get { return this[index]; } + set { throw new NotSupportedException(); } + } + + /// + /// Gets the at index. + /// + /// The string at the specified index. + /// The zero-based index of the element to get. + public string this[int index] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + // Take local copy of _values so type checks remain valid even if the StringValues is overwritten in memory + var value = _values; + if (index == 0 && value is string str) + { + return str; + } + else if (value != null) + { + // Not string, not null, can only be string[] + return Unsafe.As(value)[index]; // may throw + } + else + { + return OutOfBounds(); // throws + } + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static string OutOfBounds() + { + return Array.Empty()[0]; // throws + } + + /// + /// Converts the value of the current object to its equivalent string representation, with multiple values joined as a comma separated string. + /// + /// A string representation of the value of the current object. + public override string ToString() + { + return GetStringValue() ?? string.Empty; + } + + private string GetStringValue() + { + // Take local copy of _values so type checks remain valid even if the StringValues is overwritten in memory + var value = _values; + if (value is string s) + { + return s; + } + else + { + return GetStringValueFromArray(value); + } + + static string GetStringValueFromArray(object value) + { + if (value is null) + { + return null; + } + + Debug.Assert(value is string[]); + // value is not null or string, array, can only be string[] + var values = Unsafe.As(value); + switch (values.Length) + { + case 0: return null; + case 1: return values[0]; + default: return GetJoinedStringValueFromArray(values); + } + } + + static string GetJoinedStringValueFromArray(string[] values) + { + // Calculate final length + var length = 0; + for (var i = 0; i < values.Length; i++) + { + var value = values[i]; + // Skip null and empty values + if (value != null && value.Length > 0) + { + if (length > 0) + { + // Add seperator + length++; + } + + length += value.Length; + } + } +#if NETCOREAPP || NETSTANDARD2_1 + // Create the new string + return string.Create(length, values, (span, strings) => { + var offset = 0; + // Skip null and empty values + for (var i = 0; i < strings.Length; i++) + { + var value = strings[i]; + if (value != null && value.Length > 0) + { + if (offset > 0) + { + // Add seperator + span[offset] = ','; + offset++; + } + + value.AsSpan().CopyTo(span.Slice(offset)); + offset += value.Length; + } + } + }); +#else +#pragma warning disable CS0618 + var sb = new InplaceStringBuilder(length); +#pragma warning restore CS0618 + var hasAdded = false; + // Skip null and empty values + for (var i = 0; i < values.Length; i++) + { + var value = values[i]; + if (value != null && value.Length > 0) + { + if (hasAdded) + { + // Add seperator + sb.Append(','); + } + + sb.Append(value); + hasAdded = true; + } + } + + return sb.ToString(); +#endif + } + } + + /// + /// Creates a string array from the current object. + /// + /// A string array represented by this instance. + /// + /// If the contains a single string internally, it is copied to a new array. + /// If the contains an array internally it returns that array instance. + /// + public string[] ToArray() + { + return GetArrayValue() ?? Array.Empty(); + } + + private string[] GetArrayValue() + { + // Take local copy of _values so type checks remain valid even if the StringValues is overwritten in memory + var value = _values; + if (value is string[] values) + { + return values; + } + else if (value != null) + { + // value not array, can only be string + return new[] { Unsafe.As(value) }; + } + else + { + return null; + } + } + + /// + /// Returns the zero-based index of the first occurrence of an item in the . + /// + /// The string to locate in the . + /// the zero-based index of the first occurrence of within the , if found; otherwise, –1. + int IList.IndexOf(string item) + { + return IndexOf(item); + } + + private int IndexOf(string item) + { + // Take local copy of _values so type checks remain valid even if the StringValues is overwritten in memory + var value = _values; + if (value is string[] values) + { + for (int i = 0; i < values.Length; i++) + { + if (string.Equals(values[i], item, StringComparison.Ordinal)) + { + return i; + } + } + return -1; + } + + if (value != null) + { + // value not array, can only be string + return string.Equals(Unsafe.As(value), item, StringComparison.Ordinal) ? 0 : -1; + } + + return -1; + } + + /// Determines whether a string is in the . + /// The to locate in the . + /// true if item is found in the ; otherwise, false. + bool ICollection.Contains(string item) + { + return IndexOf(item) >= 0; + } + + /// + /// Copies the entire to a string array, starting at the specified index of the target array. + /// + /// The one-dimensional that is the destination of the elements copied from. The must have zero-based indexing. + /// The zero-based index in the destination array at which copying begins. + /// array is null. + /// arrayIndex is less than 0. + /// The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. + void ICollection.CopyTo(string[] array, int arrayIndex) + { + CopyTo(array, arrayIndex); + } + + private void CopyTo(string[] array, int arrayIndex) + { + // Take local copy of _values so type checks remain valid even if the StringValues is overwritten in memory + var value = _values; + if (value is string[] values) + { + Array.Copy(values, 0, array, arrayIndex, values.Length); + return; + } + + if (value != null) + { + if (array == null) + { + throw new ArgumentNullException(nameof(array)); + } + if (arrayIndex < 0) + { + throw new ArgumentOutOfRangeException(nameof(arrayIndex)); + } + if (array.Length - arrayIndex < 1) + { + throw new ArgumentException( + $"'{nameof(array)}' is not long enough to copy all the items in the collection. Check '{nameof(arrayIndex)}' and '{nameof(array)}' length."); + } + + // value not array, can only be string + array[arrayIndex] = Unsafe.As(value); + } + } + + void ICollection.Add(string item) => throw new NotSupportedException(); + + void IList.Insert(int index, string item) => throw new NotSupportedException(); + + bool ICollection.Remove(string item) => throw new NotSupportedException(); + + void IList.RemoveAt(int index) => throw new NotSupportedException(); + + void ICollection.Clear() => throw new NotSupportedException(); + + /// Retrieves an object that can iterate through the individual strings in this . + /// An enumerator that can be used to iterate through the . + public Enumerator GetEnumerator() + { + return new Enumerator(_values); + } + + /// + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + /// Indicates whether the specified contains no string values. + /// + /// The to test. + /// true if value contains a single null string or empty array; otherwise, false. + public static bool IsNullOrEmpty(StringValues value) + { + var data = value._values; + if (data is null) + { + return true; + } + if (data is string[] values) + { + switch (values.Length) + { + case 0: return true; + case 1: return string.IsNullOrEmpty(values[0]); + default: return false; + } + } + else + { + // Not array, can only be string + return string.IsNullOrEmpty(Unsafe.As(data)); + } + } + + /// + /// Concatenates two specified instances of . + /// + /// The first to concatenate. + /// The second to concatenate. + /// The concatenation of and . + public static StringValues Concat(StringValues values1, StringValues values2) + { + var count1 = values1.Count; + var count2 = values2.Count; + + if (count1 == 0) + { + return values2; + } + + if (count2 == 0) + { + return values1; + } + + var combined = new string[count1 + count2]; + values1.CopyTo(combined, 0); + values2.CopyTo(combined, count1); + return new StringValues(combined); + } + + /// + /// Concatenates specified instance of with specified . + /// + /// The to concatenate. + /// The to concatenate. + /// The concatenation of and . + public static StringValues Concat(in StringValues values, string value) + { + if (value == null) + { + return values; + } + + var count = values.Count; + if (count == 0) + { + return new StringValues(value); + } + + var combined = new string[count + 1]; + values.CopyTo(combined, 0); + combined[count] = value; + return new StringValues(combined); + } + + /// + /// Concatenates specified instance of with specified . + /// + /// The to concatenate. + /// The to concatenate. + /// The concatenation of and . + public static StringValues Concat(string value, in StringValues values) + { + if (value == null) + { + return values; + } + + var count = values.Count; + if (count == 0) + { + return new StringValues(value); + } + + var combined = new string[count + 1]; + combined[0] = value; + values.CopyTo(combined, 1); + return new StringValues(combined); + } + + /// + /// Determines whether two specified objects have the same values in the same order. + /// + /// The first to compare. + /// The second to compare. + /// true if the value of is the same as the value of ; otherwise, false. + public static bool Equals(StringValues left, StringValues right) + { + var count = left.Count; + + if (count != right.Count) + { + return false; + } + + for (var i = 0; i < count; i++) + { + if (left[i] != right[i]) + { + return false; + } + } + + return true; + } + + /// + /// Determines whether two specified have the same values. + /// + /// The first to compare. + /// The second to compare. + /// true if the value of is the same as the value of ; otherwise, false. + public static bool operator ==(StringValues left, StringValues right) + { + return Equals(left, right); + } + + /// + /// Determines whether two specified have different values. + /// + /// The first to compare. + /// The second to compare. + /// true if the value of is different to the value of ; otherwise, false. + public static bool operator !=(StringValues left, StringValues right) + { + return !Equals(left, right); + } + + /// + /// Determines whether this instance and another specified object have the same values. + /// + /// The string to compare to this instance. + /// true if the value of is the same as the value of this instance; otherwise, false. + public bool Equals(StringValues other) => Equals(this, other); + + /// + /// Determines whether the specified and objects have the same values. + /// + /// The to compare. + /// The to compare. + /// true if the value of is the same as the value of ; otherwise, false. If is null, the method returns false. + public static bool Equals(string left, StringValues right) => Equals(new StringValues(left), right); + + /// + /// Determines whether the specified and objects have the same values. + /// + /// The to compare. + /// The to compare. + /// true if the value of is the same as the value of ; otherwise, false. If is null, the method returns false. + public static bool Equals(StringValues left, string right) => Equals(left, new StringValues(right)); + + /// + /// Determines whether this instance and a specified , have the same value. + /// + /// The to compare to this instance. + /// true if the value of is the same as this instance; otherwise, false. If is null, returns false. + public bool Equals(string other) => Equals(this, new StringValues(other)); + + /// + /// Determines whether the specified string array and objects have the same values. + /// + /// The string array to compare. + /// The to compare. + /// true if the value of is the same as the value of ; otherwise, false. + public static bool Equals(string[] left, StringValues right) => Equals(new StringValues(left), right); + + /// + /// Determines whether the specified and string array objects have the same values. + /// + /// The to compare. + /// The string array to compare. + /// true if the value of is the same as the value of ; otherwise, false. + public static bool Equals(StringValues left, string[] right) => Equals(left, new StringValues(right)); + + /// + /// Determines whether this instance and a specified string array have the same values. + /// + /// The string array to compare to this instance. + /// true if the value of is the same as this instance; otherwise, false. + public bool Equals(string[] other) => Equals(this, new StringValues(other)); + + /// + public static bool operator ==(StringValues left, string right) => Equals(left, new StringValues(right)); + + /// + /// Determines whether the specified and objects have different values. + /// + /// The to compare. + /// The to compare. + /// true if the value of is different to the value of ; otherwise, false. + public static bool operator !=(StringValues left, string right) => !Equals(left, new StringValues(right)); + + /// + public static bool operator ==(string left, StringValues right) => Equals(new StringValues(left), right); + + /// + /// Determines whether the specified and objects have different values. + /// + /// The to compare. + /// The to compare. + /// true if the value of is different to the value of ; otherwise, false. + public static bool operator !=(string left, StringValues right) => !Equals(new StringValues(left), right); + + /// + public static bool operator ==(StringValues left, string[] right) => Equals(left, new StringValues(right)); + + /// + /// Determines whether the specified and string array have different values. + /// + /// The to compare. + /// The string array to compare. + /// true if the value of is different to the value of ; otherwise, false. + public static bool operator !=(StringValues left, string[] right) => !Equals(left, new StringValues(right)); + + /// + public static bool operator ==(string[] left, StringValues right) => Equals(new StringValues(left), right); + + /// + /// Determines whether the specified string array and have different values. + /// + /// The string array to compare. + /// The to compare. + /// true if the value of is different to the value of ; otherwise, false. + public static bool operator !=(string[] left, StringValues right) => !Equals(new StringValues(left), right); + + /// + /// Determines whether the specified and , which must be a + /// , , or array of , have the same value. + /// + /// The to compare. + /// The to compare. + /// true if the object is equal to the ; otherwise, false. + public static bool operator ==(StringValues left, object right) => left.Equals(right); + + /// + /// Determines whether the specified and , which must be a + /// , , or array of , have different values. + /// + /// The to compare. + /// The to compare. + /// true if the object is equal to the ; otherwise, false. + public static bool operator !=(StringValues left, object right) => !left.Equals(right); + + /// + /// Determines whether the specified , which must be a + /// , , or array of , and specified , have the same value. + /// + /// The to compare. + /// The to compare. + /// true if the object is equal to the ; otherwise, false. + public static bool operator ==(object left, StringValues right) => right.Equals(left); + + /// + /// Determines whether the specified and object have the same values. + /// + /// The to compare. + /// The to compare. + /// true if the object is equal to the ; otherwise, false. + public static bool operator !=(object left, StringValues right) => !right.Equals(left); + + /// + /// Determines whether this instance and a specified object have the same value. + /// + /// An object to compare with this object. + /// true if the current object is equal to ; otherwise, false. + public override bool Equals(object obj) + { + if (obj == null) + { + return Equals(this, StringValues.Empty); + } + + if (obj is string) + { + return Equals(this, (string)obj); + } + + if (obj is string[]) + { + return Equals(this, (string[])obj); + } + + if (obj is StringValues) + { + return Equals(this, (StringValues)obj); + } + + return false; + } + + /// + public override int GetHashCode() + { + var value = _values; + if (value is string[] values) + { + if (Count == 1) + { + return Unsafe.As(this[0])?.GetHashCode() ?? Count.GetHashCode(); + } + var hcc = new HashCodeCombiner(); + for (var i = 0; i < values.Length; i++) + { + hcc.Add(values[i]); + } + return hcc.CombinedHash; + } + else + { + return Unsafe.As(value)?.GetHashCode() ?? Count.GetHashCode(); + } + } + + /// + /// Enumerates the string values of a . + /// + public struct Enumerator : IEnumerator + { + private readonly string[] _values; + private string _current; + private int _index; + + internal Enumerator(object value) + { + if (value is string str) + { + _values = null; + _current = str; + } + else + { + _current = null; + _values = Unsafe.As(value); + } + _index = 0; + } + + public Enumerator(ref StringValues values) : this(values._values) + { } + + public bool MoveNext() + { + var index = _index; + if (index < 0) + { + return false; + } + + var values = _values; + if (values != null) + { + if ((uint)index < (uint)values.Length) + { + _index = index + 1; + _current = values[index]; + return true; + } + + _index = -1; + return false; + } + + _index = -1; // sentinel value + return _current != null; + } + + public string Current => _current; + + object IEnumerator.Current => _current; + + void IEnumerator.Reset() + { + throw new NotSupportedException(); + } + + public void Dispose() + { + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/ThrowHelper.cs b/src/libraries/Microsoft.Extensions.Primitives/src/ThrowHelper.cs new file mode 100644 index 00000000000000..a3ea5ac13b59a0 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/src/ThrowHelper.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Diagnostics; + +namespace Microsoft.Extensions.Primitives +{ + internal static class ThrowHelper + { + internal static void ThrowArgumentNullException(ExceptionArgument argument) + { + throw new ArgumentNullException(GetArgumentName(argument)); + } + + internal static void ThrowArgumentOutOfRangeException(ExceptionArgument argument) + { + throw new ArgumentOutOfRangeException(GetArgumentName(argument)); + } + + internal static void ThrowArgumentException(ExceptionResource resource) + { + throw new ArgumentException(GetResourceText(resource)); + } + + internal static void ThrowInvalidOperationException(ExceptionResource resource) + { + throw new InvalidOperationException(GetResourceText(resource)); + } + + internal static void ThrowInvalidOperationException(ExceptionResource resource, params object[] args) + { + var message = string.Format(GetResourceText(resource), args); + + throw new InvalidOperationException(message); + } + + internal static ArgumentNullException GetArgumentNullException(ExceptionArgument argument) + { + return new ArgumentNullException(GetArgumentName(argument)); + } + + internal static ArgumentOutOfRangeException GetArgumentOutOfRangeException(ExceptionArgument argument) + { + return new ArgumentOutOfRangeException(GetArgumentName(argument)); + } + + internal static ArgumentException GetArgumentException(ExceptionResource resource) + { + return new ArgumentException(GetResourceText(resource)); + } + + private static string GetResourceText(ExceptionResource resource) + { + return SR.GetResourceString(GetResourceName(resource)); + } + + private static string GetArgumentName(ExceptionArgument argument) + { + Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), + "The enum value is not defined, please check the ExceptionArgument Enum."); + + return argument.ToString(); + } + + private static string GetResourceName(ExceptionResource resource) + { + Debug.Assert(Enum.IsDefined(typeof(ExceptionResource), resource), + "The enum value is not defined, please check the ExceptionResource Enum."); + + return resource.ToString(); + } + } + + internal enum ExceptionArgument + { + buffer, + offset, + length, + text, + start, + count, + index, + value, + capacity, + separators + } + + internal enum ExceptionResource + { + Argument_InvalidOffsetLength, + Argument_InvalidOffsetLengthStringSegment, + Capacity_CannotChangeAfterWriteStarted, + Capacity_NotEnough, + Capacity_NotUsedEntirely + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/ChangeTokenTest.cs b/src/libraries/Microsoft.Extensions.Primitives/tests/ChangeTokenTest.cs new file mode 100644 index 00000000000000..95b805cf74add9 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/ChangeTokenTest.cs @@ -0,0 +1,316 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Threading; +using Xunit; + +namespace Microsoft.Extensions.Primitives +{ + public class ChangeTokenTests + { + public class TestChangeToken : IChangeToken + { + private Action _callback; + + public bool ActiveChangeCallbacks { get; set; } + public bool HasChanged { get; set; } + + public IDisposable RegisterChangeCallback(Action callback, object state) + { + _callback = () => callback(state); + return null; + } + + public void Changed() + { + HasChanged = true; + _callback(); + } + } + + [Fact] + public void HasChangeFiresChange() + { + var token = new TestChangeToken(); + bool fired = false; + ChangeToken.OnChange(() => token, () => fired = true); + Assert.False(fired); + token.Changed(); + Assert.True(fired); + } + + [Fact] + public void ChangesFireAfterExceptions() + { + TestChangeToken token = null; + var count = 0; + ChangeToken.OnChange(() => token = new TestChangeToken(), () => + { + count++; + throw new Exception(); + }); + Assert.Throws(() => token.Changed()); + Assert.Equal(1, count); + Assert.Throws(() => token.Changed()); + Assert.Equal(2, count); + } + + [Fact] + public void HasChangeFiresChangeWithState() + { + var token = new TestChangeToken(); + object state = new object(); + object callbackState = null; + ChangeToken.OnChange(() => token, s => callbackState = s, state); + Assert.Null(callbackState); + token.Changed(); + Assert.Equal(state, callbackState); + } + + [Fact] + public void ChangesFireAfterExceptionsWithState() + { + TestChangeToken token = null; + var count = 0; + object state = new object(); + object callbackState = null; + ChangeToken.OnChange(() => token = new TestChangeToken(), s => + { + callbackState = s; + count++; + throw new Exception(); + }, state); + Assert.Throws(() => token.Changed()); + Assert.Equal(1, count); + Assert.NotNull(callbackState); + Assert.Throws(() => token.Changed()); + Assert.Equal(2, count); + Assert.NotNull(callbackState); + } + + [Fact] + public void AsyncLocalsNotCapturedAndRestored() + { + // Capture clean context + var executionContext = ExecutionContext.Capture(); + + var cancellationTokenSource = new CancellationTokenSource(); + var cancellationToken = cancellationTokenSource.Token; + var cancellationChangeToken = new CancellationChangeToken(cancellationToken); + var executed = false; + + // Set AsyncLocal + var asyncLocal = new AsyncLocal(); + asyncLocal.Value = 1; + + // Register Callback + cancellationChangeToken.RegisterChangeCallback(al => + { + // AsyncLocal not set, when run on clean context + // A suppressed flow runs in current context, rather than restoring the captured context + Assert.Equal(0, ((AsyncLocal)al).Value); + executed = true; + }, asyncLocal); + + // AsyncLocal should still be set + Assert.Equal(1, asyncLocal.Value); + + // Check AsyncLocal is not restored by running on clean context + ExecutionContext.Run(executionContext, cts => ((CancellationTokenSource)cts).Cancel(), cancellationTokenSource); + + // AsyncLocal should still be set + Assert.Equal(1, asyncLocal.Value); + Assert.True(executed); + } + + [Fact] + public void DisposingChangeTokenRegistrationDoesNotRaiseConsumerCallback() + { + var provider = new ResettableChangeTokenProvider(); + var count = 0; + var reg = ChangeToken.OnChange(provider.GetChangeToken, () => + { + count++; + }); + + for (int i = 0; i < 5; i++) + { + provider.Changed(); + } + + Assert.Equal(5, count); + + reg.Dispose(); + + for (int i = 0; i < 5; i++) + { + provider.Changed(); + } + + Assert.Equal(5, count); + } + + [Fact] + public void DisposingChangeTokenRegistrationDoesNotRaiseConsumerCallbackStateOverload() + { + var provider = new ResettableChangeTokenProvider(); + var count = 0; + var reg = ChangeToken.OnChange(provider.GetChangeToken, state => + { + count++; + }, + null); + + for (int i = 0; i < 5; i++) + { + provider.Changed(); + } + + Assert.Equal(5, count); + + reg.Dispose(); + + for (int i = 0; i < 5; i++) + { + provider.Changed(); + } + + Assert.Equal(5, count); + } + + [Fact] + public void DisposingChangeTokenRegistrationDuringCallbackWorks() + { + var provider = new ResettableChangeTokenProvider(); + var count = 0; + + IDisposable reg = null; + + reg = ChangeToken.OnChange(provider.GetChangeToken, state => + { + count++; + reg.Dispose(); + }, + null); + + provider.Changed(); + + Assert.Equal(1, count); + + provider.Changed(); + + Assert.Equal(1, count); + } + + [Fact] + public void DoubleDisposeDisposesOnce() + { + var provider = new TrackableChangeTokenProvider(); + var count = 0; + + IDisposable reg = null; + + reg = ChangeToken.OnChange(provider.GetChangeToken, state => + { + count++; + reg.Dispose(); + }, + null); + + provider.Changed(); + + Assert.Equal(1, count); + Assert.Equal(1, provider.RegistrationCalls); + Assert.Equal(1, provider.DisposeCalls); + + reg.Dispose(); + + provider.Changed(); + + Assert.Equal(1, count); + Assert.Equal(2, provider.RegistrationCalls); + Assert.Equal(2, provider.DisposeCalls); + } + + public class TrackableChangeTokenProvider + { + private TrackableChangeToken _cts = new TrackableChangeToken(); + + public int RegistrationCalls { get; set; } + public int DisposeCalls { get; set; } + + public IChangeToken GetChangeToken() => _cts; + + public void Changed() + { + var previous = _cts; + _cts = new TrackableChangeToken(); + previous.Execute(); + + RegistrationCalls += previous.RegistrationCalls; + DisposeCalls += previous.DisposeCalls; + } + } + + public class TrackableChangeToken : IChangeToken + { + private CancellationTokenSource _cts = new CancellationTokenSource(); + + public int RegistrationCalls { get; set; } + public int DisposeCalls { get; set; } + + public bool HasChanged => _cts.IsCancellationRequested; + + public bool ActiveChangeCallbacks => true; + + public void Execute() + { + _cts.Cancel(); + } + + public IDisposable RegisterChangeCallback(Action callback, object state) + { + var registration = _cts.Token.Register(callback, state); + RegistrationCalls++; + + return new DisposableAction(() => + { + DisposeCalls++; + registration.Dispose(); + }); + } + + private class DisposableAction : IDisposable + { + private Action _action; + + public DisposableAction(Action action) + { + _action = action; + } + + public void Dispose() + { + _action?.Invoke(); + } + } + } + + public class ResettableChangeTokenProvider + { + private CancellationTokenSource _cts = new CancellationTokenSource(); + + public IChangeToken GetChangeToken() => new CancellationChangeToken(_cts.Token); + + public void Changed() + { + var previous = _cts; + _cts = new CancellationTokenSource(); + previous.Cancel(); + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs b/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs new file mode 100644 index 00000000000000..ce933840199c9d --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs @@ -0,0 +1,149 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Moq; +using Xunit; + +namespace Microsoft.Extensions.Primitives +{ + public class CompositeChangeTokenTest + { + [Fact] + public void RegisteredCallbacks_AreInvokedExactlyOnce() + { + // Arrange + var firstCancellationTokenSource = new CancellationTokenSource(); + var secondCancellationTokenSource = new CancellationTokenSource(); + var thirdCancellationTokenSource = new CancellationTokenSource(); + var firstCancellationToken = firstCancellationTokenSource.Token; + var secondCancellationToken = secondCancellationTokenSource.Token; + var thirdCancellationToken = thirdCancellationTokenSource.Token; + + var firstCancellationChangeToken = new CancellationChangeToken(firstCancellationToken); + var secondCancellationChangeToken = new CancellationChangeToken(secondCancellationToken); + var thirdCancellationChangeToken = new CancellationChangeToken(thirdCancellationToken); + + var compositeChangeToken = new CompositeChangeToken(new List { firstCancellationChangeToken, secondCancellationChangeToken, thirdCancellationChangeToken }); + var count1 = 0; + var count2 = 0; + compositeChangeToken.RegisterChangeCallback(_ => count1++, null); + compositeChangeToken.RegisterChangeCallback(_ => count2++, null); + + // Act + firstCancellationTokenSource.Cancel(); + secondCancellationTokenSource.Cancel(); + + // Assert + Assert.Equal(1, count1); + Assert.Equal(1, count2); + } + + [Fact] + public void HasChanged_IsTrue_IfAnyTokenHasChanged() + { + // Arrange + var firstChangeToken = new Mock(); + var secondChangeToken = new Mock(); + var thirdChangeToken = new Mock(); + + secondChangeToken.Setup(t => t.HasChanged).Returns(true); + + // Act + var compositeChangeToken = new CompositeChangeToken(new List { firstChangeToken.Object, secondChangeToken.Object, thirdChangeToken.Object }); + + // Assert + Assert.True(compositeChangeToken.HasChanged); + } + + [Fact] + public void HasChanged_IsFalse_IfNoTokenHasChanged() + { + // Arrange + var firstChangeToken = new Mock(); + var secondChangeToken = new Mock(); + + // Act + var compositeChangeToken = new CompositeChangeToken(new List { firstChangeToken.Object, secondChangeToken.Object }); + + // Assert + Assert.False(compositeChangeToken.HasChanged); + } + + [Fact] + public void ActiveChangeCallbacks_IsTrue_IfAnyTokenHasActiveChangeCallbacks() + { + // Arrange + var firstChangeToken = new Mock(); + var secondChangeToken = new Mock(); + var thirdChangeToken = new Mock(); + + secondChangeToken.Setup(t => t.ActiveChangeCallbacks).Returns(true); + + var compositeChangeToken = new CompositeChangeToken(new List { firstChangeToken.Object, secondChangeToken.Object, thirdChangeToken.Object }); + + // Act & Assert + Assert.True(compositeChangeToken.ActiveChangeCallbacks); + } + + [Fact] + public void ActiveChangeCallbacks_IsFalse_IfNoTokenHasActiveChangeCallbacks() + { + // Arrange + var firstChangeToken = new Mock(); + var secondChangeToken = new Mock(); + + var compositeChangeToken = new CompositeChangeToken(new List { firstChangeToken.Object, secondChangeToken.Object }); + + // Act & Assert + Assert.False(compositeChangeToken.ActiveChangeCallbacks); + } + + [Fact] + public async Task RegisteredCallbackGetsInvokedExactlyOnce_WhenMultipleConcurrentChangeEventsOccur() + { + // Arrange + var event1 = new ManualResetEvent(false); + var event2 = new ManualResetEvent(false); + var event3 = new ManualResetEvent(false); + + var cancellationTokenSource = new CancellationTokenSource(); + var cancellationToken = cancellationTokenSource.Token; + var cancellationChangeToken = new CancellationChangeToken(cancellationToken); + var count = 0; + Action callback = _ => + { + count++; + event3.Set(); + event1.WaitOne(5000); + }; + + var compositeChangeToken = new CompositeChangeToken(new List { cancellationChangeToken }); + compositeChangeToken.RegisterChangeCallback(callback, null); + + // Act + var firstChange = Task.Run(() => + { + event2.WaitOne(5000); + cancellationTokenSource.Cancel(); + }); + var secondChange = Task.Run(() => + { + event3.WaitOne(5000); + cancellationTokenSource.Cancel(); + event1.Set(); + }); + + event2.Set(); + + await Task.WhenAll(firstChange, secondChange); + + // Assert + Assert.Equal(1, count); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/InplaceStringBuilderTest.cs b/src/libraries/Microsoft.Extensions.Primitives/tests/InplaceStringBuilderTest.cs new file mode 100644 index 00000000000000..03773e82b85752 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/InplaceStringBuilderTest.cs @@ -0,0 +1,144 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using Microsoft.Extensions.Primitives; +using Xunit; + +// InplaceStringBuilder is obsolete +#pragma warning disable CS0618 + +namespace Microsoft.Extensions.Primitives +{ + public class InplaceStringBuilderTest + { + [Fact] + public void Ctor_ThrowsIfCapacityIsNegative() + { + Assert.Throws(() => new InplaceStringBuilder(-1)); + } + + [Fact] + public void ToString_ReturnsStringWithAllAppendedValues() + { + var s1 = "123"; + var c1 = '4'; + var s2 = "56789"; + var seg = new StringSegment("890123", 2, 2); + + var formatter = new InplaceStringBuilder(); + formatter.Capacity += s1.Length + 1 + s2.Length + seg.Length; + formatter.Append(s1); + formatter.Append(c1); + formatter.Append(s2, 0, 2); + formatter.Append(s2, 2, 2); + formatter.Append(s2, 4, 1); + formatter.Append(seg); + Assert.Equal("12345678901", formatter.ToString()); + } + + [Fact] + public void ToString_ThrowsIfCapacityNotUsed() + { + var formatter = new InplaceStringBuilder(10); + + formatter.Append("abc"); + + var exception = Assert.Throws(() => formatter.ToString()); + Assert.Equal("Entire reserved capacity was not used. Capacity: '10', written '3'.", exception.Message); + } + + [Fact] + public void Build_ThrowsIfNotEnoughWritten() + { + var formatter = new InplaceStringBuilder(5); + formatter.Append("123"); + var exception = Assert.Throws(() => formatter.ToString()); + Assert.Equal("Entire reserved capacity was not used. Capacity: '5', written '3'.", exception.Message); + } + + [Fact] + public void Capacity_ThrowsIfAppendWasCalled() + { + var formatter = new InplaceStringBuilder(3); + formatter.Append("123"); + + var exception = Assert.Throws(() => formatter.Capacity = 5); + Assert.Equal("Cannot change capacity after write started.", exception.Message); + } + + [Fact] + public void Capacity_ThrowsIfNegativeValueSet() + { + var formatter = new InplaceStringBuilder(3); + + Assert.Throws(() => formatter.Capacity = -1); + } + + [Fact] + public void Capacity_GetReturnsCorrectValue() + { + var formatter = new InplaceStringBuilder(3); + Assert.Equal(3, formatter.Capacity); + + formatter.Capacity = 10; + Assert.Equal(10, formatter.Capacity); + + formatter.Append("abc"); + Assert.Equal(10, formatter.Capacity); + } + + [Fact] + public void Append_ThrowsIfValueIsNull() + { + var formatter = new InplaceStringBuilder(3); + + Assert.Throws(() => formatter.Append(null as string)); + } + + [Fact] + public void Append_ThrowsIfValueIsNullInOverloadWithIndex() + { + var formatter = new InplaceStringBuilder(3); + + Assert.Throws(() => formatter.Append(null as string, 0, 3)); + } + + [Fact] + public void Append_ThrowsIfOffsetIsNegative() + { + var formatter = new InplaceStringBuilder(3); + + Assert.Throws(() => formatter.Append("abc", -1, 3)); + } + + [Fact] + public void Append_ThrowIfValueLenghtMinusOffsetSmallerThanCount() + { + var formatter = new InplaceStringBuilder(3); + + Assert.Throws(() => formatter.Append("abc", 1, 3)); + } + + [Fact] + public void Append_ThrowsIfNotEnoughCapacity() + { + var formatter = new InplaceStringBuilder(1); + + var exception = Assert.Throws(() => formatter.Append("123")); + Assert.Equal("Not enough capacity to write '3' characters, only '1' left.", exception.Message); + } + + [Fact] + public void Append_ThrowsWhenNoCapacityIsSet() + { + var formatter = new InplaceStringBuilder(); + + var exception = Assert.Throws(() => formatter.Append("123")); + Assert.Equal("Not enough capacity to write '3' characters, only '0' left.", exception.Message); + } + } +} + +#pragma warning restore CS0618 \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/Microsoft.Extensions.Primitives.Tests.csproj b/src/libraries/Microsoft.Extensions.Primitives/tests/Microsoft.Extensions.Primitives.Tests.csproj new file mode 100644 index 00000000000000..d9b69e7ce29fa5 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/Microsoft.Extensions.Primitives.Tests.csproj @@ -0,0 +1,25 @@ + + + + $(DefaultNetCoreTargetFramework);net472 + true + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/StringSegmentTest.cs b/src/libraries/Microsoft.Extensions.Primitives/tests/StringSegmentTest.cs new file mode 100644 index 00000000000000..1f072612e2c0cf --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/StringSegmentTest.cs @@ -0,0 +1,1174 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using Xunit; + +namespace Microsoft.Extensions.Primitives +{ + public class StringSegmentTest + { + [Fact] + public void StringSegment_Empty() + { + // Arrange & Act + var segment = StringSegment.Empty; + + // Assert + Assert.True(segment.HasValue); + Assert.Same(string.Empty, segment.Value); + Assert.Equal(0, segment.Offset); + Assert.Equal(0, segment.Length); + } + + [Fact] + public void StringSegment_ImplicitConvertFromString() + { + StringSegment segment = "Hello"; + + Assert.True(segment.HasValue); + Assert.Equal(0, segment.Offset); + Assert.Equal(5, segment.Length); + Assert.Equal("Hello", segment.Value); + } + + [Fact] + public void StringSegment_AsSpan() + { + var segment = new StringSegment("Hello"); + + var span = segment.AsSpan(); + + Assert.Equal(5, span.Length); + } + + [Fact] + public void StringSegment_ImplicitConvertToSpan() + { + ReadOnlySpan span = new StringSegment("Hello"); + + Assert.Equal(5, span.Length); + } + + [Fact] + public void StringSegment_AsMemory() + { + var segment = new StringSegment("Hello"); + + var memory = segment.AsMemory(); + + Assert.Equal(5, memory.Length); + } + + [Fact] + public void StringSegment_ImplicitConvertToMemory() + { + ReadOnlyMemory memory = new StringSegment("Hello"); + + Assert.Equal(5, memory.Length); + } + + [Fact] + public void StringSegment_StringCtor_AllowsNullBuffers() + { + // Arrange & Act + var segment = new StringSegment(null); + + // Assert + Assert.False(segment.HasValue); + Assert.Equal(0, segment.Offset); + Assert.Equal(0, segment.Length); + } + + [Fact] + public void StringSegmentConstructor_NullBuffer_Throws() + { + // Arrange, Act and Assert + var exception = Assert.Throws(() => new StringSegment(null, 0, 0)); + Assert.Contains("buffer", exception.Message); + } + + [Fact] + public void StringSegmentConstructor_NegativeOffset_Throws() + { + // Arrange, Act and Assert + var exception = Assert.Throws(() => new StringSegment("", -1, 0)); + Assert.Contains("offset", exception.Message); + } + + [Fact] + public void StringSegmentConstructor_NegativeLength_Throws() + { + // Arrange, Act and Assert + var exception = Assert.Throws(() => new StringSegment("", 0, -1)); + Assert.Contains("length", exception.Message); + } + + [Theory] + [InlineData(0, 10)] + [InlineData(10, 0)] + [InlineData(5, 5)] + [InlineData(int.MaxValue, int.MaxValue)] + public void StringSegmentConstructor_OffsetOrLengthOutOfBounds_Throws(int offset, int length) + { + // Arrange, Act and Assert + Assert.Throws(() => new StringSegment("lengthof9", offset, length)); + } + + [Theory] + [InlineData("", 0, 0)] + [InlineData("abc", 2, 0)] + public void StringSegmentConstructor_AllowsEmptyBuffers(string text, int offset, int length) + { + // Arrange & Act + var segment = new StringSegment(text, offset, length); + + // Assert + Assert.True(segment.HasValue); + Assert.Equal(offset, segment.Offset); + Assert.Equal(length, segment.Length); + } + + [Fact] + public void StringSegment_StringCtor_InitializesValuesCorrectly() + { + // Arrange + var buffer = "Hello world!"; + + // Act + var segment = new StringSegment(buffer); + + // Assert + Assert.True(segment.HasValue); + Assert.Equal(0, segment.Offset); + Assert.Equal(buffer.Length, segment.Length); + } + + [Fact] + public void StringSegment_Value_Valid() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 4); + + // Act + var value = segment.Value; + + // Assert + Assert.Equal("ello", value); + } + + [Fact] + public void StringSegment_Value_Invalid() + { + // Arrange + var segment = new StringSegment(); + + // Act + var value = segment.Value; + + // Assert + Assert.Null(value); + } + + [Fact] + public void StringSegment_HasValue_Valid() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 4); + + // Act + var hasValue = segment.HasValue; + + // Assert + Assert.True(hasValue); + } + + [Fact] + public void StringSegment_HasValue_Invalid() + { + // Arrange + var segment = new StringSegment(); + + // Act + var hasValue = segment.HasValue; + + // Assert + Assert.False(hasValue); + } + + [Theory] + [InlineData("a", 0, 1, 0, 'a')] + [InlineData("abc", 1, 1, 0, 'b')] + [InlineData("abcdef", 1, 4, 0, 'b')] + [InlineData("abcdef", 1, 4, 1, 'c')] + [InlineData("abcdef", 1, 4, 2, 'd')] + [InlineData("abcdef", 1, 4, 3, 'e')] + public void StringSegment_Indexer_InRange(string value, int offset, int length, int index, char expected) + { + var segment = new StringSegment(value, offset, length); + + var result = segment[index]; + + Assert.Equal(expected, result); + } + + [Theory] + [InlineData("", 0, 0, 0)] + [InlineData("a", 0, 1, -1)] + [InlineData("a", 0, 1, 1)] + public void StringSegment_Indexer_OutOfRangeThrows(string value, int offset, int length, int index) + { + var segment = new StringSegment(value, offset, length); + + Assert.Throws(() => segment[index]); + } + + public static TheoryData EndsWithData + { + get + { + // candidate / comparer / expected result + return new TheoryData() + { + { "Hello", StringComparison.Ordinal, false }, + { "ello ", StringComparison.Ordinal, false }, + { "ll", StringComparison.Ordinal, false }, + { "ello", StringComparison.Ordinal, true }, + { "llo", StringComparison.Ordinal, true }, + { "lo", StringComparison.Ordinal, true }, + { "o", StringComparison.Ordinal, true }, + { string.Empty, StringComparison.Ordinal, true }, + { "eLLo", StringComparison.Ordinal, false }, + { "eLLo", StringComparison.OrdinalIgnoreCase, true }, + }; + } + } + + [Theory] + [MemberData(nameof(EndsWithData))] + public void StringSegment_EndsWith_Valid(string candidate, StringComparison comparison, bool expectedResult) + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 4); + + // Act + var result = segment.EndsWith(candidate, comparison); + + // Assert + Assert.Equal(expectedResult, result); + } + + [Fact] + public void StringSegment_EndsWith_Invalid() + { + // Arrange + var segment = new StringSegment(); + + // Act + var result = segment.EndsWith(string.Empty, StringComparison.Ordinal); + + // Assert + Assert.False(result); + } + + public static TheoryData StartsWithData + { + get + { + // candidate / comparer / expected result + return new TheoryData() + { + { "Hello", StringComparison.Ordinal, false }, + { "ello ", StringComparison.Ordinal, false }, + { "ll", StringComparison.Ordinal, false }, + { "ello", StringComparison.Ordinal, true }, + { "ell", StringComparison.Ordinal, true }, + { "el", StringComparison.Ordinal, true }, + { "e", StringComparison.Ordinal, true }, + { string.Empty, StringComparison.Ordinal, true }, + { "eLLo", StringComparison.Ordinal, false }, + { "eLLo", StringComparison.OrdinalIgnoreCase, true }, + }; + } + } + + [Theory] + [MemberData(nameof(StartsWithData))] + public void StringSegment_StartsWith_Valid(string candidate, StringComparison comparison, bool expectedResult) + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 4); + + // Act + var result = segment.StartsWith(candidate, comparison); + + // Assert + Assert.Equal(expectedResult, result); + } + + [Fact] + public void StringSegment_StartsWith_Invalid() + { + // Arrange + var segment = new StringSegment(); + + // Act + var result = segment.StartsWith(string.Empty, StringComparison.Ordinal); + + // Assert + Assert.False(result); + } + + public static TheoryData EqualsStringData + { + get + { + // candidate / comparer / expected result + return new TheoryData() + { + { "eLLo", StringComparison.OrdinalIgnoreCase, true }, + { "eLLo", StringComparison.Ordinal, false }, + }; + } + } + + [Theory] + [MemberData(nameof(EqualsStringData))] + public void StringSegment_Equals_String_Valid(string candidate, StringComparison comparison, bool expectedResult) + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 4); + + // Act + var result = segment.Equals(candidate, comparison); + + // Assert + Assert.Equal(expectedResult, result); + } + + [Fact] + public void StringSegment_EqualsObject_Valid() + { + var segment1 = new StringSegment("My Car Is Cool", 3, 3); + var segment2 = new StringSegment("Your Carport is blue", 5, 3); + + Assert.True(segment1.Equals((object)segment2)); + } + + [Fact] + public void StringSegment_EqualsNull_Invalid() + { + var segment1 = new StringSegment("My Car Is Cool", 3, 3); + + Assert.False(segment1.Equals(null as object)); + } + + [Fact] + public void StringSegment_StaticEquals_Valid() + { + var segment1 = new StringSegment("My Car Is Cool", 3, 3); + var segment2 = new StringSegment("Your Carport is blue", 5, 3); + + Assert.True(StringSegment.Equals(segment1, segment2)); + } + + [Fact] + public void StringSegment_StaticEquals_Invalid() + { + var segment1 = new StringSegment("My Car Is Cool", 3, 4); + var segment2 = new StringSegment("Your Carport is blue", 5, 4); + + Assert.False(StringSegment.Equals(segment1, segment2)); + } + + [Fact] + public void StringSegment_IsNullOrEmpty_Valid() + { + Assert.True(StringSegment.IsNullOrEmpty(null)); + Assert.True(StringSegment.IsNullOrEmpty(string.Empty)); + Assert.True(StringSegment.IsNullOrEmpty(new StringSegment(null))); + Assert.True(StringSegment.IsNullOrEmpty(new StringSegment(string.Empty))); + Assert.True(StringSegment.IsNullOrEmpty(StringSegment.Empty)); + Assert.True(StringSegment.IsNullOrEmpty(new StringSegment(string.Empty, 0, 0))); + Assert.True(StringSegment.IsNullOrEmpty(new StringSegment("Hello", 0, 0))); + Assert.True(StringSegment.IsNullOrEmpty(new StringSegment("Hello", 3, 0))); + } + + [Fact] + public void StringSegment_IsNullOrEmpty_Invalid() + { + Assert.False(StringSegment.IsNullOrEmpty("A")); + Assert.False(StringSegment.IsNullOrEmpty("ABCDefg")); + Assert.False(StringSegment.IsNullOrEmpty(new StringSegment("A", 0 , 1))); + Assert.False(StringSegment.IsNullOrEmpty(new StringSegment("ABCDefg", 3, 2))); + } + + public static TheoryData GetHashCode_ReturnsSameValueForEqualSubstringsData + { + get + { + return new TheoryData + { + { default(StringSegment), default(StringSegment) }, + { default(StringSegment), new StringSegment() }, + { new StringSegment("Test123", 0, 0), new StringSegment(string.Empty) }, + { new StringSegment("C`est si bon", 2, 3), new StringSegment("Yesterday", 1, 3) }, + { new StringSegment("Hello", 1, 4), new StringSegment("Hello world", 1, 4) }, + { new StringSegment("Hello"), new StringSegment("Hello", 0, 5) }, + }; + } + } + + [Theory] + [MemberData(nameof(GetHashCode_ReturnsSameValueForEqualSubstringsData))] + public void GetHashCode_ReturnsSameValueForEqualSubstrings(StringSegment segment1, StringSegment segment2) + { + // Act + var hashCode1 = segment1.GetHashCode(); + var hashCode2 = segment2.GetHashCode(); + + // Assert + Assert.Equal(hashCode1, hashCode2); + } + + public static TheoryData GetHashCode_ReturnsDifferentValuesForInequalSubstringsData + { + get + { + var testString = "Test123"; + return new TheoryData + { + { new StringSegment(testString, 0, 1), new StringSegment(string.Empty) }, + { new StringSegment(testString, 0, 1), new StringSegment(testString, 1, 1) }, + { new StringSegment(testString, 1, 2), new StringSegment(testString, 1, 3) }, + { new StringSegment(testString, 0, 4), new StringSegment("TEST123", 0, 4) }, + }; + } + } + + [Theory] + [MemberData(nameof(GetHashCode_ReturnsDifferentValuesForInequalSubstringsData))] + public void GetHashCode_ReturnsDifferentValuesForInequalSubstrings( + StringSegment segment1, + StringSegment segment2) + { + // Act + var hashCode1 = segment1.GetHashCode(); + var hashCode2 = segment2.GetHashCode(); + + // Assert + Assert.NotEqual(hashCode1, hashCode2); + } + + [Fact] + public void StringSegment_EqualsString_Invalid() + { + // Arrange + var segment = new StringSegment(); + + // Act + var result = segment.Equals(string.Empty, StringComparison.Ordinal); + + // Assert + Assert.False(result); + } + + public static TheoryData DefaultStringSegmentEqualsStringSegmentData + { + get + { + // candidate + return new TheoryData() + { + { default(StringSegment) }, + { new StringSegment() }, + }; + } + } + + [Theory] + [MemberData(nameof(DefaultStringSegmentEqualsStringSegmentData))] + public void DefaultStringSegment_EqualsStringSegment(StringSegment candidate) + { + // Arrange + var segment = default(StringSegment); + + // Act + var result = segment.Equals(candidate, StringComparison.Ordinal); + + // Assert + Assert.True(result); + } + + public static TheoryData DefaultStringSegmentDoesNotEqualStringSegmentData + { + get + { + // candidate + return new TheoryData() + { + { new StringSegment("Hello, World!", 1, 4) }, + { new StringSegment("Hello", 1, 0) }, + { new StringSegment(string.Empty) }, + }; + } + } + + [Theory] + [MemberData(nameof(DefaultStringSegmentDoesNotEqualStringSegmentData))] + public void DefaultStringSegment_DoesNotEqualStringSegment(StringSegment candidate) + { + // Arrange + var segment = default(StringSegment); + + // Act + var result = segment.Equals(candidate, StringComparison.Ordinal); + + // Assert + Assert.False(result); + } + + public static TheoryData DefaultStringSegmentDoesNotEqualStringData + { + get + { + // candidate + return new TheoryData() + { + { string.Empty }, + { "Hello, World!" }, + }; + } + } + + [Theory] + [MemberData(nameof(DefaultStringSegmentDoesNotEqualStringData))] + public void DefaultStringSegment_DoesNotEqualString(string candidate) + { + // Arrange + var segment = default(StringSegment); + + // Act + var result = segment.Equals(candidate, StringComparison.Ordinal); + + // Assert + Assert.False(result); + } + + public static TheoryData EqualsStringSegmentData + { + get + { + // candidate / comparer / expected result + return new TheoryData() + { + { new StringSegment("Hello, World!", 1, 4), StringComparison.Ordinal, true }, + { new StringSegment("HELlo, World!", 1, 4), StringComparison.Ordinal, false }, + { new StringSegment("HELlo, World!", 1, 4), StringComparison.OrdinalIgnoreCase, true }, + { new StringSegment("ello, World!", 0, 4), StringComparison.Ordinal, true }, + { new StringSegment("ello, World!", 0, 3), StringComparison.Ordinal, false }, + { new StringSegment("ello, World!", 1, 3), StringComparison.Ordinal, false }, + }; + } + } + + [Theory] + [MemberData(nameof(EqualsStringSegmentData))] + public void StringSegment_Equals_StringSegment_Valid(StringSegment candidate, StringComparison comparison, bool expectedResult) + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 4); + + // Act + var result = segment.Equals(candidate, comparison); + + // Assert + Assert.Equal(expectedResult, result); + } + + [Fact] + public void StringSegment_EqualsStringSegment_Invalid() + { + // Arrange + var segment = new StringSegment(); + var candidate = new StringSegment("Hello, World!", 3, 2); + + // Act + var result = segment.Equals(candidate, StringComparison.Ordinal); + + // Assert + Assert.False(result); + } + + [Fact] + public void StringSegment_SubstringOffset_Valid() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 4); + + // Act + var result = segment.Substring(offset: 1); + + // Assert + Assert.Equal("llo", result); + } + + [Fact] + public void StringSegment_Substring_Valid() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 4); + + // Act + var result = segment.Substring(offset: 1, length: 2); + + // Assert + Assert.Equal("ll", result); + } + + [Fact] + public void StringSegment_Substring_Invalid() + { + // Arrange + var segment = new StringSegment(); + + // Act & Assert + Assert.Throws(() => segment.Substring(0, 0)); + } + + [Fact] + public void StringSegment_Substring_InvalidOffset() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act & Assert + var exception = Assert.Throws(() => segment.Substring(-1, 1)); + Assert.Equal("offset", exception.ParamName); + } + + [Fact] + public void StringSegment_Substring_InvalidLength() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act & Assert + var exception = Assert.Throws(() => segment.Substring(0, -1)); + Assert.Equal("length", exception.ParamName); + } + + [Fact] + public void StringSegment_Substring_InvalidOffsetAndLength() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act & Assert + var exception = Assert.Throws(() => segment.Substring(2, 3)); + Assert.Contains("bounds", exception.Message); + } + + [Fact] + public void StringSegment_Substring_OffsetAndLengthOverflows() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act & Assert + var exception = Assert.Throws(() => segment.Substring(1, int.MaxValue)); + Assert.Contains("bounds", exception.Message); + } + + [Fact] + public void StringSegment_SubsegmentOffset_Valid() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 4); + + // Act + var result = segment.Subsegment(offset: 1); + + // Assert + Assert.Equal(new StringSegment("Hello, World!", 2, 3), result); + Assert.Equal("llo", result.Value); + } + + [Fact] + public void StringSegment_Subsegment_Valid() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 4); + + // Act + var result = segment.Subsegment(offset: 1, length: 2); + + // Assert + Assert.Equal(new StringSegment("Hello, World!", 2, 2), result); + Assert.Equal("ll", result.Value); + } + + [Fact] + public void StringSegment_Subsegment_Invalid() + { + // Arrange + var segment = new StringSegment(); + + // Act & Assert + Assert.Throws(() => segment.Subsegment(0, 0)); + } + + [Fact] + public void StringSegment_Subsegment_InvalidOffset() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act & Assert + var exception = Assert.Throws(() => segment.Subsegment(-1, 1)); + Assert.Equal("offset", exception.ParamName); + } + + [Fact] + public void StringSegment_Subsegment_InvalidLength() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act & Assert + var exception = Assert.Throws(() => segment.Subsegment(0, -1)); + Assert.Equal("length", exception.ParamName); + } + + [Fact] + public void StringSegment_Subsegment_InvalidOffsetAndLength() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act & Assert + var exception = Assert.Throws(() => segment.Subsegment(2, 3)); + Assert.Contains("bounds", exception.Message); + } + + [Fact] + public void StringSegment_Subsegment_OffsetAndLengthOverflows() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act & Assert + var exception = Assert.Throws(() => segment.Subsegment(1, int.MaxValue)); + Assert.Contains("bounds", exception.Message); + } + + public static TheoryData CompareLesserData + { + get + { + // candidate / comparer + return new TheoryData() + { + { new StringSegment("abcdef", 1, 4), StringSegmentComparer.Ordinal }, + { new StringSegment("abcdef", 1, 5), StringSegmentComparer.OrdinalIgnoreCase }, + { new StringSegment("ABCDEF", 2, 2), StringSegmentComparer.OrdinalIgnoreCase }, + }; + } + } + + [Theory] + [MemberData(nameof(CompareLesserData))] + public void StringSegment_Compare_Lesser(StringSegment candidate, StringSegmentComparer comparer) + { + // Arrange + var segment = new StringSegment("ABCDEF", 1, 4); + + // Act + var result = comparer.Compare(segment, candidate); + + // Assert + Assert.True(result < 0, $"{segment} should be less than {candidate}"); + } + + public static TheoryData CompareEqualData + { + get + { + // candidate / comparer + return new TheoryData() + { + { new StringSegment("abcdef", 1, 4), StringSegmentComparer.Ordinal }, + { new StringSegment("ABCDEF", 1, 4), StringSegmentComparer.OrdinalIgnoreCase }, + { new StringSegment("bcde", 0, 4), StringSegmentComparer.Ordinal }, + { new StringSegment("BcDeF", 0, 4), StringSegmentComparer.OrdinalIgnoreCase }, + }; + } + } + + [Theory] + [MemberData(nameof(CompareEqualData))] + public void StringSegment_Compare_Equal(StringSegment candidate, StringSegmentComparer comparer) + { + // Arrange + var segment = new StringSegment("abcdef", 1, 4); + + // Act + var result = comparer.Compare(segment, candidate); + + // Assert + Assert.True(result == 0, $"{segment} should equal {candidate}"); + } + + public static TheoryData CompareGreaterData + { + get + { + // candidate / comparer + return new TheoryData() + { + { new StringSegment("ABCDEF", 1, 4), StringSegmentComparer.Ordinal }, + { new StringSegment("ABCDEF", 0, 6), StringSegmentComparer.OrdinalIgnoreCase }, + { new StringSegment("abcdef", 0, 3), StringSegmentComparer.Ordinal }, + }; + } + } + + [Theory] + [MemberData(nameof(CompareGreaterData))] + public void StringSegment_Compare_Greater(StringSegment candidate, StringSegmentComparer comparer) + { + // Arrange + var segment = new StringSegment("abcdef", 1, 4); + + // Act + var result = comparer.Compare(segment, candidate); + + // Assert + Assert.True(result > 0, $"{segment} should be greater than {candidate}"); + } + + [Theory] + [MemberData(nameof(GetHashCode_ReturnsSameValueForEqualSubstringsData))] + public void StringSegmentComparerOrdinal_GetHashCode_ReturnsSameValueForEqualSubstrings(StringSegment segment1, StringSegment segment2) + { + // Arrange + var comparer = StringSegmentComparer.Ordinal; + + // Act + var hashCode1 = comparer.GetHashCode(segment1); + var hashCode2 = comparer.GetHashCode(segment2); + + // Assert + Assert.Equal(hashCode1, hashCode2); + } + + [Theory] + [MemberData(nameof(GetHashCode_ReturnsSameValueForEqualSubstringsData))] + public void StringSegmentComparerOrdinalIgnoreCase_GetHashCode_ReturnsSameValueForEqualSubstrings(StringSegment segment1, StringSegment segment2) + { + // Arrange + var comparer = StringSegmentComparer.OrdinalIgnoreCase; + + // Act + var hashCode1 = comparer.GetHashCode(segment1); + var hashCode2 = comparer.GetHashCode(segment2); + + // Assert + Assert.Equal(hashCode1, hashCode2); + } + + [Fact] + public void StringSegmentComparerOrdinalIgnoreCase_GetHashCode_ReturnsSameValueForDifferentlyCasedStrings() + { + // Arrange + var segment1 = new StringSegment("abc"); + var segment2 = new StringSegment("Abcd", 0, 3); + var comparer = StringSegmentComparer.OrdinalIgnoreCase; + + // Act + var hashCode1 = comparer.GetHashCode(segment1); + var hashCode2 = comparer.GetHashCode(segment2); + + // Assert + Assert.Equal(hashCode1, hashCode2); + } + + [Theory] + [MemberData(nameof(GetHashCode_ReturnsDifferentValuesForInequalSubstringsData))] + public void StringSegmentComparerOrdinal_GetHashCode_ReturnsDifferentValuesForInequalSubstrings(StringSegment segment1, StringSegment segment2) + { + // Arrange + var comparer = StringSegmentComparer.Ordinal; + + // Act + var hashCode1 = comparer.GetHashCode(segment1); + var hashCode2 = comparer.GetHashCode(segment2); + + // Assert + Assert.NotEqual(hashCode1, hashCode2); + } + + [Fact] + public void IndexOf_ComputesIndex_RelativeToTheCurrentSegment() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 10); + + // Act + var result = segment.IndexOf(','); + + // Assert + Assert.Equal(4, result); + } + + [Fact] + public void IndexOf_ReturnsMinusOne_IfElementNotInSegment() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act + var result = segment.IndexOf(','); + + // Assert + Assert.Equal(-1, result); + } + + [Fact] + public void IndexOf_SkipsANumberOfCaracters_IfStartIsProvided() + { + // Arrange + const string buffer = "Hello, World!, Hello people!"; + var segment = new StringSegment(buffer, 3, buffer.Length - 3); + + // Act + var result = segment.IndexOf('!', 15); + + // Assert + Assert.Equal(buffer.Length - 4, result); + } + + [Fact] + public void IndexOf_SearchOnlyInsideTheRange_IfStartAndCountAreProvided() + { + // Arrange + const string buffer = "Hello, World!, Hello people!"; + var segment = new StringSegment(buffer, 3, buffer.Length - 3); + + // Act + var result = segment.IndexOf('!', 15, 5); + + // Assert + Assert.Equal(-1, result); + } + + [Fact] + public void IndexOf_NegativeStart_OutOfRangeThrows() + { + // Arrange + const string buffer = "Hello, World!, Hello people!"; + var segment = new StringSegment(buffer, 3, buffer.Length - 3); + + // Act & Assert + Assert.Throws(() => segment.IndexOf('!', -1, 3)); + } + + [Fact] + public void IndexOf_StartOverflowsWithOffset_OutOfRangeThrows() + { + // Arrange + const string buffer = "Hello, World!, Hello people!"; + var segment = new StringSegment(buffer, 3, buffer.Length - 3); + + // Act & Assert + var exception = Assert.Throws(() => segment.IndexOf('!', int.MaxValue, 3)); + Assert.Equal("start", exception.ParamName); + } + + [Fact] + public void IndexOfAny_ComputesIndex_RelativeToTheCurrentSegment() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 10); + + // Act + var result = segment.IndexOfAny(new[] { ',' }); + + // Assert + Assert.Equal(4, result); + } + + [Fact] + public void IndexOfAny_ReturnsMinusOne_IfElementNotInSegment() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act + var result = segment.IndexOfAny(new[] { ',' }); + + // Assert + Assert.Equal(-1, result); + } + + [Fact] + public void IndexOfAny_SkipsANumberOfCaracters_IfStartIsProvided() + { + // Arrange + const string buffer = "Hello, World!, Hello people!"; + var segment = new StringSegment(buffer, 3, buffer.Length - 3); + + // Act + var result = segment.IndexOfAny(new[] { '!' }, 15); + + // Assert + Assert.Equal(buffer.Length - 4, result); + } + + [Fact] + public void IndexOfAny_SearchOnlyInsideTheRange_IfStartAndCountAreProvided() + { + // Arrange + const string buffer = "Hello, World!, Hello people!"; + var segment = new StringSegment(buffer, 3, buffer.Length - 3); + + // Act + var result = segment.IndexOfAny(new[] { '!' }, 15, 5); + + // Assert + Assert.Equal(-1, result); + } + + [Fact] + public void LastIndexOf_ComputesIndex_RelativeToTheCurrentSegment() + { + // Arrange + var segment = new StringSegment("Hello, World, how, are, you!", 1, 14); + + // Act + var result = segment.LastIndexOf(','); + + // Assert + Assert.Equal(11, result); + } + + [Fact] + public void LastIndexOf_ReturnsMinusOne_IfElementNotInSegment() + { + // Arrange + var segment = new StringSegment("Hello, World!", 1, 3); + + // Act + var result = segment.LastIndexOf(','); + + // Assert + Assert.Equal(-1, result); + } + + [Fact] + public void Value_DoesNotAllocateANewString_IfTheSegmentContainsTheWholeBuffer() + { + // Arrange + const string buffer = "Hello, World!"; + var segment = new StringSegment(buffer); + + // Act + var result = segment.Value; + + // Assert + Assert.Same(buffer, result); + } + + [Fact] + public void StringSegment_CreateEmptySegment() + { + // Arrange + var segment = new StringSegment("//", 1, 0); + + // Assert + Assert.True(segment.HasValue); + } + + [Theory] + [InlineData(" value", 0, 8, "value")] + [InlineData("value ", 0, 8, "value")] + [InlineData("\t\tvalue", 0, 7, "value")] + [InlineData("value\t\t", 0, 7, "value")] + [InlineData("\t\tvalue \t a", 1, 8, "value")] + [InlineData(" a ", 0, 9, "a")] + [InlineData("value\t value value ", 2, 13, "lue\t value v")] + [InlineData("\x0009value \x0085", 0, 8, "value")] + [InlineData(" \f\t\u000B\u2028Hello \u2029\n\t ", 1, 13, "Hello")] + [InlineData(" ", 1, 2, "")] + [InlineData("\t\t\t", 0, 3, "")] + [InlineData("\n\n\t\t \t", 2, 3, "")] + [InlineData(" ", 1, 0, "")] + [InlineData("", 0, 0, "")] + public void Trim_RemovesLeadingAndTrailingWhitespaces(string value, int start, int length, string expected) + { + // Arrange + var segment = new StringSegment(value, start, length); + + // Act + var actual = segment.Trim(); + + // Assert + Assert.Equal(expected, actual.Value); + } + + [Theory] + [InlineData(" value", 0, 8, "value")] + [InlineData("value ", 0, 8, "value ")] + [InlineData("\t\tvalue", 0, 7, "value")] + [InlineData("value\t\t", 0, 7, "value\t\t")] + [InlineData("\t\tvalue \t a", 1, 8, "value \t")] + [InlineData(" a ", 0, 9, "a ")] + [InlineData("value\t value value ", 2, 13, "lue\t value v")] + [InlineData("\x0009value \x0085", 0, 8, "value \x0085")] + [InlineData(" \f\t\u000B\u2028Hello \u2029\n\t ", 1, 13, "Hello \u2029\n\t")] + [InlineData(" ", 1, 2, "")] + [InlineData("\t\t\t", 0, 3, "")] + [InlineData("\n\n\t\t \t", 2, 3, "")] + [InlineData(" ", 1, 0, "")] + [InlineData("", 0, 0, "")] + public void TrimStart_RemovesLeadingWhitespaces(string value, int start, int length, string expected) + { + // Arrange + var segment = new StringSegment(value, start, length); + + // Act + var actual = segment.TrimStart(); + + // Assert + Assert.Equal(expected, actual.Value); + } + + [Theory] + [InlineData(" value", 0, 8, " value")] + [InlineData("value ", 0, 8, "value")] + [InlineData("\t\tvalue", 0, 7, "\t\tvalue")] + [InlineData("value\t\t", 0, 7, "value")] + [InlineData("\t\tvalue \t a", 1, 8, "\tvalue")] + [InlineData(" a ", 0, 9, " a")] + [InlineData("value\t value value ", 2, 13, "lue\t value v")] + [InlineData("\x0009value \x0085", 0, 8, "\x0009value")] + [InlineData(" \f\t\u000B\u2028Hello \u2029\n\t ", 1, 13, "\f\t\u000B\u2028Hello")] + [InlineData(" ", 1, 2, "")] + [InlineData("\t\t\t", 0, 3, "")] + [InlineData("\n\n\t\t \t", 2, 3, "")] + [InlineData(" ", 1, 0, "")] + [InlineData("", 0, 0, "")] + public void TrimEnd_RemovesTrailingWhitespaces(string value, int start, int length, string expected) + { + // Arrange + var segment = new StringSegment(value, start, length); + + // Act + var actual = segment.TrimEnd(); + + // Assert + Assert.Equal(expected, actual.Value); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/StringTokenizerTest.cs b/src/libraries/Microsoft.Extensions.Primitives/tests/StringTokenizerTest.cs new file mode 100644 index 00000000000000..b3b9ebc33c6d67 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/StringTokenizerTest.cs @@ -0,0 +1,79 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Linq; +using Xunit; + +namespace Microsoft.Extensions.Primitives +{ + public class StringTokenizerTest + { + [Fact] + public void TokenizerReturnsEmptySequenceForNullValues() + { + // Arrange + var stringTokenizer = new StringTokenizer(); + var enumerator = stringTokenizer.GetEnumerator(); + + // Act + var next = enumerator.MoveNext(); + + // Assert + Assert.False(next); + } + + [Theory] + [InlineData("", new[] { "" })] + [InlineData("a", new[] { "a" })] + [InlineData("abc", new[] { "abc" })] + [InlineData("a,b", new[] { "a", "b" })] + [InlineData("a,,b", new[] { "a", "", "b" })] + [InlineData(",a,b", new[] { "", "a", "b" })] + [InlineData(",,a,b", new[] { "", "", "a", "b" })] + [InlineData("a,b,", new[] { "a", "b", "" })] + [InlineData("a,b,,", new[] { "a", "b", "", "" })] + [InlineData("ab,cde,efgh", new[] { "ab", "cde", "efgh" })] + public void Tokenizer_ReturnsSequenceOfValues(string value, string[] expected) + { + // Arrange + var tokenizer = new StringTokenizer(value, new [] { ',' }); + + // Act + var result = tokenizer.Select(t => t.Value).ToArray(); + + // Assert + Assert.Equal(expected, result); + } + + [Theory] + [InlineData("", new[] { "" })] + [InlineData("a", new[] { "a" })] + [InlineData("abc", new[] { "abc" })] + [InlineData("a.b", new[] { "a", "b" })] + [InlineData("a,b", new[] { "a", "b" })] + [InlineData("a.b,c", new[] { "a", "b", "c" })] + [InlineData("a,b.c", new[] { "a", "b", "c" })] + [InlineData("ab.cd,ef", new[] { "ab", "cd", "ef" })] + [InlineData("ab,cd.ef", new[] { "ab", "cd", "ef" })] + [InlineData(",a.b", new[] { "", "a", "b" })] + [InlineData(".a,b", new[] { "", "a", "b" })] + [InlineData(".,a.b", new[] { "", "", "a", "b" })] + [InlineData(",.a,b", new[] { "", "", "a", "b" })] + [InlineData("a.b,", new[] { "a", "b", "" })] + [InlineData("a,b.", new[] { "a", "b", "" })] + [InlineData("a.b,.", new[] { "a", "b", "", "" })] + [InlineData("a,b.,", new[] { "a", "b", "", "" })] + public void Tokenizer_SupportsMultipleSeparators(string value, string[] expected) + { + // Arrange + var tokenizer = new StringTokenizer(value, new[] { '.', ',' }); + + // Act + var result = tokenizer.Select(t => t.Value).ToArray(); + + // Assert + Assert.Equal(expected, result); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/StringValuesTests.cs b/src/libraries/Microsoft.Extensions.Primitives/tests/StringValuesTests.cs new file mode 100644 index 00000000000000..505d6259daca4b --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/StringValuesTests.cs @@ -0,0 +1,564 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Xunit; + +namespace Microsoft.Extensions.Primitives +{ + public class StringValuesTests + { + public static TheoryData DefaultOrNullStringValues + { + get + { + return new TheoryData + { + new StringValues(), + new StringValues((string)null), + new StringValues((string[])null), + (string)null, + (string[])null + }; + } + } + + public static TheoryData EmptyStringValues + { + get + { + return new TheoryData + { + StringValues.Empty, + new StringValues(new string[0]), + new string[0] + }; + } + } + + public static TheoryData FilledStringValues + { + get + { + return new TheoryData + { + new StringValues("abc"), + new StringValues(new[] { "abc" }), + new StringValues(new[] { "abc", "bcd" }), + new StringValues(new[] { "abc", "bcd", "foo" }), + "abc", + new[] { "abc" }, + new[] { "abc", "bcd" }, + new[] { "abc", "bcd", "foo" } + }; + } + } + + public static TheoryData FilledStringValuesWithExpectedStrings + { + get + { + return new TheoryData + { + { default(StringValues), (string)null }, + { StringValues.Empty, (string)null }, + { new StringValues(new string[] { }), (string)null }, + { new StringValues(string.Empty), string.Empty }, + { new StringValues(new string[] { string.Empty }), string.Empty }, + { new StringValues("abc"), "abc" } + }; + } + } + + public static TheoryData FilledStringValuesWithExpectedObjects + { + get + { + return new TheoryData + { + { default(StringValues), (object)null }, + { StringValues.Empty, (object)null }, + { new StringValues(new string[] { }), (object)null }, + { new StringValues("abc"), (object)"abc" }, + { new StringValues("abc"), (object)new[] { "abc" } }, + { new StringValues(new[] { "abc" }), (object)new[] { "abc" } }, + { new StringValues(new[] { "abc", "bcd" }), (object)new[] { "abc", "bcd" } } + }; + } + } + + public static TheoryData FilledStringValuesWithExpected + { + get + { + return new TheoryData + { + { default(StringValues), new string[0] }, + { StringValues.Empty, new string[0] }, + { new StringValues(string.Empty), new[] { string.Empty } }, + { new StringValues("abc"), new[] { "abc" } }, + { new StringValues(new[] { "abc" }), new[] { "abc" } }, + { new StringValues(new[] { "abc", "bcd" }), new[] { "abc", "bcd" } }, + { new StringValues(new[] { "abc", "bcd", "foo" }), new[] { "abc", "bcd", "foo" } }, + { string.Empty, new[] { string.Empty } }, + { "abc", new[] { "abc" } }, + { new[] { "abc" }, new[] { "abc" } }, + { new[] { "abc", "bcd" }, new[] { "abc", "bcd" } }, + { new[] { "abc", "bcd", "foo" }, new[] { "abc", "bcd", "foo" } }, + { new[] { null, "abc", "bcd", "foo" }, new[] { null, "abc", "bcd", "foo" } }, + { new[] { "abc", null, "bcd", "foo" }, new[] { "abc", null, "bcd", "foo" } }, + { new[] { "abc", "bcd", "foo", null }, new[] { "abc", "bcd", "foo", null } }, + { new[] { string.Empty, "abc", "bcd", "foo" }, new[] { string.Empty, "abc", "bcd", "foo" } }, + { new[] { "abc", string.Empty, "bcd", "foo" }, new[] { "abc", string.Empty, "bcd", "foo" } }, + { new[] { "abc", "bcd", "foo", string.Empty }, new[] { "abc", "bcd", "foo", string.Empty } } + }; + } + } + + public static TheoryData FilledStringValuesToStringToExpected + { + get + { + return new TheoryData + { + { default(StringValues), string.Empty }, + { StringValues.Empty, string.Empty }, + { new StringValues(string.Empty), string.Empty }, + { new StringValues("abc"), "abc" }, + { new StringValues(new[] { "abc" }), "abc" }, + { new StringValues(new[] { "abc", "bcd" }), "abc,bcd" }, + { new StringValues(new[] { "abc", "bcd", "foo" }), "abc,bcd,foo" }, + { string.Empty, string.Empty }, + { (string)null, string.Empty }, + { "abc","abc" }, + { new[] { "abc" }, "abc" }, + { new[] { "abc", "bcd" }, "abc,bcd" }, + { new[] { "abc", null, "bcd" }, "abc,bcd" }, + { new[] { "abc", string.Empty, "bcd" }, "abc,bcd" }, + { new[] { "abc", "bcd", "foo" }, "abc,bcd,foo" }, + { new[] { null, "abc", "bcd", "foo" }, "abc,bcd,foo" }, + { new[] { "abc", null, "bcd", "foo" }, "abc,bcd,foo" }, + { new[] { "abc", "bcd", "foo", null }, "abc,bcd,foo" }, + { new[] { string.Empty, "abc", "bcd", "foo" }, "abc,bcd,foo" }, + { new[] { "abc", string.Empty, "bcd", "foo" }, "abc,bcd,foo" }, + { new[] { "abc", "bcd", "foo", string.Empty }, "abc,bcd,foo" }, + { new[] { "abc", "bcd", "foo", string.Empty, null }, "abc,bcd,foo" } + }; + } + } + + [Theory] + [MemberData(nameof(DefaultOrNullStringValues))] + [MemberData(nameof(EmptyStringValues))] + [MemberData(nameof(FilledStringValues))] + public void IsReadOnly_True(StringValues stringValues) + { + Assert.True(((IList)stringValues).IsReadOnly); + Assert.Throws(() => ((IList)stringValues)[0] = string.Empty); + Assert.Throws(() => ((ICollection)stringValues).Add(string.Empty)); + Assert.Throws(() => ((IList)stringValues).Insert(0, string.Empty)); + Assert.Throws(() => ((ICollection)stringValues).Remove(string.Empty)); + Assert.Throws(() => ((IList)stringValues).RemoveAt(0)); + Assert.Throws(() => ((ICollection)stringValues).Clear()); + } + + [Theory] + [MemberData(nameof(DefaultOrNullStringValues))] + public void DefaultOrNull_ExpectedValues(StringValues stringValues) + { + Assert.Null((string[])stringValues); + } + + [Theory] + [MemberData(nameof(DefaultOrNullStringValues))] + [MemberData(nameof(EmptyStringValues))] + public void DefaultNullOrEmpty_ExpectedValues(StringValues stringValues) + { + Assert.Empty(stringValues); + Assert.Null((string)stringValues); + Assert.Equal((string)null, stringValues); + Assert.Equal(string.Empty, stringValues.ToString()); + Assert.Equal(new string[0], stringValues.ToArray()); + + Assert.True(StringValues.IsNullOrEmpty(stringValues)); + Assert.Throws(() => stringValues[0]); + Assert.Throws(() => ((IList)stringValues)[0]); + Assert.Equal(string.Empty, stringValues.ToString()); + Assert.Equal(-1, ((IList)stringValues).IndexOf(null)); + Assert.Equal(-1, ((IList)stringValues).IndexOf(string.Empty)); + Assert.Equal(-1, ((IList)stringValues).IndexOf("not there")); + Assert.False(((ICollection)stringValues).Contains(null)); + Assert.False(((ICollection)stringValues).Contains(string.Empty)); + Assert.False(((ICollection)stringValues).Contains("not there")); + Assert.Empty(stringValues); + } + + [Theory] + [MemberData(nameof(FilledStringValuesToStringToExpected))] + public void ToString_ExpectedValues(StringValues stringValues, string expected) + { + Assert.Equal(stringValues.ToString(), expected); + } + + [Fact] + public void ImplicitStringConverter_Works() + { + string nullString = null; + StringValues stringValues = nullString; + Assert.Empty(stringValues); + Assert.Null((string)stringValues); + Assert.Null((string[])stringValues); + + string aString = "abc"; + stringValues = aString; + Assert.Single(stringValues); + Assert.Equal(aString, stringValues); + Assert.Equal(aString, stringValues[0]); + Assert.Equal(aString, ((IList)stringValues)[0]); + Assert.Equal(new string[] { aString }, stringValues); + } + + [Fact] + public void GetHashCode_SingleValueVsArrayWithOneItem_SameHashCode() + { + var sv1 = new StringValues("value"); + var sv2 = new StringValues(new[] { "value" }); + Assert.Equal(sv1, sv2); + Assert.Equal(sv1.GetHashCode(), sv2.GetHashCode()); + } + + [Fact] + public void GetHashCode_NullCases_DifferentHashCodes() + { + var sv1 = new StringValues((string)null); + var sv2 = new StringValues(new[] { (string)null }); + Assert.NotEqual(sv1, sv2); + Assert.NotEqual(sv1.GetHashCode(), sv2.GetHashCode()); + + var sv3 = new StringValues((string[])null); + Assert.Equal(sv1, sv3); + Assert.Equal(sv1.GetHashCode(), sv3.GetHashCode()); + } + + [Fact] + public void GetHashCode_SingleValueVsArrayWithTwoItems_DifferentHashCodes() + { + var sv1 = new StringValues("value"); + var sv2 = new StringValues(new[] { "value", "value" }); + Assert.NotEqual(sv1, sv2); + Assert.NotEqual(sv1.GetHashCode(), sv2.GetHashCode()); + } + + [Fact] + public void ImplicitStringArrayConverter_Works() + { + string[] nullStringArray = null; + StringValues stringValues = nullStringArray; + Assert.Empty(stringValues); + Assert.Null((string)stringValues); + Assert.Null((string[])stringValues); + + string aString = "abc"; + string[] aStringArray = new[] { aString }; + stringValues = aStringArray; + Assert.Single(stringValues); + Assert.Equal(aString, stringValues); + Assert.Equal(aString, stringValues[0]); + Assert.Equal(aString, ((IList)stringValues)[0]); + Assert.Equal(aStringArray, stringValues); + + aString = "abc"; + string bString = "bcd"; + aStringArray = new[] { aString, bString }; + stringValues = aStringArray; + Assert.Equal(2, stringValues.Count); + Assert.Equal("abc,bcd", stringValues); + Assert.Equal(aStringArray, stringValues); + } + + [Theory] + [MemberData(nameof(DefaultOrNullStringValues))] + [MemberData(nameof(EmptyStringValues))] + public void DefaultNullOrEmpty_Enumerator(StringValues stringValues) + { + var e = stringValues.GetEnumerator(); + Assert.Null(e.Current); + Assert.False(e.MoveNext()); + Assert.Null(e.Current); + Assert.False(e.MoveNext()); + Assert.False(e.MoveNext()); + Assert.False(e.MoveNext()); + + var e1 = ((IEnumerable)stringValues).GetEnumerator(); + Assert.Null(e1.Current); + Assert.False(e1.MoveNext()); + Assert.Null(e1.Current); + Assert.False(e1.MoveNext()); + Assert.False(e1.MoveNext()); + Assert.False(e1.MoveNext()); + + var e2 = ((IEnumerable)stringValues).GetEnumerator(); + Assert.Null(e2.Current); + Assert.False(e2.MoveNext()); + Assert.Null(e2.Current); + Assert.False(e2.MoveNext()); + Assert.False(e2.MoveNext()); + Assert.False(e2.MoveNext()); + } + + [Theory] + [MemberData(nameof(FilledStringValuesWithExpected))] + public void Enumerator(StringValues stringValues, string[] expected) + { + var e = stringValues.GetEnumerator(); + for (int i = 0; i < expected.Length; i++) + { + Assert.True(e.MoveNext()); + Assert.Equal(expected[i], e.Current); + } + Assert.False(e.MoveNext()); + Assert.False(e.MoveNext()); + Assert.False(e.MoveNext()); + + var e1 = ((IEnumerable)stringValues).GetEnumerator(); + for (int i = 0; i < expected.Length; i++) + { + Assert.True(e1.MoveNext()); + Assert.Equal(expected[i], e1.Current); + } + Assert.False(e1.MoveNext()); + Assert.False(e1.MoveNext()); + Assert.False(e1.MoveNext()); + + var e2 = ((IEnumerable)stringValues).GetEnumerator(); + for (int i = 0; i < expected.Length; i++) + { + Assert.True(e2.MoveNext()); + Assert.Equal(expected[i], e2.Current); + } + Assert.False(e2.MoveNext()); + Assert.False(e2.MoveNext()); + Assert.False(e2.MoveNext()); + } + + [Theory] + [MemberData(nameof(FilledStringValuesWithExpected))] + public void IndexOf(StringValues stringValues, string[] expected) + { + IList list = stringValues; + Assert.Equal(-1, list.IndexOf("not there")); + for (int i = 0; i < expected.Length; i++) + { + Assert.Equal(i, list.IndexOf(expected[i])); + } + } + + [Theory] + [MemberData(nameof(FilledStringValuesWithExpected))] + public void Contains(StringValues stringValues, string[] expected) + { + ICollection collection = stringValues; + Assert.False(collection.Contains("not there")); + for (int i = 0; i < expected.Length; i++) + { + Assert.True(collection.Contains(expected[i])); + } + } + + [Theory] + [MemberData(nameof(DefaultOrNullStringValues))] + [MemberData(nameof(EmptyStringValues))] + [MemberData(nameof(FilledStringValues))] + public void CopyTo_TooSmall(StringValues stringValues) + { + ICollection collection = stringValues; + string[] tooSmall = new string[0]; + + if (collection.Count > 0) + { + Assert.Throws(() => collection.CopyTo(tooSmall, 0)); + } + } + + [Theory] + [MemberData(nameof(FilledStringValuesWithExpected))] + public void CopyTo_CorrectSize(StringValues stringValues, string[] expected) + { + ICollection collection = stringValues; + string[] actual = new string[expected.Length]; + + if (collection.Count > 0) + { + Assert.Throws(() => collection.CopyTo(actual, -1)); + Assert.Throws(() => collection.CopyTo(actual, actual.Length + 1)); + } + collection.CopyTo(actual, 0); + Assert.Equal(expected, actual); + } + + [Theory] + [MemberData(nameof(DefaultOrNullStringValues))] + [MemberData(nameof(EmptyStringValues))] + public void DefaultNullOrEmpty_Concat(StringValues stringValues) + { + string[] expected = new[] { "abc", "bcd", "foo" }; + StringValues expectedStringValues = new StringValues(expected); + Assert.Equal(expected, StringValues.Concat(stringValues, expectedStringValues)); + Assert.Equal(expected, StringValues.Concat(expectedStringValues, stringValues)); + Assert.Equal(expected, StringValues.Concat((string)null, in expectedStringValues)); + Assert.Equal(expected, StringValues.Concat(in expectedStringValues, (string)null)); + + string[] empty = new string[0]; + StringValues emptyStringValues = new StringValues(empty); + Assert.Equal(empty, StringValues.Concat(stringValues, StringValues.Empty)); + Assert.Equal(empty, StringValues.Concat(StringValues.Empty, stringValues)); + Assert.Equal(empty, StringValues.Concat(stringValues, new StringValues())); + Assert.Equal(empty, StringValues.Concat(new StringValues(), stringValues)); + Assert.Equal(empty, StringValues.Concat((string)null, in emptyStringValues)); + Assert.Equal(empty, StringValues.Concat(in emptyStringValues, (string)null)); + } + + [Theory] + [MemberData(nameof(FilledStringValuesWithExpected))] + public void Concat(StringValues stringValues, string[] array) + { + string[] filled = new[] { "abc", "bcd", "foo" }; + + string[] expectedPrepended = array.Concat(filled).ToArray(); + Assert.Equal(expectedPrepended, StringValues.Concat(stringValues, new StringValues(filled))); + + string[] expectedAppended = filled.Concat(array).ToArray(); + Assert.Equal(expectedAppended, StringValues.Concat(new StringValues(filled), stringValues)); + + StringValues values = stringValues; + foreach (string s in filled) + { + values = StringValues.Concat(in values, s); + } + Assert.Equal(expectedPrepended, values); + + values = stringValues; + foreach (string s in filled.Reverse()) + { + values = StringValues.Concat(s, in values); + } + Assert.Equal(expectedAppended, values); + } + + [Fact] + public void Equals_OperatorEqual() + { + var equalString = "abc"; + + var equalStringArray = new string[] { equalString }; + var equalStringValues = new StringValues(equalString); + var otherStringValues = new StringValues(equalString); + var stringArray = new string[] { equalString, equalString }; + var stringValuesArray = new StringValues(stringArray); + + Assert.True(equalStringValues == otherStringValues); + + Assert.True(equalStringValues == equalString); + Assert.True(equalString == equalStringValues); + + Assert.True(equalStringValues == equalStringArray); + Assert.True(equalStringArray == equalStringValues); + + Assert.True(stringArray == stringValuesArray); + Assert.True(stringValuesArray == stringArray); + + Assert.False(stringValuesArray == equalString); + Assert.False(stringValuesArray == equalStringArray); + Assert.False(stringValuesArray == equalStringValues); + } + + [Fact] + public void Equals_OperatorNotEqual() + { + var equalString = "abc"; + + var equalStringArray = new string[] { equalString }; + var equalStringValues = new StringValues(equalString); + var otherStringValues = new StringValues(equalString); + var stringArray = new string[] { equalString, equalString }; + var stringValuesArray = new StringValues(stringArray); + + Assert.False(equalStringValues != otherStringValues); + + Assert.False(equalStringValues != equalString); + Assert.False(equalString != equalStringValues); + + Assert.False(equalStringValues != equalStringArray); + Assert.False(equalStringArray != equalStringValues); + + Assert.False(stringArray != stringValuesArray); + Assert.False(stringValuesArray != stringArray); + + Assert.True(stringValuesArray != equalString); + Assert.True(stringValuesArray != equalStringArray); + Assert.True(stringValuesArray != equalStringValues); + } + + [Fact] + public void Equals_Instance() + { + var equalString = "abc"; + + var equalStringArray = new string[] { equalString }; + var equalStringValues = new StringValues(equalString); + var stringArray = new string[] { equalString, equalString }; + var stringValuesArray = new StringValues(stringArray); + + Assert.True(equalStringValues.Equals(equalStringValues)); + Assert.True(equalStringValues.Equals(equalString)); + Assert.True(equalStringValues.Equals(equalStringArray)); + Assert.True(stringValuesArray.Equals(stringArray)); + } + + [Theory] + [MemberData(nameof(FilledStringValuesWithExpectedObjects))] + public void Equals_ObjectEquals(StringValues stringValues, object obj) + { + Assert.True(stringValues == obj); + Assert.True(obj == stringValues); + } + + [Theory] + [MemberData(nameof(FilledStringValuesWithExpectedObjects))] + public void Equals_ObjectNotEquals(StringValues stringValues, object obj) + { + Assert.False(stringValues != obj); + Assert.False(obj != stringValues); + } + + [Theory] + [MemberData(nameof(FilledStringValuesWithExpectedStrings))] + public void Equals_String(StringValues stringValues, string expected) + { + var notEqual = new StringValues("bcd"); + + Assert.True(StringValues.Equals(stringValues, expected)); + Assert.False(StringValues.Equals(stringValues, notEqual)); + + Assert.True(StringValues.Equals(stringValues, new StringValues(expected))); + Assert.Equal(stringValues.GetHashCode(), new StringValues(expected).GetHashCode()); + } + + [Theory] + [MemberData(nameof(FilledStringValuesWithExpected))] + public void Equals_StringArray(StringValues stringValues, string[] expected) + { + var notEqual = new StringValues(new[] { "bcd", "abc" }); + + Assert.True(StringValues.Equals(stringValues, expected)); + Assert.False(StringValues.Equals(stringValues, notEqual)); + + Assert.True(StringValues.Equals(stringValues, new StringValues(expected))); + Assert.Equal(stringValues.GetHashCode(), new StringValues(expected).GetHashCode()); + } + } +} diff --git a/src/libraries/Microsoft.VisualBasic.Core/Microsoft.VisualBasic.Core.sln b/src/libraries/Microsoft.VisualBasic.Core/Microsoft.VisualBasic.Core.sln index 3789622317c4ad..3ba03e849e01df 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/Microsoft.VisualBasic.Core.sln +++ b/src/libraries/Microsoft.VisualBasic.Core/Microsoft.VisualBasic.Core.sln @@ -30,6 +30,10 @@ Global {325260D6-D5DD-4E06-9DA2-9AF2AD9DE8C8}.Debug|Any CPU.Build.0 = Debug|Any CPU {325260D6-D5DD-4E06-9DA2-9AF2AD9DE8C8}.Release|Any CPU.ActiveCfg = Release|Any CPU {325260D6-D5DD-4E06-9DA2-9AF2AD9DE8C8}.Release|Any CPU.Build.0 = Release|Any CPU + {A32671B6-5470-4F9C-9CD8-4094B9AB0799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A32671B6-5470-4F9C-9CD8-4094B9AB0799}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A32671B6-5470-4F9C-9CD8-4094B9AB0799}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A32671B6-5470-4F9C-9CD8-4094B9AB0799}.Release|Any CPU.Build.0 = Release|Any CPU {82A4357C-0A9F-4970-AAEA-216A73D8A73E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {82A4357C-0A9F-4970-AAEA-216A73D8A73E}.Debug|Any CPU.Build.0 = Debug|Any CPU {82A4357C-0A9F-4970-AAEA-216A73D8A73E}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs index d1da2fc713f323..383da32ebed057 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs @@ -2,9 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ +using System.Diagnostics.CodeAnalysis; + namespace Microsoft.VisualBasic { public enum AppWinStyle : short @@ -27,17 +29,17 @@ public sealed partial class Collection : System.Collections.ICollection, System. { public Collection() { } public int Count { get { throw null; } } - public object this[int Index] { get { throw null; } } + public object? this[int Index] { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public object this[object Index] { get { throw null; } } - public object this[string Key] { get { throw null; } } + public object? this[object Index] { get { throw null; } } + public object? this[string Key] { get { throw null; } } int System.Collections.ICollection.Count { get { throw null; } } bool System.Collections.ICollection.IsSynchronized { get { throw null; } } object System.Collections.ICollection.SyncRoot { get { throw null; } } bool System.Collections.IList.IsFixedSize { get { throw null; } } bool System.Collections.IList.IsReadOnly { get { throw null; } } - object System.Collections.IList.this[int index] { get { throw null; } set { } } - public void Add(object Item, string Key = null, object Before = null, object After = null) { } + object? System.Collections.IList.this[int index] { get { throw null; } set { } } + public void Add(object? Item, string? Key = null, object? Before = null, object? After = null) { } public void Clear() { } public bool Contains(string Key) { throw null; } public System.Collections.IEnumerator GetEnumerator() { throw null; } @@ -45,24 +47,24 @@ public void Remove(int Index) { } public void Remove(string Key) { } void System.Collections.ICollection.CopyTo(System.Array array, int index) { } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - int System.Collections.IList.Add(object value) { throw null; } + int System.Collections.IList.Add(object? value) { throw null; } void System.Collections.IList.Clear() { } - bool System.Collections.IList.Contains(object value) { throw null; } - int System.Collections.IList.IndexOf(object value) { throw null; } - void System.Collections.IList.Insert(int index, object value) { } - void System.Collections.IList.Remove(object value) { } + bool System.Collections.IList.Contains(object? value) { throw null; } + int System.Collections.IList.IndexOf(object? value) { throw null; } + void System.Collections.IList.Insert(int index, object? value) { } + void System.Collections.IList.Remove(object? value) { } void System.Collections.IList.RemoveAt(int index) { } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=false, AllowMultiple=false)] public sealed partial class ComClassAttribute : System.Attribute { public ComClassAttribute() { } - public ComClassAttribute(string _ClassID) { } - public ComClassAttribute(string _ClassID, string _InterfaceID) { } - public ComClassAttribute(string _ClassID, string _InterfaceID, string _EventId) { } - public string ClassID { get { throw null; } } - public string EventID { get { throw null; } } - public string InterfaceID { get { throw null; } } + public ComClassAttribute(string? _ClassID) { } + public ComClassAttribute(string? _ClassID, string? _InterfaceID) { } + public ComClassAttribute(string? _ClassID, string? _InterfaceID, string? _EventId) { } + public string? ClassID { get { throw null; } } + public string? EventID { get { throw null; } } + public string? InterfaceID { get { throw null; } } public bool InterfaceShadows { get { throw null; } set { } } } public enum CompareMethod @@ -137,7 +139,7 @@ internal Constants() { } public const Microsoft.VisualBasic.AppWinStyle vbNormalNoFocus = Microsoft.VisualBasic.AppWinStyle.NormalNoFocus; public const Microsoft.VisualBasic.VariantType vbNull = Microsoft.VisualBasic.VariantType.Null; public const string vbNullChar = "\0"; - public const string vbNullString = null; + public const string? vbNullString = null; public const Microsoft.VisualBasic.VariantType vbObject = Microsoft.VisualBasic.VariantType.Object; public const int vbObjectError = -2147221504; public const Microsoft.VisualBasic.MsgBoxResult vbOK = Microsoft.VisualBasic.MsgBoxResult.Ok; @@ -196,8 +198,8 @@ public ControlChars() { } public sealed partial class Conversion { internal Conversion() { } - public static object CTypeDynamic(object Expression, System.Type TargetType) { throw null; } - public static TargetType CTypeDynamic(object Expression) { throw null; } + public static object CTypeDynamic(object? Expression, System.Type TargetType) { throw null; } + public static TargetType CTypeDynamic(object? Expression) { throw null; } public static string ErrorToString() { throw null; } public static string ErrorToString(int ErrorNumber) { throw null; } public static decimal Fix(decimal Number) { throw null; } @@ -242,8 +244,8 @@ internal Conversion() { } public static string Oct(ulong Number) { throw null; } public static string Str(object Number) { throw null; } public static int Val(char Expression) { throw null; } - public static double Val(object Expression) { throw null; } - public static double Val(string InputStr) { throw null; } + public static double Val(object? Expression) { throw null; } + public static double Val(string? InputStr) { throw null; } } [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] public sealed partial class DateAndTime @@ -256,11 +258,11 @@ internal DateAndTime() { } public static string TimeString { get { throw null; } set { } } public static System.DateTime Today { get { throw null; } set { } } public static System.DateTime DateAdd(Microsoft.VisualBasic.DateInterval Interval, double Number, System.DateTime DateValue) { throw null; } - public static System.DateTime DateAdd(string Interval, double Number, object DateValue) { throw null; } + public static System.DateTime DateAdd(string Interval, double Number, object? DateValue) { throw null; } public static long DateDiff(Microsoft.VisualBasic.DateInterval Interval, System.DateTime Date1, System.DateTime Date2, Microsoft.VisualBasic.FirstDayOfWeek DayOfWeek = Microsoft.VisualBasic.FirstDayOfWeek.Sunday, Microsoft.VisualBasic.FirstWeekOfYear WeekOfYear = Microsoft.VisualBasic.FirstWeekOfYear.Jan1) { throw null; } - public static long DateDiff(string Interval, object Date1, object Date2, Microsoft.VisualBasic.FirstDayOfWeek DayOfWeek = Microsoft.VisualBasic.FirstDayOfWeek.Sunday, Microsoft.VisualBasic.FirstWeekOfYear WeekOfYear = Microsoft.VisualBasic.FirstWeekOfYear.Jan1) { throw null; } + public static long DateDiff(string Interval, object? Date1, object? Date2, Microsoft.VisualBasic.FirstDayOfWeek DayOfWeek = Microsoft.VisualBasic.FirstDayOfWeek.Sunday, Microsoft.VisualBasic.FirstWeekOfYear WeekOfYear = Microsoft.VisualBasic.FirstWeekOfYear.Jan1) { throw null; } public static int DatePart(Microsoft.VisualBasic.DateInterval Interval, System.DateTime DateValue, Microsoft.VisualBasic.FirstDayOfWeek FirstDayOfWeekValue = Microsoft.VisualBasic.FirstDayOfWeek.Sunday, Microsoft.VisualBasic.FirstWeekOfYear FirstWeekOfYearValue = Microsoft.VisualBasic.FirstWeekOfYear.Jan1) { throw null; } - public static int DatePart(string Interval, object DateValue, Microsoft.VisualBasic.FirstDayOfWeek DayOfWeek = Microsoft.VisualBasic.FirstDayOfWeek.Sunday, Microsoft.VisualBasic.FirstWeekOfYear WeekOfYear = Microsoft.VisualBasic.FirstWeekOfYear.Jan1) { throw null; } + public static int DatePart(string Interval, object? DateValue, Microsoft.VisualBasic.FirstDayOfWeek DayOfWeek = Microsoft.VisualBasic.FirstDayOfWeek.Sunday, Microsoft.VisualBasic.FirstWeekOfYear WeekOfYear = Microsoft.VisualBasic.FirstWeekOfYear.Jan1) { throw null; } public static System.DateTime DateSerial(int Year, int Month, int Day) { throw null; } public static System.DateTime DateValue(string StringDate) { throw null; } public static int Day(System.DateTime DateValue) { throw null; } @@ -312,8 +314,8 @@ internal ErrObject() { } public int Number { get { throw null; } set { } } public string Source { get { throw null; } set { } } public void Clear() { } - public System.Exception GetException() { throw null; } - public void Raise(int Number, object Source = null, object Description = null, object HelpFile = null, object HelpContext = null) { } + public System.Exception? GetException() { throw null; } + public void Raise(int Number, object? Source = null, object? Description = null, object? HelpFile = null, object? HelpContext = null) { } } [System.FlagsAttribute] public enum FileAttribute @@ -332,7 +334,7 @@ public sealed partial class FileSystem internal FileSystem() { } public static void ChDir(string Path) { } public static void ChDrive(char Drive) { } - public static void ChDrive(string Drive) { } + public static void ChDrive(string? Drive) { } public static string CurDir() { throw null; } public static string CurDir(char Drive) { throw null; } public static string Dir() { throw null; } @@ -463,21 +465,21 @@ public sealed partial class Information internal Information() { } public static int Erl() { throw null; } public static Microsoft.VisualBasic.ErrObject Err() { throw null; } - public static bool IsArray(object VarName) { throw null; } - public static bool IsDate(object Expression) { throw null; } - public static bool IsDBNull(object Expression) { throw null; } - public static bool IsError(object Expression) { throw null; } - public static bool IsNothing(object Expression) { throw null; } - public static bool IsNumeric(object Expression) { throw null; } - public static bool IsReference(object Expression) { throw null; } + public static bool IsArray(object? VarName) { throw null; } + public static bool IsDate(object? Expression) { throw null; } + public static bool IsDBNull(object? Expression) { throw null; } + public static bool IsError(object? Expression) { throw null; } + public static bool IsNothing(object? Expression) { throw null; } + public static bool IsNumeric(object? Expression) { throw null; } + public static bool IsReference(object? Expression) { throw null; } public static int LBound(System.Array Array, int Rank = 1) { throw null; } public static int QBColor(int Color) { throw null; } public static int RGB(int Red, int Green, int Blue) { throw null; } - public static string SystemTypeName(string VbName) { throw null; } - public static string TypeName(object VarName) { throw null; } + public static string? SystemTypeName(string? VbName) { throw null; } + public static string TypeName(object? VarName) { throw null; } public static int UBound(System.Array Array, int Rank = 1) { throw null; } - public static Microsoft.VisualBasic.VariantType VarType(object VarName) { throw null; } - public static string VbTypeName(string UrtName) { throw null; } + public static Microsoft.VisualBasic.VariantType VarType(object? VarName) { throw null; } + public static string? VbTypeName(string? UrtName) { throw null; } } [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] public sealed partial class Interaction @@ -486,23 +488,23 @@ internal Interaction() { } public static void AppActivate(int ProcessId) { } public static void AppActivate(string Title) { } public static void Beep() { } - public static object CallByName(object ObjectRef, string ProcName, Microsoft.VisualBasic.CallType UseCallType, params object[] Args) { throw null; } - public static object Choose(double Index, params object[] Choice) { throw null; } + public static object? CallByName(object? ObjectRef, string ProcName, Microsoft.VisualBasic.CallType UseCallType, params object?[] Args) { throw null; } + public static object? Choose(double Index, params object?[] Choice) { throw null; } public static string Command() { throw null; } - public static object CreateObject(string ProgId, string ServerName = "") { throw null; } - public static void DeleteSetting(string AppName, string Section = null, string Key = null) { } - public static string Environ(string Expression) { throw null; } + public static object CreateObject(string ProgId, string? ServerName = "") { throw null; } + public static void DeleteSetting(string AppName, string? Section = null, string? Key = null) { } + public static string Environ(string? Expression) { throw null; } public static string Environ(int Expression) { throw null; } - public static string[,] GetAllSettings(string AppName, string Section) { throw null; } - public static object GetObject(string PathName = null, string Class = null) { throw null; } - public static string GetSetting(string AppName, string Section, string Key, string Default = "") { throw null; } - public static object IIf(bool Expression, object TruePart, object FalsePart) { throw null; } + public static string[,]? GetAllSettings(string AppName, string Section) { throw null; } + public static object? GetObject(string? PathName = null, string? Class = null) { throw null; } + public static string? GetSetting(string AppName, string Section, string Key, string? Default = "") { throw null; } + public static object? IIf(bool Expression, object? TruePart, object? FalsePart) { throw null; } public static string InputBox(string Prompt, string Title = "", string DefaultResponse = "", int XPos = -1, int YPos = -1) { throw null; } - public static MsgBoxResult MsgBox(object Prompt, MsgBoxStyle Buttons = MsgBoxStyle.ApplicationModal, object Title = null) { throw null; } + public static MsgBoxResult MsgBox(object Prompt, MsgBoxStyle Buttons = MsgBoxStyle.ApplicationModal, object? Title = null) { throw null; } public static string Partition(long Number, long Start, long Stop, long Interval) { throw null; } public static void SaveSetting(string AppName, string Section, string Key, string Setting) { } public static int Shell(string PathName, AppWinStyle Style = AppWinStyle.MinimizedFocus, bool Wait = false, int Timeout = -1) { throw null; } - public static object Switch(params object[] VarExpr) { throw null; } + public static object? Switch(params object?[]? VarExpr) { throw null; } } public enum MsgBoxResult { @@ -585,22 +587,23 @@ internal Strings() { } public static int AscW(string String) { throw null; } public static char Chr(int CharCode) { throw null; } public static char ChrW(int CharCode) { throw null; } - public static string[] Filter(object[] Source, string Match, bool Include = true, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } - public static string[] Filter(string[] Source, string Match, bool Include = true, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } - public static string Format(object Expression, string Style = "") { throw null; } - public static string FormatCurrency(object Expression, int NumDigitsAfterDecimal = -1, Microsoft.VisualBasic.TriState IncludeLeadingDigit = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState GroupDigits = Microsoft.VisualBasic.TriState.UseDefault) { throw null; } + public static string[]? Filter(object?[] Source, string? Match, bool Include = true, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } + public static string[]? Filter(string?[] Source, string? Match, bool Include = true, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } + public static string Format(object? Expression, string? Style = "") { throw null; } + public static string FormatCurrency(object? Expression, int NumDigitsAfterDecimal = -1, Microsoft.VisualBasic.TriState IncludeLeadingDigit = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState GroupDigits = Microsoft.VisualBasic.TriState.UseDefault) { throw null; } public static string FormatDateTime(System.DateTime Expression, Microsoft.VisualBasic.DateFormat NamedFormat = Microsoft.VisualBasic.DateFormat.GeneralDate) { throw null; } - public static string FormatNumber(object Expression, int NumDigitsAfterDecimal = -1, Microsoft.VisualBasic.TriState IncludeLeadingDigit = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState GroupDigits = Microsoft.VisualBasic.TriState.UseDefault) { throw null; } - public static string FormatPercent(object Expression, int NumDigitsAfterDecimal = -1, Microsoft.VisualBasic.TriState IncludeLeadingDigit = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState GroupDigits = Microsoft.VisualBasic.TriState.UseDefault) { throw null; } + public static string FormatNumber(object? Expression, int NumDigitsAfterDecimal = -1, Microsoft.VisualBasic.TriState IncludeLeadingDigit = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState GroupDigits = Microsoft.VisualBasic.TriState.UseDefault) { throw null; } + public static string FormatPercent(object? Expression, int NumDigitsAfterDecimal = -1, Microsoft.VisualBasic.TriState IncludeLeadingDigit = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState GroupDigits = Microsoft.VisualBasic.TriState.UseDefault) { throw null; } public static char GetChar(string str, int Index) { throw null; } - public static int InStr(int StartPos, string String1, string String2, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } - public static int InStr(string String1, string String2, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } - public static int InStrRev(string StringCheck, string StringMatch, int Start = -1, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } - public static string Join(object[] SourceArray, string Delimiter = " ") { throw null; } - public static string Join(string[] SourceArray, string Delimiter = " ") { throw null; } + public static int InStr(int StartPos, string? String1, string? String2, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } + public static int InStr(string? String1, string? String2, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } + public static int InStrRev(string? StringCheck, string? StringMatch, int Start = -1, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } + public static string? Join(object?[] SourceArray, string? Delimiter = " ") { throw null; } + public static string? Join(string?[] SourceArray, string? Delimiter = " ") { throw null; } public static char LCase(char Value) { throw null; } - public static string LCase(string Value) { throw null; } - public static string Left(string str, int Length) { throw null; } + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("Value")] + public static string? LCase(string? Value) { throw null; } + public static string Left(string? str, int Length) { throw null; } public static int Len(bool Expression) { throw null; } public static int Len(byte Expression) { throw null; } public static int Len(char Expression) { throw null; } @@ -610,36 +613,36 @@ internal Strings() { } public static int Len(short Expression) { throw null; } public static int Len(int Expression) { throw null; } public static int Len(long Expression) { throw null; } - public static int Len(object Expression) { throw null; } + public static int Len(object? Expression) { throw null; } [System.CLSCompliantAttribute(false)] public static int Len(sbyte Expression) { throw null; } public static int Len(float Expression) { throw null; } - public static int Len(string Expression) { throw null; } + public static int Len(string? Expression) { throw null; } [System.CLSCompliantAttribute(false)] public static int Len(ushort Expression) { throw null; } [System.CLSCompliantAttribute(false)] public static int Len(uint Expression) { throw null; } [System.CLSCompliantAttribute(false)] public static int Len(ulong Expression) { throw null; } - public static string LSet(string Source, int Length) { throw null; } - public static string LTrim(string str) { throw null; } - public static string Mid(string str, int Start) { throw null; } - public static string Mid(string str, int Start, int Length) { throw null; } - public static string Replace(string Expression, string Find, string Replacement, int Start = 1, int Count = -1, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } - public static string Right(string str, int Length) { throw null; } - public static string RSet(string Source, int Length) { throw null; } - public static string RTrim(string str) { throw null; } + public static string LSet(string? Source, int Length) { throw null; } + public static string LTrim(string? str) { throw null; } + public static string? Mid(string? str, int Start) { throw null; } + public static string Mid(string? str, int Start, int Length) { throw null; } + public static string? Replace(string? Expression, string? Find, string? Replacement, int Start = 1, int Count = -1, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } + public static string Right(string? str, int Length) { throw null; } + public static string RSet(string? Source, int Length) { throw null; } + public static string RTrim(string? str) { throw null; } public static string Space(int Number) { throw null; } - public static string[] Split(string Expression, string Delimiter = " ", int Limit = -1, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } - public static int StrComp(string String1, string String2, Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } - public static string StrConv(string str, Microsoft.VisualBasic.VbStrConv Conversion, int LocaleID = 0) { throw null; } + public static string[] Split(string? Expression, string? Delimiter = " ", int Limit = -1, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } + public static int StrComp(string? String1, string? String2, Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } + public static string? StrConv(string? str, Microsoft.VisualBasic.VbStrConv Conversion, int LocaleID = 0) { throw null; } public static string StrDup(int Number, char Character) { throw null; } public static object StrDup(int Number, object Character) { throw null; } public static string StrDup(int Number, string Character) { throw null; } - public static string StrReverse(string Expression) { throw null; } - public static string Trim(string str) { throw null; } + public static string StrReverse(string? Expression) { throw null; } + public static string Trim(string? str) { throw null; } public static char UCase(char Value) { throw null; } - public static string UCase(string Value) { throw null; } + public static string UCase(string? Value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial struct TabInfo @@ -720,117 +723,119 @@ namespace Microsoft.VisualBasic.CompilerServices public sealed partial class BooleanType { internal BooleanType() { } - public static bool FromObject(object Value) { throw null; } - public static bool FromString(string Value) { throw null; } + public static bool FromObject(object? Value) { throw null; } + public static bool FromString(string? Value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class ByteType { internal ByteType() { } - public static byte FromObject(object Value) { throw null; } - public static byte FromString(string Value) { throw null; } + public static byte FromObject(object? Value) { throw null; } + public static byte FromString(string? Value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class CharArrayType { internal CharArrayType() { } - public static char[] FromObject(object Value) { throw null; } - public static char[] FromString(string Value) { throw null; } + public static char[] FromObject(object? Value) { throw null; } + public static char[] FromString(string? Value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class CharType { internal CharType() { } - public static char FromObject(object Value) { throw null; } - public static char FromString(string Value) { throw null; } + public static char FromObject(object? Value) { throw null; } + public static char FromString(string? Value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class Conversions { internal Conversions() { } - public static object ChangeType(object Expression, System.Type TargetType) { throw null; } + public static object? ChangeType(object? Expression, System.Type TargetType) { throw null; } [System.ObsoleteAttribute("do not use this method", true)] public static object FallbackUserDefinedConversion(object Expression, System.Type TargetType) { throw null; } public static string FromCharAndCount(char Value, int Count) { throw null; } public static string FromCharArray(char[] Value) { throw null; } public static string FromCharArraySubset(char[] Value, int StartIndex, int Length) { throw null; } - public static bool ToBoolean(object Value) { throw null; } - public static bool ToBoolean(string Value) { throw null; } - public static byte ToByte(object Value) { throw null; } - public static byte ToByte(string Value) { throw null; } - public static char ToChar(object Value) { throw null; } - public static char ToChar(string Value) { throw null; } - public static char[] ToCharArrayRankOne(object Value) { throw null; } - public static char[] ToCharArrayRankOne(string Value) { throw null; } - public static System.DateTime ToDate(object Value) { throw null; } - public static System.DateTime ToDate(string Value) { throw null; } + public static bool ToBoolean(object? Value) { throw null; } + public static bool ToBoolean(string? Value) { throw null; } + public static byte ToByte(object? Value) { throw null; } + public static byte ToByte(string? Value) { throw null; } + public static char ToChar(object? Value) { throw null; } + public static char ToChar(string? Value) { throw null; } + public static char[] ToCharArrayRankOne(object? Value) { throw null; } + public static char[] ToCharArrayRankOne(string? Value) { throw null; } + public static System.DateTime ToDate(object? Value) { throw null; } + public static System.DateTime ToDate(string? Value) { throw null; } public static decimal ToDecimal(bool Value) { throw null; } - public static decimal ToDecimal(object Value) { throw null; } - public static decimal ToDecimal(string Value) { throw null; } - public static double ToDouble(object Value) { throw null; } - public static double ToDouble(string Value) { throw null; } - public static T ToGenericParameter(object Value) { throw null; } - public static int ToInteger(object Value) { throw null; } - public static int ToInteger(string Value) { throw null; } - public static long ToLong(object Value) { throw null; } - public static long ToLong(string Value) { throw null; } + public static decimal ToDecimal(object? Value) { throw null; } + public static decimal ToDecimal(string? Value) { throw null; } + public static double ToDouble(object? Value) { throw null; } + public static double ToDouble(string? Value) { throw null; } + [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("Value")] + public static T ToGenericParameter(object? Value) { throw null; } + public static int ToInteger(object? Value) { throw null; } + public static int ToInteger(string? Value) { throw null; } + public static long ToLong(object? Value) { throw null; } + public static long ToLong(string? Value) { throw null; } [System.CLSCompliantAttribute(false)] - public static sbyte ToSByte(object Value) { throw null; } + public static sbyte ToSByte(object? Value) { throw null; } [System.CLSCompliantAttribute(false)] - public static sbyte ToSByte(string Value) { throw null; } - public static short ToShort(object Value) { throw null; } - public static short ToShort(string Value) { throw null; } - public static float ToSingle(object Value) { throw null; } - public static float ToSingle(string Value) { throw null; } + public static sbyte ToSByte(string? Value) { throw null; } + public static short ToShort(object? Value) { throw null; } + public static short ToShort(string? Value) { throw null; } + public static float ToSingle(object? Value) { throw null; } + public static float ToSingle(string? Value) { throw null; } public static string ToString(bool Value) { throw null; } public static string ToString(byte Value) { throw null; } public static string ToString(char Value) { throw null; } public static string ToString(System.DateTime Value) { throw null; } public static string ToString(decimal Value) { throw null; } - public static string ToString(decimal Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } + public static string ToString(decimal Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } public static string ToString(double Value) { throw null; } - public static string ToString(double Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } + public static string ToString(double Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } public static string ToString(short Value) { throw null; } public static string ToString(int Value) { throw null; } public static string ToString(long Value) { throw null; } - public static string ToString(object Value) { throw null; } + public static string? ToString(object? Value) { throw null; } public static string ToString(float Value) { throw null; } - public static string ToString(float Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } + public static string ToString(float Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } [System.CLSCompliantAttribute(false)] public static string ToString(uint Value) { throw null; } [System.CLSCompliantAttribute(false)] public static string ToString(ulong Value) { throw null; } [System.CLSCompliantAttribute(false)] - public static uint ToUInteger(object Value) { throw null; } + public static uint ToUInteger(object? Value) { throw null; } [System.CLSCompliantAttribute(false)] - public static uint ToUInteger(string Value) { throw null; } + public static uint ToUInteger(string? Value) { throw null; } [System.CLSCompliantAttribute(false)] - public static ulong ToULong(object Value) { throw null; } + public static ulong ToULong(object? Value) { throw null; } [System.CLSCompliantAttribute(false)] - public static ulong ToULong(string Value) { throw null; } + public static ulong ToULong(string? Value) { throw null; } [System.CLSCompliantAttribute(false)] - public static ushort ToUShort(object Value) { throw null; } + public static ushort ToUShort(object? Value) { throw null; } [System.CLSCompliantAttribute(false)] - public static ushort ToUShort(string Value) { throw null; } + public static ushort ToUShort(string? Value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class DateType { internal DateType() { } - public static System.DateTime FromObject(object Value) { throw null; } - public static System.DateTime FromString(string Value) { throw null; } - public static System.DateTime FromString(string Value, System.Globalization.CultureInfo culture) { throw null; } + public static System.DateTime FromObject(object? Value) { throw null; } + public static System.DateTime FromString(string? Value) { throw null; } + public static System.DateTime FromString(string? Value, System.Globalization.CultureInfo? culture) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class DecimalType { internal DecimalType() { } public static decimal FromBoolean(bool Value) { throw null; } - public static decimal FromObject(object Value) { throw null; } - public static decimal FromObject(object Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } - public static decimal FromString(string Value) { throw null; } - public static decimal FromString(string Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } - public static decimal Parse(string Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } + public static decimal FromObject(object? Value) { throw null; } + public static decimal FromObject(object? Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } + public static decimal FromString(string? Value) { throw null; } + public static decimal FromString(string? Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } + public static decimal Parse(string Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -842,12 +847,12 @@ public DesignerGeneratedAttribute() { } public sealed partial class DoubleType { internal DoubleType() { } - public static double FromObject(object Value) { throw null; } - public static double FromObject(object Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } - public static double FromString(string Value) { throw null; } - public static double FromString(string Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } + public static double FromObject(object? Value) { throw null; } + public static double FromObject(object? Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } + public static double FromString(string? Value) { throw null; } + public static double FromString(string? Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } public static double Parse(string Value) { throw null; } - public static double Parse(string Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } + public static double Parse(string Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class IncompleteInitialization : System.Exception @@ -858,8 +863,8 @@ public IncompleteInitialization() { } public sealed partial class IntegerType { internal IntegerType() { } - public static int FromObject(object Value) { throw null; } - public static int FromString(string Value) { throw null; } + public static int FromObject(object? Value) { throw null; } + public static int FromString(string? Value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class LateBinding @@ -867,39 +872,39 @@ public sealed partial class LateBinding internal LateBinding() { } [System.Diagnostics.DebuggerHiddenAttribute] [System.Diagnostics.DebuggerStepThroughAttribute] - public static void LateCall(object o, System.Type objType, string name, object[] args, string[] paramnames, bool[] CopyBack) { } + public static void LateCall(object? o, System.Type? objType, string name, object?[]? args, string?[]? paramnames, bool[]? CopyBack) { } [System.Diagnostics.DebuggerHiddenAttribute] [System.Diagnostics.DebuggerStepThroughAttribute] - public static object LateGet(object o, System.Type objType, string name, object[] args, string[] paramnames, bool[] CopyBack) { throw null; } + public static object? LateGet(object? o, System.Type? objType, string name, object?[]? args, string?[]? paramnames, bool[]? CopyBack) { throw null; } [System.Diagnostics.DebuggerHiddenAttribute] [System.Diagnostics.DebuggerStepThroughAttribute] - public static object LateIndexGet(object o, object[] args, string[] paramnames) { throw null; } + public static object? LateIndexGet(object o, object?[]? args, string?[]? paramnames) { throw null; } [System.Diagnostics.DebuggerHiddenAttribute] [System.Diagnostics.DebuggerStepThroughAttribute] - public static void LateIndexSet(object o, object[] args, string[] paramnames) { } + public static void LateIndexSet(object o, object?[] args, string?[]? paramnames) { } [System.Diagnostics.DebuggerHiddenAttribute] [System.Diagnostics.DebuggerStepThroughAttribute] - public static void LateIndexSetComplex(object o, object[] args, string[] paramnames, bool OptimisticSet, bool RValueBase) { } + public static void LateIndexSetComplex(object o, object?[] args, string?[]? paramnames, bool OptimisticSet, bool RValueBase) { } [System.Diagnostics.DebuggerHiddenAttribute] [System.Diagnostics.DebuggerStepThroughAttribute] - public static void LateSet(object o, System.Type objType, string name, object[] args, string[] paramnames) { } + public static void LateSet(object? o, System.Type? objType, string name, object?[]? args, string?[]? paramnames) { } [System.Diagnostics.DebuggerHiddenAttribute] [System.Diagnostics.DebuggerStepThroughAttribute] - public static void LateSetComplex(object o, System.Type objType, string name, object[] args, string[] paramnames, bool OptimisticSet, bool RValueBase) { } + public static void LateSetComplex(object? o, System.Type? objType, string name, object?[]? args, string?[]? paramnames, bool OptimisticSet, bool RValueBase) { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class LikeOperator { internal LikeOperator() { } - public static object LikeObject(object Source, object Pattern, Microsoft.VisualBasic.CompareMethod CompareOption) { throw null; } - public static bool LikeString(string Source, string Pattern, Microsoft.VisualBasic.CompareMethod CompareOption) { throw null; } + public static object LikeObject(object? Source, object? Pattern, Microsoft.VisualBasic.CompareMethod CompareOption) { throw null; } + public static bool LikeString(string? Source, string? Pattern, Microsoft.VisualBasic.CompareMethod CompareOption) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class LongType { internal LongType() { } - public static long FromObject(object Value) { throw null; } - public static long FromString(string Value) { throw null; } + public static long FromObject(object? Value) { throw null; } + public static long FromString(string? Value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class NewLateBinding @@ -907,10 +912,10 @@ public sealed partial class NewLateBinding internal NewLateBinding() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("do not use this method", true)] - public static object FallbackCall(object Instance, string MemberName, object[] Arguments, string[] ArgumentNames, bool IgnoreReturn) { throw null; } + public static object? FallbackCall(object Instance, string MemberName, object[] Arguments, string[] ArgumentNames, bool IgnoreReturn) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("do not use this method", true)] - public static object FallbackGet(object Instance, string MemberName, object[] Arguments, string[] ArgumentNames) { throw null; } + public static object? FallbackGet(object Instance, string MemberName, object[] Arguments, string[] ArgumentNames) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("do not use this method", true)] public static void FallbackIndexSet(object Instance, object[] Arguments, string[] ArgumentNames) { } @@ -919,34 +924,34 @@ public static void FallbackIndexSet(object Instance, object[] Arguments, string[ public static void FallbackIndexSetComplex(object Instance, object[] Arguments, string[] ArgumentNames, bool OptimisticSet, bool RValueBase) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("do not use this method", true)] - public static object FallbackInvokeDefault1(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors) { throw null; } + public static object? FallbackInvokeDefault1(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("do not use this method", true)] - public static object FallbackInvokeDefault2(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors) { throw null; } + public static object? FallbackInvokeDefault2(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("do not use this method", true)] public static void FallbackSet(object Instance, string MemberName, object[] Arguments) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("do not use this method", true)] public static void FallbackSetComplex(object Instance, string MemberName, object[] Arguments, bool OptimisticSet, bool RValueBase) { } - public static object LateCall(object Instance, System.Type Type, string MemberName, object[] Arguments, string[] ArgumentNames, System.Type[] TypeArguments, bool[] CopyBack, bool IgnoreReturn) { throw null; } + public static object? LateCall(object? Instance, System.Type? Type, string MemberName, object?[]? Arguments, string?[]? ArgumentNames, System.Type?[]? TypeArguments, bool[]? CopyBack, bool IgnoreReturn) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static object LateCallInvokeDefault(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors) { throw null; } - public static object LateGet(object Instance, System.Type Type, string MemberName, object[] Arguments, string[] ArgumentNames, System.Type[] TypeArguments, bool[] CopyBack) { throw null; } + public static object? LateCallInvokeDefault(object? Instance, object?[]? Arguments, string?[]? ArgumentNames, bool ReportErrors) { throw null; } + public static object? LateGet(object? Instance, System.Type? Type, string MemberName, object?[]? Arguments, string?[]? ArgumentNames, System.Type?[]? TypeArguments, bool[]? CopyBack) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static object LateGetInvokeDefault(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors) { throw null; } - public static object LateIndexGet(object Instance, object[] Arguments, string[] ArgumentNames) { throw null; } - public static void LateIndexSet(object Instance, object[] Arguments, string[] ArgumentNames) { } - public static void LateIndexSetComplex(object Instance, object[] Arguments, string[] ArgumentNames, bool OptimisticSet, bool RValueBase) { } - public static void LateSet(object Instance, System.Type Type, string MemberName, object[] Arguments, string[] ArgumentNames, System.Type[] TypeArguments) { } - public static void LateSet(object Instance, System.Type Type, string MemberName, object[] Arguments, string[] ArgumentNames, System.Type[] TypeArguments, bool OptimisticSet, bool RValueBase, Microsoft.VisualBasic.CallType CallType) { } - public static void LateSetComplex(object Instance, System.Type Type, string MemberName, object[] Arguments, string[] ArgumentNames, System.Type[] TypeArguments, bool OptimisticSet, bool RValueBase) { } + public static object? LateGetInvokeDefault(object Instance, object?[]? Arguments, string?[]? ArgumentNames, bool ReportErrors) { throw null; } + public static object? LateIndexGet(object Instance, object?[]? Arguments, string?[]? ArgumentNames) { throw null; } + public static void LateIndexSet(object Instance, object?[]? Arguments, string?[]? ArgumentNames) { } + public static void LateIndexSetComplex(object Instance, object?[]? Arguments, string?[]? ArgumentNames, bool OptimisticSet, bool RValueBase) { } + public static void LateSet(object? Instance, System.Type? Type, string MemberName, object?[]? Arguments, string?[]? ArgumentNames, System.Type[]? TypeArguments) { } + public static void LateSet(object? Instance, System.Type? Type, string MemberName, object?[]? Arguments, string?[]? ArgumentNames, System.Type[]? TypeArguments, bool OptimisticSet, bool RValueBase, Microsoft.VisualBasic.CallType CallType) { } + public static void LateSetComplex(object? Instance, System.Type? Type, string MemberName, object?[]? Arguments, string?[]? ArgumentNames, System.Type[]? TypeArguments, bool OptimisticSet, bool RValueBase) { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class ObjectFlowControl { internal ObjectFlowControl() { } - public static void CheckForSyncLockOnValueType(object Expression) { } + public static void CheckForSyncLockOnValueType(object? Expression) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class ForLoopControl { @@ -962,62 +967,62 @@ internal ForLoopControl() { } public sealed partial class ObjectType { public ObjectType() { } - public static object AddObj(object o1, object o2) { throw null; } - public static object BitAndObj(object obj1, object obj2) { throw null; } - public static object BitOrObj(object obj1, object obj2) { throw null; } - public static object BitXorObj(object obj1, object obj2) { throw null; } - public static object DivObj(object o1, object o2) { throw null; } - public static object GetObjectValuePrimitive(object o) { throw null; } - public static object IDivObj(object o1, object o2) { throw null; } - public static bool LikeObj(object vLeft, object vRight, Microsoft.VisualBasic.CompareMethod CompareOption) { throw null; } - public static object ModObj(object o1, object o2) { throw null; } - public static object MulObj(object o1, object o2) { throw null; } - public static object NegObj(object obj) { throw null; } - public static object NotObj(object obj) { throw null; } - public static int ObjTst(object o1, object o2, bool TextCompare) { throw null; } - public static object PlusObj(object obj) { throw null; } - public static object PowObj(object obj1, object obj2) { throw null; } - public static object ShiftLeftObj(object o1, int amount) { throw null; } - public static object ShiftRightObj(object o1, int amount) { throw null; } - public static object StrCatObj(object vLeft, object vRight) { throw null; } - public static object SubObj(object o1, object o2) { throw null; } - public static object XorObj(object obj1, object obj2) { throw null; } + public static object AddObj(object? o1, object? o2) { throw null; } + public static object BitAndObj(object? obj1, object? obj2) { throw null; } + public static object BitOrObj(object? obj1, object? obj2) { throw null; } + public static object BitXorObj(object? obj1, object? obj2) { throw null; } + public static object DivObj(object? o1, object? o2) { throw null; } + public static object GetObjectValuePrimitive(object? o) { throw null; } + public static object IDivObj(object? o1, object? o2) { throw null; } + public static bool LikeObj(object? vLeft, object? vRight, Microsoft.VisualBasic.CompareMethod CompareOption) { throw null; } + public static object ModObj(object? o1, object?o2) { throw null; } + public static object MulObj(object? o1, object? o2) { throw null; } + public static object NegObj(object? obj) { throw null; } + public static object NotObj(object? obj) { throw null; } + public static int ObjTst(object? o1, object? o2, bool TextCompare) { throw null; } + public static object PlusObj(object? obj) { throw null; } + public static object PowObj(object? obj1, object? obj2) { throw null; } + public static object ShiftLeftObj(object? o1, int amount) { throw null; } + public static object ShiftRightObj(object? o1, int amount) { throw null; } + public static object StrCatObj(object? vLeft, object? vRight) { throw null; } + public static object SubObj(object? o1, object? o2) { throw null; } + public static object XorObj(object? obj1, object? obj2) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class Operators { internal Operators() { } - public static object AddObject(object Left, object Right) { throw null; } - public static object AndObject(object Left, object Right) { throw null; } - public static object CompareObjectEqual(object Left, object Right, bool TextCompare) { throw null; } - public static object CompareObjectGreater(object Left, object Right, bool TextCompare) { throw null; } - public static object CompareObjectGreaterEqual(object Left, object Right, bool TextCompare) { throw null; } - public static object CompareObjectLess(object Left, object Right, bool TextCompare) { throw null; } - public static object CompareObjectLessEqual(object Left, object Right, bool TextCompare) { throw null; } - public static object CompareObjectNotEqual(object Left, object Right, bool TextCompare) { throw null; } - public static int CompareString(string Left, string Right, bool TextCompare) { throw null; } - public static object ConcatenateObject(object Left, object Right) { throw null; } - public static bool ConditionalCompareObjectEqual(object Left, object Right, bool TextCompare) { throw null; } - public static bool ConditionalCompareObjectGreater(object Left, object Right, bool TextCompare) { throw null; } - public static bool ConditionalCompareObjectGreaterEqual(object Left, object Right, bool TextCompare) { throw null; } - public static bool ConditionalCompareObjectLess(object Left, object Right, bool TextCompare) { throw null; } - public static bool ConditionalCompareObjectLessEqual(object Left, object Right, bool TextCompare) { throw null; } - public static bool ConditionalCompareObjectNotEqual(object Left, object Right, bool TextCompare) { throw null; } - public static object DivideObject(object Left, object Right) { throw null; } - public static object ExponentObject(object Left, object Right) { throw null; } + public static object? AddObject(object? Left, object? Right) { throw null; } + public static object? AndObject(object? Left, object? Right) { throw null; } + public static object? CompareObjectEqual(object? Left, object? Right, bool TextCompare) { throw null; } + public static object? CompareObjectGreater(object? Left, object? Right, bool TextCompare) { throw null; } + public static object? CompareObjectGreaterEqual(object? Left, object? Right, bool TextCompare) { throw null; } + public static object? CompareObjectLess(object? Left, object? Right, bool TextCompare) { throw null; } + public static object? CompareObjectLessEqual(object? Left, object? Right, bool TextCompare) { throw null; } + public static object? CompareObjectNotEqual(object? Left, object? Right, bool TextCompare) { throw null; } + public static int CompareString(string? Left, string? Right, bool TextCompare) { throw null; } + public static object? ConcatenateObject(object? Left, object? Right) { throw null; } + public static bool ConditionalCompareObjectEqual(object? Left, object? Right, bool TextCompare) { throw null; } + public static bool ConditionalCompareObjectGreater(object? Left, object? Right, bool TextCompare) { throw null; } + public static bool ConditionalCompareObjectGreaterEqual(object? Left, object? Right, bool TextCompare) { throw null; } + public static bool ConditionalCompareObjectLess(object? Left, object? Right, bool TextCompare) { throw null; } + public static bool ConditionalCompareObjectLessEqual(object? Left, object? Right, bool TextCompare) { throw null; } + public static bool ConditionalCompareObjectNotEqual(object? Left, object? Right, bool TextCompare) { throw null; } + public static object? DivideObject(object? Left, object? Right) { throw null; } + public static object? ExponentObject(object? Left, object? Right) { throw null; } [System.ObsoleteAttribute("do not use this method", true)] - public static object FallbackInvokeUserDefinedOperator(object vbOp, object[] arguments) { throw null; } - public static object IntDivideObject(object Left, object Right) { throw null; } - public static object LeftShiftObject(object Operand, object Amount) { throw null; } - public static object ModObject(object Left, object Right) { throw null; } - public static object MultiplyObject(object Left, object Right) { throw null; } - public static object NegateObject(object Operand) { throw null; } - public static object NotObject(object Operand) { throw null; } - public static object OrObject(object Left, object Right) { throw null; } - public static object PlusObject(object Operand) { throw null; } - public static object RightShiftObject(object Operand, object Amount) { throw null; } - public static object SubtractObject(object Left, object Right) { throw null; } - public static object XorObject(object Left, object Right) { throw null; } + public static object? FallbackInvokeUserDefinedOperator(object? vbOp, object?[]? arguments) { throw null; } + public static object? IntDivideObject(object? Left, object? Right) { throw null; } + public static object? LeftShiftObject(object? Operand, object? Amount) { throw null; } + public static object? ModObject(object? Left, object? Right) { throw null; } + public static object? MultiplyObject(object? Left, object? Right) { throw null; } + public static object? NegateObject(object? Operand) { throw null; } + public static object? NotObject(object? Operand) { throw null; } + public static object? OrObject(object? Left, object? Right) { throw null; } + public static object? PlusObject(object? Operand) { throw null; } + public static object? RightShiftObject(object? Operand, object? Amount) { throw null; } + public static object? SubtractObject(object? Left, object? Right) { throw null; } + public static object? XorObject(object? Left, object? Right) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false, AllowMultiple=false)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1038,24 +1043,24 @@ internal ProjectData() { } public static void ClearProjectError() { } public static System.Exception CreateProjectError(int hr) { throw null; } public static void EndApp() { } - public static void SetProjectError(System.Exception ex) { } - public static void SetProjectError(System.Exception ex, int lErl) { } + public static void SetProjectError(System.Exception? ex) { } + public static void SetProjectError(System.Exception? ex, int lErl) { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class ShortType { internal ShortType() { } - public static short FromObject(object Value) { throw null; } - public static short FromString(string Value) { throw null; } + public static short FromObject(object? Value) { throw null; } + public static short FromString(string? Value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class SingleType { internal SingleType() { } - public static float FromObject(object Value) { throw null; } - public static float FromObject(object Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } - public static float FromString(string Value) { throw null; } - public static float FromString(string Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } + public static float FromObject(object? Value) { throw null; } + public static float FromObject(object? Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } + public static float FromString(string? Value) { throw null; } + public static float FromString(string? Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=false, AllowMultiple=false)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1078,37 +1083,38 @@ internal StringType() { } public static string FromChar(char Value) { throw null; } public static string FromDate(System.DateTime Value) { throw null; } public static string FromDecimal(decimal Value) { throw null; } - public static string FromDecimal(decimal Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } + public static string FromDecimal(decimal Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } public static string FromDouble(double Value) { throw null; } - public static string FromDouble(double Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } + public static string FromDouble(double Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } public static string FromInteger(int Value) { throw null; } public static string FromLong(long Value) { throw null; } - public static string FromObject(object Value) { throw null; } + [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("Value")] + public static string? FromObject(object? Value) { throw null; } public static string FromShort(short Value) { throw null; } public static string FromSingle(float Value) { throw null; } - public static string FromSingle(float Value, System.Globalization.NumberFormatInfo NumberFormat) { throw null; } - public static void MidStmtStr(ref string sDest, int StartPosition, int MaxInsertLength, string sInsert) { } - public static int StrCmp(string sLeft, string sRight, bool TextCompare) { throw null; } - public static bool StrLike(string Source, string Pattern, Microsoft.VisualBasic.CompareMethod CompareOption) { throw null; } - public static bool StrLikeBinary(string Source, string Pattern) { throw null; } - public static bool StrLikeText(string Source, string Pattern) { throw null; } + public static string FromSingle(float Value, System.Globalization.NumberFormatInfo? NumberFormat) { throw null; } + public static void MidStmtStr(ref string? sDest, int StartPosition, int MaxInsertLength, string sInsert) { } + public static int StrCmp(string? sLeft, string? sRight, bool TextCompare) { throw null; } + public static bool StrLike(string? Source, string? Pattern, Microsoft.VisualBasic.CompareMethod CompareOption) { throw null; } + public static bool StrLikeBinary(string? Source, string? Pattern) { throw null; } + public static bool StrLikeText(string? Source, string? Pattern) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class Utils { internal Utils() { } public static System.Array CopyArray(System.Array arySrc, System.Array aryDest) { throw null; } - public static string GetResourceString(string ResourceKey, params string[] Args) { throw null; } + public static string GetResourceString(string ResourceKey, params string?[] Args) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class Versioned { internal Versioned() { } - public static object CallByName(object Instance, string MethodName, Microsoft.VisualBasic.CallType UseCallType, params object[] Arguments) { throw null; } - public static bool IsNumeric(object Expression) { throw null; } - public static string SystemTypeName(string VbName) { throw null; } - public static string TypeName(object Expression) { throw null; } - public static string VbTypeName(string SystemName) { throw null; } + public static object? CallByName(object? Instance, string MethodName, Microsoft.VisualBasic.CallType UseCallType, params object?[]? Arguments) { throw null; } + public static bool IsNumeric(object? Expression) { throw null; } + public static string? SystemTypeName(string? VbName) { throw null; } + public static string TypeName(object? Expression) { throw null; } + public static string? VbTypeName(string? SystemName) { throw null; } } } namespace Microsoft.VisualBasic.FileIO @@ -1128,7 +1134,7 @@ public partial class FileSystem public FileSystem() { } public static string CurrentDirectory { get { throw null; } set { } } public static System.Collections.ObjectModel.ReadOnlyCollection Drives { get { throw null; } } - public static string CombinePath(string baseDirectory, string relativePath) { throw null; } + public static string CombinePath(string baseDirectory, string? relativePath) { throw null; } public static void CopyDirectory(string sourceDirectoryName, string destinationDirectoryName) { } public static void CopyDirectory(string sourceDirectoryName, string destinationDirectoryName, Microsoft.VisualBasic.FileIO.UIOption showUI) { } public static void CopyDirectory(string sourceDirectoryName, string destinationDirectoryName, Microsoft.VisualBasic.FileIO.UIOption showUI, Microsoft.VisualBasic.FileIO.UICancelOption onUserCancel) { } @@ -1187,10 +1193,10 @@ public partial class MalformedLineException : System.Exception public MalformedLineException() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] protected MalformedLineException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } - public MalformedLineException(string message) { } - public MalformedLineException(string message, System.Exception innerException) { } - public MalformedLineException(string message, long lineNumber) { } - public MalformedLineException(string message, long lineNumber, System.Exception innerException) { } + public MalformedLineException(string? message) { } + public MalformedLineException(string? message, System.Exception? innerException) { } + public MalformedLineException(string? message, long lineNumber) { } + public MalformedLineException(string? message, long lineNumber, System.Exception? innerException) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Always)] public long LineNumber { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] @@ -1230,12 +1236,12 @@ public TextFieldParser(System.IO.TextReader reader) { } public TextFieldParser(string path) { } public TextFieldParser(string path, System.Text.Encoding defaultEncoding) { } public TextFieldParser(string path, System.Text.Encoding defaultEncoding, bool detectEncoding) { } - public string[] CommentTokens { get { throw null; } set { } } - public string[] Delimiters { get { throw null; } set { } } + public string[]? CommentTokens { get { throw null; } set { } } + public string[]? Delimiters { get { throw null; } set { } } public bool EndOfData { get { throw null; } } public string ErrorLine { get { throw null; } } public long ErrorLineNumber { get { throw null; } } - public int[] FieldWidths { get { throw null; } set { } } + public int[]? FieldWidths { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] public bool HasFieldsEnclosedInQuotes { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] @@ -1246,14 +1252,14 @@ public TextFieldParser(string path, System.Text.Encoding defaultEncoding, bool d public void Close() { } protected virtual void Dispose(bool disposing) { } ~TextFieldParser() { } - public string PeekChars(int numberOfChars) { throw null; } - public string[] ReadFields() { throw null; } + public string? PeekChars(int numberOfChars) { throw null; } + public string[]? ReadFields() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public string ReadLine() { throw null; } + public string? ReadLine() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public string ReadToEnd() { throw null; } - public void SetDelimiters(params string[] delimiters) { } - public void SetFieldWidths(params int[] fieldWidths) { } + public string? ReadToEnd() { throw null; } + public void SetDelimiters(params string[]? delimiters) { } + public void SetFieldWidths(params int[]? fieldWidths) { } void System.IDisposable.Dispose() { } } public enum UICancelOption diff --git a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.csproj b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.csproj index 1063d6ba29f9ae..177effc558f4f9 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.csproj +++ b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.csproj @@ -1,6 +1,7 @@ $(NetCoreAppCurrent) + enable diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/CompilerServices/LikeOperator.vb b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/CompilerServices/LikeOperator.vb index d2a6d9b050bbae..6cf0e953472057 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/CompilerServices/LikeOperator.vb +++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/CompilerServices/LikeOperator.vb @@ -146,7 +146,7 @@ Namespace Microsoft.VisualBasic.CompilerServices WidthChanged = False If Length = 0 Then Return - Input = Input.ToLower(System.Globalization.CultureInfo.InvariantCulture) + Input = Input.ToLowerInvariant() Dim ExtraChars As Integer diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb index a1427b5d616f1e..ff5b4c3253a5c3 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb +++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb @@ -75,7 +75,7 @@ Namespace Microsoft.VisualBasic End Sub Public Sub ChDrive(ByVal Drive As Char) - Drive = System.Char.ToUpper(Drive, CultureInfo.InvariantCulture) + Drive = System.Char.ToUpperInvariant(Drive) If (Drive < chLetterA) OrElse (Drive > chLetterZ) Then Throw New ArgumentException(SR.Format(SR.Argument_InvalidValue1, "Drive")) @@ -110,7 +110,7 @@ Namespace Microsoft.VisualBasic Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, "Methods in Microsoft.VisualBasic should not call FileSystem public method.") - Drive = System.Char.ToUpper(Drive, CultureInfo.InvariantCulture) + Drive = System.Char.ToUpperInvariant(Drive) If (Drive < chLetterA OrElse Drive > chLetterZ) Then Throw VbMakeException(New ArgumentException(SR.Format(SR.Argument_InvalidValue1, "Drive")), vbErrors.DevUnavailable) End If diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs index 0f863c5ab02c19..9708195070dc26 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs @@ -11,6 +11,7 @@ namespace Microsoft.VisualBasic.Tests public class ErrObjectTests { [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/14854", TestRuntimes.Mono)] public void Clear() { ProjectData.ClearProjectError(); diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/InteractionTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/InteractionTests.cs index b94b9d51f180d8..4ee3004cf68539 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/InteractionTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/InteractionTests.cs @@ -138,6 +138,7 @@ public static IEnumerable IIf_TestData() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/2139", TestRuntimes.Mono)] public void DeleteSetting() { if (!PlatformDetection.IsInAppContainer) @@ -207,6 +208,7 @@ private static (string, string)[] GetEnvironmentVariables() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/2139", TestRuntimes.Mono)] public void GetAllSettings() { if (!PlatformDetection.IsInAppContainer) @@ -221,6 +223,7 @@ public void GetAllSettings() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/2139", TestRuntimes.Mono)] public void GetSetting() { if (!PlatformDetection.IsInAppContainer) @@ -301,14 +304,14 @@ public void Partition_Overflow(long Number, long Start, long Stop, long Interval { Assert.Throws(() => Interaction.Partition(Number, Start, Stop, Interval)); } - + [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/2139", TestRuntimes.Mono)] public void SaveSetting() { if (!PlatformDetection.IsInAppContainer) { Assert.Throws(() => Interaction.SaveSetting(AppName: "", Section: "", Key: "", Setting: "")); - } else { diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/StringsTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/StringsTests.cs index f2551e9b2c2599..da8350a036eff9 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/StringsTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/StringsTests.cs @@ -129,7 +129,7 @@ public void Asc_Chr_Invariant(int charCode, int expected) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/39888", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30419", TargetFrameworkMonikers.NetFramework)] [Theory] [InlineData(0, 0)] [InlineData(33, 33)] diff --git a/src/libraries/Microsoft.Win32.Primitives/ref/Microsoft.Win32.Primitives.cs b/src/libraries/Microsoft.Win32.Primitives/ref/Microsoft.Win32.Primitives.cs index cc2fa98899e466..c7a8e578d73bd7 100644 --- a/src/libraries/Microsoft.Win32.Primitives/ref/Microsoft.Win32.Primitives.cs +++ b/src/libraries/Microsoft.Win32.Primitives/ref/Microsoft.Win32.Primitives.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.ComponentModel diff --git a/src/libraries/Microsoft.Win32.Primitives/src/Microsoft.Win32.Primitives.csproj b/src/libraries/Microsoft.Win32.Primitives/src/Microsoft.Win32.Primitives.csproj index 864dcb7bb8fdbb..1114cc984bd052 100644 --- a/src/libraries/Microsoft.Win32.Primitives/src/Microsoft.Win32.Primitives.csproj +++ b/src/libraries/Microsoft.Win32.Primitives/src/Microsoft.Win32.Primitives.csproj @@ -1,7 +1,7 @@ true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix enable diff --git a/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.Forwards.cs b/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.Forwards.cs index 95a6b951eb9836..24bb6656afa7bb 100644 --- a/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.Forwards.cs +++ b/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.AccessControl.RegistryAccessRule))] diff --git a/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.cs b/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.cs index d06d94310c9a3f..ab0bb3095b7558 100644 --- a/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.cs +++ b/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace Microsoft.Win32 diff --git a/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.csproj b/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.csproj index 7b74239980a0ca..764e814e8461b4 100644 --- a/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.csproj +++ b/src/libraries/Microsoft.Win32.Registry.AccessControl/ref/Microsoft.Win32.Registry.AccessControl.csproj @@ -1,7 +1,7 @@ netstandard2.0;net461;$(NetFrameworkCurrent) - true + true diff --git a/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj b/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj index 08786e3a3e5ed5..519d2cea378044 100644 --- a/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj +++ b/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj @@ -5,7 +5,7 @@ true SR.PlatformNotSupported_RegistryAccessControl netstandard2.0-Windows_NT;netstandard2.0;net461-Windows_NT;$(NetFrameworkCurrent)-Windows_NT - true + true diff --git a/src/libraries/Microsoft.Win32.Registry/ref/Microsoft.Win32.Registry.cs b/src/libraries/Microsoft.Win32.Registry/ref/Microsoft.Win32.Registry.cs index ca0e7ec84f007e..00cd1a2f643e99 100644 --- a/src/libraries/Microsoft.Win32.Registry/ref/Microsoft.Win32.Registry.cs +++ b/src/libraries/Microsoft.Win32.Registry/ref/Microsoft.Win32.Registry.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace Microsoft.Win32 @@ -15,9 +15,9 @@ public static partial class Registry public static readonly Microsoft.Win32.RegistryKey LocalMachine; public static readonly Microsoft.Win32.RegistryKey PerformanceData; public static readonly Microsoft.Win32.RegistryKey Users; - public static object GetValue(string keyName, string valueName, object defaultValue) { throw null; } - public static void SetValue(string keyName, string valueName, object value) { } - public static void SetValue(string keyName, string valueName, object value, Microsoft.Win32.RegistryValueKind valueKind) { } + public static object? GetValue(string keyName, string? valueName, object? defaultValue) { throw null; } + public static void SetValue(string keyName, string? valueName, object value) { } + public static void SetValue(string keyName, string? valueName, object value, Microsoft.Win32.RegistryValueKind valueKind) { } } public enum RegistryHive { @@ -40,8 +40,8 @@ public void Close() { } public Microsoft.Win32.RegistryKey CreateSubKey(string subkey) { throw null; } public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck) { throw null; } public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, Microsoft.Win32.RegistryOptions registryOptions) { throw null; } - public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, Microsoft.Win32.RegistryOptions registryOptions, System.Security.AccessControl.RegistrySecurity registrySecurity) { throw null; } - public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, System.Security.AccessControl.RegistrySecurity registrySecurity) { throw null; } + public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, Microsoft.Win32.RegistryOptions registryOptions, System.Security.AccessControl.RegistrySecurity? registrySecurity) { throw null; } + public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, System.Security.AccessControl.RegistrySecurity? registrySecurity) { throw null; } public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, bool writable) { throw null; } public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, bool writable, Microsoft.Win32.RegistryOptions options) { throw null; } public void DeleteSubKey(string subkey) { } @@ -57,22 +57,22 @@ public void Flush() { } public System.Security.AccessControl.RegistrySecurity GetAccessControl() { throw null; } public System.Security.AccessControl.RegistrySecurity GetAccessControl(System.Security.AccessControl.AccessControlSections includeSections) { throw null; } public string[] GetSubKeyNames() { throw null; } - public object GetValue(string name) { throw null; } - public object GetValue(string name, object defaultValue) { throw null; } - public object GetValue(string name, object defaultValue, Microsoft.Win32.RegistryValueOptions options) { throw null; } - public Microsoft.Win32.RegistryValueKind GetValueKind(string name) { throw null; } + public object? GetValue(string? name) { throw null; } + public object? GetValue(string? name, object? defaultValue) { throw null; } + public object? GetValue(string? name, object? defaultValue, Microsoft.Win32.RegistryValueOptions options) { throw null; } + public Microsoft.Win32.RegistryValueKind GetValueKind(string? name) { throw null; } public string[] GetValueNames() { throw null; } public static Microsoft.Win32.RegistryKey OpenBaseKey(Microsoft.Win32.RegistryHive hKey, Microsoft.Win32.RegistryView view) { throw null; } public static Microsoft.Win32.RegistryKey OpenRemoteBaseKey(Microsoft.Win32.RegistryHive hKey, string machineName) { throw null; } public static Microsoft.Win32.RegistryKey OpenRemoteBaseKey(Microsoft.Win32.RegistryHive hKey, string machineName, Microsoft.Win32.RegistryView view) { throw null; } - public Microsoft.Win32.RegistryKey OpenSubKey(string name) { throw null; } - public Microsoft.Win32.RegistryKey OpenSubKey(string name, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck) { throw null; } - public Microsoft.Win32.RegistryKey OpenSubKey(string name, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, System.Security.AccessControl.RegistryRights rights) { throw null; } - public Microsoft.Win32.RegistryKey OpenSubKey(string name, bool writable) { throw null; } - public Microsoft.Win32.RegistryKey OpenSubKey(string name, System.Security.AccessControl.RegistryRights rights) { throw null; } + public Microsoft.Win32.RegistryKey? OpenSubKey(string name) { throw null; } + public Microsoft.Win32.RegistryKey? OpenSubKey(string name, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck) { throw null; } + public Microsoft.Win32.RegistryKey? OpenSubKey(string name, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, System.Security.AccessControl.RegistryRights rights) { throw null; } + public Microsoft.Win32.RegistryKey? OpenSubKey(string name, bool writable) { throw null; } + public Microsoft.Win32.RegistryKey? OpenSubKey(string name, System.Security.AccessControl.RegistryRights rights) { throw null; } public void SetAccessControl(System.Security.AccessControl.RegistrySecurity registrySecurity) { } - public void SetValue(string name, object value) { } - public void SetValue(string name, object value, Microsoft.Win32.RegistryValueKind valueKind) { } + public void SetValue(string? name, object value) { } + public void SetValue(string? name, object value, Microsoft.Win32.RegistryValueKind valueKind) { } public override string ToString() { throw null; } } public enum RegistryKeyPermissionCheck diff --git a/src/libraries/Microsoft.Win32.Registry/ref/Microsoft.Win32.Registry.csproj b/src/libraries/Microsoft.Win32.Registry/ref/Microsoft.Win32.Registry.csproj index bece872888a28a..460ce738b8d0f2 100644 --- a/src/libraries/Microsoft.Win32.Registry/ref/Microsoft.Win32.Registry.csproj +++ b/src/libraries/Microsoft.Win32.Registry/ref/Microsoft.Win32.Registry.csproj @@ -2,6 +2,7 @@ true netstandard2.0;$(NetFrameworkCurrent);net461 + enable diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj b/src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj index e4c7b59fe23608..c477714db0b9f0 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj @@ -4,13 +4,14 @@ $(NoWarn);CS1573 $(DefineConstants);REGISTRY_ASSEMBLY true - SR.PlatformNotSupported_Registry + SR.PlatformNotSupported_Registry $(NoWarn);CA1823 - netstandard2.0-Windows_NT;netstandard2.0-Unix;netstandard2.0;net461-Windows_NT;$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetFrameworkCurrent)-Windows_NT - true - true + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetFrameworkCurrent)-Windows_NT;netstandard2.0-Windows_NT;netstandard2.0-Unix;netstandard2.0;net461-Windows_NT + true + true + enable - + Common\Interop\Windows\Advapi32\Interop.RegistryConstants.cs @@ -107,4 +108,4 @@ - \ No newline at end of file + diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/Registry.cs b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/Registry.cs index f86f170333b897..803a1a6e694d0b 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/Registry.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/Registry.cs @@ -45,7 +45,7 @@ private static RegistryKey GetBaseKeyFromKeyName(string keyName, out string subK int length = i != -1 ? i : keyName.Length; // Determine the potential base key from the length. - RegistryKey baseKey = null; + RegistryKey? baseKey = null; switch (length) { case 10: baseKey = Users; break; // HKEY_USERS @@ -68,28 +68,26 @@ private static RegistryKey GetBaseKeyFromKeyName(string keyName, out string subK throw new ArgumentException(SR.Format(SR.Arg_RegInvalidKeyName, nameof(keyName)), nameof(keyName)); } - public static object GetValue(string keyName, string valueName, object defaultValue) + public static object? GetValue(string keyName, string? valueName, object? defaultValue) { - string subKeyName; - RegistryKey basekey = GetBaseKeyFromKeyName(keyName, out subKeyName); + RegistryKey basekey = GetBaseKeyFromKeyName(keyName, out string subKeyName); - using (RegistryKey key = basekey.OpenSubKey(subKeyName)) + using (RegistryKey? key = basekey.OpenSubKey(subKeyName)) { return key?.GetValue(valueName, defaultValue); } } - public static void SetValue(string keyName, string valueName, object value) + public static void SetValue(string keyName, string? valueName, object value) { SetValue(keyName, valueName, value, RegistryValueKind.Unknown); } - public static void SetValue(string keyName, string valueName, object value, RegistryValueKind valueKind) + public static void SetValue(string keyName, string? valueName, object value, RegistryValueKind valueKind) { - string subKeyName; - RegistryKey basekey = GetBaseKeyFromKeyName(keyName, out subKeyName); + RegistryKey basekey = GetBaseKeyFromKeyName(keyName, out string subKeyName); - using (RegistryKey key = basekey.CreateSubKey(subKeyName)) + using (RegistryKey? key = basekey.CreateSubKey(subKeyName)) { Debug.Assert(key != null, "An exception should be thrown if failed!"); key.SetValue(valueName, value, valueKind); diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.FileSystem.cs b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.FileSystem.cs index c0b9846ba4f232..6f0565adf93b73 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.FileSystem.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.FileSystem.cs @@ -92,17 +92,17 @@ private string[] GetValueNamesCore(int values) throw new PlatformNotSupportedException(SR.PlatformNotSupported_Registry); } - private object InternalGetValueCore(string name, object defaultValue, bool doNotExpand) + private object InternalGetValueCore(string? name, object? defaultValue, bool doNotExpand) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_Registry); } - private RegistryValueKind GetValueKindCore(string name) + private RegistryValueKind GetValueKindCore(string? name) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_Registry); } - private void SetValueCore(string name, object value, RegistryValueKind valueKind) + private void SetValueCore(string? name, object value, RegistryValueKind valueKind) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_Registry); } diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.Windows.cs b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.Windows.cs index 4cdde3b0730b7e..b55e1b2b5d9506 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.Windows.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.Windows.cs @@ -9,7 +9,6 @@ using System.Diagnostics; using System.IO; using System.Security; -using System.Security.AccessControl; /* Note on transaction support: @@ -85,11 +84,9 @@ private void FlushCore() private unsafe RegistryKey CreateSubKeyInternalCore(string subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions registryOptions) { - Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs = default(Interop.Kernel32.SECURITY_ATTRIBUTES); - int disposition = 0; + Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs = default; // By default, the new key will be writable. - SafeRegistryHandle result = null; int ret = Interop.Advapi32.RegCreateKeyEx(_hkey, subkey, 0, @@ -97,8 +94,8 @@ private unsafe RegistryKey CreateSubKeyInternalCore(string subkey, RegistryKeyPe (int)registryOptions /* specifies if the key is volatile */, GetRegistryKeyAccess(permissionCheck != RegistryKeyPermissionCheck.ReadSubTree) | (int)_regView, ref secAttrs, - out result, - out disposition); + out SafeRegistryHandle result, + out int _); if (ret == 0 && !result.IsInvalid) { @@ -220,8 +217,7 @@ private static RegistryKey OpenRemoteBaseKeyCore(RegistryHive hKey, string machi } // connect to the specified remote registry - SafeRegistryHandle foreignHKey = null; - int ret = Interop.Advapi32.RegConnectRegistry(machineName, new SafeRegistryHandle(new IntPtr((int)hKey), false), out foreignHKey); + int ret = Interop.Advapi32.RegConnectRegistry(machineName, new SafeRegistryHandle(new IntPtr((int)hKey), false), out SafeRegistryHandle foreignHKey); if (ret == Interop.Errors.ERROR_DLL_INIT_FAILED) { @@ -246,10 +242,9 @@ private static RegistryKey OpenRemoteBaseKeyCore(RegistryHive hKey, string machi return key; } - private RegistryKey InternalOpenSubKeyCore(string name, RegistryKeyPermissionCheck permissionCheck, int rights) + private RegistryKey? InternalOpenSubKeyCore(string name, RegistryKeyPermissionCheck permissionCheck, int rights) { - SafeRegistryHandle result = null; - int ret = Interop.Advapi32.RegOpenKeyEx(_hkey, name, 0, (rights | (int)_regView), out result); + int ret = Interop.Advapi32.RegOpenKeyEx(_hkey, name, 0, (rights | (int)_regView), out SafeRegistryHandle result); if (ret == 0 && !result.IsInvalid) { RegistryKey key = new RegistryKey(result, (permissionCheck == RegistryKeyPermissionCheck.ReadWriteSubTree), false, _remoteKey, false, _regView); @@ -269,10 +264,9 @@ private RegistryKey InternalOpenSubKeyCore(string name, RegistryKeyPermissionChe return null; } - private RegistryKey InternalOpenSubKeyCore(string name, bool writable) + private RegistryKey? InternalOpenSubKeyCore(string name, bool writable) { - SafeRegistryHandle result = null; - int ret = Interop.Advapi32.RegOpenKeyEx(_hkey, name, 0, (GetRegistryKeyAccess(writable) | (int)_regView), out result); + int ret = Interop.Advapi32.RegOpenKeyEx(_hkey, name, 0, (GetRegistryKeyAccess(writable) | (int)_regView), out SafeRegistryHandle result); if (ret == 0 && !result.IsInvalid) { RegistryKey key = new RegistryKey(result, writable, false, _remoteKey, false, _regView); @@ -292,10 +286,9 @@ private RegistryKey InternalOpenSubKeyCore(string name, bool writable) return null; } - internal RegistryKey InternalOpenSubKeyWithoutSecurityChecksCore(string name, bool writable) + internal RegistryKey? InternalOpenSubKeyWithoutSecurityChecksCore(string name, bool writable) { - SafeRegistryHandle result = null; - int ret = Interop.Advapi32.RegOpenKeyEx(_hkey, name, 0, (GetRegistryKeyAccess(writable) | (int)_regView), out result); + int ret = Interop.Advapi32.RegOpenKeyEx(_hkey, name, 0, (GetRegistryKeyAccess(writable) | (int)_regView), out SafeRegistryHandle result); if (ret == 0 && !result.IsInvalid) { RegistryKey key = new RegistryKey(result, writable, false, _remoteKey, false, _regView); @@ -340,12 +333,11 @@ private SafeRegistryHandle SystemKeyHandle } // open the base key so that RegistryKey.Handle will return a valid handle - SafeRegistryHandle result; ret = Interop.Advapi32.RegOpenKeyEx(baseKey, null, 0, GetRegistryKeyAccess(IsWritable()) | (int)_regView, - out result); + out SafeRegistryHandle result); if (ret == 0 && !result.IsInvalid) { @@ -463,7 +455,7 @@ private unsafe string[] GetValueNamesCore(int values) // add up quickly- we'll try to keep the memory pressure low and grow the buffer // only if needed. - char[] name = ArrayPool.Shared.Rent(100); + char[]? name = ArrayPool.Shared.Rent(100); try { @@ -528,13 +520,13 @@ private unsafe string[] GetValueNamesCore(int values) return names.ToArray(); } - private object InternalGetValueCore(string name, object defaultValue, bool doNotExpand) + private object? InternalGetValueCore(string? name, object? defaultValue, bool doNotExpand) { - object data = defaultValue; + object? data = defaultValue; int type = 0; int datasize = 0; - int ret = Interop.Advapi32.RegQueryValueEx(_hkey, name, null, ref type, (byte[])null, ref datasize); + int ret = Interop.Advapi32.RegQueryValueEx(_hkey, name, null, ref type, (byte[]?)null, ref datasize); if (ret != 0) { @@ -734,7 +726,7 @@ private object InternalGetValueCore(string name, object defaultValue, bool doNot nextNull++; } - string toAdd = null; + string? toAdd = null; if (nextNull < len) { Debug.Assert(blob[nextNull] == (char)0, "blob[nextNull] should be 0"); @@ -780,11 +772,11 @@ private object InternalGetValueCore(string name, object defaultValue, bool doNot return data; } - private RegistryValueKind GetValueKindCore(string name) + private RegistryValueKind GetValueKindCore(string? name) { int type = 0; int datasize = 0; - int ret = Interop.Advapi32.RegQueryValueEx(_hkey, name, null, ref type, (byte[])null, ref datasize); + int ret = Interop.Advapi32.RegQueryValueEx(_hkey, name, null, ref type, (byte[]?)null, ref datasize); if (ret != 0) { Win32Error(ret, null); @@ -796,7 +788,7 @@ private RegistryValueKind GetValueKindCore(string name) (RegistryValueKind)type; } - private unsafe void SetValueCore(string name, object value, RegistryValueKind valueKind) + private unsafe void SetValueCore(string? name, object value, RegistryValueKind valueKind) { int ret = 0; try @@ -806,7 +798,7 @@ private unsafe void SetValueCore(string name, object value, RegistryValueKind va case RegistryValueKind.ExpandString: case RegistryValueKind.String: { - string data = value.ToString(); + string data = value.ToString()!; ret = Interop.Advapi32.RegSetValueEx(_hkey, name, 0, @@ -921,7 +913,7 @@ private unsafe void SetValueCore(string name, object value, RegistryValueKind va /// error, and depending on the error, insert a string into the message /// gotten from the ResourceManager. /// - private void Win32Error(int errorCode, string str) + private void Win32Error(int errorCode, string? str) { switch (errorCode) { @@ -944,7 +936,7 @@ private void Win32Error(int errorCode, string str) if (!IsPerfDataKey()) { _hkey.SetHandleAsInvalid(); - _hkey = null; + _hkey = null!; } goto default; @@ -956,7 +948,7 @@ private void Win32Error(int errorCode, string str) } } - private static void Win32ErrorStatic(int errorCode, string str) => + private static void Win32ErrorStatic(int errorCode, string? str) => throw errorCode switch { Interop.Errors.ERROR_ACCESS_DENIED => str != null ? diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs index f3b1ef19801444..1860a0a2223ef6 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs @@ -113,7 +113,7 @@ public void Dispose() } finally { - _hkey = null; + _hkey = null!; } } else if (IsPerfDataKey()) @@ -126,7 +126,6 @@ public void Dispose() /// Creates a new subkey, or opens an existing one. /// Name or path to subkey to create or open. /// The subkey, or null if the operation failed. - [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "Reviewed for thread safety")] public RegistryKey CreateSubKey(string subkey) { return CreateSubKey(subkey, _checkMode); @@ -147,12 +146,12 @@ public RegistryKey CreateSubKey(string subkey, RegistryKeyPermissionCheck permis return CreateSubKey(subkey, permissionCheck, RegistryOptions.None); } - public RegistryKey CreateSubKey(string subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions registryOptions, RegistrySecurity registrySecurity) + public RegistryKey CreateSubKey(string subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions registryOptions, RegistrySecurity? registrySecurity) { return CreateSubKey(subkey, permissionCheck, registryOptions); } - public RegistryKey CreateSubKey(string subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity registrySecurity) + public RegistryKey CreateSubKey(string subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity? registrySecurity) { return CreateSubKey(subkey, permissionCheck, RegistryOptions.None); } @@ -168,7 +167,7 @@ public RegistryKey CreateSubKey(string subkey, RegistryKeyPermissionCheck permis // only keys opened under read mode is not writable if (!_remoteKey) { - RegistryKey key = InternalOpenSubKeyWithoutSecurityChecks(subkey, (permissionCheck != RegistryKeyPermissionCheck.ReadSubTree)); + RegistryKey? key = InternalOpenSubKeyWithoutSecurityChecks(subkey, (permissionCheck != RegistryKeyPermissionCheck.ReadSubTree)); if (key != null) { // Key already exits @@ -200,7 +199,7 @@ public void DeleteSubKey(string subkey, bool throwOnMissingSubKey) // Open the key we are deleting and check for children. Be sure to // explicitly call close to avoid keeping an extra HKEY open. // - RegistryKey key = InternalOpenSubKeyWithoutSecurityChecks(subkey, false); + RegistryKey? key = InternalOpenSubKeyWithoutSecurityChecks(subkey, false); if (key != null) { using (key) @@ -244,7 +243,7 @@ public void DeleteSubKeyTree(string subkey, bool throwOnMissingSubKey) subkey = FixupName(subkey); // Fixup multiple slashes to a single slash - RegistryKey key = InternalOpenSubKeyWithoutSecurityChecks(subkey, true); + RegistryKey? key = InternalOpenSubKeyWithoutSecurityChecks(subkey, true); if (key != null) { using (key) @@ -274,7 +273,7 @@ public void DeleteSubKeyTree(string subkey, bool throwOnMissingSubKey) /// private void DeleteSubKeyTreeInternal(string subkey) { - RegistryKey key = InternalOpenSubKeyWithoutSecurityChecks(subkey, true); + RegistryKey? key = InternalOpenSubKeyWithoutSecurityChecks(subkey, true); if (key != null) { using (key) @@ -339,7 +338,7 @@ public static RegistryKey OpenRemoteBaseKey(RegistryHive hKey, string machineNam /// Returns a subkey with read only permissions. /// Name or path of subkey to open. /// The Subkey requested, or null if the operation failed. - public RegistryKey OpenSubKey(string name) + public RegistryKey? OpenSubKey(string name) { return OpenSubKey(name, false); } @@ -351,7 +350,7 @@ public RegistryKey OpenSubKey(string name) /// Name or the path of subkey to open. /// Set to true if you only need readonly access. /// the Subkey requested, or null if the operation failed. - public RegistryKey OpenSubKey(string name, bool writable) + public RegistryKey? OpenSubKey(string name, bool writable) { ValidateKeyName(name); EnsureNotDisposed(); @@ -360,19 +359,19 @@ public RegistryKey OpenSubKey(string name, bool writable) return InternalOpenSubKeyCore(name, writable); } - public RegistryKey OpenSubKey(string name, RegistryKeyPermissionCheck permissionCheck) + public RegistryKey? OpenSubKey(string name, RegistryKeyPermissionCheck permissionCheck) { ValidateKeyMode(permissionCheck); return OpenSubKey(name, permissionCheck, (RegistryRights)GetRegistryKeyAccess(permissionCheck)); } - public RegistryKey OpenSubKey(string name, RegistryRights rights) + public RegistryKey? OpenSubKey(string name, RegistryRights rights) { return OpenSubKey(name, this._checkMode, rights); } - public RegistryKey OpenSubKey(string name, RegistryKeyPermissionCheck permissionCheck, RegistryRights rights) + public RegistryKey? OpenSubKey(string name, RegistryKeyPermissionCheck permissionCheck, RegistryRights rights) { ValidateKeyName(name); ValidateKeyMode(permissionCheck); @@ -385,7 +384,7 @@ public RegistryKey OpenSubKey(string name, RegistryKeyPermissionCheck permission return InternalOpenSubKeyCore(name, permissionCheck, (int)rights); } - internal RegistryKey InternalOpenSubKeyWithoutSecurityChecks(string name, bool writable) + internal RegistryKey? InternalOpenSubKeyWithoutSecurityChecks(string name, bool writable) { ValidateKeyName(name); EnsureNotDisposed(); @@ -498,7 +497,7 @@ public string[] GetValueNames() /// /// Name of value to retrieve. /// The data associated with the value. - public object GetValue(string name) + public object? GetValue(string? name) { return InternalGetValue(name, null, false); } @@ -515,12 +514,12 @@ public object GetValue(string name) /// Name of value to retrieve. /// Value to return if name doesn't exist. /// The data associated with the value. - public object GetValue(string name, object defaultValue) + public object? GetValue(string? name, object? defaultValue) { return InternalGetValue(name, defaultValue, false); } - public object GetValue(string name, object defaultValue, RegistryValueOptions options) + public object? GetValue(string? name, object? defaultValue, RegistryValueOptions options) { if (options < RegistryValueOptions.None || options > RegistryValueOptions.DoNotExpandEnvironmentNames) { @@ -530,13 +529,13 @@ public object GetValue(string name, object defaultValue, RegistryValueOptions op return InternalGetValue(name, defaultValue, doNotExpand); } - private object InternalGetValue(string name, object defaultValue, bool doNotExpand) + private object? InternalGetValue(string? name, object? defaultValue, bool doNotExpand) { EnsureNotDisposed(); return InternalGetValueCore(name, defaultValue, doNotExpand); } - public RegistryValueKind GetValueKind(string name) + public RegistryValueKind GetValueKind(string? name) { EnsureNotDisposed(); return GetValueKindCore(name); @@ -554,12 +553,12 @@ public string Name /// Sets the specified value. /// Name of value to store data in. /// Data to store. - public void SetValue(string name, object value) + public void SetValue(string? name, object value) { SetValue(name, value, RegistryValueKind.Unknown); } - public void SetValue(string name, object value, RegistryValueKind valueKind) + public void SetValue(string? name, object value, RegistryValueKind valueKind) { if (value == null) { diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKeyPermissionCheck.cs b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKeyPermissionCheck.cs index 92b8b0156c0d4f..f69b6eeb9bd185 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKeyPermissionCheck.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKeyPermissionCheck.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; - namespace Microsoft.Win32 { public enum RegistryKeyPermissionCheck @@ -11,5 +9,5 @@ public enum RegistryKeyPermissionCheck Default = 0, ReadSubTree = 1, ReadWriteSubTree = 2, - }; + } } diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryOptions.cs b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryOptions.cs index 112efd26e9a986..e288412b28107a 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryOptions.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryOptions.cs @@ -11,5 +11,5 @@ public enum RegistryOptions { None = Interop.Advapi32.RegistryOptions.REG_OPTION_NON_VOLATILE, // 0x0000 Volatile = Interop.Advapi32.RegistryOptions.REG_OPTION_VOLATILE, // 0x0001 - }; + } } diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryView.cs b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryView.cs index 0bfe1a53eb25ce..22b153ce05297b 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryView.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryView.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; - namespace Microsoft.Win32 { public enum RegistryView @@ -11,5 +9,5 @@ public enum RegistryView Default = 0, // 0x0000 operate on the default registry view Registry64 = Interop.Advapi32.RegistryView.KEY_WOW64_64KEY, // 0x0100 operate on the 64-bit registry view Registry32 = Interop.Advapi32.RegistryView.KEY_WOW64_32KEY, // 0x0200 operate on the 32-bit registry view - }; + } } diff --git a/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistryRights.cs b/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistryRights.cs index 61e537159ec682..4e5de446385239 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistryRights.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistryRights.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Microsoft.Win32; - namespace System.Security.AccessControl { // We derived this enum from the definitions of KEY_READ and such from diff --git a/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.FileSystem.cs b/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.FileSystem.cs index d41a07e98f6efd..2c81aaa32a21cc 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.FileSystem.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.FileSystem.cs @@ -8,7 +8,7 @@ namespace System.Security.AccessControl { public sealed partial class RegistrySecurity : NativeObjectSecurity { - private static Exception _HandleErrorCodeCore(int errorCode, string name, SafeHandle handle, object context) + private static Exception _HandleErrorCodeCore(int errorCode, string? name, SafeHandle? handle, object? context) { // TODO: Implement this throw new PlatformNotSupportedException(); diff --git a/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.Windows.cs b/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.Windows.cs index 240a1c2bed9356..5bcdd7a464c107 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.Windows.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.Windows.cs @@ -9,9 +9,9 @@ namespace System.Security.AccessControl { public sealed partial class RegistrySecurity : NativeObjectSecurity { - private static Exception _HandleErrorCodeCore(int errorCode, string name, SafeHandle handle, object context) + private static Exception? _HandleErrorCodeCore(int errorCode, string? name, SafeHandle? handle, object? context) { - Exception exception = null; + Exception? exception = null; switch (errorCode) { diff --git a/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.cs b/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.cs index fd8f244dfb83c7..4a3ad7a8985323 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/System/Security/AccessControl/RegistrySecurity.cs @@ -95,7 +95,7 @@ internal RegistrySecurity(SafeRegistryHandle hKey, string name, AccessControlSec { } - private static Exception _HandleErrorCode(int errorCode, string name, SafeHandle handle, object context) + private static Exception? _HandleErrorCode(int errorCode, string? name, SafeHandle? handle, object? context) { return _HandleErrorCodeCore(errorCode, name, handle, context); } diff --git a/src/libraries/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj.cs b/src/libraries/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj.cs index 2385b37bb9adc3..745a8703da65b9 100644 --- a/src/libraries/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj.cs +++ b/src/libraries/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj.cs @@ -118,7 +118,7 @@ public void SetValueWithEnvironmentVariable(string valueName, string envVariable { // ExpandEnvironmentStrings is converting "C:\Program Files (Arm)" to "C:\Program Files (x86)". if (envVariableName == "ProgramFiles" && PlatformDetection.IsArmProcess) - return; // see https://github.com/dotnet/corefx/issues/28856 + return; // see https://github.com/dotnet/runtime/issues/25778 string value = "%" + envVariableName + "%"; Registry.SetValue(TestRegistryKey.Name, valueName, value); diff --git a/src/libraries/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValue_str_obj.cs b/src/libraries/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValue_str_obj.cs index 5f2898eb5250a5..614d1618d80f08 100644 --- a/src/libraries/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValue_str_obj.cs +++ b/src/libraries/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValue_str_obj.cs @@ -116,7 +116,7 @@ public void SetValueWithEnvironmentVariable(string valueName, string envVariable { // ExpandEnvironmentStrings is converting "C:\Program Files (Arm)" to "C:\Program Files (x86)". if (envVariableName == "ProgramFiles" && PlatformDetection.IsArmProcess) - return; // see https://github.com/dotnet/corefx/issues/28856 + return; // see https://github.com/dotnet/runtime/issues/25778 string value = "%" + envVariableName + "%"; TestRegistryKey.SetValue(valueName, value); diff --git a/src/libraries/Microsoft.Win32.SystemEvents/ref/Microsoft.Win32.SystemEvents.cs b/src/libraries/Microsoft.Win32.SystemEvents/ref/Microsoft.Win32.SystemEvents.cs index a1bfcd978255c6..66d8f04e865838 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/ref/Microsoft.Win32.SystemEvents.cs +++ b/src/libraries/Microsoft.Win32.SystemEvents/ref/Microsoft.Win32.SystemEvents.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace Microsoft.Win32 diff --git a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj index 4b1f9323654e69..9305567a07479f 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj +++ b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj @@ -3,10 +3,10 @@ true true enable - SR.PlatformNotSupported_SystemEvents - netstandard2.0;netcoreapp2.0-Windows_NT;netcoreapp3.0-Windows_NT;net461;$(NetCoreAppCurrent)-Windows_NT;$(NetFrameworkCurrent) - true - true + SR.PlatformNotSupported_SystemEvents + $(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netcoreapp2.0-Windows_NT;netcoreapp3.0-Windows_NT;net461;$(NetFrameworkCurrent) + true + true diff --git a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs index 0fb80344d7f17c..06e9bff4dae87f 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs +++ b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs @@ -70,7 +70,6 @@ private SystemEvents() // stole from SystemInformation... if we get SystemInformation moved // to somewhere that we can use it... rip this! - [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private static volatile IntPtr s_processWinStation = IntPtr.Zero; private static volatile bool s_isUserInteractive = false; private static unsafe bool UserInteractive @@ -715,8 +714,6 @@ private unsafe void Initialize() /// This empties this control's callback queue, propagating any exceptions /// back as needed. /// - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void InvokeMarshaledCallbacks() { Debug.Assert(s_threadCallbackList != null, "Invoking marshaled callbacks before there are any"); @@ -998,8 +995,6 @@ private static void RaiseEvent(object key, params object[] args) RaiseEvent(true, key, args); } - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private static void RaiseEvent(bool checkFinalization, object key, params object[] args) { Debug.Assert(args != null && args.Length == 2); @@ -1129,8 +1124,6 @@ private static void Shutdown(object? sender, EventArgs e) /// /// A standard Win32 window proc for our broadcast window. /// - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private IntPtr WindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam) { switch (msg) @@ -1255,8 +1248,6 @@ private IntPtr WindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam) /// is made visible with a size of 0, 0, so that it will trap /// global broadcast messages. /// - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void WindowThreadProc() { try diff --git a/src/libraries/Microsoft.Win32.SystemEvents/tests/SystemEvents.CreateTimer.cs b/src/libraries/Microsoft.Win32.SystemEvents/tests/SystemEvents.CreateTimer.cs index 67bc4136d6bade..a359aefb8f709e 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/tests/SystemEvents.CreateTimer.cs +++ b/src/libraries/Microsoft.Win32.SystemEvents/tests/SystemEvents.CreateTimer.cs @@ -29,7 +29,7 @@ public void CreateTimerInvalidInterval() Assert.Throws(() => SystemEvents.CreateTimer(int.MinValue)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/29166")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/25920")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] public void TimerElapsedSignaled() { diff --git a/src/libraries/Microsoft.Win32.SystemEvents/tests/SystemEvents.InvokeOnEventsThread.cs b/src/libraries/Microsoft.Win32.SystemEvents/tests/SystemEvents.InvokeOnEventsThread.cs index b5ad2066266f5f..8d47307061da12 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/tests/SystemEvents.InvokeOnEventsThread.cs +++ b/src/libraries/Microsoft.Win32.SystemEvents/tests/SystemEvents.InvokeOnEventsThread.cs @@ -14,7 +14,7 @@ namespace Microsoft.Win32.SystemEventsTests { public class InvokeOnEventsThreadTests : SystemEventsTest { - [ActiveIssue("https://github.com/dotnet/corefx/issues/38661", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/29941", TargetFrameworkMonikers.NetFramework)] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] public void InvokeOnEventsThreadRunsAsynchronously() { diff --git a/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs b/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs index 58b582f9688e92..8a08a19efdce71 100644 --- a/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs +++ b/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs @@ -309,7 +309,7 @@ private void GenerateFile(List typeNames, string assemblyName, bool prox //However when a path ending with backslash, if followed by double quote, it becomes an escapte sequence //e.g. "obj\Debug\netcoreapp2.0\", it will be converted as obj\Debug\netcoreapp2.0", which is not valid and not exist //We need remove the ending quote for this situation - if (!outputDirectory.EndsWith("\"") || !Directory.Exists(outputDirectory = outputDirectory.Remove(outputDirectory.Length - 1))) + if (!outputDirectory.EndsWith("\"", StringComparison.Ordinal) || !Directory.Exists(outputDirectory = outputDirectory.Remove(outputDirectory.Length - 1))) { throw new ArgumentException(SR.Format(SR.ErrDirectoryNotExists, outputDirectory)); } diff --git a/src/libraries/Microsoft.XmlSerializer.Generator/tests/Microsoft.XmlSerializer.Generator.Tests.csproj b/src/libraries/Microsoft.XmlSerializer.Generator/tests/Microsoft.XmlSerializer.Generator.Tests.csproj index c1278c3d3b831b..c4377ad3d6506a 100644 --- a/src/libraries/Microsoft.XmlSerializer.Generator/tests/Microsoft.XmlSerializer.Generator.Tests.csproj +++ b/src/libraries/Microsoft.XmlSerializer.Generator/tests/Microsoft.XmlSerializer.Generator.Tests.csproj @@ -11,7 +11,7 @@ "$(TestHostRootPath)$([System.IO.Path]::GetFileName('$(DotNetTool)'))" --fx-version $(ProductVersion) "$(DotNetTool)" set DOTNET_MULTILEVEL_LOOKUP=0 & $(GeneratorCommand) - export DOTNET_MULTILEVEL_LOOKUP=0 & $(GeneratorCommand) + export DOTNET_MULTILEVEL_LOOKUP=0 && $(GeneratorCommand) diff --git a/src/libraries/Native/AnyOS/zlib/pal_zlib.h b/src/libraries/Native/AnyOS/zlib/pal_zlib.h index 93daa5e0b804c2..d784a201b5ca98 100644 --- a/src/libraries/Native/AnyOS/zlib/pal_zlib.h +++ b/src/libraries/Native/AnyOS/zlib/pal_zlib.h @@ -10,7 +10,7 @@ #else #include "pal_types.h" #include "pal_compiler.h" - #define FUNCTIONEXPORT DLLEXPORT + #define FUNCTIONEXPORT PALEXPORT #define FUNCTIONCALLINGCONVENCTION #endif diff --git a/src/libraries/Native/Unix/CMakeLists.txt b/src/libraries/Native/Unix/CMakeLists.txt index 27283371942dab..f6570bc3fffcf9 100644 --- a/src/libraries/Native/Unix/CMakeLists.txt +++ b/src/libraries/Native/Unix/CMakeLists.txt @@ -16,7 +16,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") set(CMAKE_SHARED_LIBRARY_PREFIX "") set(VERSION_FILE_PATH "${CMAKE_BINARY_DIR}/version.c") -# We mark the function which needs exporting with DLLEXPORT +# We mark the function which needs exporting with PALEXPORT add_compile_options(-fvisibility=hidden) add_compile_options(-Wno-format-nonliteral) diff --git a/src/libraries/Native/Unix/Common/pal_compiler.h b/src/libraries/Native/Unix/Common/pal_compiler.h index cb22fc140bae48..52471c6f7eb944 100644 --- a/src/libraries/Native/Unix/Common/pal_compiler.h +++ b/src/libraries/Native/Unix/Common/pal_compiler.h @@ -19,4 +19,6 @@ #define c_static_assert(e) c_static_assert_msg(e, "") #endif -#define DLLEXPORT __attribute__ ((__visibility__ ("default"))) +#ifndef PALEXPORT +#define PALEXPORT __attribute__ ((__visibility__ ("default"))) +#endif // ifndef PALEXPORT diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.c index 68005cbc8011fa..10bdcfafb3410a 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.c +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.c @@ -7,6 +7,8 @@ #include #include +#include "pal_locale_internal.h" +#include "pal_errors_internal.h" #include "pal_calendarData.h" #define GREGORIAN_NAME "gregorian" diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.h index e0d5ac5f46720b..77e8a75be5c73d 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.h @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#pragma once + #include -#include "pal_compiler.h" #include "pal_locale.h" +#include "pal_compiler.h" #include "pal_errors.h" /* @@ -68,25 +70,25 @@ typedef enum // the function pointer definition for the callback used in EnumCalendarInfo typedef void (*EnumCalendarInfoCallback)(const UChar*, const void*); -DLLEXPORT int32_t GlobalizationNative_GetCalendars(const UChar* localeName, +PALEXPORT int32_t GlobalizationNative_GetCalendars(const UChar* localeName, CalendarId* calendars, int32_t calendarsCapacity); -DLLEXPORT ResultCode GlobalizationNative_GetCalendarInfo(const UChar* localeName, +PALEXPORT ResultCode GlobalizationNative_GetCalendarInfo(const UChar* localeName, CalendarId calendarId, CalendarDataType dataType, UChar* result, int32_t resultCapacity); -DLLEXPORT int32_t GlobalizationNative_EnumCalendarInfo(EnumCalendarInfoCallback callback, +PALEXPORT int32_t GlobalizationNative_EnumCalendarInfo(EnumCalendarInfoCallback callback, const UChar* localeName, CalendarId calendarId, CalendarDataType dataType, const void* context); -DLLEXPORT int32_t GlobalizationNative_GetLatestJapaneseEra(void); +PALEXPORT int32_t GlobalizationNative_GetLatestJapaneseEra(void); -DLLEXPORT int32_t GlobalizationNative_GetJapaneseEraStartDate(int32_t era, +PALEXPORT int32_t GlobalizationNative_GetJapaneseEraStartDate(int32_t era, int32_t* startYear, int32_t* startMonth, int32_t* startDay); diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_casing.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_casing.c index 353542390ca7c4..2e90f1481233ec 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_casing.c +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_casing.c @@ -6,8 +6,8 @@ #include #include +#include "pal_icushim_internal.h" #include "pal_casing.h" -#include "pal_icushim.h" // Workaround for warnings produced by U16_NEXT and U16_APPEND macro expansions #pragma clang diagnostic push diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_casing.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_casing.h index 3ea29dd73b4e76..8b790b3be775fb 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_casing.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_casing.h @@ -2,22 +2,22 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#include "pal_compiler.h" #include "pal_locale.h" +#include "pal_compiler.h" -DLLEXPORT void GlobalizationNative_ChangeCase(const UChar* lpSrc, +PALEXPORT void GlobalizationNative_ChangeCase(const UChar* lpSrc, int32_t cwSrcLength, UChar* lpDst, int32_t cwDstLength, int32_t bToUpper); -DLLEXPORT void GlobalizationNative_ChangeCaseInvariant(const UChar* lpSrc, +PALEXPORT void GlobalizationNative_ChangeCaseInvariant(const UChar* lpSrc, int32_t cwSrcLength, UChar* lpDst, int32_t cwDstLength, int32_t bToUpper); -DLLEXPORT void GlobalizationNative_ChangeCaseTurkish(const UChar* lpSrc, +PALEXPORT void GlobalizationNative_ChangeCaseTurkish(const UChar* lpSrc, int32_t cwSrcLength, UChar* lpDst, int32_t cwDstLength, diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_collation.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_collation.c index 4b07e752dce8b6..c5ba1ca33efeef 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_collation.c +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_collation.c @@ -10,6 +10,7 @@ #include #include +#include "pal_errors_internal.h" #include "pal_collation.h" c_static_assert_msg(UCOL_EQUAL == 0, "managed side requires 0 for equal strings"); diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_collation.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_collation.h index 482a59a7eca22c..dd2fcc4252c1ee 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_collation.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_collation.h @@ -2,26 +2,28 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#include "pal_compiler.h" +#pragma once + #include "pal_locale.h" +#include "pal_compiler.h" #include "pal_errors.h" typedef struct SortHandle SortHandle; -DLLEXPORT ResultCode GlobalizationNative_GetSortHandle(const char* lpLocaleName, SortHandle** ppSortHandle); +PALEXPORT ResultCode GlobalizationNative_GetSortHandle(const char* lpLocaleName, SortHandle** ppSortHandle); -DLLEXPORT void GlobalizationNative_CloseSortHandle(SortHandle* pSortHandle); +PALEXPORT void GlobalizationNative_CloseSortHandle(SortHandle* pSortHandle); -DLLEXPORT int32_t GlobalizationNative_GetSortVersion(SortHandle* pSortHandle); +PALEXPORT int32_t GlobalizationNative_GetSortVersion(SortHandle* pSortHandle); -DLLEXPORT int32_t GlobalizationNative_CompareString(SortHandle* pSortHandle, +PALEXPORT int32_t GlobalizationNative_CompareString(SortHandle* pSortHandle, const UChar* lpStr1, int32_t cwStr1Length, const UChar* lpStr2, int32_t cwStr2Length, int32_t options); -DLLEXPORT int32_t GlobalizationNative_IndexOf(SortHandle* pSortHandle, +PALEXPORT int32_t GlobalizationNative_IndexOf(SortHandle* pSortHandle, const UChar* lpTarget, int32_t cwTargetLength, const UChar* lpSource, @@ -29,41 +31,41 @@ DLLEXPORT int32_t GlobalizationNative_IndexOf(SortHandle* pSortHandle, int32_t options, int32_t* pMatchedLength); -DLLEXPORT int32_t GlobalizationNative_LastIndexOf(SortHandle* pSortHandle, +PALEXPORT int32_t GlobalizationNative_LastIndexOf(SortHandle* pSortHandle, const UChar* lpTarget, int32_t cwTargetLength, const UChar* lpSource, int32_t cwSourceLength, int32_t options); -DLLEXPORT int32_t GlobalizationNative_IndexOfOrdinalIgnoreCase(const UChar* lpTarget, +PALEXPORT int32_t GlobalizationNative_IndexOfOrdinalIgnoreCase(const UChar* lpTarget, int32_t cwTargetLength, const UChar* lpSource, int32_t cwSourceLength, int32_t findLast); -DLLEXPORT int32_t GlobalizationNative_StartsWith(SortHandle* pSortHandle, +PALEXPORT int32_t GlobalizationNative_StartsWith(SortHandle* pSortHandle, const UChar* lpTarget, int32_t cwTargetLength, const UChar* lpSource, int32_t cwSourceLength, int32_t options); -DLLEXPORT int32_t GlobalizationNative_EndsWith(SortHandle* pSortHandle, +PALEXPORT int32_t GlobalizationNative_EndsWith(SortHandle* pSortHandle, const UChar* lpTarget, int32_t cwTargetLength, const UChar* lpSource, int32_t cwSourceLength, int32_t options); -DLLEXPORT int32_t GlobalizationNative_GetSortKey(SortHandle* pSortHandle, +PALEXPORT int32_t GlobalizationNative_GetSortKey(SortHandle* pSortHandle, const UChar* lpStr, int32_t cwStrLength, uint8_t* sortKey, int32_t cbSortKeyLength, int32_t options); -DLLEXPORT int32_t GlobalizationNative_CompareStringOrdinalIgnoreCase(const UChar* lpStr1, +PALEXPORT int32_t GlobalizationNative_CompareStringOrdinalIgnoreCase(const UChar* lpStr1, int32_t cwStr1Length, const UChar* lpStr2, int32_t cwStr2Length); diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_errors.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_errors.h index 55d9ca026b9413..8ef1e62eb2b92d 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_errors.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_errors.h @@ -4,8 +4,6 @@ #pragma once -#include "pal_compiler.h" - /* * These values should be kept in sync with * Interop.GlobalizationInterop.ResultCode @@ -17,26 +15,3 @@ typedef enum InsufficentBuffer = 2, OutOfMemory = 3 } ResultCode; - -/* -Converts a UErrorCode to a ResultCode. -*/ -static ResultCode GetResultCode(UErrorCode err) -{ - if (err == U_BUFFER_OVERFLOW_ERROR || err == U_STRING_NOT_TERMINATED_WARNING) - { - return InsufficentBuffer; - } - - if (err == U_MEMORY_ALLOCATION_ERROR) - { - return OutOfMemory; - } - - if (U_SUCCESS(err)) - { - return Success; - } - - return UnknownError; -} diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_errors_internal.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_errors_internal.h new file mode 100644 index 00000000000000..a0b14471d25797 --- /dev/null +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_errors_internal.h @@ -0,0 +1,31 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#pragma once + +#include "pal_icushim_internal.h" +#include "pal_errors.h" + +/* +Converts a UErrorCode to a ResultCode. +*/ +static ResultCode GetResultCode(UErrorCode err) +{ + if (err == U_BUFFER_OVERFLOW_ERROR || err == U_STRING_NOT_TERMINATED_WARNING) + { + return InsufficentBuffer; + } + + if (err == U_MEMORY_ALLOCATION_ERROR) + { + return OutOfMemory; + } + + if (U_SUCCESS(err)) + { + return Success; + } + + return UnknownError; +} diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.c index a71c47ae0ac5fc..bb418e8573e8fd 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.c +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.c @@ -9,6 +9,7 @@ #include #include +#include "pal_icushim_internal.h" #include "pal_icushim.h" // Define pointers to all the used ICU functions diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.h index fff2364026c49f..49db55214bf8dd 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.h @@ -1,245 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// - -// Enable calling ICU functions through shims to enable support for -// multiple versions of ICU. #pragma once -#include "config.h" #include "pal_compiler.h" -#define U_DISABLE_RENAMING 1 - -// All ICU headers need to be included here so that all function prototypes are -// available before the function pointers are declared below. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// List of all functions from the ICU libraries that are used in the System.Globalization.Native.so -#define FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \ - PER_FUNCTION_BLOCK(u_charsToUChars, libicuuc) \ - PER_FUNCTION_BLOCK(u_getVersion, libicuuc) \ - PER_FUNCTION_BLOCK(u_strlen, libicuuc) \ - PER_FUNCTION_BLOCK(u_strncpy, libicuuc) \ - PER_FUNCTION_BLOCK(u_tolower, libicuuc) \ - PER_FUNCTION_BLOCK(u_toupper, libicuuc) \ - PER_FUNCTION_BLOCK(ucal_add, libicui18n) \ - PER_FUNCTION_BLOCK(ucal_close, libicui18n) \ - PER_FUNCTION_BLOCK(ucal_get, libicui18n) \ - PER_FUNCTION_BLOCK(ucal_getAttribute, libicui18n) \ - PER_FUNCTION_BLOCK(ucal_getKeywordValuesForLocale, libicui18n) \ - PER_FUNCTION_BLOCK(ucal_getLimit, libicui18n) \ - PER_FUNCTION_BLOCK(ucal_getTimeZoneDisplayName, libicui18n) \ - PER_FUNCTION_BLOCK(ucal_open, libicui18n) \ - PER_FUNCTION_BLOCK(ucal_set, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_close, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_closeElements, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_getRules, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_getSortKey, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_getStrength, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_getVersion, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_next, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_previous, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_open, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_openElements, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_openRules, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_safeClone, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_setAttribute, libicui18n) \ - PER_FUNCTION_BLOCK(ucol_strcoll, libicui18n) \ - PER_FUNCTION_BLOCK(ucurr_forLocale, libicui18n) \ - PER_FUNCTION_BLOCK(ucurr_getName, libicui18n) \ - PER_FUNCTION_BLOCK(udat_close, libicui18n) \ - PER_FUNCTION_BLOCK(udat_countSymbols, libicui18n) \ - PER_FUNCTION_BLOCK(udat_getSymbols, libicui18n) \ - PER_FUNCTION_BLOCK(udat_open, libicui18n) \ - PER_FUNCTION_BLOCK(udat_setCalendar, libicui18n) \ - PER_FUNCTION_BLOCK(udat_toPattern, libicui18n) \ - PER_FUNCTION_BLOCK(udatpg_close, libicui18n) \ - PER_FUNCTION_BLOCK(udatpg_getBestPattern, libicui18n) \ - PER_FUNCTION_BLOCK(udatpg_open, libicui18n) \ - PER_FUNCTION_BLOCK(uenum_close, libicuuc) \ - PER_FUNCTION_BLOCK(uenum_count, libicuuc) \ - PER_FUNCTION_BLOCK(uenum_next, libicuuc) \ - PER_FUNCTION_BLOCK(uidna_close, libicuuc) \ - PER_FUNCTION_BLOCK(uidna_nameToASCII, libicuuc) \ - PER_FUNCTION_BLOCK(uidna_nameToUnicode, libicuuc) \ - PER_FUNCTION_BLOCK(uidna_openUTS46, libicuuc) \ - PER_FUNCTION_BLOCK(uldn_close, libicui18n) \ - PER_FUNCTION_BLOCK(uldn_keyValueDisplayName, libicui18n) \ - PER_FUNCTION_BLOCK(uldn_open, libicui18n) \ - PER_FUNCTION_BLOCK(uloc_canonicalize, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_countAvailable, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getAvailable, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getBaseName, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getCharacterOrientation, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getCountry, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getDefault, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getDisplayCountry, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getDisplayLanguage, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getDisplayName, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getISO3Country, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getISO3Language, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getKeywordValue, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getLanguage, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getLCID, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getName, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_getParent, libicuuc) \ - PER_FUNCTION_BLOCK(uloc_setKeywordValue, libicuuc) \ - PER_FUNCTION_BLOCK(ulocdata_getMeasurementSystem, libicui18n) \ - PER_FUNCTION_BLOCK(unorm2_getNFCInstance, libicuuc) \ - PER_FUNCTION_BLOCK(unorm2_getNFDInstance, libicuuc) \ - PER_FUNCTION_BLOCK(unorm2_getNFKCInstance, libicuuc) \ - PER_FUNCTION_BLOCK(unorm2_getNFKDInstance, libicuuc) \ - PER_FUNCTION_BLOCK(unorm2_isNormalized, libicuuc) \ - PER_FUNCTION_BLOCK(unorm2_normalize, libicuuc) \ - PER_FUNCTION_BLOCK(unum_close, libicui18n) \ - PER_FUNCTION_BLOCK(unum_getAttribute, libicui18n) \ - PER_FUNCTION_BLOCK(unum_getSymbol, libicui18n) \ - PER_FUNCTION_BLOCK(unum_open, libicui18n) \ - PER_FUNCTION_BLOCK(unum_toPattern, libicui18n) \ - PER_FUNCTION_BLOCK(ures_close, libicuuc) \ - PER_FUNCTION_BLOCK(ures_getByKey, libicuuc) \ - PER_FUNCTION_BLOCK(ures_getSize, libicuuc) \ - PER_FUNCTION_BLOCK(ures_getStringByIndex, libicuuc) \ - PER_FUNCTION_BLOCK(ures_open, libicuuc) \ - PER_FUNCTION_BLOCK(usearch_close, libicui18n) \ - PER_FUNCTION_BLOCK(usearch_first, libicui18n) \ - PER_FUNCTION_BLOCK(usearch_getMatchedLength, libicui18n) \ - PER_FUNCTION_BLOCK(usearch_last, libicui18n) \ - PER_FUNCTION_BLOCK(usearch_openFromCollator, libicui18n) - -#if HAVE_SET_MAX_VARIABLE -#define FOR_ALL_ICU_FUNCTIONS \ - FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \ - PER_FUNCTION_BLOCK(ucol_setMaxVariable, libicui18n) -#else -#define FOR_ALL_ICU_FUNCTIONS \ - FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \ - PER_FUNCTION_BLOCK(ucol_setVariableTop, libicui18n) -#endif - -// Declare pointers to all the used ICU functions -#define PER_FUNCTION_BLOCK(fn, lib) extern __typeof(fn)* fn##_ptr; -FOR_ALL_ICU_FUNCTIONS -#undef PER_FUNCTION_BLOCK - -// Redefine all calls to ICU functions as calls through pointers that are set -// to the functions of the selected version of ICU in the initialization. -#define u_charsToUChars(...) u_charsToUChars_ptr(__VA_ARGS__) -#define u_getVersion(...) u_getVersion_ptr(__VA_ARGS__) -#define u_strlen(...) u_strlen_ptr(__VA_ARGS__) -#define u_strncpy(...) u_strncpy_ptr(__VA_ARGS__) -#define u_tolower(...) u_tolower_ptr(__VA_ARGS__) -#define u_toupper(...) u_toupper_ptr(__VA_ARGS__) -#define ucal_add(...) ucal_add_ptr(__VA_ARGS__) -#define ucal_close(...) ucal_close_ptr(__VA_ARGS__) -#define ucal_get(...) ucal_get_ptr(__VA_ARGS__) -#define ucal_getAttribute(...) ucal_getAttribute_ptr(__VA_ARGS__) -#define ucal_getKeywordValuesForLocale(...) ucal_getKeywordValuesForLocale_ptr(__VA_ARGS__) -#define ucal_getLimit(...) ucal_getLimit_ptr(__VA_ARGS__) -#define ucal_getTimeZoneDisplayName(...) ucal_getTimeZoneDisplayName_ptr(__VA_ARGS__) -#define ucal_open(...) ucal_open_ptr(__VA_ARGS__) -#define ucal_set(...) ucal_set_ptr(__VA_ARGS__) -#define ucol_close(...) ucol_close_ptr(__VA_ARGS__) -#define ucol_closeElements(...) ucol_closeElements_ptr(__VA_ARGS__) -#define ucol_getRules(...) ucol_getRules_ptr(__VA_ARGS__) -#define ucol_getSortKey(...) ucol_getSortKey_ptr(__VA_ARGS__) -#define ucol_getStrength(...) ucol_getStrength_ptr(__VA_ARGS__) -#define ucol_getVersion(...) ucol_getVersion_ptr(__VA_ARGS__) -#define ucol_next(...) ucol_next_ptr(__VA_ARGS__) -#define ucol_previous(...) ucol_previous_ptr(__VA_ARGS__) -#define ucol_open(...) ucol_open_ptr(__VA_ARGS__) -#define ucol_openElements(...) ucol_openElements_ptr(__VA_ARGS__) -#define ucol_openRules(...) ucol_openRules_ptr(__VA_ARGS__) -#define ucol_safeClone(...) ucol_safeClone_ptr(__VA_ARGS__) -#define ucol_setAttribute(...) ucol_setAttribute_ptr(__VA_ARGS__) -#if HAVE_SET_MAX_VARIABLE -#define ucol_setMaxVariable(...) ucol_setMaxVariable_ptr(__VA_ARGS__) -#else -#define ucol_setVariableTop(...) ucol_setVariableTop_ptr(__VA_ARGS__) -#endif -#define ucol_strcoll(...) ucol_strcoll_ptr(__VA_ARGS__) -#define ucurr_forLocale(...) ucurr_forLocale_ptr(__VA_ARGS__) -#define ucurr_getName(...) ucurr_getName_ptr(__VA_ARGS__) -#define udat_close(...) udat_close_ptr(__VA_ARGS__) -#define udat_countSymbols(...) udat_countSymbols_ptr(__VA_ARGS__) -#define udat_getSymbols(...) udat_getSymbols_ptr(__VA_ARGS__) -#define udat_open(...) udat_open_ptr(__VA_ARGS__) -#define udat_setCalendar(...) udat_setCalendar_ptr(__VA_ARGS__) -#define udat_toPattern(...) udat_toPattern_ptr(__VA_ARGS__) -#define udatpg_close(...) udatpg_close_ptr(__VA_ARGS__) -#define udatpg_getBestPattern(...) udatpg_getBestPattern_ptr(__VA_ARGS__) -#define udatpg_open(...) udatpg_open_ptr(__VA_ARGS__) -#define uenum_close(...) uenum_close_ptr(__VA_ARGS__) -#define uenum_count(...) uenum_count_ptr(__VA_ARGS__) -#define uenum_next(...) uenum_next_ptr(__VA_ARGS__) -#define uidna_close(...) uidna_close_ptr(__VA_ARGS__) -#define uidna_nameToASCII(...) uidna_nameToASCII_ptr(__VA_ARGS__) -#define uidna_nameToUnicode(...) uidna_nameToUnicode_ptr(__VA_ARGS__) -#define uidna_openUTS46(...) uidna_openUTS46_ptr(__VA_ARGS__) -#define uldn_close(...) uldn_close_ptr(__VA_ARGS__) -#define uldn_keyValueDisplayName(...) uldn_keyValueDisplayName_ptr(__VA_ARGS__) -#define uldn_open(...) uldn_open_ptr(__VA_ARGS__) -#define uloc_canonicalize(...) uloc_canonicalize_ptr(__VA_ARGS__) -#define uloc_countAvailable(...) uloc_countAvailable_ptr(__VA_ARGS__) -#define uloc_getAvailable(...) uloc_getAvailable_ptr(__VA_ARGS__) -#define uloc_getBaseName(...) uloc_getBaseName_ptr(__VA_ARGS__) -#define uloc_getCharacterOrientation(...) uloc_getCharacterOrientation_ptr(__VA_ARGS__) -#define uloc_getCountry(...) uloc_getCountry_ptr(__VA_ARGS__) -#define uloc_getDefault(...) uloc_getDefault_ptr(__VA_ARGS__) -#define uloc_getDisplayCountry(...) uloc_getDisplayCountry_ptr(__VA_ARGS__) -#define uloc_getDisplayLanguage(...) uloc_getDisplayLanguage_ptr(__VA_ARGS__) -#define uloc_getDisplayName(...) uloc_getDisplayName_ptr(__VA_ARGS__) -#define uloc_getISO3Country(...) uloc_getISO3Country_ptr(__VA_ARGS__) -#define uloc_getISO3Language(...) uloc_getISO3Language_ptr(__VA_ARGS__) -#define uloc_getKeywordValue(...) uloc_getKeywordValue_ptr(__VA_ARGS__) -#define uloc_getLanguage(...) uloc_getLanguage_ptr(__VA_ARGS__) -#define uloc_getLCID(...) uloc_getLCID_ptr(__VA_ARGS__) -#define uloc_getName(...) uloc_getName_ptr(__VA_ARGS__) -#define uloc_getParent(...) uloc_getParent_ptr(__VA_ARGS__) -#define uloc_setKeywordValue(...) uloc_setKeywordValue_ptr(__VA_ARGS__) -#define ulocdata_getMeasurementSystem(...) ulocdata_getMeasurementSystem_ptr(__VA_ARGS__) -#define unorm2_getNFCInstance(...) unorm2_getNFCInstance_ptr(__VA_ARGS__) -#define unorm2_getNFDInstance(...) unorm2_getNFDInstance_ptr(__VA_ARGS__) -#define unorm2_getNFKCInstance(...) unorm2_getNFKCInstance_ptr(__VA_ARGS__) -#define unorm2_getNFKDInstance(...) unorm2_getNFKDInstance_ptr(__VA_ARGS__) -#define unorm2_isNormalized(...) unorm2_isNormalized_ptr(__VA_ARGS__) -#define unorm2_normalize(...) unorm2_normalize_ptr(__VA_ARGS__) -#define unum_close(...) unum_close_ptr(__VA_ARGS__) -#define unum_getAttribute(...) unum_getAttribute_ptr(__VA_ARGS__) -#define unum_getSymbol(...) unum_getSymbol_ptr(__VA_ARGS__) -#define unum_open(...) unum_open_ptr(__VA_ARGS__) -#define unum_toPattern(...) unum_toPattern_ptr(__VA_ARGS__) -#define ures_close(...) ures_close_ptr(__VA_ARGS__) -#define ures_getByKey(...) ures_getByKey_ptr(__VA_ARGS__) -#define ures_getSize(...) ures_getSize_ptr(__VA_ARGS__) -#define ures_getStringByIndex(...) ures_getStringByIndex_ptr(__VA_ARGS__) -#define ures_open(...) ures_open_ptr(__VA_ARGS__) -#define usearch_close(...) usearch_close_ptr(__VA_ARGS__) -#define usearch_first(...) usearch_first_ptr(__VA_ARGS__) -#define usearch_getMatchedLength(...) usearch_getMatchedLength_ptr(__VA_ARGS__) -#define usearch_last(...) usearch_last_ptr(__VA_ARGS__) -#define usearch_openFromCollator(...) usearch_openFromCollator_ptr(__VA_ARGS__) - -DLLEXPORT int32_t GlobalizationNative_LoadICU(void); +PALEXPORT int32_t GlobalizationNative_LoadICU(void); -DLLEXPORT int32_t GlobalizationNative_GetICUVersion(void); +PALEXPORT int32_t GlobalizationNative_GetICUVersion(void); diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal.h new file mode 100644 index 00000000000000..c6a48f964a2a00 --- /dev/null +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal.h @@ -0,0 +1,240 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +// Enable calling ICU functions through shims to enable support for +// multiple versions of ICU. + +#pragma once + +#include "config.h" + +#define U_DISABLE_RENAMING 1 + +// All ICU headers need to be included here so that all function prototypes are +// available before the function pointers are declared below. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// List of all functions from the ICU libraries that are used in the System.Globalization.Native.so +#define FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \ + PER_FUNCTION_BLOCK(u_charsToUChars, libicuuc) \ + PER_FUNCTION_BLOCK(u_getVersion, libicuuc) \ + PER_FUNCTION_BLOCK(u_strlen, libicuuc) \ + PER_FUNCTION_BLOCK(u_strncpy, libicuuc) \ + PER_FUNCTION_BLOCK(u_tolower, libicuuc) \ + PER_FUNCTION_BLOCK(u_toupper, libicuuc) \ + PER_FUNCTION_BLOCK(ucal_add, libicui18n) \ + PER_FUNCTION_BLOCK(ucal_close, libicui18n) \ + PER_FUNCTION_BLOCK(ucal_get, libicui18n) \ + PER_FUNCTION_BLOCK(ucal_getAttribute, libicui18n) \ + PER_FUNCTION_BLOCK(ucal_getKeywordValuesForLocale, libicui18n) \ + PER_FUNCTION_BLOCK(ucal_getLimit, libicui18n) \ + PER_FUNCTION_BLOCK(ucal_getTimeZoneDisplayName, libicui18n) \ + PER_FUNCTION_BLOCK(ucal_open, libicui18n) \ + PER_FUNCTION_BLOCK(ucal_set, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_close, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_closeElements, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_getRules, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_getSortKey, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_getStrength, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_getVersion, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_next, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_previous, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_open, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_openElements, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_openRules, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_safeClone, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_setAttribute, libicui18n) \ + PER_FUNCTION_BLOCK(ucol_strcoll, libicui18n) \ + PER_FUNCTION_BLOCK(ucurr_forLocale, libicui18n) \ + PER_FUNCTION_BLOCK(ucurr_getName, libicui18n) \ + PER_FUNCTION_BLOCK(udat_close, libicui18n) \ + PER_FUNCTION_BLOCK(udat_countSymbols, libicui18n) \ + PER_FUNCTION_BLOCK(udat_getSymbols, libicui18n) \ + PER_FUNCTION_BLOCK(udat_open, libicui18n) \ + PER_FUNCTION_BLOCK(udat_setCalendar, libicui18n) \ + PER_FUNCTION_BLOCK(udat_toPattern, libicui18n) \ + PER_FUNCTION_BLOCK(udatpg_close, libicui18n) \ + PER_FUNCTION_BLOCK(udatpg_getBestPattern, libicui18n) \ + PER_FUNCTION_BLOCK(udatpg_open, libicui18n) \ + PER_FUNCTION_BLOCK(uenum_close, libicuuc) \ + PER_FUNCTION_BLOCK(uenum_count, libicuuc) \ + PER_FUNCTION_BLOCK(uenum_next, libicuuc) \ + PER_FUNCTION_BLOCK(uidna_close, libicuuc) \ + PER_FUNCTION_BLOCK(uidna_nameToASCII, libicuuc) \ + PER_FUNCTION_BLOCK(uidna_nameToUnicode, libicuuc) \ + PER_FUNCTION_BLOCK(uidna_openUTS46, libicuuc) \ + PER_FUNCTION_BLOCK(uldn_close, libicui18n) \ + PER_FUNCTION_BLOCK(uldn_keyValueDisplayName, libicui18n) \ + PER_FUNCTION_BLOCK(uldn_open, libicui18n) \ + PER_FUNCTION_BLOCK(uloc_canonicalize, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_countAvailable, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getAvailable, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getBaseName, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getCharacterOrientation, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getCountry, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getDefault, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getDisplayCountry, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getDisplayLanguage, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getDisplayName, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getISO3Country, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getISO3Language, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getKeywordValue, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getLanguage, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getLCID, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getName, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_getParent, libicuuc) \ + PER_FUNCTION_BLOCK(uloc_setKeywordValue, libicuuc) \ + PER_FUNCTION_BLOCK(ulocdata_getMeasurementSystem, libicui18n) \ + PER_FUNCTION_BLOCK(unorm2_getNFCInstance, libicuuc) \ + PER_FUNCTION_BLOCK(unorm2_getNFDInstance, libicuuc) \ + PER_FUNCTION_BLOCK(unorm2_getNFKCInstance, libicuuc) \ + PER_FUNCTION_BLOCK(unorm2_getNFKDInstance, libicuuc) \ + PER_FUNCTION_BLOCK(unorm2_isNormalized, libicuuc) \ + PER_FUNCTION_BLOCK(unorm2_normalize, libicuuc) \ + PER_FUNCTION_BLOCK(unum_close, libicui18n) \ + PER_FUNCTION_BLOCK(unum_getAttribute, libicui18n) \ + PER_FUNCTION_BLOCK(unum_getSymbol, libicui18n) \ + PER_FUNCTION_BLOCK(unum_open, libicui18n) \ + PER_FUNCTION_BLOCK(unum_toPattern, libicui18n) \ + PER_FUNCTION_BLOCK(ures_close, libicuuc) \ + PER_FUNCTION_BLOCK(ures_getByKey, libicuuc) \ + PER_FUNCTION_BLOCK(ures_getSize, libicuuc) \ + PER_FUNCTION_BLOCK(ures_getStringByIndex, libicuuc) \ + PER_FUNCTION_BLOCK(ures_open, libicuuc) \ + PER_FUNCTION_BLOCK(usearch_close, libicui18n) \ + PER_FUNCTION_BLOCK(usearch_first, libicui18n) \ + PER_FUNCTION_BLOCK(usearch_getMatchedLength, libicui18n) \ + PER_FUNCTION_BLOCK(usearch_last, libicui18n) \ + PER_FUNCTION_BLOCK(usearch_openFromCollator, libicui18n) + +#if HAVE_SET_MAX_VARIABLE +#define FOR_ALL_ICU_FUNCTIONS \ + FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \ + PER_FUNCTION_BLOCK(ucol_setMaxVariable, libicui18n) +#else +#define FOR_ALL_ICU_FUNCTIONS \ + FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \ + PER_FUNCTION_BLOCK(ucol_setVariableTop, libicui18n) +#endif + +// Declare pointers to all the used ICU functions +#define PER_FUNCTION_BLOCK(fn, lib) extern __typeof(fn)* fn##_ptr; +FOR_ALL_ICU_FUNCTIONS +#undef PER_FUNCTION_BLOCK + +// Redefine all calls to ICU functions as calls through pointers that are set +// to the functions of the selected version of ICU in the initialization. +#define u_charsToUChars(...) u_charsToUChars_ptr(__VA_ARGS__) +#define u_getVersion(...) u_getVersion_ptr(__VA_ARGS__) +#define u_strlen(...) u_strlen_ptr(__VA_ARGS__) +#define u_strncpy(...) u_strncpy_ptr(__VA_ARGS__) +#define u_tolower(...) u_tolower_ptr(__VA_ARGS__) +#define u_toupper(...) u_toupper_ptr(__VA_ARGS__) +#define ucal_add(...) ucal_add_ptr(__VA_ARGS__) +#define ucal_close(...) ucal_close_ptr(__VA_ARGS__) +#define ucal_get(...) ucal_get_ptr(__VA_ARGS__) +#define ucal_getAttribute(...) ucal_getAttribute_ptr(__VA_ARGS__) +#define ucal_getKeywordValuesForLocale(...) ucal_getKeywordValuesForLocale_ptr(__VA_ARGS__) +#define ucal_getLimit(...) ucal_getLimit_ptr(__VA_ARGS__) +#define ucal_getTimeZoneDisplayName(...) ucal_getTimeZoneDisplayName_ptr(__VA_ARGS__) +#define ucal_open(...) ucal_open_ptr(__VA_ARGS__) +#define ucal_set(...) ucal_set_ptr(__VA_ARGS__) +#define ucol_close(...) ucol_close_ptr(__VA_ARGS__) +#define ucol_closeElements(...) ucol_closeElements_ptr(__VA_ARGS__) +#define ucol_getRules(...) ucol_getRules_ptr(__VA_ARGS__) +#define ucol_getSortKey(...) ucol_getSortKey_ptr(__VA_ARGS__) +#define ucol_getStrength(...) ucol_getStrength_ptr(__VA_ARGS__) +#define ucol_getVersion(...) ucol_getVersion_ptr(__VA_ARGS__) +#define ucol_next(...) ucol_next_ptr(__VA_ARGS__) +#define ucol_previous(...) ucol_previous_ptr(__VA_ARGS__) +#define ucol_open(...) ucol_open_ptr(__VA_ARGS__) +#define ucol_openElements(...) ucol_openElements_ptr(__VA_ARGS__) +#define ucol_openRules(...) ucol_openRules_ptr(__VA_ARGS__) +#define ucol_safeClone(...) ucol_safeClone_ptr(__VA_ARGS__) +#define ucol_setAttribute(...) ucol_setAttribute_ptr(__VA_ARGS__) +#if HAVE_SET_MAX_VARIABLE +#define ucol_setMaxVariable(...) ucol_setMaxVariable_ptr(__VA_ARGS__) +#else +#define ucol_setVariableTop(...) ucol_setVariableTop_ptr(__VA_ARGS__) +#endif +#define ucol_strcoll(...) ucol_strcoll_ptr(__VA_ARGS__) +#define ucurr_forLocale(...) ucurr_forLocale_ptr(__VA_ARGS__) +#define ucurr_getName(...) ucurr_getName_ptr(__VA_ARGS__) +#define udat_close(...) udat_close_ptr(__VA_ARGS__) +#define udat_countSymbols(...) udat_countSymbols_ptr(__VA_ARGS__) +#define udat_getSymbols(...) udat_getSymbols_ptr(__VA_ARGS__) +#define udat_open(...) udat_open_ptr(__VA_ARGS__) +#define udat_setCalendar(...) udat_setCalendar_ptr(__VA_ARGS__) +#define udat_toPattern(...) udat_toPattern_ptr(__VA_ARGS__) +#define udatpg_close(...) udatpg_close_ptr(__VA_ARGS__) +#define udatpg_getBestPattern(...) udatpg_getBestPattern_ptr(__VA_ARGS__) +#define udatpg_open(...) udatpg_open_ptr(__VA_ARGS__) +#define uenum_close(...) uenum_close_ptr(__VA_ARGS__) +#define uenum_count(...) uenum_count_ptr(__VA_ARGS__) +#define uenum_next(...) uenum_next_ptr(__VA_ARGS__) +#define uidna_close(...) uidna_close_ptr(__VA_ARGS__) +#define uidna_nameToASCII(...) uidna_nameToASCII_ptr(__VA_ARGS__) +#define uidna_nameToUnicode(...) uidna_nameToUnicode_ptr(__VA_ARGS__) +#define uidna_openUTS46(...) uidna_openUTS46_ptr(__VA_ARGS__) +#define uldn_close(...) uldn_close_ptr(__VA_ARGS__) +#define uldn_keyValueDisplayName(...) uldn_keyValueDisplayName_ptr(__VA_ARGS__) +#define uldn_open(...) uldn_open_ptr(__VA_ARGS__) +#define uloc_canonicalize(...) uloc_canonicalize_ptr(__VA_ARGS__) +#define uloc_countAvailable(...) uloc_countAvailable_ptr(__VA_ARGS__) +#define uloc_getAvailable(...) uloc_getAvailable_ptr(__VA_ARGS__) +#define uloc_getBaseName(...) uloc_getBaseName_ptr(__VA_ARGS__) +#define uloc_getCharacterOrientation(...) uloc_getCharacterOrientation_ptr(__VA_ARGS__) +#define uloc_getCountry(...) uloc_getCountry_ptr(__VA_ARGS__) +#define uloc_getDefault(...) uloc_getDefault_ptr(__VA_ARGS__) +#define uloc_getDisplayCountry(...) uloc_getDisplayCountry_ptr(__VA_ARGS__) +#define uloc_getDisplayLanguage(...) uloc_getDisplayLanguage_ptr(__VA_ARGS__) +#define uloc_getDisplayName(...) uloc_getDisplayName_ptr(__VA_ARGS__) +#define uloc_getISO3Country(...) uloc_getISO3Country_ptr(__VA_ARGS__) +#define uloc_getISO3Language(...) uloc_getISO3Language_ptr(__VA_ARGS__) +#define uloc_getKeywordValue(...) uloc_getKeywordValue_ptr(__VA_ARGS__) +#define uloc_getLanguage(...) uloc_getLanguage_ptr(__VA_ARGS__) +#define uloc_getLCID(...) uloc_getLCID_ptr(__VA_ARGS__) +#define uloc_getName(...) uloc_getName_ptr(__VA_ARGS__) +#define uloc_getParent(...) uloc_getParent_ptr(__VA_ARGS__) +#define uloc_setKeywordValue(...) uloc_setKeywordValue_ptr(__VA_ARGS__) +#define ulocdata_getMeasurementSystem(...) ulocdata_getMeasurementSystem_ptr(__VA_ARGS__) +#define unorm2_getNFCInstance(...) unorm2_getNFCInstance_ptr(__VA_ARGS__) +#define unorm2_getNFDInstance(...) unorm2_getNFDInstance_ptr(__VA_ARGS__) +#define unorm2_getNFKCInstance(...) unorm2_getNFKCInstance_ptr(__VA_ARGS__) +#define unorm2_getNFKDInstance(...) unorm2_getNFKDInstance_ptr(__VA_ARGS__) +#define unorm2_isNormalized(...) unorm2_isNormalized_ptr(__VA_ARGS__) +#define unorm2_normalize(...) unorm2_normalize_ptr(__VA_ARGS__) +#define unum_close(...) unum_close_ptr(__VA_ARGS__) +#define unum_getAttribute(...) unum_getAttribute_ptr(__VA_ARGS__) +#define unum_getSymbol(...) unum_getSymbol_ptr(__VA_ARGS__) +#define unum_open(...) unum_open_ptr(__VA_ARGS__) +#define unum_toPattern(...) unum_toPattern_ptr(__VA_ARGS__) +#define ures_close(...) ures_close_ptr(__VA_ARGS__) +#define ures_getByKey(...) ures_getByKey_ptr(__VA_ARGS__) +#define ures_getSize(...) ures_getSize_ptr(__VA_ARGS__) +#define ures_getStringByIndex(...) ures_getStringByIndex_ptr(__VA_ARGS__) +#define ures_open(...) ures_open_ptr(__VA_ARGS__) +#define usearch_close(...) usearch_close_ptr(__VA_ARGS__) +#define usearch_first(...) usearch_first_ptr(__VA_ARGS__) +#define usearch_getMatchedLength(...) usearch_getMatchedLength_ptr(__VA_ARGS__) +#define usearch_last(...) usearch_last_ptr(__VA_ARGS__) +#define usearch_openFromCollator(...) usearch_openFromCollator_ptr(__VA_ARGS__) diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_idna.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_idna.c index 6ce504d61f9488..97fe2315511d53 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_idna.c +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_idna.c @@ -5,7 +5,7 @@ #include -#include "pal_icushim.h" +#include "pal_icushim_internal.h" #include "pal_idna.h" static const uint32_t AllowUnassigned = 0x1; diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_idna.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_idna.h index f2228cbd535fc0..b7cf6fa5482ae4 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_idna.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_idna.h @@ -3,16 +3,18 @@ // See the LICENSE file in the project root for more information. // -#include "pal_compiler.h" +#pragma once + #include "pal_locale.h" +#include "pal_compiler.h" -DLLEXPORT int32_t GlobalizationNative_ToAscii(uint32_t flags, +PALEXPORT int32_t GlobalizationNative_ToAscii(uint32_t flags, const UChar* lpSrc, int32_t cwSrcLength, UChar* lpDst, int32_t cwDstLength); -DLLEXPORT int32_t GlobalizationNative_ToUnicode(uint32_t flags, +PALEXPORT int32_t GlobalizationNative_ToUnicode(uint32_t flags, const UChar* lpSrc, int32_t cwSrcLength, UChar* lpDst, diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_locale.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_locale.c index ffbeef3d15f128..8dab4d98fd050e 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_locale.c +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_locale.c @@ -9,6 +9,7 @@ #include #include +#include "pal_locale_internal.h" #include "pal_locale.h" int32_t UErrorCodeToBool(UErrorCode status) diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_locale.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_locale.h index f771954d65f643..4f7dd556e357b5 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_locale.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_locale.h @@ -2,59 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#include "pal_icushim.h" +#pragma once -/* -Function: -UErrorCodeToBool +#include "pal_compiler.h" -Convert an ICU UErrorCode to a Bool compatible with Win32 -Returns 1 for success, 0 otherwise -*/ -int32_t UErrorCodeToBool(UErrorCode code); +PALEXPORT int32_t GlobalizationNative_GetLocales(UChar *value, int32_t valueLength); -/* -Function: -GetLocale +PALEXPORT int32_t GlobalizationNative_GetLocaleName(const UChar* localeName, UChar* value, int32_t valueLength); -Converts a managed localeName into something ICU understands and can use as a localeName. -*/ -int32_t GetLocale(const UChar* localeName, - char* localeNameResult, - int32_t localeNameResultLength, - UBool canonicalize, - UErrorCode* err); +PALEXPORT int32_t GlobalizationNative_GetDefaultLocaleName(UChar* value, int32_t valueLength); -/* -Function: -u_charsToUChars_safe - -Copies the given null terminated char* to UChar with error checking. Replacement for ICU u_charsToUChars -*/ -void u_charsToUChars_safe(const char* str, UChar* value, int32_t valueLength, UErrorCode* err); - -/* -Function: -FixupLocaleName - -Replace underscores with hyphens to interop with existing .NET code. -Returns the length of the string. -*/ -int32_t FixupLocaleName(UChar* value, int32_t valueLength); - -/* -Function: -DetectDefaultLocaleName - -Detect the default locale for the machine, defaulting to Invaraint if -we can't compute one (different from uloc_getDefault()) would do. -*/ -const char* DetectDefaultLocaleName(void); - -DLLEXPORT int32_t GlobalizationNative_GetLocales(UChar *value, int32_t valueLength); - -DLLEXPORT int32_t GlobalizationNative_GetLocaleName(const UChar* localeName, UChar* value, int32_t valueLength); - -DLLEXPORT int32_t GlobalizationNative_GetDefaultLocaleName(UChar* value, int32_t valueLength); - -DLLEXPORT int32_t GlobalizationNative_IsPredefinedLocale(const UChar* localeName); +PALEXPORT int32_t GlobalizationNative_IsPredefinedLocale(const UChar* localeName); diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.c index 01d970a5b9991a..0beae272c7aff7 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.c +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.c @@ -7,6 +7,7 @@ #include #include +#include "pal_locale_internal.h" #include "pal_localeNumberData.h" // invariant character definitions used by ICU diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.h index 32eb3fd8a0798d..2599ba5ad4c427 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.h @@ -3,8 +3,10 @@ // See the LICENSE file in the project root for more information. // -#include "pal_compiler.h" +#pragma once + #include "pal_locale.h" +#include "pal_compiler.h" // Enum that corresponds to managed enum CultureData.LocaleNumberData. // The numeric values of the enum members match their Win32 counterparts. @@ -34,11 +36,11 @@ typedef enum WeekRule_FirstFourDayWeek = 2 } CalendarWeekRule; -DLLEXPORT int32_t GlobalizationNative_GetLocaleInfoInt(const UChar* localeName, +PALEXPORT int32_t GlobalizationNative_GetLocaleInfoInt(const UChar* localeName, LocaleNumberData localeNumberData, int32_t* value); -DLLEXPORT int32_t GlobalizationNative_GetLocaleInfoGroupingSizes(const UChar* localeName, +PALEXPORT int32_t GlobalizationNative_GetLocaleInfoGroupingSizes(const UChar* localeName, LocaleNumberData localeGroupingData, int32_t* primaryGroupSize, int32_t* secondaryGroupSize); diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.c index c16b87d3af78d8..f0894b73ee1000 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.c +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.c @@ -7,6 +7,7 @@ #include #include +#include "pal_locale_internal.h" #include "pal_localeStringData.h" /* diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.h index 58894284f1ecad..01584d2673360b 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.h @@ -3,8 +3,10 @@ // See the LICENSE file in the project root for more information. // -#include "pal_compiler.h" +#pragma once + #include "pal_locale.h" +#include "pal_compiler.h" // Enum that corresponds to managed enum CultureData.LocaleStringData. // The numeric values of the enum members match their Win32 counterparts. @@ -43,12 +45,12 @@ typedef enum LocaleString_PerMilleSymbol = 0x00000077 } LocaleStringData; -DLLEXPORT int32_t GlobalizationNative_GetLocaleInfoString(const UChar* localeName, +PALEXPORT int32_t GlobalizationNative_GetLocaleInfoString(const UChar* localeName, LocaleStringData localeStringData, UChar* value, int32_t valueLength); -DLLEXPORT int32_t GlobalizationNative_GetLocaleTimeFormat(const UChar* localeName, +PALEXPORT int32_t GlobalizationNative_GetLocaleTimeFormat(const UChar* localeName, int shortFormat, UChar* value, int32_t valueLength); diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_locale_internal.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_locale_internal.h new file mode 100644 index 00000000000000..24a6307e1026a8 --- /dev/null +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_locale_internal.h @@ -0,0 +1,54 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#pragma once + +#include "pal_icushim_internal.h" + +/* +Function: +UErrorCodeToBool + +Convert an ICU UErrorCode to a Bool compatible with Win32 +Returns 1 for success, 0 otherwise +*/ +int32_t UErrorCodeToBool(UErrorCode code); + +/* +Function: +GetLocale + +Converts a managed localeName into something ICU understands and can use as a localeName. +*/ +int32_t GetLocale(const UChar* localeName, + char* localeNameResult, + int32_t localeNameResultLength, + UBool canonicalize, + UErrorCode* err); + +/* +Function: +u_charsToUChars_safe + +Copies the given null terminated char* to UChar with error checking. Replacement for ICU u_charsToUChars +*/ +void u_charsToUChars_safe(const char* str, UChar* value, int32_t valueLength, UErrorCode* err); + +/* +Function: +FixupLocaleName + +Replace underscores with hyphens to interop with existing .NET code. +Returns the length of the string. +*/ +int32_t FixupLocaleName(UChar* value, int32_t valueLength); + +/* +Function: +DetectDefaultLocaleName + +Detect the default locale for the machine, defaulting to Invaraint if +we can't compute one (different from uloc_getDefault()) would do. +*/ +const char* DetectDefaultLocaleName(void); diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.c index 46b41554b7d3d2..7b2c6414dad58a 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.c +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.c @@ -5,7 +5,7 @@ #include -#include "pal_icushim.h" +#include "pal_icushim_internal.h" #include "pal_normalization.h" static const UNormalizer2* GetNormalizerForForm(NormalizationForm normalizationForm, UErrorCode* pErrorCode) diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.h index 993d95678d3ddf..aca8b50e35b92c 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.h @@ -3,8 +3,10 @@ // See the LICENSE file in the project root for more information. // -#include "pal_compiler.h" +#pragma once + #include "pal_locale.h" +#include "pal_compiler.h" /* * These values should be kept in sync with System.Text.NormalizationForm @@ -17,11 +19,11 @@ typedef enum FormKD = 0x6 } NormalizationForm; -DLLEXPORT int32_t GlobalizationNative_IsNormalized(NormalizationForm normalizationForm, +PALEXPORT int32_t GlobalizationNative_IsNormalized(NormalizationForm normalizationForm, const UChar* lpStr, int32_t cwStrLength); -DLLEXPORT int32_t GlobalizationNative_NormalizeString(NormalizationForm normalizationForm, +PALEXPORT int32_t GlobalizationNative_NormalizeString(NormalizationForm normalizationForm, const UChar* lpSrc, int32_t cwSrcLength, UChar* lpDst, diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.c index bf2a9dca0f2cab..537464dd2358a0 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.c +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.c @@ -6,6 +6,8 @@ #include #include +#include "pal_errors_internal.h" +#include "pal_locale_internal.h" #include "pal_timeZoneInfo.h" /* diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.h index 1c030ca0c3cb18..e08439d260ac4e 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.h @@ -3,8 +3,10 @@ // See the LICENSE file in the project root for more information. // -#include "pal_compiler.h" +#pragma once + #include "pal_locale.h" +#include "pal_compiler.h" #include "pal_errors.h" /* @@ -17,7 +19,7 @@ typedef enum TimeZoneDisplayName_DaylightSavings = 2, } TimeZoneDisplayNameType; -DLLEXPORT ResultCode GlobalizationNative_GetTimeZoneDisplayName(const UChar* localeName, +PALEXPORT ResultCode GlobalizationNative_GetTimeZoneDisplayName(const UChar* localeName, const UChar* timeZoneId, TimeZoneDisplayNameType type, UChar* result, diff --git a/src/libraries/Native/Unix/System.IO.Ports.Native/pal_serial.h b/src/libraries/Native/Unix/System.IO.Ports.Native/pal_serial.h index b998de87e30ec8..3d35b8186ed899 100644 --- a/src/libraries/Native/Unix/System.IO.Ports.Native/pal_serial.h +++ b/src/libraries/Native/Unix/System.IO.Ports.Native/pal_serial.h @@ -5,5 +5,5 @@ #include "pal_types.h" #include "pal_compiler.h" -DLLEXPORT intptr_t SystemIoPortsNative_SerialPortOpen(const char * name); -DLLEXPORT int SystemIoPortsNative_SerialPortClose(intptr_t fd); +PALEXPORT intptr_t SystemIoPortsNative_SerialPortOpen(const char * name); +PALEXPORT int SystemIoPortsNative_SerialPortClose(intptr_t fd); diff --git a/src/libraries/Native/Unix/System.IO.Ports.Native/pal_termios.h b/src/libraries/Native/Unix/System.IO.Ports.Native/pal_termios.h index ae260a7630cdd5..5b3c8f626c9f2f 100644 --- a/src/libraries/Native/Unix/System.IO.Ports.Native/pal_termios.h +++ b/src/libraries/Native/Unix/System.IO.Ports.Native/pal_termios.h @@ -5,16 +5,16 @@ #include "pal_types.h" #include "pal_compiler.h" -DLLEXPORT int32_t SystemIoPortsNative_TermiosGetSignal(intptr_t fd, int32_t signal); -DLLEXPORT int32_t SystemIoPortsNative_TermiosSetSignal(intptr_t fd, int32_t signal, int32_t set); -DLLEXPORT int32_t SystemIoPortsNative_TermiosGetAllSignals(intptr_t fd); +PALEXPORT int32_t SystemIoPortsNative_TermiosGetSignal(intptr_t fd, int32_t signal); +PALEXPORT int32_t SystemIoPortsNative_TermiosSetSignal(intptr_t fd, int32_t signal, int32_t set); +PALEXPORT int32_t SystemIoPortsNative_TermiosGetAllSignals(intptr_t fd); -DLLEXPORT int32_t SystemIoPortsNative_TermiosGetSpeed(intptr_t fd); -DLLEXPORT int32_t SystemIoPortsNative_TermiosSetSpeed(intptr_t fd, int32_t speed); +PALEXPORT int32_t SystemIoPortsNative_TermiosGetSpeed(intptr_t fd); +PALEXPORT int32_t SystemIoPortsNative_TermiosSetSpeed(intptr_t fd, int32_t speed); -DLLEXPORT int32_t SystemIoPortsNative_TermiosAvailableBytes(intptr_t fd, int32_t readBuffer); +PALEXPORT int32_t SystemIoPortsNative_TermiosAvailableBytes(intptr_t fd, int32_t readBuffer); -DLLEXPORT int32_t SystemIoPortsNative_TermiosReset(intptr_t fd, int32_t speed, int32_t dataBits, int32_t stopBits, int32_t parity, int32_t handshake); -DLLEXPORT int32_t SystemIoPortsNative_TermiosDiscard(intptr_t fd, int32_t queue); -DLLEXPORT int32_t SystemIoPortsNative_TermiosDrain(intptr_t fd); -DLLEXPORT int32_t SystemIoPortsNative_TermiosSendBreak(intptr_t fd, int32_t duration); +PALEXPORT int32_t SystemIoPortsNative_TermiosReset(intptr_t fd, int32_t speed, int32_t dataBits, int32_t stopBits, int32_t parity, int32_t handshake); +PALEXPORT int32_t SystemIoPortsNative_TermiosDiscard(intptr_t fd, int32_t queue); +PALEXPORT int32_t SystemIoPortsNative_TermiosDrain(intptr_t fd); +PALEXPORT int32_t SystemIoPortsNative_TermiosSendBreak(intptr_t fd, int32_t duration); diff --git a/src/libraries/Native/Unix/System.Native/pal_console.h b/src/libraries/Native/Unix/System.Native/pal_console.h index f5b59c04ca5ebc..db0837ebc81b7d 100644 --- a/src/libraries/Native/Unix/System.Native/pal_console.h +++ b/src/libraries/Native/Unix/System.Native/pal_console.h @@ -47,7 +47,7 @@ typedef struct * * Returns 0 on success; otherwise, returns errorNo. */ -DLLEXPORT int32_t SystemNative_GetWindowSize(WinSize* windowsSize); +PALEXPORT int32_t SystemNative_GetWindowSize(WinSize* windowsSize); /** * Gets whether the specified file descriptor is for a terminal. @@ -55,14 +55,14 @@ DLLEXPORT int32_t SystemNative_GetWindowSize(WinSize* windowsSize); * Returns 1 if the file descriptor is referring to a terminal; * otherwise returns 0 and sets errno. */ -DLLEXPORT int32_t SystemNative_IsATty(intptr_t fd); +PALEXPORT int32_t SystemNative_IsATty(intptr_t fd); /** * Initializes signal handling and terminal for use by System.Console and System.Diagnostics.Process. * * Returns 1 on success; otherwise returns 0 and sets errno. */ -DLLEXPORT int32_t SystemNative_InitializeTerminalAndSignalHandling(void); +PALEXPORT int32_t SystemNative_InitializeTerminalAndSignalHandling(void); /** * Stores the string that can be written to stdout to transition @@ -70,7 +70,7 @@ DLLEXPORT int32_t SystemNative_InitializeTerminalAndSignalHandling(void); * * Returns 1 on success; otherwise returns 0 and sets errno. */ -DLLEXPORT void SystemNative_SetKeypadXmit(const char* terminfoString); +PALEXPORT void SystemNative_SetKeypadXmit(const char* terminfoString); /** * Gets the special control character codes for the requested control characters. @@ -80,40 +80,40 @@ DLLEXPORT void SystemNative_SetKeypadXmit(const char* terminfoString); * or 0 if a particular name is unsupported or disabled. posixDisableValue is the special sentinel used in the output * controlCharacterValues array to indicate no value is available. */ -DLLEXPORT void SystemNative_GetControlCharacters( +PALEXPORT void SystemNative_GetControlCharacters( int32_t* controlCharacterNames, uint8_t* controlCharacterValues, int32_t controlCharacterLength, uint8_t* posixDisableValue); /** * Returns 1 if any input is waiting on stdin; otherwise, 0. */ -DLLEXPORT int32_t SystemNative_StdinReady(void); +PALEXPORT int32_t SystemNative_StdinReady(void); /** * Configures the terminal for System.Console Read. */ -DLLEXPORT void SystemNative_InitializeConsoleBeforeRead(uint8_t minChars, uint8_t decisecondsTimeout); +PALEXPORT void SystemNative_InitializeConsoleBeforeRead(uint8_t minChars, uint8_t decisecondsTimeout); /** * Configures the terminal after System.Console Read. */ -DLLEXPORT void SystemNative_UninitializeConsoleAfterRead(void); +PALEXPORT void SystemNative_UninitializeConsoleAfterRead(void); /** * Configures the terminal for child processes. */ -DLLEXPORT void SystemNative_ConfigureTerminalForChildProcess(int32_t enable); +PALEXPORT void SystemNative_ConfigureTerminalForChildProcess(int32_t enable); /** * Reads the number of bytes specified into the provided buffer from stdin. * Returns the number of bytes read on success; otherwise, -1 is returned an errno is set. */ -DLLEXPORT int32_t SystemNative_ReadStdin(void* buffer, int32_t bufferSize); +PALEXPORT int32_t SystemNative_ReadStdin(void* buffer, int32_t bufferSize); /** * Gets the terminal's break mode. */ -DLLEXPORT int32_t SystemNative_GetSignalForBreak(void); +PALEXPORT int32_t SystemNative_GetSignalForBreak(void); /** * Configures the terminal's break mode. @@ -122,7 +122,7 @@ DLLEXPORT int32_t SystemNative_GetSignalForBreak(void); * * Returns 1 on success, 0 on failure, in which case errno is set. */ -DLLEXPORT int32_t SystemNative_SetSignalForBreak(int32_t signalForBreak); +PALEXPORT int32_t SystemNative_SetSignalForBreak(int32_t signalForBreak); typedef enum { diff --git a/src/libraries/Native/Unix/System.Native/pal_datetime.h b/src/libraries/Native/Unix/System.Native/pal_datetime.h index 7cae83797b5033..3440bc305a2dcd 100644 --- a/src/libraries/Native/Unix/System.Native/pal_datetime.h +++ b/src/libraries/Native/Unix/System.Native/pal_datetime.h @@ -6,4 +6,4 @@ #include "pal_compiler.h" -DLLEXPORT int64_t SystemNative_GetSystemTimeAsTicks(void); +PALEXPORT int64_t SystemNative_GetSystemTimeAsTicks(void); diff --git a/src/libraries/Native/Unix/System.Native/pal_errno.h b/src/libraries/Native/Unix/System.Native/pal_errno.h index 1aa566ffd30f30..c4ba9ccd6e5080 100644 --- a/src/libraries/Native/Unix/System.Native/pal_errno.h +++ b/src/libraries/Native/Unix/System.Native/pal_errno.h @@ -132,14 +132,14 @@ typedef enum * Error above. If the value is not recognized, returns * Error_ENONSTANDARD. */ -DLLEXPORT int32_t SystemNative_ConvertErrorPlatformToPal(int32_t platformErrno); +PALEXPORT int32_t SystemNative_ConvertErrorPlatformToPal(int32_t platformErrno); /** * Converts the given PAL Error value to a platform-specific errno * value. This is to be used when we want to synthesize a given error * and obtain the appropriate error message via StrErrorR. */ -DLLEXPORT int32_t SystemNative_ConvertErrorPalToPlatform(int32_t error); +PALEXPORT int32_t SystemNative_ConvertErrorPalToPlatform(int32_t error); /** * Obtains the system error message for the given raw numeric value @@ -162,4 +162,4 @@ DLLEXPORT int32_t SystemNative_ConvertErrorPalToPlatform(int32_t error); * returned and the buffer is filled with as much of the message * as possible and null-terminated. */ -DLLEXPORT const char* SystemNative_StrErrorR(int32_t platformErrno, char* buffer, int32_t bufferSize); +PALEXPORT const char* SystemNative_StrErrorR(int32_t platformErrno, char* buffer, int32_t bufferSize); diff --git a/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c b/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c index 4db081d9a9aa96..a656046577525a 100644 --- a/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c +++ b/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c @@ -373,7 +373,7 @@ int32_t SystemNative_GetNetworkInterfaces(int32_t * interfaceCount, NetworkInter ecmd.cmd = ETHTOOL_GSET; if (ioctl(socketfd, SIOCETHTOOL, &ifr) == 0) { - nii->Speed = (int)ethtool_cmd_speed(&ecmd); + nii->Speed = (int64_t)ethtool_cmd_speed(&ecmd); if (nii->Speed > 0) { // If we did not get -1 diff --git a/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.h b/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.h index ab4392aab439e0..7ea4fb6b72179b 100644 --- a/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.h +++ b/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.h @@ -37,8 +37,8 @@ typedef struct typedef struct { char Name[16]; // OS Interface name. + int64_t Speed; // Link speed for physical interfaces. uint32_t InterfaceIndex; // Interface index. - int32_t Speed; // Link speed for physical interfaces. int32_t Mtu; // Interface MTU. uint16_t HardwareType; // Interface mapped from L2 to NetworkInterfaceType. uint8_t OperationalState; // Operational status. @@ -53,10 +53,10 @@ typedef void (*IPv6AddressFound)(const char* interfaceName, IpAddressInfo* info, typedef void (*LinkLayerAddressFound)(const char* interfaceName, LinkLayerAddressInfo* llAddress); typedef void (*GatewayAddressFound)(IpAddressInfo* addressInfo); -DLLEXPORT int32_t SystemNative_EnumerateInterfaceAddresses( +PALEXPORT int32_t SystemNative_EnumerateInterfaceAddresses( IPv4AddressFound onIpv4Found, IPv6AddressFound onIpv6Found, LinkLayerAddressFound onLinkLayerFound); -DLLEXPORT int32_t SystemNative_GetNetworkInterfaces(int32_t * interfaceCount, NetworkInterfaceInfo** interfaces, int32_t * addressCount, IpAddressInfo **addressList); +PALEXPORT int32_t SystemNative_GetNetworkInterfaces(int32_t * interfaceCount, NetworkInterfaceInfo** interfaces, int32_t * addressCount, IpAddressInfo **addressList); #if HAVE_RT_MSGHDR -DLLEXPORT int32_t SystemNative_EnumerateGatewayAddressesForInterface(uint32_t interfaceIndex, GatewayAddressFound onGatewayFound); +PALEXPORT int32_t SystemNative_EnumerateGatewayAddressesForInterface(uint32_t interfaceIndex, GatewayAddressFound onGatewayFound); #endif diff --git a/src/libraries/Native/Unix/System.Native/pal_io.h b/src/libraries/Native/Unix/System.Native/pal_io.h index 147e64e8945857..136f534e163e4e 100644 --- a/src/libraries/Native/Unix/System.Native/pal_io.h +++ b/src/libraries/Native/Unix/System.Native/pal_io.h @@ -332,85 +332,85 @@ typedef enum * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_FStat(intptr_t fd, FileStatus* output); +PALEXPORT int32_t SystemNative_FStat(intptr_t fd, FileStatus* output); /** * Get file status from a full path. Implemented as shim to stat(2). * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_Stat(const char* path, FileStatus* output); +PALEXPORT int32_t SystemNative_Stat(const char* path, FileStatus* output); /** * Get file stats from a full path. Implemented as shim to lstat(2). * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_LStat(const char* path, FileStatus* output); +PALEXPORT int32_t SystemNative_LStat(const char* path, FileStatus* output); /** * Open or create a file or device. Implemented as shim to open(2). * * Returns file descriptor or -1 for failure. Sets errno on failure. */ -DLLEXPORT intptr_t SystemNative_Open(const char* path, int32_t flags, int32_t mode); +PALEXPORT intptr_t SystemNative_Open(const char* path, int32_t flags, int32_t mode); /** * Close a file descriptor. Implemented as shim to open(2). * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_Close(intptr_t fd); +PALEXPORT int32_t SystemNative_Close(intptr_t fd); /** * Duplicates a file descriptor. * * Returns the duplication descriptor for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT intptr_t SystemNative_Dup(intptr_t oldfd); +PALEXPORT intptr_t SystemNative_Dup(intptr_t oldfd); /** * Delete an entry from the file system. Implemented as shim to unlink(2). * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_Unlink(const char* path); +PALEXPORT int32_t SystemNative_Unlink(const char* path); /** * Open or create a shared memory object. Implemented as shim to shm_open(3). * * Returns file descriptor or -1 on fiailure. Sets errno on failure. */ -DLLEXPORT intptr_t SystemNative_ShmOpen(const char* name, int32_t flags, int32_t mode); +PALEXPORT intptr_t SystemNative_ShmOpen(const char* name, int32_t flags, int32_t mode); /** * Unlink a shared memory object. Implemented as shim to shm_unlink(3). * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_ShmUnlink(const char* name); +PALEXPORT int32_t SystemNative_ShmUnlink(const char* name); /** * Returns the size of the dirent struct on the current architecture */ -DLLEXPORT int32_t SystemNative_GetReadDirRBufferSize(void); +PALEXPORT int32_t SystemNative_GetReadDirRBufferSize(void); /** * Re-entrant readdir that will retrieve the next dirent from the directory stream pointed to by dir. * * Returns 0 when data is retrieved; returns -1 when end-of-stream is reached; returns an error code on failure */ -DLLEXPORT int32_t SystemNative_ReadDirR(DIR* dir, uint8_t* buffer, int32_t bufferSize, DirectoryEntry* outputEntry); +PALEXPORT int32_t SystemNative_ReadDirR(DIR* dir, uint8_t* buffer, int32_t bufferSize, DirectoryEntry* outputEntry); /** * Returns a DIR struct containing info about the current path or NULL on failure; sets errno on fail. */ -DLLEXPORT DIR* SystemNative_OpenDir(const char* path); +PALEXPORT DIR* SystemNative_OpenDir(const char* path); /** * Closes the directory stream opened by opendir and returns 0 on success. On fail, -1 is returned and errno is set */ -DLLEXPORT int32_t SystemNative_CloseDir(DIR* dir); +PALEXPORT int32_t SystemNative_CloseDir(DIR* dir); /** * Creates a pipe. Implemented as shim to pipe(2) or pipe2(2) if available. @@ -418,7 +418,7 @@ DLLEXPORT int32_t SystemNative_CloseDir(DIR* dir); * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_Pipe(int32_t pipefd[2], // [out] pipefds[0] gets read end, pipefd[1] gets write end. +PALEXPORT int32_t SystemNative_Pipe(int32_t pipefd[2], // [out] pipefds[0] gets read end, pipefd[1] gets write end. int32_t flags); // 0 for defaults or PAL_O_CLOEXEC for close-on-exec // NOTE: Rather than a general fcntl shim, we opt to export separate functions @@ -430,21 +430,21 @@ DLLEXPORT int32_t SystemNative_Pipe(int32_t pipefd[2], // [out] pipefds[0] gets * * Returns 0 for success; -1 for failure. Sets errno for failure. */ -DLLEXPORT int32_t SystemNative_FcntlSetFD(intptr_t fd, int32_t flags); +PALEXPORT int32_t SystemNative_FcntlSetFD(intptr_t fd, int32_t flags); /** * Gets the flags on a file descriptor. * * Returns flags for success; -1 for failure. Sets errno for failure. */ -DLLEXPORT int32_t SystemNative_FcntlGetFD(intptr_t fd); +PALEXPORT int32_t SystemNative_FcntlGetFD(intptr_t fd); /** * Determines if the current platform supports getting and setting pipe capacity. * * Returns true (non-zero) if supported, false (zero) if not. */ -DLLEXPORT int32_t SystemNative_FcntlCanGetSetPipeSz(void); +PALEXPORT int32_t SystemNative_FcntlCanGetSetPipeSz(void); /** * Gets the capacity of a pipe. @@ -453,7 +453,7 @@ DLLEXPORT int32_t SystemNative_FcntlCanGetSetPipeSz(void); * * NOTE: Some platforms do not support this operation and will always fail with errno = ENOTSUP. */ -DLLEXPORT int32_t SystemNative_FcntlGetPipeSz(intptr_t fd); +PALEXPORT int32_t SystemNative_FcntlGetPipeSz(intptr_t fd); /** * Sets the capacity of a pipe. @@ -462,56 +462,56 @@ DLLEXPORT int32_t SystemNative_FcntlGetPipeSz(intptr_t fd); * * NOTE: Some platforms do not support this operation and will always fail with errno = ENOTSUP. */ -DLLEXPORT int32_t SystemNative_FcntlSetPipeSz(intptr_t fd, int32_t size); +PALEXPORT int32_t SystemNative_FcntlSetPipeSz(intptr_t fd, int32_t size); /** * Sets whether or not a file descriptor is non-blocking. * * Returns 0 for success, -1 for failure. Sets errno for failure. */ -DLLEXPORT int32_t SystemNative_FcntlSetIsNonBlocking(intptr_t fd, int32_t isNonBlocking); +PALEXPORT int32_t SystemNative_FcntlSetIsNonBlocking(intptr_t fd, int32_t isNonBlocking); /** * Create a directory. Implemented as a shim to mkdir(2). * * Returns 0 for success, -1 for failure. Sets errno for failure. */ -DLLEXPORT int32_t SystemNative_MkDir(const char* path, int32_t mode); +PALEXPORT int32_t SystemNative_MkDir(const char* path, int32_t mode); /** * Change permissions of a file. Implemented as a shim to chmod(2). * * Returns 0 for success, -1 for failure. Sets errno for failure. */ -DLLEXPORT int32_t SystemNative_ChMod(const char* path, int32_t mode); +PALEXPORT int32_t SystemNative_ChMod(const char* path, int32_t mode); /** * Change permissions of a file. Implemented as a shim to fchmod(2). * * Returns 0 for success, -1 for failure. Sets errno for failure. */ -DLLEXPORT int32_t SystemNative_FChMod(intptr_t fd, int32_t mode); +PALEXPORT int32_t SystemNative_FChMod(intptr_t fd, int32_t mode); /** * Flushes all modified data and attribtues of the specified File Descriptor to the storage medium. * * Returns 0 for success; on fail, -1 is returned and errno is set. */ -DLLEXPORT int32_t SystemNative_FSync(intptr_t fd); +PALEXPORT int32_t SystemNative_FSync(intptr_t fd); /** * Changes the advisory lock status on a given File Descriptor * * Returns 0 on success; otherwise, -1 is returned and errno is set */ -DLLEXPORT int32_t SystemNative_FLock(intptr_t fd, int32_t operation); +PALEXPORT int32_t SystemNative_FLock(intptr_t fd, int32_t operation); /** * Changes the current working directory to be the specified path. * * Returns 0 on success; otherwise, returns -1 and errno is set */ -DLLEXPORT int32_t SystemNative_ChDir(const char* path); +PALEXPORT int32_t SystemNative_ChDir(const char* path); /** * Checks the access permissions of the current calling user on the specified path for the specified mode. @@ -519,7 +519,7 @@ DLLEXPORT int32_t SystemNative_ChDir(const char* path); * Returns -1 if the path cannot be found or the if desired access is not granted and errno is set; otherwise, returns * 0. */ -DLLEXPORT int32_t SystemNative_Access(const char* path, int32_t mode); +PALEXPORT int32_t SystemNative_Access(const char* path, int32_t mode); /** * Seek to a specified location within a seekable stream @@ -527,14 +527,14 @@ DLLEXPORT int32_t SystemNative_Access(const char* path, int32_t mode); * On success, the resulting offet, in bytes, from the beginning of the stream; otherwise, * returns -1 and errno is set. */ -DLLEXPORT int64_t SystemNative_LSeek(intptr_t fd, int64_t offset, int32_t whence); +PALEXPORT int64_t SystemNative_LSeek(intptr_t fd, int64_t offset, int32_t whence); /** * Creates a hard-link at link pointing to source. * * Returns 0 on success; otherwise, returns -1 and errno is set. */ -DLLEXPORT int32_t SystemNative_Link(const char* source, const char* linkTarget); +PALEXPORT int32_t SystemNative_Link(const char* source, const char* linkTarget); /** * Creates a file name that adheres to the specified template, creates the file on disk with @@ -542,7 +542,7 @@ DLLEXPORT int32_t SystemNative_Link(const char* source, const char* linkTarget); * * Returns a valid File Descriptor on success; otherwise, returns -1 and errno is set. */ -DLLEXPORT intptr_t SystemNative_MksTemps(char* pathTemplate, int32_t suffixLength); +PALEXPORT intptr_t SystemNative_MksTemps(char* pathTemplate, int32_t suffixLength); /** * Map file or device into memory. Implemented as shim to mmap(2). @@ -552,7 +552,7 @@ DLLEXPORT intptr_t SystemNative_MksTemps(char* pathTemplate, int32_t suffixLengt * Note that null failure result is a departure from underlying * mmap(2) using non-null sentinel. */ -DLLEXPORT void* SystemNative_MMap(void* address, +PALEXPORT void* SystemNative_MMap(void* address, uint64_t length, int32_t protection, // bitwise OR of PAL_PROT_* int32_t flags, // bitwise OR of PAL_MAP_*, but PRIVATE and SHARED are mutually exclusive. @@ -564,21 +564,21 @@ DLLEXPORT void* SystemNative_MMap(void* address, * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_MUnmap(void* address, uint64_t length); +PALEXPORT int32_t SystemNative_MUnmap(void* address, uint64_t length); /** * Give advice about use of memory. Implemented as shim to madvise(2). * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_MAdvise(void* address, uint64_t length, int32_t advice); +PALEXPORT int32_t SystemNative_MAdvise(void* address, uint64_t length, int32_t advice); /** * Sycnhronize a file with a memory map. Implemented as shim to mmap(2). * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_MSync(void* address, uint64_t length, int32_t flags); +PALEXPORT int32_t SystemNative_MSync(void* address, uint64_t length, int32_t flags); /** * Get system configuration value. Implemented as shim to sysconf(3). @@ -589,14 +589,14 @@ DLLEXPORT int32_t SystemNative_MSync(void* address, uint64_t length, int32_t fla * note that -1 can also be a meaningful successful return value, in * which case errno is unchanged. */ -DLLEXPORT int64_t SystemNative_SysConf(int32_t name); +PALEXPORT int64_t SystemNative_SysConf(int32_t name); /** * Truncate a file to given length. Implemented as shim to ftruncate(2). * * Returns 0 for success, -1 for failure. Sets errno on failure. */ -DLLEXPORT int32_t SystemNative_FTruncate(intptr_t fd, int64_t length); +PALEXPORT int32_t SystemNative_FTruncate(intptr_t fd, int64_t length); /** * Examines one or more file descriptors for the specified state(s) and blocks until the state(s) occur or the timeout @@ -605,7 +605,7 @@ DLLEXPORT int32_t SystemNative_FTruncate(intptr_t fd, int64_t length); * Returns an error or Error_SUCCESS. `triggered` is set to the number of ready descriptors if any. The number of * triggered descriptors may be zero in the event of a timeout. */ -DLLEXPORT int32_t SystemNative_Poll(PollEvent* pollEvents, uint32_t eventCount, int32_t milliseconds, uint32_t* triggered); +PALEXPORT int32_t SystemNative_Poll(PollEvent* pollEvents, uint32_t eventCount, int32_t milliseconds, uint32_t* triggered); /** * Notifies the OS kernel that the specified file will be accessed in a particular way soon; this allows the kernel to @@ -613,14 +613,14 @@ DLLEXPORT int32_t SystemNative_Poll(PollEvent* pollEvents, uint32_t eventCount, * * Returns 0 on success; otherwise, the error code is returned and errno is NOT set. */ -DLLEXPORT int32_t SystemNative_PosixFAdvise(intptr_t fd, int64_t offset, int64_t length, int32_t advice); +PALEXPORT int32_t SystemNative_PosixFAdvise(intptr_t fd, int64_t offset, int64_t length, int32_t advice); /** * Reads a line from the provided stream. * * Returns the read line, or null if no line could be read. The caller is responsible for freeing the malloc'd line. */ -DLLEXPORT char* SystemNative_GetLine(FILE* stream); +PALEXPORT char* SystemNative_GetLine(FILE* stream); /** * Reads the number of bytes specified into the provided buffer from the specified, opened file descriptor. @@ -629,7 +629,7 @@ DLLEXPORT char* SystemNative_GetLine(FILE* stream); * * Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info */ -DLLEXPORT int32_t SystemNative_Read(intptr_t fd, void* buffer, int32_t bufferSize); +PALEXPORT int32_t SystemNative_Read(intptr_t fd, void* buffer, int32_t bufferSize); /** * Takes a path to a symbolic link and attempts to place the link target path into the buffer. If the buffer is too @@ -637,7 +637,7 @@ DLLEXPORT int32_t SystemNative_Read(intptr_t fd, void* buffer, int32_t bufferSiz * * Returns the number of bytes placed into the buffer on success; otherwise, -1 is returned and errno is set. */ -DLLEXPORT int32_t SystemNative_ReadLink(const char* path, char* buffer, int32_t bufferSize); +PALEXPORT int32_t SystemNative_ReadLink(const char* path, char* buffer, int32_t bufferSize); /** * Renames a file, moving to the correct destination if necessary. There are many edge cases to this call, check man 2 @@ -645,33 +645,33 @@ DLLEXPORT int32_t SystemNative_ReadLink(const char* path, char* buffer, int32_t * * Returns 0 on succes; otherwise, returns -1 and errno is set. */ -DLLEXPORT int32_t SystemNative_Rename(const char* oldPath, const char* newPath); +PALEXPORT int32_t SystemNative_Rename(const char* oldPath, const char* newPath); /** * Deletes the specified empty directory. * * Returns 0 on success; otherwise, returns -1 and errno is set. */ -DLLEXPORT int32_t SystemNative_RmDir(const char* path); +PALEXPORT int32_t SystemNative_RmDir(const char* path); /** * Forces a write of all modified I/O buffers to their storage mediums. */ -DLLEXPORT void SystemNative_Sync(void); +PALEXPORT void SystemNative_Sync(void); /** * Writes the specified buffer to the provided open file descriptor * * Returns the number of bytes written on success; otherwise, returns -1 and sets errno */ -DLLEXPORT int32_t SystemNative_Write(intptr_t fd, const void* buffer, int32_t bufferSize); +PALEXPORT int32_t SystemNative_Write(intptr_t fd, const void* buffer, int32_t bufferSize); /** * Copies all data from the source file descriptor/path to the destination file path. * * Returns 0 on success; otherwise, returns -1 and sets errno. */ -DLLEXPORT int32_t SystemNative_CopyFile(intptr_t sourceFd, const char* srcPath, const char* destPath, int32_t overwrite); +PALEXPORT int32_t SystemNative_CopyFile(intptr_t sourceFd, const char* srcPath, const char* destPath, int32_t overwrite); /** * Initializes a new inotify instance and returns a file @@ -680,7 +680,7 @@ DLLEXPORT int32_t SystemNative_CopyFile(intptr_t sourceFd, const char* srcPath, * Returns a new file descriptor on success. * On error, -1 is returned, and errno is set to indicate the error. */ -DLLEXPORT intptr_t SystemNative_INotifyInit(void); +PALEXPORT intptr_t SystemNative_INotifyInit(void); /** * Adds a new watch, or modifies an existing watch, @@ -689,7 +689,7 @@ DLLEXPORT intptr_t SystemNative_INotifyInit(void); * Returns a nonnegative watch descriptor on success. * On error -1 is returned and errno is set appropriately. */ -DLLEXPORT int32_t SystemNative_INotifyAddWatch(intptr_t fd, const char* pathName, uint32_t mask); +PALEXPORT int32_t SystemNative_INotifyAddWatch(intptr_t fd, const char* pathName, uint32_t mask); /** * Removes the watch associated with the watch descriptor wd @@ -697,21 +697,21 @@ DLLEXPORT int32_t SystemNative_INotifyAddWatch(intptr_t fd, const char* pathName * * Returns 0 on success, or -1 if an error occurred (in which case, errno is set appropriately). */ -DLLEXPORT int32_t SystemNative_INotifyRemoveWatch(intptr_t fd, int32_t wd); +PALEXPORT int32_t SystemNative_INotifyRemoveWatch(intptr_t fd, int32_t wd); /** * Expands all symbolic links and expands all paths to return an absolute path * * Returns the result absolute path on success or null on error with errno set appropriately. */ -DLLEXPORT char* SystemNative_RealPath(const char* path); +PALEXPORT char* SystemNative_RealPath(const char* path); /** * Attempts to retrieve the ID of the process at the end of the given socket * * Returns 0 on success, or -1 if an error occurred (in which case, errno is set appropriately). */ -DLLEXPORT int32_t SystemNative_GetPeerID(intptr_t socket, uid_t* euid); +PALEXPORT int32_t SystemNative_GetPeerID(intptr_t socket, uid_t* euid); /** * Attempts to lock/unlock the region of the file "fd" specified by the offset and length. lockType @@ -719,18 +719,18 @@ DLLEXPORT int32_t SystemNative_GetPeerID(intptr_t socket, uid_t* euid); * * Returns 0 on success, or -1 if an error occurred (in which case, errno is set appropriately). */ -DLLEXPORT int32_t SystemNative_LockFileRegion(intptr_t fd, int64_t offset, int64_t length, int16_t lockType); +PALEXPORT int32_t SystemNative_LockFileRegion(intptr_t fd, int64_t offset, int64_t length, int16_t lockType); /** * Changes the file flags of the file whose location is specified in path * * Returns 0 for success, -1 for failure. Sets errno for failure. */ -DLLEXPORT int32_t SystemNative_LChflags(const char* path, uint32_t flags); +PALEXPORT int32_t SystemNative_LChflags(const char* path, uint32_t flags); /** * Determines if the current platform supports setting UF_HIDDEN (0x8000) flag * * Returns true (non-zero) if supported, false (zero) if not. */ -DLLEXPORT int32_t SystemNative_LChflagsCanSetHiddenFlag(void); +PALEXPORT int32_t SystemNative_LChflagsCanSetHiddenFlag(void); diff --git a/src/libraries/Native/Unix/System.Native/pal_memory.h b/src/libraries/Native/Unix/System.Native/pal_memory.h index a5b1bdbeeda565..c77d211b1f7ebe 100644 --- a/src/libraries/Native/Unix/System.Native/pal_memory.h +++ b/src/libraries/Native/Unix/System.Native/pal_memory.h @@ -12,4 +12,4 @@ * * Returns a pointer to the memory. */ -DLLEXPORT void* SystemNative_MemSet(void *s, int c, uintptr_t n); +PALEXPORT void* SystemNative_MemSet(void *s, int c, uintptr_t n); diff --git a/src/libraries/Native/Unix/System.Native/pal_mount.h b/src/libraries/Native/Unix/System.Native/pal_mount.h index beec3649def856..0a425705f292ca 100644 --- a/src/libraries/Native/Unix/System.Native/pal_mount.h +++ b/src/libraries/Native/Unix/System.Native/pal_mount.h @@ -27,7 +27,7 @@ typedef void (*MountPointFound)(const char* name); /** * Gets the space information for the given mount point and populates the input struct with the data. */ -DLLEXPORT int32_t SystemNative_GetSpaceInfoForMountPoint(const char* name, MountPointInformation* mpi); +PALEXPORT int32_t SystemNative_GetSpaceInfoForMountPoint(const char* name, MountPointInformation* mpi); /** * Gets the format information about the given mount point. @@ -38,7 +38,7 @@ DLLEXPORT int32_t SystemNative_GetSpaceInfoForMountPoint(const char* name, Mount * Since C# is much better at enum and string handling, pass either the char buffer or the long type * back, depending on what the platform gives us, and let C# reason on it in an easy way. */ -DLLEXPORT int32_t SystemNative_GetFormatInfoForMountPoint( +PALEXPORT int32_t SystemNative_GetFormatInfoForMountPoint( const char* name, char* formatNameBuffer, int32_t bufferLength, int64_t* formatType); /** @@ -46,4 +46,4 @@ DLLEXPORT int32_t SystemNative_GetFormatInfoForMountPoint( * function pointer once-per-mount-point to prevent heap allocs * as much as possible. */ -DLLEXPORT int32_t SystemNative_GetAllMountPoints(MountPointFound onFound); +PALEXPORT int32_t SystemNative_GetAllMountPoints(MountPointFound onFound); diff --git a/src/libraries/Native/Unix/System.Native/pal_networkchange.c b/src/libraries/Native/Unix/System.Native/pal_networkchange.c index 7dd6d7939316bc..3c493ef76dd882 100644 --- a/src/libraries/Native/Unix/System.Native/pal_networkchange.c +++ b/src/libraries/Native/Unix/System.Native/pal_networkchange.c @@ -162,10 +162,8 @@ void SystemNative_ReadEvents(int32_t sock, NetworkChangeEvent onNetworkChange) case RTM_ADD: case RTM_DELETE: case RTM_REDIRECT: - { onNetworkChange(sock, AvailabilityChanged); return; - } default: break; } diff --git a/src/libraries/Native/Unix/System.Native/pal_networkchange.h b/src/libraries/Native/Unix/System.Native/pal_networkchange.h index 727f17b5b14b03..cc178ae3ab4472 100644 --- a/src/libraries/Native/Unix/System.Native/pal_networkchange.h +++ b/src/libraries/Native/Unix/System.Native/pal_networkchange.h @@ -19,8 +19,8 @@ typedef enum typedef void (*NetworkChangeEvent)(int32_t sock, NetworkChangeKind notificationKind); -DLLEXPORT void SystemNative_ReadEvents(int32_t sock, NetworkChangeEvent onNetworkChange); +PALEXPORT void SystemNative_ReadEvents(int32_t sock, NetworkChangeEvent onNetworkChange); -DLLEXPORT Error SystemNative_CreateNetworkChangeListenerSocket(int32_t* retSocket); +PALEXPORT Error SystemNative_CreateNetworkChangeListenerSocket(int32_t* retSocket); -DLLEXPORT Error SystemNative_CloseNetworkChangeListenerSocket(int32_t socket); +PALEXPORT Error SystemNative_CloseNetworkChangeListenerSocket(int32_t socket); diff --git a/src/libraries/Native/Unix/System.Native/pal_networking.c b/src/libraries/Native/Unix/System.Native/pal_networking.c index 9b1cd7b824de87..444aa1ad09a09f 100644 --- a/src/libraries/Native/Unix/System.Native/pal_networking.c +++ b/src/libraries/Native/Unix/System.Native/pal_networking.c @@ -495,7 +495,7 @@ int32_t SystemNative_GetNameInfo(const uint8_t* address, (uint32_t)hostLength, (char*)service, (uint32_t)serviceLength, - nativeFlags); + (int)nativeFlags); } else { @@ -508,7 +508,7 @@ int32_t SystemNative_GetNameInfo(const uint8_t* address, (uint32_t)hostLength, (char*)service, (uint32_t)serviceLength, - nativeFlags); + (int)nativeFlags); } return ConvertGetAddrInfoAndGetNameInfoErrorsToPal(result); @@ -1489,11 +1489,7 @@ int32_t SystemNative_Bind(intptr_t socket, int32_t protocolType, uint8_t* socket int err = bind( fd, (struct sockaddr*)socketAddress, -#if BIND_ADDRLEN_UNSIGNED (socklen_t)socketAddressLen); -#else - socketAddressLen); -#endif return err == 0 ? Error_SUCCESS : SystemNative_ConvertErrorPlatformToPal(errno); } diff --git a/src/libraries/Native/Unix/System.Native/pal_networking.h b/src/libraries/Native/Unix/System.Native/pal_networking.h index e92f39a0f07f5e..b8377effd928a7 100644 --- a/src/libraries/Native/Unix/System.Native/pal_networking.h +++ b/src/libraries/Native/Unix/System.Native/pal_networking.h @@ -310,12 +310,12 @@ typedef struct uint32_t Padding; // Pad out to 8-byte alignment } SocketEvent; -DLLEXPORT int32_t SystemNative_GetHostEntryForName(const uint8_t* address, HostEntry* entry); +PALEXPORT int32_t SystemNative_GetHostEntryForName(const uint8_t* address, HostEntry* entry); -DLLEXPORT void SystemNative_FreeHostEntry(HostEntry* entry); +PALEXPORT void SystemNative_FreeHostEntry(HostEntry* entry); -DLLEXPORT int32_t SystemNative_GetNameInfo(const uint8_t* address, +PALEXPORT int32_t SystemNative_GetNameInfo(const uint8_t* address, int32_t addressLength, int8_t isIPv6, uint8_t* host, @@ -324,103 +324,103 @@ DLLEXPORT int32_t SystemNative_GetNameInfo(const uint8_t* address, int32_t serviceLength, int32_t flags); -DLLEXPORT int32_t SystemNative_GetDomainName(uint8_t* name, int32_t nameLength); +PALEXPORT int32_t SystemNative_GetDomainName(uint8_t* name, int32_t nameLength); -DLLEXPORT int32_t SystemNative_GetHostName(uint8_t* name, int32_t nameLength); +PALEXPORT int32_t SystemNative_GetHostName(uint8_t* name, int32_t nameLength); -DLLEXPORT int32_t SystemNative_GetIPSocketAddressSizes(int32_t* ipv4SocketAddressSize, int32_t* ipv6SocketAddressSize); +PALEXPORT int32_t SystemNative_GetIPSocketAddressSizes(int32_t* ipv4SocketAddressSize, int32_t* ipv6SocketAddressSize); -DLLEXPORT int32_t SystemNative_GetAddressFamily(const uint8_t* socketAddress, int32_t socketAddressLen, int32_t* addressFamily); +PALEXPORT int32_t SystemNative_GetAddressFamily(const uint8_t* socketAddress, int32_t socketAddressLen, int32_t* addressFamily); -DLLEXPORT int32_t SystemNative_SetAddressFamily(uint8_t* socketAddress, int32_t socketAddressLen, int32_t addressFamily); +PALEXPORT int32_t SystemNative_SetAddressFamily(uint8_t* socketAddress, int32_t socketAddressLen, int32_t addressFamily); -DLLEXPORT int32_t SystemNative_GetPort(const uint8_t* socketAddress, int32_t socketAddressLen, uint16_t* port); +PALEXPORT int32_t SystemNative_GetPort(const uint8_t* socketAddress, int32_t socketAddressLen, uint16_t* port); -DLLEXPORT int32_t SystemNative_SetPort(uint8_t* socketAddress, int32_t socketAddressLen, uint16_t port); +PALEXPORT int32_t SystemNative_SetPort(uint8_t* socketAddress, int32_t socketAddressLen, uint16_t port); -DLLEXPORT int32_t SystemNative_GetIPv4Address(const uint8_t* socketAddress, int32_t socketAddressLen, uint32_t* address); +PALEXPORT int32_t SystemNative_GetIPv4Address(const uint8_t* socketAddress, int32_t socketAddressLen, uint32_t* address); -DLLEXPORT int32_t SystemNative_SetIPv4Address(uint8_t* socketAddress, int32_t socketAddressLen, uint32_t address); +PALEXPORT int32_t SystemNative_SetIPv4Address(uint8_t* socketAddress, int32_t socketAddressLen, uint32_t address); -DLLEXPORT int32_t SystemNative_GetIPv6Address( +PALEXPORT int32_t SystemNative_GetIPv6Address( const uint8_t* socketAddress, int32_t socketAddressLen, uint8_t* address, int32_t addressLen, uint32_t* scopeId); -DLLEXPORT int32_t SystemNative_SetIPv6Address( +PALEXPORT int32_t SystemNative_SetIPv6Address( uint8_t* socketAddress, int32_t socketAddressLen, uint8_t* address, int32_t addressLen, uint32_t scopeId); -DLLEXPORT int32_t SystemNative_GetControlMessageBufferSize(int32_t isIPv4, int32_t isIPv6); +PALEXPORT int32_t SystemNative_GetControlMessageBufferSize(int32_t isIPv4, int32_t isIPv6); -DLLEXPORT int32_t SystemNative_TryGetIPPacketInformation(MessageHeader* messageHeader, int32_t isIPv4, IPPacketInformation* packetInfo); +PALEXPORT int32_t SystemNative_TryGetIPPacketInformation(MessageHeader* messageHeader, int32_t isIPv4, IPPacketInformation* packetInfo); -DLLEXPORT int32_t SystemNative_GetIPv4MulticastOption(intptr_t socket, int32_t multicastOption, IPv4MulticastOption* option); +PALEXPORT int32_t SystemNative_GetIPv4MulticastOption(intptr_t socket, int32_t multicastOption, IPv4MulticastOption* option); -DLLEXPORT int32_t SystemNative_SetIPv4MulticastOption(intptr_t socket, int32_t multicastOption, IPv4MulticastOption* option); +PALEXPORT int32_t SystemNative_SetIPv4MulticastOption(intptr_t socket, int32_t multicastOption, IPv4MulticastOption* option); -DLLEXPORT int32_t SystemNative_GetIPv6MulticastOption(intptr_t socket, int32_t multicastOption, IPv6MulticastOption* option); +PALEXPORT int32_t SystemNative_GetIPv6MulticastOption(intptr_t socket, int32_t multicastOption, IPv6MulticastOption* option); -DLLEXPORT int32_t SystemNative_SetIPv6MulticastOption(intptr_t socket, int32_t multicastOption, IPv6MulticastOption* option); +PALEXPORT int32_t SystemNative_SetIPv6MulticastOption(intptr_t socket, int32_t multicastOption, IPv6MulticastOption* option); -DLLEXPORT int32_t SystemNative_GetLingerOption(intptr_t socket, LingerOption* option); +PALEXPORT int32_t SystemNative_GetLingerOption(intptr_t socket, LingerOption* option); -DLLEXPORT int32_t SystemNative_SetLingerOption(intptr_t socket, LingerOption* option); +PALEXPORT int32_t SystemNative_SetLingerOption(intptr_t socket, LingerOption* option); -DLLEXPORT int32_t SystemNative_SetReceiveTimeout(intptr_t socket, int32_t millisecondsTimeout); +PALEXPORT int32_t SystemNative_SetReceiveTimeout(intptr_t socket, int32_t millisecondsTimeout); -DLLEXPORT int32_t SystemNative_SetSendTimeout(intptr_t socket, int32_t millisecondsTimeout); +PALEXPORT int32_t SystemNative_SetSendTimeout(intptr_t socket, int32_t millisecondsTimeout); -DLLEXPORT int32_t SystemNative_ReceiveMessage(intptr_t socket, MessageHeader* messageHeader, int32_t flags, int64_t* received); +PALEXPORT int32_t SystemNative_ReceiveMessage(intptr_t socket, MessageHeader* messageHeader, int32_t flags, int64_t* received); -DLLEXPORT int32_t SystemNative_SendMessage(intptr_t socket, MessageHeader* messageHeader, int32_t flags, int64_t* sent); +PALEXPORT int32_t SystemNative_SendMessage(intptr_t socket, MessageHeader* messageHeader, int32_t flags, int64_t* sent); -DLLEXPORT int32_t SystemNative_Accept(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen, intptr_t* acceptedSocket); +PALEXPORT int32_t SystemNative_Accept(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen, intptr_t* acceptedSocket); -DLLEXPORT int32_t SystemNative_Bind(intptr_t socket, int32_t protocolType, uint8_t* socketAddress, int32_t socketAddressLen); +PALEXPORT int32_t SystemNative_Bind(intptr_t socket, int32_t protocolType, uint8_t* socketAddress, int32_t socketAddressLen); -DLLEXPORT int32_t SystemNative_Connect(intptr_t socket, uint8_t* socketAddress, int32_t socketAddressLen); +PALEXPORT int32_t SystemNative_Connect(intptr_t socket, uint8_t* socketAddress, int32_t socketAddressLen); -DLLEXPORT int32_t SystemNative_GetPeerName(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen); +PALEXPORT int32_t SystemNative_GetPeerName(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen); -DLLEXPORT int32_t SystemNative_GetSockName(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen); +PALEXPORT int32_t SystemNative_GetSockName(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen); -DLLEXPORT int32_t SystemNative_Listen(intptr_t socket, int32_t backlog); +PALEXPORT int32_t SystemNative_Listen(intptr_t socket, int32_t backlog); -DLLEXPORT int32_t SystemNative_Shutdown(intptr_t socket, int32_t socketShutdown); +PALEXPORT int32_t SystemNative_Shutdown(intptr_t socket, int32_t socketShutdown); -DLLEXPORT int32_t SystemNative_GetSocketErrorOption(intptr_t socket, int32_t* error); +PALEXPORT int32_t SystemNative_GetSocketErrorOption(intptr_t socket, int32_t* error); -DLLEXPORT int32_t SystemNative_GetSockOpt( +PALEXPORT int32_t SystemNative_GetSockOpt( intptr_t socket, int32_t socketOptionLevel, int32_t socketOptionName, uint8_t* optionValue, int32_t* optionLen); -DLLEXPORT int32_t SystemNative_SetSockOpt( +PALEXPORT int32_t SystemNative_SetSockOpt( intptr_t socket, int32_t socketOptionLevel, int32_t socketOptionName, uint8_t* optionValue, int32_t optionLen); -DLLEXPORT int32_t SystemNative_Socket(int32_t addressFamily, int32_t socketType, int32_t protocolType, intptr_t* createdSocket); +PALEXPORT int32_t SystemNative_Socket(int32_t addressFamily, int32_t socketType, int32_t protocolType, intptr_t* createdSocket); -DLLEXPORT int32_t SystemNative_GetAtOutOfBandMark(intptr_t socket, int32_t* available); +PALEXPORT int32_t SystemNative_GetAtOutOfBandMark(intptr_t socket, int32_t* available); -DLLEXPORT int32_t SystemNative_GetBytesAvailable(intptr_t socket, int32_t* available); +PALEXPORT int32_t SystemNative_GetBytesAvailable(intptr_t socket, int32_t* available); -DLLEXPORT int32_t SystemNative_CreateSocketEventPort(intptr_t* port); +PALEXPORT int32_t SystemNative_CreateSocketEventPort(intptr_t* port); -DLLEXPORT int32_t SystemNative_CloseSocketEventPort(intptr_t port); +PALEXPORT int32_t SystemNative_CloseSocketEventPort(intptr_t port); -DLLEXPORT int32_t SystemNative_CreateSocketEventBuffer(int32_t count, SocketEvent** buffer); +PALEXPORT int32_t SystemNative_CreateSocketEventBuffer(int32_t count, SocketEvent** buffer); -DLLEXPORT int32_t SystemNative_FreeSocketEventBuffer(SocketEvent* buffer); +PALEXPORT int32_t SystemNative_FreeSocketEventBuffer(SocketEvent* buffer); -DLLEXPORT int32_t SystemNative_TryChangeSocketEventRegistration( +PALEXPORT int32_t SystemNative_TryChangeSocketEventRegistration( intptr_t port, intptr_t socket, int32_t currentEvents, int32_t newEvents, uintptr_t data); -DLLEXPORT int32_t SystemNative_WaitForSocketEvents(intptr_t port, SocketEvent* buffer, int32_t* count); +PALEXPORT int32_t SystemNative_WaitForSocketEvents(intptr_t port, SocketEvent* buffer, int32_t* count); -DLLEXPORT int32_t SystemNative_PlatformSupportsDualModeIPv4PacketInfo(void); +PALEXPORT int32_t SystemNative_PlatformSupportsDualModeIPv4PacketInfo(void); -DLLEXPORT char* SystemNative_GetPeerUserName(intptr_t socket); +PALEXPORT char* SystemNative_GetPeerUserName(intptr_t socket); -DLLEXPORT void SystemNative_GetDomainSocketSizes(int32_t* pathOffset, int32_t* pathSize, int32_t* addressSize); +PALEXPORT void SystemNative_GetDomainSocketSizes(int32_t* pathOffset, int32_t* pathSize, int32_t* addressSize); -DLLEXPORT int32_t SystemNative_SendFile(intptr_t out_fd, intptr_t in_fd, int64_t offset, int64_t count, int64_t* sent); +PALEXPORT int32_t SystemNative_SendFile(intptr_t out_fd, intptr_t in_fd, int64_t offset, int64_t count, int64_t* sent); -DLLEXPORT int32_t SystemNative_Disconnect(intptr_t socket); +PALEXPORT int32_t SystemNative_Disconnect(intptr_t socket); -DLLEXPORT uint32_t SystemNative_InterfaceNameToIndex(char* interfaceName); +PALEXPORT uint32_t SystemNative_InterfaceNameToIndex(char* interfaceName); diff --git a/src/libraries/Native/Unix/System.Native/pal_networkstatistics.h b/src/libraries/Native/Unix/System.Native/pal_networkstatistics.h index 743415259714be..8dbae90381f007 100644 --- a/src/libraries/Native/Unix/System.Native/pal_networkstatistics.h +++ b/src/libraries/Native/Unix/System.Native/pal_networkstatistics.h @@ -149,24 +149,24 @@ typedef struct uint64_t Flags; } NativeIPInterfaceStatistics; -DLLEXPORT int32_t SystemNative_GetTcpGlobalStatistics(TcpGlobalStatistics* retStats); +PALEXPORT int32_t SystemNative_GetTcpGlobalStatistics(TcpGlobalStatistics* retStats); -DLLEXPORT int32_t SystemNative_GetIPv4GlobalStatistics(IPv4GlobalStatistics* retStats); +PALEXPORT int32_t SystemNative_GetIPv4GlobalStatistics(IPv4GlobalStatistics* retStats); -DLLEXPORT int32_t SystemNative_GetUdpGlobalStatistics(UdpGlobalStatistics* retStats); +PALEXPORT int32_t SystemNative_GetUdpGlobalStatistics(UdpGlobalStatistics* retStats); -DLLEXPORT int32_t SystemNative_GetIcmpv4GlobalStatistics(Icmpv4GlobalStatistics* retStats); +PALEXPORT int32_t SystemNative_GetIcmpv4GlobalStatistics(Icmpv4GlobalStatistics* retStats); -DLLEXPORT int32_t SystemNative_GetIcmpv6GlobalStatistics(Icmpv6GlobalStatistics* retStats); +PALEXPORT int32_t SystemNative_GetIcmpv6GlobalStatistics(Icmpv6GlobalStatistics* retStats); -DLLEXPORT int32_t SystemNative_GetEstimatedTcpConnectionCount(void); +PALEXPORT int32_t SystemNative_GetEstimatedTcpConnectionCount(void); -DLLEXPORT int32_t SystemNative_GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int32_t* infoCount); +PALEXPORT int32_t SystemNative_GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int32_t* infoCount); -DLLEXPORT int32_t SystemNative_GetEstimatedUdpListenerCount(void); +PALEXPORT int32_t SystemNative_GetEstimatedUdpListenerCount(void); -DLLEXPORT int32_t SystemNative_GetActiveUdpListeners(IPEndPointInfo* infos, int32_t* infoCount); +PALEXPORT int32_t SystemNative_GetActiveUdpListeners(IPEndPointInfo* infos, int32_t* infoCount); -DLLEXPORT int32_t SystemNative_GetNativeIPInterfaceStatistics(char* interfaceName, NativeIPInterfaceStatistics* retStats); +PALEXPORT int32_t SystemNative_GetNativeIPInterfaceStatistics(char* interfaceName, NativeIPInterfaceStatistics* retStats); -DLLEXPORT int32_t SystemNative_GetNumRoutes(void); +PALEXPORT int32_t SystemNative_GetNumRoutes(void); diff --git a/src/libraries/Native/Unix/System.Native/pal_process.c b/src/libraries/Native/Unix/System.Native/pal_process.c index 97795517968ac8..529be7d428c52e 100644 --- a/src/libraries/Native/Unix/System.Native/pal_process.c +++ b/src/libraries/Native/Unix/System.Native/pal_process.c @@ -304,9 +304,9 @@ int32_t SystemNative_ForkAndExecProcess(const char* filename, // Process is still the clone of this one. This is a best-effort attempt, so ignore any errors. // If the child fails to exec we use the pipe to pass the errno to the parent process. #if HAVE_PIPE2 - pipe2(waitForChildToExecPipe, O_CLOEXEC); + (void)! pipe2(waitForChildToExecPipe, O_CLOEXEC); #else - SystemNative_Pipe(waitForChildToExecPipe, PAL_O_CLOEXEC); + (void)! SystemNative_Pipe(waitForChildToExecPipe, PAL_O_CLOEXEC); #endif // The fork child must not be signalled until it calls exec(): our signal handlers do not diff --git a/src/libraries/Native/Unix/System.Native/pal_process.h b/src/libraries/Native/Unix/System.Native/pal_process.h index cb5add67e0f17a..d75f25bcb43199 100644 --- a/src/libraries/Native/Unix/System.Native/pal_process.h +++ b/src/libraries/Native/Unix/System.Native/pal_process.h @@ -19,7 +19,7 @@ * As would have been the case with fork/execve, a return value of 0 is success and -1 * is failure; if failure, error information is provided in errno. */ -DLLEXPORT int32_t SystemNative_ForkAndExecProcess( +PALEXPORT int32_t SystemNative_ForkAndExecProcess( const char* filename, // filename argument to execve char* const argv[], // argv argument to execve char* const envp[], // envp argument to execve @@ -40,12 +40,12 @@ DLLEXPORT int32_t SystemNative_ForkAndExecProcess( /** * Shim for the popen function. */ -DLLEXPORT FILE* SystemNative_POpen(const char* command, const char* type); +PALEXPORT FILE* SystemNative_POpen(const char* command, const char* type); /** * Shim for the pclose function. */ -DLLEXPORT int32_t SystemNative_PClose(FILE* stream); +PALEXPORT int32_t SystemNative_PClose(FILE* stream); /************ * The values below in the header are fixed and correct for managed callers to use forever. @@ -173,40 +173,40 @@ typedef struct * Get the current limit for the specified resource of the current process. * Returns 0 on success; returns -1 on failure and errno is set to the error reason. */ -DLLEXPORT int32_t SystemNative_GetRLimit(RLimitResources resourceType, RLimit* limits); +PALEXPORT int32_t SystemNative_GetRLimit(RLimitResources resourceType, RLimit* limits); /** * Set the soft and hard limits for the specified resource. * Only a super-user can increase hard limits for the current process. * Returns 0 on success; returns -1 on failure and errno is set to the error reason. */ -DLLEXPORT int32_t SystemNative_SetRLimit(RLimitResources resourceType, const RLimit* limits); +PALEXPORT int32_t SystemNative_SetRLimit(RLimitResources resourceType, const RLimit* limits); /** * Kill the specified process (or process group) identified by the supplied pid; the * process or process group will be killed by the specified signal. * Returns 0 on success; on failure, -1 is returned and errno is set */ -DLLEXPORT int32_t SystemNative_Kill(int32_t pid, int32_t signal); +PALEXPORT int32_t SystemNative_Kill(int32_t pid, int32_t signal); /** * Returns the Process ID of the current executing process. * This call should never fail */ -DLLEXPORT int32_t SystemNative_GetPid(void); +PALEXPORT int32_t SystemNative_GetPid(void); /** * Returns the sessions ID of the specified process; if 0 is passed in, returns the * session ID of the current process. * Returns a session ID on success; otherwise, returns -1 and sets errno. */ -DLLEXPORT int32_t SystemNative_GetSid(int32_t pid); +PALEXPORT int32_t SystemNative_GetSid(int32_t pid); /** * Write a message to the system logger, which in turn writes the message to the system console, log files, etc. * See man 3 syslog for more info */ -DLLEXPORT void SystemNative_SysLog(SysLogPriority priority, const char* message, const char* arg1); +PALEXPORT void SystemNative_SysLog(SysLogPriority priority, const char* message, const char* arg1); /** * Returns the pid of a terminated child without reaping it. @@ -215,7 +215,7 @@ DLLEXPORT void SystemNative_SysLog(SysLogPriority priority, const char* message, * 2) if no children are terminated, 0 is returned * 3) on error, -1 is returned */ -DLLEXPORT int32_t SystemNative_WaitIdAnyExitedNoHangNoWait(void); +PALEXPORT int32_t SystemNative_WaitIdAnyExitedNoHangNoWait(void); /** * Reaps a terminated child. @@ -225,7 +225,7 @@ DLLEXPORT int32_t SystemNative_WaitIdAnyExitedNoHangNoWait(void); * 3) if the child has not yet terminated, 0 is returned * 4) on error, -1 is returned. */ -DLLEXPORT int32_t SystemNative_WaitPidExitedNoHang(int32_t pid, int32_t* exitCode); +PALEXPORT int32_t SystemNative_WaitPidExitedNoHang(int32_t pid, int32_t* exitCode); /** * Gets the configurable limit or variable for system path or file descriptor options. @@ -233,7 +233,7 @@ DLLEXPORT int32_t SystemNative_WaitPidExitedNoHang(int32_t pid, int32_t* exitCod * Returns the requested variable value on success; if the variable does not have a limit, -1 is returned and errno * is not set; otherwise, -1 is returned and errno is set. */ -DLLEXPORT int64_t SystemNative_PathConf(const char* path, PathConfName name); +PALEXPORT int64_t SystemNative_PathConf(const char* path, PathConfName name); /** * Gets the priority (nice value) of a certain execution group. @@ -242,19 +242,19 @@ DLLEXPORT int64_t SystemNative_PathConf(const char* path, PathConfName name); * valid nice value, meaning we can't use that value to determine valid output or not. Errno is set on failure so * we need to reset errno before a call and check the value if we get -1. */ -DLLEXPORT int32_t SystemNative_GetPriority(PriorityWhich which, int32_t who); +PALEXPORT int32_t SystemNative_GetPriority(PriorityWhich which, int32_t who); /** * Sets the priority (nice value) of a certain execution group. * * Returns 0 on success; otherwise, -1 and errno is set. */ -DLLEXPORT int32_t SystemNative_SetPriority(PriorityWhich which, int32_t who, int32_t nice); +PALEXPORT int32_t SystemNative_SetPriority(PriorityWhich which, int32_t who, int32_t nice); /** * Gets the current working directory of the currently executing process. */ -DLLEXPORT char* SystemNative_GetCwd(char* buffer, int32_t bufferSize); +PALEXPORT char* SystemNative_GetCwd(char* buffer, int32_t bufferSize); #if HAVE_SCHED_SETAFFINITY /** @@ -262,7 +262,7 @@ DLLEXPORT char* SystemNative_GetCwd(char* buffer, int32_t bufferSize); * * Returns 0 on success; otherwise, -1 is returned and errno is set */ -DLLEXPORT int32_t SystemNative_SchedSetAffinity(int32_t pid, intptr_t* mask); +PALEXPORT int32_t SystemNative_SchedSetAffinity(int32_t pid, intptr_t* mask); #endif #if HAVE_SCHED_GETAFFINITY @@ -271,5 +271,5 @@ DLLEXPORT int32_t SystemNative_SchedSetAffinity(int32_t pid, intptr_t* mask); * * Returns 0 on success; otherwise, -1 is returned and errno is set. */ -DLLEXPORT int32_t SystemNative_SchedGetAffinity(int32_t pid, intptr_t* mask); +PALEXPORT int32_t SystemNative_SchedGetAffinity(int32_t pid, intptr_t* mask); #endif diff --git a/src/libraries/Native/Unix/System.Native/pal_random.h b/src/libraries/Native/Unix/System.Native/pal_random.h index b828d325e7eb77..bde525bb47e84a 100644 --- a/src/libraries/Native/Unix/System.Native/pal_random.h +++ b/src/libraries/Native/Unix/System.Native/pal_random.h @@ -7,4 +7,4 @@ #include "pal_compiler.h" #include "pal_types.h" -DLLEXPORT void SystemNative_GetNonCryptographicallySecureRandomBytes(uint8_t* buffer, int32_t bufferLength); +PALEXPORT void SystemNative_GetNonCryptographicallySecureRandomBytes(uint8_t* buffer, int32_t bufferLength); diff --git a/src/libraries/Native/Unix/System.Native/pal_runtimeextensions.h b/src/libraries/Native/Unix/System.Native/pal_runtimeextensions.h index b92d76b3c38c36..ff7fca196db9f2 100644 --- a/src/libraries/Native/Unix/System.Native/pal_runtimeextensions.h +++ b/src/libraries/Native/Unix/System.Native/pal_runtimeextensions.h @@ -7,4 +7,4 @@ #include "pal_compiler.h" #include "pal_types.h" -DLLEXPORT int32_t SystemNative_GetNodeName(char* version, int* capacity); +PALEXPORT int32_t SystemNative_GetNodeName(char* version, int* capacity); diff --git a/src/libraries/Native/Unix/System.Native/pal_runtimeinformation.h b/src/libraries/Native/Unix/System.Native/pal_runtimeinformation.h index 370a6b4d951d89..8265fef9388867 100644 --- a/src/libraries/Native/Unix/System.Native/pal_runtimeinformation.h +++ b/src/libraries/Native/Unix/System.Native/pal_runtimeinformation.h @@ -7,15 +7,15 @@ #include "pal_compiler.h" #include "pal_types.h" -DLLEXPORT const char* SystemNative_GetUnixName(void); +PALEXPORT const char* SystemNative_GetUnixName(void); -DLLEXPORT char* SystemNative_GetUnixRelease(void); +PALEXPORT char* SystemNative_GetUnixRelease(void); -DLLEXPORT int32_t SystemNative_GetUnixVersion(char* version, int* capacity); +PALEXPORT int32_t SystemNative_GetUnixVersion(char* version, int* capacity); -DLLEXPORT int32_t SystemNative_GetOSArchitecture(void); +PALEXPORT int32_t SystemNative_GetOSArchitecture(void); -DLLEXPORT int32_t SystemNative_GetProcessArchitecture(void); +PALEXPORT int32_t SystemNative_GetProcessArchitecture(void); enum { diff --git a/src/libraries/Native/Unix/System.Native/pal_signal.h b/src/libraries/Native/Unix/System.Native/pal_signal.h index 41e51e0b85889b..752cbf0349f656 100644 --- a/src/libraries/Native/Unix/System.Native/pal_signal.h +++ b/src/libraries/Native/Unix/System.Native/pal_signal.h @@ -22,7 +22,7 @@ int32_t InitializeSignalHandlingCore(void); * * Should only be called when a callback is not currently registered. */ -DLLEXPORT void SystemNative_RegisterForCtrl(CtrlCallback callback); +PALEXPORT void SystemNative_RegisterForCtrl(CtrlCallback callback); /** * Unregisters the previously registered ctrlCCallback. @@ -34,7 +34,7 @@ DLLEXPORT void SystemNative_RegisterForCtrl(CtrlCallback callback); * previously registered must remain valid until all ctrl handling activity * has quiesced. */ -DLLEXPORT void SystemNative_UnregisterForCtrl(void); +PALEXPORT void SystemNative_UnregisterForCtrl(void); typedef void (*SigChldCallback)(int reapAll); @@ -43,7 +43,7 @@ typedef void (*SigChldCallback)(int reapAll); * * Should only be called when a callback is not currently registered. */ -DLLEXPORT void SystemNative_RegisterForSigChld(SigChldCallback callback); +PALEXPORT void SystemNative_RegisterForSigChld(SigChldCallback callback); /** * Remove our handler and reissue the signal to be picked up by the previously registered handler. @@ -51,7 +51,7 @@ DLLEXPORT void SystemNative_RegisterForSigChld(SigChldCallback callback); * In the most common case, this will be the default handler, causing the process to be torn down. * It could also be a custom handler registered by other code before us. */ -DLLEXPORT void SystemNative_RestoreAndHandleCtrl(CtrlCode ctrlCode); +PALEXPORT void SystemNative_RestoreAndHandleCtrl(CtrlCode ctrlCode); typedef void (*TerminalInvalidationCallback)(void); @@ -59,4 +59,4 @@ typedef void (*TerminalInvalidationCallback)(void); * Hooks up the specified callback for notifications when SIGCHLD, SIGCONT, SIGWINCH are received. * */ -DLLEXPORT void SystemNative_SetTerminalInvalidationHandler(TerminalInvalidationCallback callback); +PALEXPORT void SystemNative_SetTerminalInvalidationHandler(TerminalInvalidationCallback callback); diff --git a/src/libraries/Native/Unix/System.Native/pal_string.h b/src/libraries/Native/Unix/System.Native/pal_string.h index 380c75eab52c97..331d7d8872524c 100644 --- a/src/libraries/Native/Unix/System.Native/pal_string.h +++ b/src/libraries/Native/Unix/System.Native/pal_string.h @@ -15,4 +15,4 @@ * success; if the return value is equal to the size then the result may have been truncated. * On failure, returns a negative value. */ -DLLEXPORT int32_t SystemNative_SNPrintF(char* string, int32_t size, const char* format, ...); +PALEXPORT int32_t SystemNative_SNPrintF(char* string, int32_t size, const char* format, ...); diff --git a/src/libraries/Native/Unix/System.Native/pal_sysctl.h b/src/libraries/Native/Unix/System.Native/pal_sysctl.h index b9c9408c82b727..1064da5052f86e 100644 --- a/src/libraries/Native/Unix/System.Native/pal_sysctl.h +++ b/src/libraries/Native/Unix/System.Native/pal_sysctl.h @@ -8,4 +8,4 @@ #include "pal_types.h" #include "pal_errno.h" -DLLEXPORT int32_t SystemNative_Sysctl(int* name, unsigned int namelen, void* value, size_t* len); +PALEXPORT int32_t SystemNative_Sysctl(int* name, unsigned int namelen, void* value, size_t* len); diff --git a/src/libraries/Native/Unix/System.Native/pal_tcpstate.h b/src/libraries/Native/Unix/System.Native/pal_tcpstate.h index 1bc36ce6d555c0..7d096fc24dd41a 100644 --- a/src/libraries/Native/Unix/System.Native/pal_tcpstate.h +++ b/src/libraries/Native/Unix/System.Native/pal_tcpstate.h @@ -24,4 +24,4 @@ typedef enum TcpState_DeleteTcb } TcpState; -DLLEXPORT int32_t SystemNative_MapTcpState(int32_t tcpState); +PALEXPORT int32_t SystemNative_MapTcpState(int32_t tcpState); diff --git a/src/libraries/Native/Unix/System.Native/pal_time.h b/src/libraries/Native/Unix/System.Native/pal_time.h index 0a9c98058777fa..ae0b50ba17fb4c 100644 --- a/src/libraries/Native/Unix/System.Native/pal_time.h +++ b/src/libraries/Native/Unix/System.Native/pal_time.h @@ -26,17 +26,17 @@ typedef struct ProcessCpuInformation * * Returns 0 on success; otherwise, returns -1 and errno is set. */ -DLLEXPORT int32_t SystemNative_UTimensat(const char* path, TimeSpec* times); +PALEXPORT int32_t SystemNative_UTimensat(const char* path, TimeSpec* times); /** * Gets the resolution of the timestamp, in counts per second. */ -DLLEXPORT uint64_t SystemNative_GetTimestampResolution(void); +PALEXPORT uint64_t SystemNative_GetTimestampResolution(void); /** * Gets a high-resolution timestamp that can be used for time-interval measurements. */ -DLLEXPORT uint64_t SystemNative_GetTimestamp(void); +PALEXPORT uint64_t SystemNative_GetTimestamp(void); /** * The main purpose of this function is to compute the overall CPU utilization @@ -47,4 +47,4 @@ DLLEXPORT uint64_t SystemNative_GetTimestamp(void); * returned is sum of utilization accross all processors, e.g. this function will * return 200 when two cores are running at 100%. */ -DLLEXPORT int32_t SystemNative_GetCpuUtilization(ProcessCpuInformation* previousCpuInfo); +PALEXPORT int32_t SystemNative_GetCpuUtilization(ProcessCpuInformation* previousCpuInfo); diff --git a/src/libraries/Native/Unix/System.Native/pal_uid.h b/src/libraries/Native/Unix/System.Native/pal_uid.h index b32916cd432e22..3117fa01fbcb83 100644 --- a/src/libraries/Native/Unix/System.Native/pal_uid.h +++ b/src/libraries/Native/Unix/System.Native/pal_uid.h @@ -30,7 +30,7 @@ typedef struct * number for any other failure. * */ -DLLEXPORT int32_t SystemNative_GetPwUidR(uint32_t uid, Passwd* pwd, char* buf, int32_t buflen); +PALEXPORT int32_t SystemNative_GetPwUidR(uint32_t uid, Passwd* pwd, char* buf, int32_t buflen); /** * Gets a password structure for the given user name. @@ -39,7 +39,7 @@ DLLEXPORT int32_t SystemNative_GetPwUidR(uint32_t uid, Passwd* pwd, char* buf, i * Returns 0 for success, -1 if no entry found, positive error * number for any other failure. */ -DLLEXPORT int32_t SystemNative_GetPwNamR(const char* name, Passwd* pwd, char* buf, int32_t buflen); +PALEXPORT int32_t SystemNative_GetPwNamR(const char* name, Passwd* pwd, char* buf, int32_t buflen); /** * Gets and returns the effective user's identity. @@ -47,7 +47,7 @@ DLLEXPORT int32_t SystemNative_GetPwNamR(const char* name, Passwd* pwd, char* bu * * Always succeeds. */ -DLLEXPORT uint32_t SystemNative_GetEUid(void); +PALEXPORT uint32_t SystemNative_GetEUid(void); /** * Gets and returns the effective group's identity. @@ -55,7 +55,7 @@ DLLEXPORT uint32_t SystemNative_GetEUid(void); * * Always succeeds. */ -DLLEXPORT uint32_t SystemNative_GetEGid(void); +PALEXPORT uint32_t SystemNative_GetEGid(void); /** * Sets the effective user ID of the calling process @@ -63,7 +63,7 @@ DLLEXPORT uint32_t SystemNative_GetEGid(void); * * Returns 0 for success. On error, -1 is returned and errno is set. */ -DLLEXPORT int32_t SystemNative_SetEUid(uint32_t euid); +PALEXPORT int32_t SystemNative_SetEUid(uint32_t euid); /** * Gets the list of groups to which a user belongs. @@ -73,7 +73,7 @@ DLLEXPORT int32_t SystemNative_SetEUid(uint32_t euid); * If the buffer is too small, -1 is returned and ngroups contains the required size. * On error, -1 is returned and errno is set. */ -DLLEXPORT int32_t SystemNative_GetGroupList(const char* name, uint32_t group, uint32_t* groups, int32_t* ngroups); +PALEXPORT int32_t SystemNative_GetGroupList(const char* name, uint32_t group, uint32_t* groups, int32_t* ngroups); /** * Gets and returns the real user's identity. @@ -81,4 +81,4 @@ DLLEXPORT int32_t SystemNative_GetGroupList(const char* name, uint32_t group, ui * * Always succeeds. */ -DLLEXPORT uint32_t SystemNative_GetUid(void); +PALEXPORT uint32_t SystemNative_GetUid(void); diff --git a/src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.h b/src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.h index 58b9ef93aaed1b..11e232d01501d9 100644 --- a/src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.h +++ b/src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.h @@ -56,30 +56,30 @@ typedef struct /* Shims the gss_release_buffer method. */ -DLLEXPORT void NetSecurityNative_ReleaseGssBuffer(void* buffer, uint64_t length); +PALEXPORT void NetSecurityNative_ReleaseGssBuffer(void* buffer, uint64_t length); /* Shims the gss_display_status method for minor status (status_type = GSS_C_MECH_CODE). */ -DLLEXPORT uint32_t +PALEXPORT uint32_t NetSecurityNative_DisplayMinorStatus(uint32_t* minorStatus, uint32_t statusValue, PAL_GssBuffer* outBuffer); /* Shims the gss_display_status method for major status (status_type = GSS_C_GSS_CODE). */ -DLLEXPORT uint32_t +PALEXPORT uint32_t NetSecurityNative_DisplayMajorStatus(uint32_t* minorStatus, uint32_t statusValue, PAL_GssBuffer* outBuffer); /* Shims the gss_import_name method with nametype = GSS_C_NT_USER_NAME. */ -DLLEXPORT uint32_t +PALEXPORT uint32_t NetSecurityNative_ImportUserName(uint32_t* minorStatus, char* inputName, uint32_t inputNameLen, GssName** outputName); /* Shims the gss_import_name method with nametype = GSS_C_NT_USER_NAME. */ -DLLEXPORT uint32_t NetSecurityNative_ImportPrincipalName(uint32_t* minorStatus, +PALEXPORT uint32_t NetSecurityNative_ImportPrincipalName(uint32_t* minorStatus, char* inputName, uint32_t inputNameLen, GssName** outputName); @@ -87,28 +87,28 @@ DLLEXPORT uint32_t NetSecurityNative_ImportPrincipalName(uint32_t* minorStatus, /* Shims the gss_release_name method. */ -DLLEXPORT uint32_t NetSecurityNative_ReleaseName(uint32_t* minorStatus, GssName** inputName); +PALEXPORT uint32_t NetSecurityNative_ReleaseName(uint32_t* minorStatus, GssName** inputName); /* Shims the gss_acquire_cred method with GSS_C_ACCEPT. */ -DLLEXPORT uint32_t NetSecurityNative_AcquireAcceptorCred(uint32_t* minorStatus, GssCredId** outputCredHandle); +PALEXPORT uint32_t NetSecurityNative_AcquireAcceptorCred(uint32_t* minorStatus, GssCredId** outputCredHandle); /* Shims the gss_acquire_cred method with SPNEGO oids with GSS_C_INITIATE. */ -DLLEXPORT uint32_t +PALEXPORT uint32_t NetSecurityNative_InitiateCredSpNego(uint32_t* minorStatus, GssName* desiredName, GssCredId** outputCredHandle); /* Shims the gss_release_cred method. */ -DLLEXPORT uint32_t NetSecurityNative_ReleaseCred(uint32_t* minorStatus, GssCredId** credHandle); +PALEXPORT uint32_t NetSecurityNative_ReleaseCred(uint32_t* minorStatus, GssCredId** credHandle); /* Shims the gss_init_sec_context method with SPNEGO oids. */ -DLLEXPORT uint32_t NetSecurityNative_InitSecContext(uint32_t* minorStatus, +PALEXPORT uint32_t NetSecurityNative_InitSecContext(uint32_t* minorStatus, GssCredId* claimantCredHandle, GssCtxId** contextHandle, uint32_t isNtlm, @@ -120,7 +120,7 @@ DLLEXPORT uint32_t NetSecurityNative_InitSecContext(uint32_t* minorStatus, uint32_t* retFlags, int32_t* isNtlmUsed); -DLLEXPORT uint32_t NetSecurityNative_InitSecContextEx(uint32_t* minorStatus, +PALEXPORT uint32_t NetSecurityNative_InitSecContextEx(uint32_t* minorStatus, GssCredId* claimantCredHandle, GssCtxId** contextHandle, uint32_t isNtlm, @@ -137,7 +137,7 @@ DLLEXPORT uint32_t NetSecurityNative_InitSecContextEx(uint32_t* minorStatus, /* Shims the gss_accept_sec_context method. */ -DLLEXPORT uint32_t NetSecurityNative_AcceptSecContext(uint32_t* minorStatus, +PALEXPORT uint32_t NetSecurityNative_AcceptSecContext(uint32_t* minorStatus, GssCredId* acceptorCredHandle, GssCtxId** contextHandle, uint8_t* inputBytes, @@ -150,12 +150,12 @@ DLLEXPORT uint32_t NetSecurityNative_AcceptSecContext(uint32_t* minorStatus, Shims the gss_delete_sec_context method. */ -DLLEXPORT uint32_t NetSecurityNative_DeleteSecContext(uint32_t* minorStatus, GssCtxId** contextHandle); +PALEXPORT uint32_t NetSecurityNative_DeleteSecContext(uint32_t* minorStatus, GssCtxId** contextHandle); /* Shims the gss_wrap method. */ -DLLEXPORT uint32_t NetSecurityNative_Wrap(uint32_t* minorStatus, +PALEXPORT uint32_t NetSecurityNative_Wrap(uint32_t* minorStatus, GssCtxId* contextHandle, int32_t isEncrypt, uint8_t* inputBytes, @@ -166,7 +166,7 @@ DLLEXPORT uint32_t NetSecurityNative_Wrap(uint32_t* minorStatus, /* Shims the gss_unwrap method. */ -DLLEXPORT uint32_t NetSecurityNative_Unwrap(uint32_t* minorStatus, +PALEXPORT uint32_t NetSecurityNative_Unwrap(uint32_t* minorStatus, GssCtxId* contextHandle, uint8_t* inputBytes, int32_t offset, @@ -176,7 +176,7 @@ DLLEXPORT uint32_t NetSecurityNative_Unwrap(uint32_t* minorStatus, /* Shims the gss_acquire_cred_with_password method with GSS_C_INITIATE. */ -DLLEXPORT uint32_t NetSecurityNative_InitiateCredWithPassword(uint32_t* minorStatus, +PALEXPORT uint32_t NetSecurityNative_InitiateCredWithPassword(uint32_t* minorStatus, int32_t isNtlm, GssName* desiredName, char* password, @@ -186,11 +186,11 @@ DLLEXPORT uint32_t NetSecurityNative_InitiateCredWithPassword(uint32_t* minorSta /* Shims the gss_indicate_mechs method to detect if NTLM mech is installed. */ -DLLEXPORT uint32_t NetSecurityNative_IsNtlmInstalled(void); +PALEXPORT uint32_t NetSecurityNative_IsNtlmInstalled(void); /* Shims gss_inquire_context and gss_display_name to get the remote user principal name. */ -DLLEXPORT uint32_t NetSecurityNative_GetUser(uint32_t* minorStatus, +PALEXPORT uint32_t NetSecurityNative_GetUser(uint32_t* minorStatus, GssCtxId* contextHandle, PAL_GssBuffer* outBuffer); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.h index 5d31aa21c8eda5..72e65741c04eea 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.h @@ -26,7 +26,7 @@ typedef struct digest_ctx_st DigestCtx; /* Free the resources held by a DigestCtx */ -DLLEXPORT void AppleCryptoNative_DigestFree(DigestCtx* pDigest); +PALEXPORT void AppleCryptoNative_DigestFree(DigestCtx* pDigest); /* Create a digest handle for the specified algorithm. @@ -35,18 +35,18 @@ Returns NULL when the algorithm is unknown, or pcbDigest is NULL; otherwise retu to a digest context suitable for calling DigestUpdate and DigestFinal on and sets pcbDigest to the size of the digest output. */ -DLLEXPORT DigestCtx* AppleCryptoNative_DigestCreate(PAL_HashAlgorithm algorithm, int32_t* pcbDigest); +PALEXPORT DigestCtx* AppleCryptoNative_DigestCreate(PAL_HashAlgorithm algorithm, int32_t* pcbDigest); /* Apply cbBuf bytes of data from pBuf to the ongoing digest represented in ctx. Returns 1 on success, 0 on failure, any other value on invalid inputs/state. */ -DLLEXPORT int32_t AppleCryptoNative_DigestUpdate(DigestCtx* ctx, uint8_t* pBuf, int32_t cbBuf); +PALEXPORT int32_t AppleCryptoNative_DigestUpdate(DigestCtx* ctx, uint8_t* pBuf, int32_t cbBuf); /* Complete the digest in ctx, copying the results to pOutput, and reset ctx for a new digest. Returns 1 on success, 0 on failure, any other value on invalid inputs/state. */ -DLLEXPORT int32_t AppleCryptoNative_DigestFinal(DigestCtx* ctx, uint8_t* pOutput, int32_t cbOutput); +PALEXPORT int32_t AppleCryptoNative_DigestFinal(DigestCtx* ctx, uint8_t* pOutput, int32_t cbOutput); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h index 71df9e25fdcee3..3ae5da555e1a90 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h @@ -14,7 +14,7 @@ Generate an ECC keypair of the specified size. Returns 1 on success, 0 on failure. On failure, *pOSStatus should carry the OS failure code. */ -DLLEXPORT int32_t AppleCryptoNative_EccGenerateKey(int32_t keySizeBits, +PALEXPORT int32_t AppleCryptoNative_EccGenerateKey(int32_t keySizeBits, SecKeychainRef tempKeychain, SecKeyRef* pPublicKey, SecKeyRef* pPrivateKey, @@ -25,4 +25,4 @@ Get the keysize, in bits, of an ECC key. Returns the keysize, in bits, of the ECC key, or 0 on error. */ -DLLEXPORT uint64_t AppleCryptoNative_EccGetKeySizeInBits(SecKeyRef publicKey); +PALEXPORT uint64_t AppleCryptoNative_EccGetKeySizeInBits(SecKeyRef publicKey); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_hmac.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_hmac.h index 12682347c82ed7..59b8330c994726 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_hmac.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_hmac.h @@ -13,7 +13,7 @@ typedef struct hmac_ctx_st HmacCtx; /* Free a HmacCtx created by AppleCryptoNative_HmacCreate */ -DLLEXPORT void AppleCryptoNative_HmacFree(HmacCtx* pHmac); +PALEXPORT void AppleCryptoNative_HmacFree(HmacCtx* pHmac); /* Create an HmacCtx for the specified algorithm, receiving the hash output size in pcbHmac. @@ -23,25 +23,25 @@ it should be freed via AppleCryptoNative_HmacFree regardless of a negative pbHma Returns NULL on error, an unkeyed HmacCtx otherwise. */ -DLLEXPORT HmacCtx* AppleCryptoNative_HmacCreate(PAL_HashAlgorithm algorithm, int32_t* pcbHmac); +PALEXPORT HmacCtx* AppleCryptoNative_HmacCreate(PAL_HashAlgorithm algorithm, int32_t* pcbHmac); /* Initialize an HMAC to the correct key and start state. Returns 1 on success, 0 on error. */ -DLLEXPORT int32_t AppleCryptoNative_HmacInit(HmacCtx* ctx, uint8_t* pbKey, int32_t cbKey); +PALEXPORT int32_t AppleCryptoNative_HmacInit(HmacCtx* ctx, uint8_t* pbKey, int32_t cbKey); /* Add data into the HMAC Returns 1 on success, 0 on error. */ -DLLEXPORT int32_t AppleCryptoNative_HmacUpdate(HmacCtx* ctx, uint8_t* pbData, int32_t cbData); +PALEXPORT int32_t AppleCryptoNative_HmacUpdate(HmacCtx* ctx, uint8_t* pbData, int32_t cbData); /* Complete the HMAC and copy the result into pbOutput. Returns 1 on success, 0 on error. */ -DLLEXPORT int32_t AppleCryptoNative_HmacFinal(HmacCtx* ctx, uint8_t* pbOutput); +PALEXPORT int32_t AppleCryptoNative_HmacFinal(HmacCtx* ctx, uint8_t* pbOutput); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyagree.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyagree.h index 32c65f635acc92..153972a9f79742 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyagree.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyagree.h @@ -14,5 +14,5 @@ Perform the EC Diffie-Hellman key agreement between the provided keys. Follows pal_seckey return conventions. */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_EcdhKeyAgree(SecKeyRef privateKey, SecKeyRef publicKey, CFDataRef* pAgreeOut, CFErrorRef* pErrorOut); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h index e7b86814a428e1..7dbcd5e934cd78 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h @@ -18,7 +18,7 @@ Errors of the item having no keychain are suppressed, returning success (0) with For all other situations, see SecKeychainItemCopyKeychain documentation. */ -DLLEXPORT int32_t AppleCryptoNative_SecKeychainItemCopyKeychain(SecKeychainItemRef item, SecKeychainRef* pKeychainOut); +PALEXPORT int32_t AppleCryptoNative_SecKeychainItemCopyKeychain(SecKeychainItemRef item, SecKeychainRef* pKeychainOut); /* Create a keychain at the specified location with a given (UTF-8 encoded) lock passphrase. @@ -28,7 +28,7 @@ Returns the result of SecKeychainCreate. Output: pKeychainOut: The SecKeychainRef created by this function */ -DLLEXPORT int32_t AppleCryptoNative_SecKeychainCreate(const char* pathName, +PALEXPORT int32_t AppleCryptoNative_SecKeychainCreate(const char* pathName, uint32_t passphraseLength, const uint8_t* passphraseUtf8, SecKeychainRef* pKeychainOut); @@ -38,7 +38,7 @@ Delete a keychain, including the file on disk. Returns the result of SecKeychainDelete */ -DLLEXPORT int32_t AppleCryptoNative_SecKeychainDelete(SecKeychainRef keychain); +PALEXPORT int32_t AppleCryptoNative_SecKeychainDelete(SecKeychainRef keychain); /* Open the default keychain. @@ -49,7 +49,7 @@ Returns the result of SecKeychainCopyDefault. Output: pKeyChainOut: Receives the SecKeychainRef for the default keychain. */ -DLLEXPORT int32_t AppleCryptoNative_SecKeychainCopyDefault(SecKeychainRef* pKeychainOut); +PALEXPORT int32_t AppleCryptoNative_SecKeychainCopyDefault(SecKeychainRef* pKeychainOut); /* Open the named keychain (full path to the file). @@ -59,14 +59,14 @@ Returns the result of SecKeychainOpen. Output: pKeychainOut: Receives the SecKeychainRef for the named keychain. */ -DLLEXPORT int32_t AppleCryptoNative_SecKeychainOpen(const char* pszKeychainPath, SecKeychainRef* pKeychainOut); +PALEXPORT int32_t AppleCryptoNative_SecKeychainOpen(const char* pszKeychainPath, SecKeychainRef* pKeychainOut); /* Unlock an opened keychain with a given (UTF-8 encoded) lock passphrase. Returns the result of SecKeychainUnlock. */ -DLLEXPORT int32_t AppleCryptoNative_SecKeychainUnlock(SecKeychainRef keychain, +PALEXPORT int32_t AppleCryptoNative_SecKeychainUnlock(SecKeychainRef keychain, uint32_t passphraseLength, const uint8_t* passphraseUtf8); @@ -75,7 +75,7 @@ Set a keychain to never (automatically) lock. Returns the result of SecKeychainSetSettings to a never-auto-lock policy. */ -DLLEXPORT int32_t AppleCryptoNative_SetKeychainNeverLock(SecKeychainRef keychain); +PALEXPORT int32_t AppleCryptoNative_SetKeychainNeverLock(SecKeychainRef keychain); /* Enumerate the certificate objects within the given keychain. @@ -87,7 +87,7 @@ pCertsOut: When the return value is not 1, NULL. Otherwise NULL on "no certs fou (including a single match). pOSStatus: Receives the last OSStatus value. */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_SecKeychainEnumerateCerts(SecKeychainRef keychain, CFArrayRef* pCertsOut, int32_t* pOSStatus); /* @@ -103,7 +103,7 @@ pCertsOut: When the return value is not 1, NULL. Otherwise NULL on "no certs fou (including a single match). pOSStatus: Receives the last OSStatus value. */ -DLLEXPORT int32_t AppleCryptoNative_SecKeychainEnumerateIdentities(SecKeychainRef keychain, +PALEXPORT int32_t AppleCryptoNative_SecKeychainEnumerateIdentities(SecKeychainRef keychain, CFArrayRef* pIdentitiesOut, int32_t* pOSStatus); @@ -118,7 +118,7 @@ any other value is invalid Output: pOSStatus: Receives the last OSStatus value.. */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_X509StoreAddCertificate(CFTypeRef certOrIdentity, SecKeychainRef keychain, int32_t* pOSStatus); /* @@ -135,5 +135,5 @@ any other value is invalid Output: pOSStatus: Receives the last OSStatus value.. */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_X509StoreRemoveCertificate(CFTypeRef certOrIdentity, SecKeychainRef keychain, uint8_t isReadOnlyMode, int32_t* pOSStatus); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_random.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_random.h index 311cad6a90851d..615291eb4b1396 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_random.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_random.h @@ -12,4 +12,4 @@ Shims CCRandomGenerateBytes, putting the resulting CCRNGStatus value in pkCCStat Returns 1 on success, 0 on system error (see pkCCStatus), -1 on input error. */ -DLLEXPORT int32_t AppleCryptoNative_GetRandomBytes(uint8_t* pBuf, uint32_t cbBuf, int32_t* pkCCStatus); +PALEXPORT int32_t AppleCryptoNative_GetRandomBytes(uint8_t* pBuf, uint32_t cbBuf, int32_t* pkCCStatus); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h index ae2a8fd0f462a1..b9d0834d991d41 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h @@ -15,7 +15,7 @@ Generate a new RSA keypair with the specified key size, in bits. Returns 1 on success, 0 on failure. On failure, *pOSStatus should contain the OS reported error. */ -DLLEXPORT int32_t AppleCryptoNative_RsaGenerateKey(int32_t keySizeBits, +PALEXPORT int32_t AppleCryptoNative_RsaGenerateKey(int32_t keySizeBits, SecKeychainRef tempKeychain, SecKeyRef* pPublicKey, SecKeyRef* pPrivateKey, @@ -26,7 +26,7 @@ Decrypt the contents of pbData using the provided privateKey under OAEP padding. Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_RsaDecryptOaep(SecKeyRef privateKey, +PALEXPORT int32_t AppleCryptoNative_RsaDecryptOaep(SecKeyRef privateKey, uint8_t* pbData, int32_t cbData, PAL_HashAlgorithm mfgAlgorithm, @@ -38,7 +38,7 @@ Decrypt the contents of pbData using the provided privateKey under PKCS#1 paddin Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_RsaDecryptPkcs( +PALEXPORT int32_t AppleCryptoNative_RsaDecryptPkcs( SecKeyRef privateKey, uint8_t* pbData, int32_t cbData, CFDataRef* pDecryptedOut, CFErrorRef* pErrorOut); /* @@ -46,7 +46,7 @@ Encrypt pbData for the provided publicKey using OAEP padding. Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_RsaEncryptOaep(SecKeyRef publicKey, +PALEXPORT int32_t AppleCryptoNative_RsaEncryptOaep(SecKeyRef publicKey, uint8_t* pbData, int32_t cbData, PAL_HashAlgorithm mgfAlgorithm, @@ -58,7 +58,7 @@ Encrypt pbData for the provided publicKey using PKCS#1 padding. Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_RsaEncryptPkcs( +PALEXPORT int32_t AppleCryptoNative_RsaEncryptPkcs( SecKeyRef publicKey, uint8_t* pbData, int32_t cbData, CFDataRef* pEncryptedOut, CFErrorRef* pErrorOut); /* @@ -66,7 +66,7 @@ Apply an RSA private key to a signing operation on data which was already padded Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_RsaSignaturePrimitive( +PALEXPORT int32_t AppleCryptoNative_RsaSignaturePrimitive( SecKeyRef privateKey, uint8_t* pbData, int32_t cbData, CFDataRef* pDataOut, CFErrorRef* pErrorOut); /* @@ -74,7 +74,7 @@ Apply an RSA private key to an encryption operation to emit data which is still Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_RsaDecryptionPrimitive( +PALEXPORT int32_t AppleCryptoNative_RsaDecryptionPrimitive( SecKeyRef privateKey, uint8_t* pbData, int32_t cbData, CFDataRef* pDataOut, CFErrorRef* pErrorOut); /* @@ -82,7 +82,7 @@ Apply an RSA public key to an encryption operation on data which was already pad Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_RsaEncryptionPrimitive( +PALEXPORT int32_t AppleCryptoNative_RsaEncryptionPrimitive( SecKeyRef publicKey, uint8_t* pbData, int32_t cbData, CFDataRef* pDataOut, CFErrorRef* pErrorOut); /* @@ -90,5 +90,5 @@ Apply an RSA public key to a signing operation to emit data which is still padde Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_RsaVerificationPrimitive( +PALEXPORT int32_t AppleCryptoNative_RsaVerificationPrimitive( SecKeyRef publicKey, uint8_t* pbData, int32_t cbData, CFDataRef* pDataOut, CFErrorRef* pErrorOut); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h index 4317d7268a84bf..4e81d6b57e13b2 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h @@ -15,4 +15,4 @@ Get an error message for an OSStatus error from the security library. Returns NULL if no message is available for the code. */ -DLLEXPORT CFStringRef AppleCryptoNative_SecCopyErrorMessageString(OSStatus osStatus); +PALEXPORT CFStringRef AppleCryptoNative_SecCopyErrorMessageString(OSStatus osStatus); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c index 8ac8f0207b888a..99c2a661f6fa15 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c @@ -182,10 +182,18 @@ OSStatus ExportImportKey(SecKeyRef* key, SecExternalItemType type) CFRetain(outItem); *key = (SecKeyRef)CONST_CAST(void *, outItem); - return noErr; + goto cleanup; } } } - return errSecBadReq; + status = errSecBadReq; + +cleanup: + if (outItems != NULL) + { + CFRelease(outItems); + } + + return status; } diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h index a0f0f39b34736d..a645d8600fe147 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h @@ -31,7 +31,7 @@ An export passphrase is required for private keys, and ignored for public keys. Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_SecKeyExport( +PALEXPORT int32_t AppleCryptoNative_SecKeyExport( SecKeyRef pKey, int32_t exportPrivate, CFStringRef cfExportPassphrase, CFDataRef* ppDataOut, int32_t* pOSStatus); /* @@ -46,7 +46,7 @@ but is in fact the X.509 SubjectPublicKeyInfo structure. Returns 1 on success, 0 on failure (*pOSStatus should be set) and negative numbers for various state machine errors. */ -DLLEXPORT int32_t AppleCryptoNative_SecKeyImportEphemeral( +PALEXPORT int32_t AppleCryptoNative_SecKeyImportEphemeral( uint8_t* pbKeyBlob, int32_t cbKeyBlob, int32_t isPrivateKey, SecKeyRef* ppKeyOut, int32_t* pOSStatus); /* @@ -57,7 +57,7 @@ For ECC the value should not be used. 0 is returned for invalid inputs. */ -DLLEXPORT uint64_t AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SecKeyRef publicKey); +PALEXPORT uint64_t AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SecKeyRef publicKey); /* Export a key and re-import it to the NULL keychain. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h index d872649be6b77a..37060b93edeb23 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h @@ -15,7 +15,7 @@ Generate a signature for algorithms which require only the data hash blob, like Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_GenerateSignature( +PALEXPORT int32_t AppleCryptoNative_GenerateSignature( SecKeyRef privateKey, uint8_t* pbDataHash, int32_t cbDataHash, CFDataRef* pSignatureOut, CFErrorRef* pErrorOut); /* @@ -23,7 +23,7 @@ Generate a signature for algorithms which require the pair of (dataHash, algorit Follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_GenerateSignatureWithHashAlgorithm(SecKeyRef privateKey, +PALEXPORT int32_t AppleCryptoNative_GenerateSignatureWithHashAlgorithm(SecKeyRef privateKey, uint8_t* pbDataHash, int32_t cbDataHash, PAL_HashAlgorithm hashAlgorithm, @@ -36,7 +36,7 @@ Verify a signature for algorithms which only require the data hash blob, like DS Returns 1 when the signature is correct, 0 when it is incorrect, and otherwise follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_VerifySignatureWithHashAlgorithm(SecKeyRef publicKey, +PALEXPORT int32_t AppleCryptoNative_VerifySignatureWithHashAlgorithm(SecKeyRef publicKey, uint8_t* pbDataHash, int32_t cbDataHash, uint8_t* pbSignature, @@ -50,7 +50,7 @@ Verify a signature for algorithms which require the pair of (dataHash, algorithm Returns 1 when the signature is correct, 0 when it is incorrect, and otherwise follows pal_seckey return conventions. */ -DLLEXPORT int32_t AppleCryptoNative_VerifySignature(SecKeyRef publicKey, +PALEXPORT int32_t AppleCryptoNative_VerifySignature(SecKeyRef publicKey, uint8_t* pbDataHash, int32_t cbDataHash, uint8_t* pbSignature, diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.h index 784d97b6bed2d2..48cff8839a40dd 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.h @@ -44,28 +44,28 @@ Create an SSL context, for the Server or Client role as determined by isServer. Returns NULL if an invalid boolean is given for isServer, an SSLContextRef otherwise. */ -DLLEXPORT SSLContextRef AppleCryptoNative_SslCreateContext(int32_t isServer); +PALEXPORT SSLContextRef AppleCryptoNative_SslCreateContext(int32_t isServer); /* Indicate that an SSL Context (in server mode) should allow a client to present a mutual auth cert. Returns The result of SSLSetClientSideAuthenticate */ -DLLEXPORT int32_t AppleCryptoNative_SslSetAcceptClientCert(SSLContextRef sslContext); +PALEXPORT int32_t AppleCryptoNative_SslSetAcceptClientCert(SSLContextRef sslContext); /* Assign a minimum to the TLS protocol version for this connection. Returns the output of SSLSetProtocolVersionMin */ -DLLEXPORT int32_t AppleCryptoNative_SslSetMinProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol sslProtocol); +PALEXPORT int32_t AppleCryptoNative_SslSetMinProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol sslProtocol); /* Assign a maximum to the TLS protocol version for this connection. Returns the output of SSLSetProtocolVersionMax */ -DLLEXPORT int32_t AppleCryptoNative_SslSetMaxProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol sslProtocol); +PALEXPORT int32_t AppleCryptoNative_SslSetMaxProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol sslProtocol); /* Get the SecTrustRef from the SSL context which represents the certificte chain. @@ -76,7 +76,7 @@ Returns 1 on success, 0 on failure, and other values on invalid state. pChainOut: Receives the SecTrustRef representing the populated chain pOSStatus: Receives the value returned by SSLCopyPeerTrust */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_SslCopyCertChain(SSLContextRef sslContext, SecTrustRef* pChainOut, int32_t* pOSStatus); /* @@ -90,7 +90,7 @@ values sent by the server. pOSStatus: Receives the output of SSLCopyDistinguishedNames. */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_SslCopyCADistinguishedNames(SSLContextRef sslContext, CFArrayRef* pArrayOut, int32_t* pOSStatus); /* @@ -101,7 +101,7 @@ Returns 1 on success, 0 on failure, other values on invalid state. Output: pOSStatus: Receives the value returned by SSLSetSessionOption */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_SslSetBreakOnServerAuth(SSLContextRef sslContext, int32_t setBreak, int32_t* pOSStatus); /* @@ -112,7 +112,7 @@ Returns 1 on success, 0 on failure, other values on invalid state. Output: pOSStatus: Receives the value returned by SSLSetSessionOption */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_SslSetBreakOnClientAuth(SSLContextRef sslContext, int32_t setBreak, int32_t* pOSStatus); /* @@ -124,7 +124,7 @@ intermediate (non-root) certificate. Returns the output of SSLSetCertificate */ -DLLEXPORT int32_t AppleCryptoNative_SslSetCertificate(SSLContextRef sslContext, CFArrayRef certRefs); +PALEXPORT int32_t AppleCryptoNative_SslSetCertificate(SSLContextRef sslContext, CFArrayRef certRefs); /* Set the target hostname for SNI. pszTargetName must already be converted for IDNA if required. @@ -134,7 +134,7 @@ Returns 1 on success, 0 on failure, other values for invalid state. Output: pOSStatus: Receives the value for SSLSetPeerDomainName */ -DLLEXPORT int32_t AppleCryptoNative_SslSetTargetName(SSLContextRef sslContext, +PALEXPORT int32_t AppleCryptoNative_SslSetTargetName(SSLContextRef sslContext, const char* pszTargetName, int32_t cbTargetName, int32_t* pOSStatus); @@ -147,19 +147,19 @@ Returns 1 on success, 0 on failure, other values for invalid state. Output: pOSStatus: Receives the value from SSLSetALPNData() */ -DLLEXPORT int32_t AppleCryptoNative_SSLSetALPNProtocols(SSLContextRef sslContext, CFArrayRef protocols, int32_t* pOSStatus); +PALEXPORT int32_t AppleCryptoNative_SSLSetALPNProtocols(SSLContextRef sslContext, CFArrayRef protocols, int32_t* pOSStatus); /* Get negotiated protocol value from ServerHello. */ -DLLEXPORT int32_t AppleCryptoNative_SslGetAlpnSelected(SSLContextRef sslContext, CFDataRef *protocol); +PALEXPORT int32_t AppleCryptoNative_SslGetAlpnSelected(SSLContextRef sslContext, CFDataRef *protocol); /* Register the callbacks for reading and writing data to the SSL context. Returns the output of SSLSetIOFuncs. */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_SslSetIoCallbacks(SSLContextRef sslContext, SSLReadFunc readFunc, SSLWriteFunc writeFunc); /* @@ -167,7 +167,7 @@ Pump the TLS handshake. Returns an indication of what state the error is in. Any negative number means an error occurred. */ -DLLEXPORT PAL_TlsHandshakeState AppleCryptoNative_SslHandshake(SSLContextRef sslContext); +PALEXPORT PAL_TlsHandshakeState AppleCryptoNative_SslHandshake(SSLContextRef sslContext); /* Take bufLen bytes of cleartext data from buf and encrypt/frame the data. @@ -180,7 +180,7 @@ bytesWritten: When any value other than PAL_TlsIo_Success is returned, receives which were read from buf. On PAL_TlsIo_Success the parameter is not written through (but must still not be NULL) */ -DLLEXPORT PAL_TlsIo +PALEXPORT PAL_TlsIo AppleCryptoNative_SslWrite(SSLContextRef sslContext, const uint8_t* buf, uint32_t bufLen, uint32_t* bytesWritten); /* @@ -193,7 +193,7 @@ Returns a PAL_TlsIo code indicating how to proceed. Output: written: Receives the number of bytes written into buf */ -DLLEXPORT PAL_TlsIo +PALEXPORT PAL_TlsIo AppleCryptoNative_SslRead(SSLContextRef sslContext, uint8_t* buf, uint32_t bufLen, uint32_t* written); /* @@ -204,7 +204,7 @@ the certificate being expired (or not yet valid). Returns 1 on match, 0 on mismatch, any other value indicates an invalid state. */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_SslIsHostnameMatch(SSLContextRef sslContext, CFStringRef cfHostname, CFDateRef notBefore, int32_t* pOSStatus); /* @@ -212,7 +212,7 @@ Generate a TLS Close alert to terminate the session. Returns the output of SSLClose */ -DLLEXPORT int32_t AppleCryptoNative_SslShutdown(SSLContextRef sslContext); +PALEXPORT int32_t AppleCryptoNative_SslShutdown(SSLContextRef sslContext); /* Retrieve the TLS Protocol Version (e.g. TLS1.2) for the current session. @@ -222,7 +222,7 @@ Returns the output of SSLGetNegotiatedProtocolVersion. Output: pProtocol: Receives the protocol ID. PAL_SslProtocol_None is issued on error or an unknown mapping. */ -DLLEXPORT int32_t AppleCryptoNative_SslGetProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol* pProtocol); +PALEXPORT int32_t AppleCryptoNative_SslGetProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol* pProtocol); /* Retrieve the TLS Cipher Suite which was negotiated for the current session. @@ -233,11 +233,11 @@ Returns the output of SSLGetNegotiatedCipher. pProtocol: The TLS CipherSuite value (from the RFC), e.g. ((uint16_t)0xC030) for TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 */ -DLLEXPORT int32_t AppleCryptoNative_SslGetCipherSuite(SSLContextRef sslContext, uint16_t* pCipherSuiteOut); +PALEXPORT int32_t AppleCryptoNative_SslGetCipherSuite(SSLContextRef sslContext, uint16_t* pCipherSuiteOut); /* Sets enabled cipher suites for the current session. Returns the output of SSLSetEnabledCiphers. */ -DLLEXPORT int32_t AppleCryptoNative_SslSetEnabledCipherSuites(SSLContextRef sslContext, const uint32_t* cipherSuites, int32_t numCipherSuites); +PALEXPORT int32_t AppleCryptoNative_SslSetEnabledCipherSuites(SSLContextRef sslContext, const uint32_t* cipherSuites, int32_t numCipherSuites); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_symmetric.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_symmetric.h index 458f96a86937c3..9bbab56b18fb58 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_symmetric.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_symmetric.h @@ -54,7 +54,7 @@ typedef uint32_t PAL_SymmetricOptions; /* Free a CCCryptor created by AppleCryptoNative_CryptorCreate. */ -DLLEXPORT void AppleCryptoNative_CryptorFree(CCCryptorRef cryptor); +PALEXPORT void AppleCryptoNative_CryptorFree(CCCryptorRef cryptor); /* Create a CCCryptor for the described symmetric algorithm with a chosen operation, chainingMode, @@ -66,7 +66,7 @@ algorithm and assumed valid. pbIv is only allowed to be NULL for PAL_ChainingMod Returns 1 on success, 0 on system error, -1 on input error. */ -DLLEXPORT int32_t AppleCryptoNative_CryptorCreate(PAL_SymmetricOperation operation, +PALEXPORT int32_t AppleCryptoNative_CryptorCreate(PAL_SymmetricOperation operation, PAL_SymmetricAlgorithm algorithm, PAL_ChainingMode chainingMode, PAL_PaddingMode paddingMode, @@ -82,7 +82,7 @@ Shims CCCryptorUpdate, updating *pkCCStatus as its output. Returns 1 on success, 0 on system error, -1 on input error. */ -DLLEXPORT int32_t AppleCryptoNative_CryptorUpdate(CCCryptorRef cryptor, +PALEXPORT int32_t AppleCryptoNative_CryptorUpdate(CCCryptorRef cryptor, const uint8_t* pbData, int32_t cbData, uint32_t* pbOutput, @@ -95,7 +95,7 @@ Shims CCCryptorFinal, updating *pkCCStatus as its output. Returns 1 on success, 0 on system error, -1 on input error. */ -DLLEXPORT int32_t AppleCryptoNative_CryptorFinal( +PALEXPORT int32_t AppleCryptoNative_CryptorFinal( CCCryptorRef cryptor, uint8_t* pbOutput, int32_t cbOutput, int32_t* pcbWritten, int32_t* pkCCStatus); /* @@ -103,4 +103,4 @@ Shims CCCryptorReset, updating *pkCCStatus as its output. Returns 1 on success, 0 on system error, -1 on input error. */ -DLLEXPORT int32_t AppleCryptoNative_CryptorReset(CCCryptorRef cryptor, const uint8_t* pbIv, int32_t* pkCCStatus); +PALEXPORT int32_t AppleCryptoNative_CryptorReset(CCCryptorRef cryptor, const uint8_t* pbIv, int32_t* pkCCStatus); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h index 1523a22bcc1c1e..ae2ee23e6bb831 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h @@ -19,7 +19,7 @@ pCertsOut: When the return value is not 1, NULL. Otherwise NULL on "no certs fou (including a single match). pOSStatus: Receives the last OSStatus value. */ -DLLEXPORT int32_t AppleCryptoNative_StoreEnumerateUserRoot(CFArrayRef* pCertsOut, int32_t* pOSStatusOut); +PALEXPORT int32_t AppleCryptoNative_StoreEnumerateUserRoot(CFArrayRef* pCertsOut, int32_t* pOSStatusOut); /* Enumerate the certificates which are root trusted by the machine ("admin" and "system" domains). @@ -34,7 +34,7 @@ pCertsOut: When the return value is not 1, NULL. Otherwise NULL on "no certs fou (including a single match). pOSStatus: Receives the last OSStatus value. */ -DLLEXPORT int32_t AppleCryptoNative_StoreEnumerateMachineRoot(CFArrayRef* pCertsOut, int32_t* pOSStatusOut); +PALEXPORT int32_t AppleCryptoNative_StoreEnumerateMachineRoot(CFArrayRef* pCertsOut, int32_t* pOSStatusOut); /* Enumerate the certificates which are disallowed by the user. @@ -46,7 +46,7 @@ pCertsOut: When the return value is not 1, NULL. Otherwise NULL on "no certs fou (including a single match). pOSStatus: Receives the last OSStatus value. */ -DLLEXPORT int32_t AppleCryptoNative_StoreEnumerateUserDisallowed(CFArrayRef* pCertsOut, int32_t* pOSStatusOut); +PALEXPORT int32_t AppleCryptoNative_StoreEnumerateUserDisallowed(CFArrayRef* pCertsOut, int32_t* pOSStatusOut); /* Enumerate the certificates which are disallowed by the machine ("admin" and "system" domains). @@ -61,4 +61,4 @@ pCertsOut: When the return value is not 1, NULL. Otherwise NULL on "no certs fou (including a single match). pOSStatus: Receives the last OSStatus value. */ -DLLEXPORT int32_t AppleCryptoNative_StoreEnumerateMachineDisallowed(CFArrayRef* pCertsOut, int32_t* pOSStatusOut); +PALEXPORT int32_t AppleCryptoNative_StoreEnumerateMachineDisallowed(CFArrayRef* pCertsOut, int32_t* pOSStatusOut); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h index 844065f92427ac..951a25ae6c4260 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h @@ -32,7 +32,7 @@ Returns 1 if the handle was a certificate or identity, 0 otherwise (other values pCertOut: If handle is a certificate, receives handle, otherwise NULL pIdentityut: If handle is an identity, receives handle, otherwise NULL */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_X509DemuxAndRetainHandle(CFTypeRef handle, SecCertificateRef* pCertOut, SecIdentityRef* pIdentityOut); /* @@ -44,7 +44,7 @@ Returns 1 on success, 0 on failure, any other value on invalid state. pPublicKeyOut: Receives a CFRetain()ed SecKeyRef for the public key pOSStatusOut: Receives the result of SecCertificateCopyKey or SecCertificateCopyPublicKey, depending on the OS version. */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_X509GetPublicKey(SecCertificateRef cert, SecKeyRef* pPublicKeyOut, int32_t* pOSStatusOut); /* @@ -52,7 +52,7 @@ Determines the data type of the provided input. Returns the data (format) type of the provided input, PAL_X509Unknown if it cannot be determined. */ -DLLEXPORT PAL_X509ContentType AppleCryptoNative_X509GetContentType(uint8_t* pbData, int32_t cbData); +PALEXPORT PAL_X509ContentType AppleCryptoNative_X509GetContentType(uint8_t* pbData, int32_t cbData); /* Extract a SecCertificateRef for the certificate from an identity handle. @@ -62,7 +62,7 @@ Returns the result of SecIdentityCopyCertificate. Output: pCertOut: Receives a SecCertificateRef for the certificate associated with the identity */ -DLLEXPORT int32_t AppleCryptoNative_X509CopyCertFromIdentity(SecIdentityRef identity, SecCertificateRef* pCertOut); +PALEXPORT int32_t AppleCryptoNative_X509CopyCertFromIdentity(SecIdentityRef identity, SecCertificateRef* pCertOut); /* Extract a SecKeyRef for the private key from an identity handle. @@ -72,7 +72,7 @@ Returns the result of SecIdentityCopyPrivateKey Output: pPrivateKeyOut: Receives a SecKeyRef for the private key associated with the identity */ -DLLEXPORT int32_t AppleCryptoNative_X509CopyPrivateKeyFromIdentity(SecIdentityRef identity, SecKeyRef* pPrivateKeyOut); +PALEXPORT int32_t AppleCryptoNative_X509CopyPrivateKeyFromIdentity(SecIdentityRef identity, SecKeyRef* pPrivateKeyOut); /* Read cbData bytes of data from pbData and interpret it to a collection of certificates (or identities). @@ -90,7 +90,7 @@ pCollectionOut: Receives an array which contains SecCertificateRef, SecIdentityR read out of the provided blob pOSStatus: Receives the output of SecItemImport for the last attempted read */ -DLLEXPORT int32_t AppleCryptoNative_X509ImportCollection(uint8_t* pbData, +PALEXPORT int32_t AppleCryptoNative_X509ImportCollection(uint8_t* pbData, int32_t cbData, PAL_X509ContentType contentType, CFStringRef cfPfxPassphrase, @@ -120,7 +120,7 @@ pCertOut: If the best matched value was a certificate, receives the SecCertifica pIdentityOut: If the best matched value was an identity, receives the SecIdentityRef, otherwise receives NULL pOSStatus: Receives the return of the last call to SecItemImport */ -DLLEXPORT int32_t AppleCryptoNative_X509ImportCertificate(uint8_t* pbData, +PALEXPORT int32_t AppleCryptoNative_X509ImportCertificate(uint8_t* pbData, int32_t cbData, PAL_X509ContentType contentType, CFStringRef cfPfxPassphrase, @@ -141,7 +141,7 @@ Returns 1 on success, 0 on failure, any other value indicates invalid state. pExportOut: Receives a CFDataRef with the exported blob pOSStatus: Receives the result of SecItemExport */ -DLLEXPORT int32_t AppleCryptoNative_X509ExportData(CFArrayRef data, +PALEXPORT int32_t AppleCryptoNative_X509ExportData(CFArrayRef data, PAL_X509ContentType type, CFStringRef cfExportPassphrase, CFDataRef* pExportOut, @@ -156,7 +156,7 @@ Returns 1 on success, 0 on failure, any other value indicates invalid state. ppDataOut: Receives a CFDataRef with the exported blob pOSStatus: Receives the result of SecItemExport */ -DLLEXPORT int32_t AppleCryptoNative_X509GetRawData(SecCertificateRef cert, CFDataRef* ppDataOut, int32_t* pOSStatus); +PALEXPORT int32_t AppleCryptoNative_X509GetRawData(SecCertificateRef cert, CFDataRef* ppDataOut, int32_t* pOSStatus); /* Find a SecIdentityRef for the given cert and private key in the target keychain. @@ -169,7 +169,7 @@ Returns 1 on success, 0 on failure, any other value indicates invalid state. pIdentityOut: Receives the SecIdentityRef of the mated cert/key pair. pOSStatus: Receives the result of the last executed system call. */ -DLLEXPORT int32_t AppleCryptoNative_X509CopyWithPrivateKey(SecCertificateRef cert, +PALEXPORT int32_t AppleCryptoNative_X509CopyWithPrivateKey(SecCertificateRef cert, SecKeyRef privateKey, SecKeychainRef targetKeychain, SecIdentityRef* pIdentityOut, @@ -186,7 +186,7 @@ Returns 1 on success, 0 on failure, any other value indicates invalid state. pIdentityOut: Receives the SecIdentityRef of the mated cert/key pair, when applicable. pOSStatus: Receives the result of the last executed system call. */ -DLLEXPORT int32_t AppleCryptoNative_X509MoveToKeychain(SecCertificateRef cert, +PALEXPORT int32_t AppleCryptoNative_X509MoveToKeychain(SecCertificateRef cert, SecKeychainRef keychain, SecKeyRef privateKey, SecIdentityRef* pIdentityOut, diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509chain.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509chain.h index 1fcf322a5b8f73..599d2409f8acd8 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509chain.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509chain.h @@ -49,12 +49,12 @@ typedef uint64_t PAL_X509ChainErrorFlags; /* Create a SecPolicyRef representing the basic X.509 policy */ -DLLEXPORT SecPolicyRef AppleCryptoNative_X509ChainCreateDefaultPolicy(void); +PALEXPORT SecPolicyRef AppleCryptoNative_X509ChainCreateDefaultPolicy(void); /* Create a SecPolicyRef which checks for revocation (OCSP or CRL) */ -DLLEXPORT SecPolicyRef AppleCryptoNative_X509ChainCreateRevocationPolicy(void); +PALEXPORT SecPolicyRef AppleCryptoNative_X509ChainCreateRevocationPolicy(void); /* Create a SecTrustRef to build a chain over the specified certificates with the given policies. @@ -69,7 +69,7 @@ Returns 1 on success, 0 on failure, any other value for invalid state. pTrustOut: Receives the SecTrustRef to build the chain, in an unbuilt state pOSStatus: Receives the result of SecTrustCreateWithCertificates */ -DLLEXPORT int32_t +PALEXPORT int32_t AppleCryptoNative_X509ChainCreate(CFTypeRef certs, CFTypeRef policies, SecTrustRef* pTrustOut, int32_t* pOSStatus); /* @@ -83,7 +83,7 @@ state. Note that an untrusted chain building successfully still returns 1. Output: pOSStatus: Receives the result of SecTrustEvaluate */ -DLLEXPORT int32_t AppleCryptoNative_X509ChainEvaluate(SecTrustRef chain, +PALEXPORT int32_t AppleCryptoNative_X509ChainEvaluate(SecTrustRef chain, CFDateRef cfEvaluationTime, bool allowNetwork, int32_t* pOSStatus); @@ -91,19 +91,19 @@ DLLEXPORT int32_t AppleCryptoNative_X509ChainEvaluate(SecTrustRef chain, /* Gets the number of certificates in the chain. */ -DLLEXPORT int64_t AppleCryptoNative_X509ChainGetChainSize(SecTrustRef chain); +PALEXPORT int64_t AppleCryptoNative_X509ChainGetChainSize(SecTrustRef chain); /* Fetches the SecCertificateRef at a given position in the chain. Position 0 is the End-Entity certificate, postiion 1 is the issuer of position 0, et cetera. */ -DLLEXPORT SecCertificateRef AppleCryptoNative_X509ChainGetCertificateAtIndex(SecTrustRef chain, int64_t index); +PALEXPORT SecCertificateRef AppleCryptoNative_X509ChainGetCertificateAtIndex(SecTrustRef chain, int64_t index); /* Get a CFRetain()ed array of dictionaries which contain the detailed results for each element in the certificate chain. */ -DLLEXPORT CFArrayRef AppleCryptoNative_X509ChainGetTrustResults(SecTrustRef chain); +PALEXPORT CFArrayRef AppleCryptoNative_X509ChainGetTrustResults(SecTrustRef chain); /* Get the PAL_X509ChainStatusFlags values for the certificate at the requested position within the @@ -114,7 +114,7 @@ Returns 0 on success, non-zero on error. Output: pdwStatus: Receives a flags value for the various status codes that went awry at the given position */ -DLLEXPORT int32_t AppleCryptoNative_X509ChainGetStatusAtIndex(CFArrayRef details, int64_t index, int32_t* pdwStatus); +PALEXPORT int32_t AppleCryptoNative_X509ChainGetStatusAtIndex(CFArrayRef details, int64_t index, int32_t* pdwStatus); /* Looks up the equivalent OSStatus code for a given PAL_X509ChainStatusFlags single-bit value. @@ -124,9 +124,9 @@ Returns errSecCoreFoundationUnknown on bad/unmapped input, otherwise the appropr Note that PAL_X509ChainNotTimeValid is an ambiguous code, it could be errSecCertificateExpired or errSecCertificateNotValidYet. A caller should resolve that code via other means. */ -DLLEXPORT int32_t AppleCryptoNative_GetOSStatusForChainStatus(PAL_X509ChainStatusFlags chainStatusFlag); +PALEXPORT int32_t AppleCryptoNative_GetOSStatusForChainStatus(PAL_X509ChainStatusFlags chainStatusFlag); /* Sets the trusted certificates used when evaluating a chain. */ -DLLEXPORT int32_t AppleCryptoNative_X509ChainSetTrustAnchorCertificates(SecTrustRef chain, CFArrayRef anchorCertificates); +PALEXPORT int32_t AppleCryptoNative_X509ChainSetTrustAnchorCertificates(SecTrustRef chain, CFArrayRef anchorCertificates); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.h index 1b4604024e323c..8e1ff967b3cd80 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.h @@ -8,46 +8,46 @@ #include "pal_compiler.h" #include "opensslshim.h" -DLLEXPORT int32_t CryptoNative_GetX509Thumbprint(X509* x509, uint8_t* pBuf, int32_t cBuf); +PALEXPORT int32_t CryptoNative_GetX509Thumbprint(X509* x509, uint8_t* pBuf, int32_t cBuf); -DLLEXPORT const ASN1_TIME* CryptoNative_GetX509NotBefore(X509* x509); +PALEXPORT const ASN1_TIME* CryptoNative_GetX509NotBefore(X509* x509); -DLLEXPORT const ASN1_TIME* CryptoNative_GetX509NotAfter(X509* x509); +PALEXPORT const ASN1_TIME* CryptoNative_GetX509NotAfter(X509* x509); -DLLEXPORT const ASN1_TIME* CryptoNative_GetX509CrlNextUpdate(X509_CRL* crl); +PALEXPORT const ASN1_TIME* CryptoNative_GetX509CrlNextUpdate(X509_CRL* crl); -DLLEXPORT int32_t CryptoNative_GetX509Version(X509* x509); +PALEXPORT int32_t CryptoNative_GetX509Version(X509* x509); -DLLEXPORT ASN1_OBJECT* CryptoNative_GetX509PublicKeyAlgorithm(X509* x509); +PALEXPORT ASN1_OBJECT* CryptoNative_GetX509PublicKeyAlgorithm(X509* x509); -DLLEXPORT ASN1_OBJECT* CryptoNative_GetX509SignatureAlgorithm(X509* x509); +PALEXPORT ASN1_OBJECT* CryptoNative_GetX509SignatureAlgorithm(X509* x509); -DLLEXPORT int32_t CryptoNative_GetX509PublicKeyParameterBytes(X509* x509, uint8_t* pBuf, int32_t cBuf); +PALEXPORT int32_t CryptoNative_GetX509PublicKeyParameterBytes(X509* x509, uint8_t* pBuf, int32_t cBuf); -DLLEXPORT ASN1_BIT_STRING* CryptoNative_GetX509PublicKeyBytes(X509* x509); +PALEXPORT ASN1_BIT_STRING* CryptoNative_GetX509PublicKeyBytes(X509* x509); -DLLEXPORT int32_t CryptoNative_GetAsn1StringBytes(ASN1_STRING* asn1, uint8_t* pBuf, int32_t cBuf); +PALEXPORT int32_t CryptoNative_GetAsn1StringBytes(ASN1_STRING* asn1, uint8_t* pBuf, int32_t cBuf); -DLLEXPORT int32_t CryptoNative_GetX509NameRawBytes(X509_NAME* x509Name, uint8_t* pBuf, int32_t cBuf); +PALEXPORT int32_t CryptoNative_GetX509NameRawBytes(X509_NAME* x509Name, uint8_t* pBuf, int32_t cBuf); -DLLEXPORT int32_t CryptoNative_GetX509EkuFieldCount(EXTENDED_KEY_USAGE* eku); +PALEXPORT int32_t CryptoNative_GetX509EkuFieldCount(EXTENDED_KEY_USAGE* eku); -DLLEXPORT ASN1_OBJECT* CryptoNative_GetX509EkuField(EXTENDED_KEY_USAGE* eku, int32_t loc); +PALEXPORT ASN1_OBJECT* CryptoNative_GetX509EkuField(EXTENDED_KEY_USAGE* eku, int32_t loc); -DLLEXPORT BIO* CryptoNative_GetX509NameInfo(X509* x509, int32_t nameType, int32_t forIssuer); +PALEXPORT BIO* CryptoNative_GetX509NameInfo(X509* x509, int32_t nameType, int32_t forIssuer); -DLLEXPORT int32_t CryptoNative_CheckX509Hostname(X509* x509, const char* hostname, int32_t cchHostname); +PALEXPORT int32_t CryptoNative_CheckX509Hostname(X509* x509, const char* hostname, int32_t cchHostname); -DLLEXPORT int32_t CryptoNative_CheckX509IpAddress( +PALEXPORT int32_t CryptoNative_CheckX509IpAddress( X509* x509, const uint8_t* addressBytes, int32_t addressBytesLen, const char* hostname, int32_t cchHostname); -DLLEXPORT int32_t CryptoNative_GetX509StackFieldCount(STACK_OF(X509) * stack); +PALEXPORT int32_t CryptoNative_GetX509StackFieldCount(STACK_OF(X509) * stack); -DLLEXPORT X509* CryptoNative_GetX509StackField(STACK_OF(X509) * stack, int loc); +PALEXPORT X509* CryptoNative_GetX509StackField(STACK_OF(X509) * stack, int loc); -DLLEXPORT void CryptoNative_RecursiveFreeX509Stack(STACK_OF(X509) * stack); +PALEXPORT void CryptoNative_RecursiveFreeX509Stack(STACK_OF(X509) * stack); -DLLEXPORT int32_t CryptoNative_X509StoreSetVerifyTime(X509_STORE* ctx, +PALEXPORT int32_t CryptoNative_X509StoreSetVerifyTime(X509_STORE* ctx, int32_t year, int32_t month, int32_t day, @@ -56,20 +56,20 @@ DLLEXPORT int32_t CryptoNative_X509StoreSetVerifyTime(X509_STORE* ctx, int32_t second, int32_t isDst); -DLLEXPORT X509* CryptoNative_ReadX509AsDerFromBio(BIO* bio); +PALEXPORT X509* CryptoNative_ReadX509AsDerFromBio(BIO* bio); -DLLEXPORT int32_t CryptoNative_BioTell(BIO* bio); +PALEXPORT int32_t CryptoNative_BioTell(BIO* bio); -DLLEXPORT int32_t CryptoNative_BioSeek(BIO* bio, int32_t ofs); +PALEXPORT int32_t CryptoNative_BioSeek(BIO* bio, int32_t ofs); -DLLEXPORT STACK_OF(X509) * CryptoNative_NewX509Stack(void); +PALEXPORT STACK_OF(X509) * CryptoNative_NewX509Stack(void); -DLLEXPORT int32_t CryptoNative_PushX509StackField(STACK_OF(X509) * stack, X509* x509); +PALEXPORT int32_t CryptoNative_PushX509StackField(STACK_OF(X509) * stack, X509* x509); -DLLEXPORT int32_t CryptoNative_GetRandomBytes(uint8_t* buf, int32_t num); +PALEXPORT int32_t CryptoNative_GetRandomBytes(uint8_t* buf, int32_t num); -DLLEXPORT int32_t CryptoNative_LookupFriendlyNameByOid(const char* oidValue, const char** friendlyName); +PALEXPORT int32_t CryptoNative_LookupFriendlyNameByOid(const char* oidValue, const char** friendlyName); -DLLEXPORT int32_t CryptoNative_EnsureOpenSslInitialized(void); +PALEXPORT int32_t CryptoNative_EnsureOpenSslInitialized(void); -DLLEXPORT int64_t CryptoNative_OpenSslVersionNumber(void); +PALEXPORT int64_t CryptoNative_OpenSslVersionNumber(void); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_asn1.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_asn1.h index 1650a45b6571b9..93f193f2dfabd7 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_asn1.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_asn1.h @@ -21,79 +21,79 @@ typedef enum /* Direct shim to OBJ_txt2obj. */ -DLLEXPORT const ASN1_OBJECT* CryptoNative_ObjTxt2Obj(const char* s); +PALEXPORT const ASN1_OBJECT* CryptoNative_ObjTxt2Obj(const char* s); /* Direct shim to OBJ_obj2txt. */ -DLLEXPORT int32_t CryptoNative_ObjObj2Txt(char* buf, int32_t buf_len, const ASN1_OBJECT* a); +PALEXPORT int32_t CryptoNative_ObjObj2Txt(char* buf, int32_t buf_len, const ASN1_OBJECT* a); /* Retrieves the ASN1_OBJECT for the specified friendly name. Can return nullptr if there isn't a corresponding shared object. */ -DLLEXPORT const ASN1_OBJECT* CryptoNative_GetObjectDefinitionByName(const char* friendlyName); +PALEXPORT const ASN1_OBJECT* CryptoNative_GetObjectDefinitionByName(const char* friendlyName); /* Direct shim to OBJ_sn2nid. */ -DLLEXPORT int32_t CryptoNative_ObjSn2Nid(const char* sn); +PALEXPORT int32_t CryptoNative_ObjSn2Nid(const char* sn); /* Direct shim to OBJ_txt2nid. */ -DLLEXPORT int32_t CryptoNative_ObjTxt2Nid(const char* sn); +PALEXPORT int32_t CryptoNative_ObjTxt2Nid(const char* sn); /* Direct shim to OBJ_nid2obj. */ -DLLEXPORT const ASN1_OBJECT* CryptoNative_ObjNid2Obj(int32_t nid); +PALEXPORT const ASN1_OBJECT* CryptoNative_ObjNid2Obj(int32_t nid); /* Direct shim to ASN1_OBJECT_free. */ -DLLEXPORT void CryptoNative_Asn1ObjectFree(ASN1_OBJECT* a); +PALEXPORT void CryptoNative_Asn1ObjectFree(ASN1_OBJECT* a); /* Shims the d2i_ASN1_BIT_STRING method and makes it easier to invoke from managed code. */ -DLLEXPORT ASN1_BIT_STRING* CryptoNative_DecodeAsn1BitString(const uint8_t* buf, int32_t len); +PALEXPORT ASN1_BIT_STRING* CryptoNative_DecodeAsn1BitString(const uint8_t* buf, int32_t len); /* Direct shim to ASN1_BIT_STRING_free. */ -DLLEXPORT void CryptoNative_Asn1BitStringFree(ASN1_STRING* a); +PALEXPORT void CryptoNative_Asn1BitStringFree(ASN1_STRING* a); /* Direct shim to ASN1_OCTET_STRING_new. */ -DLLEXPORT ASN1_OCTET_STRING* CryptoNative_Asn1OctetStringNew(void); +PALEXPORT ASN1_OCTET_STRING* CryptoNative_Asn1OctetStringNew(void); /* Direct shim to ASN1_OCTET_STRING_set. */ -DLLEXPORT int32_t CryptoNative_Asn1OctetStringSet(ASN1_OCTET_STRING* s, const uint8_t* data, int32_t len); +PALEXPORT int32_t CryptoNative_Asn1OctetStringSet(ASN1_OCTET_STRING* s, const uint8_t* data, int32_t len); /* Direct shim to ASN1_OCTET_STRING_free. */ -DLLEXPORT void CryptoNative_Asn1OctetStringFree(ASN1_STRING* a); +PALEXPORT void CryptoNative_Asn1OctetStringFree(ASN1_STRING* a); /* Direct shim to ASN1_STRING_free. */ -DLLEXPORT void CryptoNative_Asn1StringFree(ASN1_STRING* a); +PALEXPORT void CryptoNative_Asn1StringFree(ASN1_STRING* a); /* Returns the number of bytes it will take to convert the ASN1_INTEGER to a DER format. */ -DLLEXPORT int32_t CryptoNative_GetAsn1IntegerDerSize(ASN1_INTEGER* i); +PALEXPORT int32_t CryptoNative_GetAsn1IntegerDerSize(ASN1_INTEGER* i); /* Shims the i2d_ASN1_INTEGER method. Returns the number of bytes written to buf. */ -DLLEXPORT int32_t CryptoNative_EncodeAsn1Integer(ASN1_INTEGER* i, uint8_t* buf); +PALEXPORT int32_t CryptoNative_EncodeAsn1Integer(ASN1_INTEGER* i, uint8_t* buf); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bignum.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bignum.h index 79da9b89fb77ed..de8ad3f4d87742 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bignum.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bignum.h @@ -16,19 +16,19 @@ No-op if a is null. The given BIGNUM pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_BigNumDestroy(BIGNUM* a); +PALEXPORT void CryptoNative_BigNumDestroy(BIGNUM* a); /* Shims the BN_bin2bn method. */ -DLLEXPORT BIGNUM* CryptoNative_BigNumFromBinary(const uint8_t* s, int32_t len); +PALEXPORT BIGNUM* CryptoNative_BigNumFromBinary(const uint8_t* s, int32_t len); /* Shims the BN_bn2bin method. */ -DLLEXPORT int32_t CryptoNative_BigNumToBinary(const BIGNUM* a, uint8_t* to); +PALEXPORT int32_t CryptoNative_BigNumToBinary(const BIGNUM* a, uint8_t* to); /* Returns the number of bytes needed to export a BIGNUM. */ -DLLEXPORT int32_t CryptoNative_GetBigNumBytes(const BIGNUM* a); +PALEXPORT int32_t CryptoNative_GetBigNumBytes(const BIGNUM* a); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bio.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bio.h index 21a19890956607..2f465a99c350f3 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bio.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bio.h @@ -9,12 +9,12 @@ /* Creates a new memory-backed BIO instance. */ -DLLEXPORT BIO* CryptoNative_CreateMemoryBio(void); +PALEXPORT BIO* CryptoNative_CreateMemoryBio(void); /* Direct shim to BIO_new_file. */ -DLLEXPORT BIO* CryptoNative_BioNewFile(const char* filename, const char* mode); +PALEXPORT BIO* CryptoNative_BioNewFile(const char* filename, const char* mode); /* Cleans up and deletes a BIO instance. @@ -25,33 +25,33 @@ Implemented by: No-op if a is null. The given BIO pointer is invalid after this call. */ -DLLEXPORT int32_t CryptoNative_BioDestroy(BIO* a); +PALEXPORT int32_t CryptoNative_BioDestroy(BIO* a); /* Direct shim to BIO_gets. */ -DLLEXPORT int32_t CryptoNative_BioGets(BIO* b, char* buf, int32_t size); +PALEXPORT int32_t CryptoNative_BioGets(BIO* b, char* buf, int32_t size); /* Direct shim to BIO_read. */ -DLLEXPORT int32_t CryptoNative_BioRead(BIO* b, void* buf, int32_t len); +PALEXPORT int32_t CryptoNative_BioRead(BIO* b, void* buf, int32_t len); /* Direct shim to BIO_write. */ -DLLEXPORT int32_t CryptoNative_BioWrite(BIO* b, const void* buf, int32_t len); +PALEXPORT int32_t CryptoNative_BioWrite(BIO* b, const void* buf, int32_t len); /* Gets the size of data available in the BIO. Shims the BIO_get_mem_data method. */ -DLLEXPORT int32_t CryptoNative_GetMemoryBioSize(BIO* bio); +PALEXPORT int32_t CryptoNative_GetMemoryBioSize(BIO* bio); /* Shims the BIO_ctrl_pending method. Returns the number of pending characters in the BIOs read and write buffers. */ -DLLEXPORT int32_t CryptoNative_BioCtrlPending(BIO* bio); +PALEXPORT int32_t CryptoNative_BioCtrlPending(BIO* bio); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_dsa.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_dsa.h index d220fd7bf3b437..351c4d3e5665ac 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_dsa.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_dsa.h @@ -11,7 +11,7 @@ Shims the DSA_up_ref method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_DsaUpRef(DSA* dsa); +PALEXPORT int32_t CryptoNative_DsaUpRef(DSA* dsa); /* Cleans up and deletes a DSA instance. @@ -22,38 +22,38 @@ No-op if dsa is null. The given DSA pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_DsaDestroy(DSA* dsa); +PALEXPORT void CryptoNative_DsaDestroy(DSA* dsa); /* Shims the DSA_generate_key_ex method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_DsaGenerateKey(DSA** dsa, int32_t bits); +PALEXPORT int32_t CryptoNative_DsaGenerateKey(DSA** dsa, int32_t bits); /* Shims the DSA_size method. Returns the size of the ASN.1 encoded signature. */ -DLLEXPORT int32_t CryptoNative_DsaSizeSignature(DSA* dsa); +PALEXPORT int32_t CryptoNative_DsaSizeSignature(DSA* dsa); /* Returns the size of the p parameter in bytes. */ -DLLEXPORT int32_t CryptoNative_DsaSizeP(DSA* dsa); +PALEXPORT int32_t CryptoNative_DsaSizeP(DSA* dsa); /* Returns the size of the q parameter in bytes. */ -DLLEXPORT int32_t CryptoNative_DsaSizeQ(DSA* dsa); +PALEXPORT int32_t CryptoNative_DsaSizeQ(DSA* dsa); /* Shims the DSA_sign method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t +PALEXPORT int32_t CryptoNative_DsaSign( DSA* dsa, const uint8_t* hash, @@ -66,7 +66,7 @@ Shims the DSA_verify method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t +PALEXPORT int32_t CryptoNative_DsaVerify( DSA* dsa, const uint8_t* hash, @@ -79,7 +79,7 @@ Gets all the parameters from the DSA instance. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_GetDsaParameters( +PALEXPORT int32_t CryptoNative_GetDsaParameters( const DSA* dsa, const BIGNUM** p, int32_t* pLength, const BIGNUM** q, int32_t* qLength, @@ -90,7 +90,7 @@ DLLEXPORT int32_t CryptoNative_GetDsaParameters( /* Sets all the parameters on the DSA instance. */ -DLLEXPORT int32_t CryptoNative_DsaKeyCreateByExplicitParameters( +PALEXPORT int32_t CryptoNative_DsaKeyCreateByExplicitParameters( DSA** dsa, uint8_t* p, int32_t pLength, diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecc_import_export.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecc_import_export.h index 61e6e3918daedb..594c98c0b4d740 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecc_import_export.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecc_import_export.h @@ -19,7 +19,7 @@ typedef enum /* Returns the ECC key parameters. */ -DLLEXPORT int32_t CryptoNative_GetECKeyParameters( +PALEXPORT int32_t CryptoNative_GetECKeyParameters( const EC_KEY* key, int32_t includePrivate, const BIGNUM** qx, int32_t* cbQx, @@ -29,7 +29,7 @@ DLLEXPORT int32_t CryptoNative_GetECKeyParameters( /* Returns the ECC key and curve parameters. */ -DLLEXPORT int32_t CryptoNative_GetECCurveParameters( +PALEXPORT int32_t CryptoNative_GetECCurveParameters( const EC_KEY* key, int32_t includePrivate, ECCurveType* curveType, @@ -49,7 +49,7 @@ DLLEXPORT int32_t CryptoNative_GetECCurveParameters( Creates the new EC_KEY instance using the curve oid (friendly name or value) and public key parameters. Returns 1 upon success, -1 if oid was not found, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_EcKeyCreateByKeyParameters( +PALEXPORT int32_t CryptoNative_EcKeyCreateByKeyParameters( EC_KEY** key, const char* oid, uint8_t* qx, int32_t qxLength, @@ -59,7 +59,7 @@ DLLEXPORT int32_t CryptoNative_EcKeyCreateByKeyParameters( /* Returns the new EC_KEY instance using the explicit parameters. */ -DLLEXPORT EC_KEY* CryptoNative_EcKeyCreateByExplicitParameters( +PALEXPORT EC_KEY* CryptoNative_EcKeyCreateByExplicitParameters( ECCurveType curveType, uint8_t* qx, int32_t qxLength, uint8_t* qy, int32_t qyLength, diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecdsa.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecdsa.h index ccc47c95684c5b..055ef6833a4f04 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecdsa.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecdsa.h @@ -11,7 +11,7 @@ Shims the ECDSA_sign method. Returns 1 on success, otherwise 0. */ -DLLEXPORT int32_t +PALEXPORT int32_t CryptoNative_EcDsaSign(const uint8_t* dgst, int32_t dgstlen, uint8_t* sig, int32_t* siglen, EC_KEY* key); /* @@ -19,7 +19,7 @@ Shims the ECDSA_verify method. Returns 1 for a correct signature, 0 for an incorrect signature, -1 on error. */ -DLLEXPORT int32_t +PALEXPORT int32_t CryptoNative_EcDsaVerify(const uint8_t* dgst, int32_t dgstlen, const uint8_t* sig, int32_t siglen, EC_KEY* key); /* @@ -27,4 +27,4 @@ Shims the ECDSA_size method. Returns the maximum length of a DER encoded ECDSA signature created with this key. */ -DLLEXPORT int32_t CryptoNative_EcDsaSize(const EC_KEY* key); +PALEXPORT int32_t CryptoNative_EcDsaSize(const EC_KEY* key); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_eckey.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_eckey.h index 3f03058d392f32..58934e40055916 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_eckey.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_eckey.h @@ -15,39 +15,39 @@ No-op if r is null. The given EC_KEY pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_EcKeyDestroy(EC_KEY* r); +PALEXPORT void CryptoNative_EcKeyDestroy(EC_KEY* r); /* Shims the EC_KEY_new_by_curve_name method. Returns the new EC_KEY instance. */ -DLLEXPORT EC_KEY* CryptoNative_EcKeyCreateByOid(const char* oid); +PALEXPORT EC_KEY* CryptoNative_EcKeyCreateByOid(const char* oid); /* Shims the EC_KEY_generate_key method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_EcKeyGenerateKey(EC_KEY* eckey); +PALEXPORT int32_t CryptoNative_EcKeyGenerateKey(EC_KEY* eckey); /* Shims the EC_KEY_up_ref method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_EcKeyUpRef(EC_KEY* r); +PALEXPORT int32_t CryptoNative_EcKeyUpRef(EC_KEY* r); /* Gets the key size in bits for the specified EC_KEY. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_EcKeyGetSize(const EC_KEY* key, int32_t* keySize); +PALEXPORT int32_t CryptoNative_EcKeyGetSize(const EC_KEY* key, int32_t* keySize); /* Gets the NID of the curve name as an oid value for the specified EC_KEY. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_EcKeyGetCurveName2(const EC_KEY* key, int32_t* nidName); +PALEXPORT int32_t CryptoNative_EcKeyGetCurveName2(const EC_KEY* key, int32_t* nidName); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_err.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_err.h index 98ac2937cdffad..3610c263d0af17 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_err.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_err.h @@ -9,26 +9,26 @@ /* Shims the ERR_clear_error method. */ -DLLEXPORT void CryptoNative_ErrClearError(void); +PALEXPORT void CryptoNative_ErrClearError(void); /* Shim to ERR_get_error which also returns whether the error was caused by an allocation failure. */ -DLLEXPORT uint64_t CryptoNative_ErrGetErrorAlloc(int32_t* isAllocFailure); +PALEXPORT uint64_t CryptoNative_ErrGetErrorAlloc(int32_t* isAllocFailure); -DLLEXPORT uint64_t CryptoNative_ErrPeekError(void); +PALEXPORT uint64_t CryptoNative_ErrPeekError(void); -DLLEXPORT uint64_t CryptoNative_ErrPeekLastError(void); +PALEXPORT uint64_t CryptoNative_ErrPeekLastError(void); /* Shims the ERR_reason_error_string method. Returns the string for the specified error. */ -DLLEXPORT const char* CryptoNative_ErrReasonErrorString(uint64_t error); +PALEXPORT const char* CryptoNative_ErrReasonErrorString(uint64_t error); /* Direct shim to ERR_error_string_n. */ -DLLEXPORT void CryptoNative_ErrErrorStringN(uint64_t e, char* buf, int32_t len); +PALEXPORT void CryptoNative_ErrErrorStringN(uint64_t e, char* buf, int32_t len); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h index cb981185d2b61d..8eb150b1600e01 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h @@ -15,7 +15,7 @@ Implemented by: Returns new EVP_MD_CTX on success, nullptr on failure. */ -DLLEXPORT EVP_MD_CTX* CryptoNative_EvpMdCtxCreate(const EVP_MD* type); +PALEXPORT EVP_MD_CTX* CryptoNative_EvpMdCtxCreate(const EVP_MD* type); /* Cleans up and deletes an EVP_MD_CTX instance created by EvpMdCtxCreate. @@ -27,12 +27,12 @@ No-op if ctx is null. The given EVP_MD_CTX pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_EvpMdCtxDestroy(EVP_MD_CTX* ctx); +PALEXPORT void CryptoNative_EvpMdCtxDestroy(EVP_MD_CTX* ctx); /* Resets an EVP_MD_CTX instance for a new computation. */ -DLLEXPORT int32_t CryptoNative_EvpDigestReset(EVP_MD_CTX* ctx, const EVP_MD* type); +PALEXPORT int32_t CryptoNative_EvpDigestReset(EVP_MD_CTX* ctx, const EVP_MD* type); /* Function: @@ -40,7 +40,7 @@ EvpDigestUpdate Direct shim to EVP_DigestUpdate. */ -DLLEXPORT int32_t CryptoNative_EvpDigestUpdate(EVP_MD_CTX* ctx, const void* d, int32_t cnt); +PALEXPORT int32_t CryptoNative_EvpDigestUpdate(EVP_MD_CTX* ctx, const void* d, int32_t cnt); /* Function: @@ -48,7 +48,7 @@ EvpDigestFinalEx Direct shim to EVP_DigestFinal_ex. */ -DLLEXPORT int32_t CryptoNative_EvpDigestFinalEx(EVP_MD_CTX* ctx, uint8_t* md, uint32_t* s); +PALEXPORT int32_t CryptoNative_EvpDigestFinalEx(EVP_MD_CTX* ctx, uint8_t* md, uint32_t* s); /* Function: @@ -56,7 +56,7 @@ EvpMdSize Direct shim to EVP_MD_size. */ -DLLEXPORT int32_t CryptoNative_EvpMdSize(const EVP_MD* md); +PALEXPORT int32_t CryptoNative_EvpMdSize(const EVP_MD* md); /* Function: @@ -64,7 +64,7 @@ EvpMd5 Direct shim to EVP_md5. */ -DLLEXPORT const EVP_MD* CryptoNative_EvpMd5(void); +PALEXPORT const EVP_MD* CryptoNative_EvpMd5(void); /* Function: @@ -72,7 +72,7 @@ EvpSha1 Direct shim to EVP_sha1. */ -DLLEXPORT const EVP_MD* CryptoNative_EvpSha1(void); +PALEXPORT const EVP_MD* CryptoNative_EvpSha1(void); /* Function: @@ -80,7 +80,7 @@ EvpSha256 Direct shim to EVP_sha256. */ -DLLEXPORT const EVP_MD* CryptoNative_EvpSha256(void); +PALEXPORT const EVP_MD* CryptoNative_EvpSha256(void); /* Function: @@ -88,7 +88,7 @@ EvpSha384 Direct shim to EVP_sha384. */ -DLLEXPORT const EVP_MD* CryptoNative_EvpSha384(void); +PALEXPORT const EVP_MD* CryptoNative_EvpSha384(void); /* Function: @@ -96,7 +96,7 @@ EvpSha512 Direct shim to EVP_sha512. */ -DLLEXPORT const EVP_MD* CryptoNative_EvpSha512(void); +PALEXPORT const EVP_MD* CryptoNative_EvpSha512(void); /* Function: @@ -104,4 +104,4 @@ GetMaxMdSize Returns the maxium bytes for a message digest. */ -DLLEXPORT int32_t CryptoNative_GetMaxMdSize(void); +PALEXPORT int32_t CryptoNative_GetMaxMdSize(void); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_cipher.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_cipher.h index a0ba12a2d95560..fbaa474981acf7 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_cipher.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_cipher.h @@ -6,16 +6,16 @@ #include "pal_compiler.h" #include "opensslshim.h" -DLLEXPORT EVP_CIPHER_CTX* +PALEXPORT EVP_CIPHER_CTX* CryptoNative_EvpCipherCreate2(const EVP_CIPHER* type, uint8_t* key, int32_t keyLength, int32_t effectiveKeyLength, unsigned char* iv, int32_t enc); -DLLEXPORT EVP_CIPHER_CTX* +PALEXPORT EVP_CIPHER_CTX* CryptoNative_EvpCipherCreatePartial(const EVP_CIPHER* type); -DLLEXPORT int32_t CryptoNative_EvpCipherSetKeyAndIV(EVP_CIPHER_CTX* ctx, uint8_t* key, unsigned char* iv, int32_t enc); +PALEXPORT int32_t CryptoNative_EvpCipherSetKeyAndIV(EVP_CIPHER_CTX* ctx, uint8_t* key, unsigned char* iv, int32_t enc); -DLLEXPORT int32_t CryptoNative_EvpCipherSetGcmNonceLength(EVP_CIPHER_CTX* ctx, int32_t ivLength); -DLLEXPORT int32_t CryptoNative_EvpCipherSetCcmNonceLength(EVP_CIPHER_CTX* ctx, int32_t ivLength); +PALEXPORT int32_t CryptoNative_EvpCipherSetGcmNonceLength(EVP_CIPHER_CTX* ctx, int32_t ivLength); +PALEXPORT int32_t CryptoNative_EvpCipherSetCcmNonceLength(EVP_CIPHER_CTX* ctx, int32_t ivLength); /* Cleans up and deletes an EVP_CIPHER_CTX instance created by EvpCipherCreate. @@ -28,7 +28,7 @@ No-op if ctx is null. The given EVP_CIPHER_CTX pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_EvpCipherDestroy(EVP_CIPHER_CTX* ctx); +PALEXPORT void CryptoNative_EvpCipherDestroy(EVP_CIPHER_CTX* ctx); /* Function: @@ -36,7 +36,7 @@ EvpCipherReset Resets an EVP_CIPHER_CTX instance for a new computation. */ -DLLEXPORT int32_t CryptoNative_EvpCipherReset(EVP_CIPHER_CTX* ctx); +PALEXPORT int32_t CryptoNative_EvpCipherReset(EVP_CIPHER_CTX* ctx); /* Function: @@ -44,7 +44,7 @@ EvpCipherCtxSetPadding Direct shim to EVP_CIPHER_CTX_set_padding. */ -DLLEXPORT int32_t CryptoNative_EvpCipherCtxSetPadding(EVP_CIPHER_CTX* x, int32_t padding); +PALEXPORT int32_t CryptoNative_EvpCipherCtxSetPadding(EVP_CIPHER_CTX* x, int32_t padding); /* Function: @@ -52,7 +52,7 @@ EvpCipherUpdate Direct shim to EVP_CipherUpdate. */ -DLLEXPORT int32_t +PALEXPORT int32_t CryptoNative_EvpCipherUpdate(EVP_CIPHER_CTX* ctx, uint8_t* out, int32_t* outl, unsigned char* in, int32_t inl); /* @@ -61,7 +61,7 @@ EvpCipherFinalEx Direct shim to EVP_CipherFinal_ex. */ -DLLEXPORT int32_t CryptoNative_EvpCipherFinalEx(EVP_CIPHER_CTX* ctx, uint8_t* outm, int32_t* outl); +PALEXPORT int32_t CryptoNative_EvpCipherFinalEx(EVP_CIPHER_CTX* ctx, uint8_t* outm, int32_t* outl); /* Function: @@ -69,7 +69,7 @@ EvpAesGcmGetTag Retrieves tag for authenticated encryption */ -DLLEXPORT int32_t CryptoNative_EvpCipherGetGcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength); +PALEXPORT int32_t CryptoNative_EvpCipherGetGcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength); /* Function: @@ -77,7 +77,7 @@ EvpAesGcmSetTag Sets tag for authenticated decryption */ -DLLEXPORT int32_t CryptoNative_EvpCipherSetGcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength); +PALEXPORT int32_t CryptoNative_EvpCipherSetGcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength); /* Function: @@ -85,7 +85,7 @@ EvpAesCcmGetTag Retrieves tag for authenticated encryption */ -DLLEXPORT int32_t CryptoNative_EvpCipherGetCcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength); +PALEXPORT int32_t CryptoNative_EvpCipherGetCcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength); /* Function: @@ -93,7 +93,7 @@ EvpAesCcmSetTag Sets tag for authenticated decryption */ -DLLEXPORT int32_t CryptoNative_EvpCipherSetCcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength); +PALEXPORT int32_t CryptoNative_EvpCipherSetCcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength); /* Function: @@ -101,7 +101,7 @@ EvpAes128Ecb Direct shim to EVP_aes_128_ecb. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Ecb(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Ecb(void); /* Function: @@ -109,7 +109,7 @@ EvpAes128Cbc Direct shim to EVP_aes_128_cbc. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Cbc(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Cbc(void); /* Function: @@ -117,7 +117,7 @@ EvpAes128Gcm Direct shim to EVP_aes_128_gcm. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Gcm(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Gcm(void); /* Function: @@ -125,7 +125,7 @@ EvpAes128Ccm Direct shim to EVP_aes_128_ccm. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Ccm(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Ccm(void); /* Function: @@ -133,7 +133,7 @@ EvpAes192Ecb Direct shim to EVP_aes_192_ecb. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Ecb(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Ecb(void); /* Function: @@ -141,7 +141,7 @@ EvpAes192Cbc Direct shim to EVP_aes_192_cbc. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Cbc(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Cbc(void); /* Function: @@ -149,7 +149,7 @@ EvpAes192Gcm Direct shim to EVP_aes_192_gcm. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Gcm(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Gcm(void); /* Function: @@ -157,7 +157,7 @@ EvpAes192Ccm Direct shim to EVP_aes_192_ccm. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Ccm(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Ccm(void); /* Function: @@ -165,7 +165,7 @@ EvpAes256Ecb Direct shim to EVP_aes_256_ecb. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Ecb(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Ecb(void); /* Function: @@ -173,7 +173,7 @@ EvpAes256Cbc Direct shim to EVP_aes_256_cbc. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Cbc(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Cbc(void); /* Function: @@ -181,7 +181,7 @@ EvpAes256Gcm Direct shim to EVP_aes_256_gcm. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Gcm(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Gcm(void); /* Function: @@ -189,7 +189,7 @@ EvpAes256Ccm Direct shim to EVP_aes_256_ccm. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Ccm(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Ccm(void); /* Function: @@ -197,7 +197,7 @@ EvpDes3Ecb Direct shim to EVP_des_ede3. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpDes3Ecb(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpDes3Ecb(void); /* Function: @@ -205,7 +205,7 @@ EvpDes3Cbc Direct shim to EVP_des_ede3_cbc. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpDes3Cbc(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpDes3Cbc(void); /* Function: @@ -213,7 +213,7 @@ EvpDesEcb Direct shim to EVP_des_ecb. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpDesEcb(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpDesEcb(void); /* Function: @@ -221,7 +221,7 @@ EvpDesCbc Direct shim to EVP_des_ede_cbc. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpDesCbc(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpDesCbc(void); /* Function: @@ -229,7 +229,7 @@ EvpRC2Ecb Direct shim to EVP_rc2_ecb. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpRC2Ecb(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpRC2Ecb(void); /* Function: @@ -237,4 +237,4 @@ EvpRC2Cbc Direct shim to EVP_des_rc2_cbc. */ -DLLEXPORT const EVP_CIPHER* CryptoNative_EvpRC2Cbc(void); +PALEXPORT const EVP_CIPHER* CryptoNative_EvpRC2Cbc(void); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey.h index 7baf997d8dbc47..f1e23da6a16964 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey.h @@ -11,7 +11,7 @@ Shims the EVP_PKEY_new method. Returns the new EVP_PKEY instance. */ -DLLEXPORT EVP_PKEY* CryptoNative_EvpPkeyCreate(void); +PALEXPORT EVP_PKEY* CryptoNative_EvpPkeyCreate(void); /* Cleans up and deletes a EVP_PKEY instance. @@ -22,7 +22,7 @@ No-op if pkey is null. The given EVP_PKEY pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_EvpPkeyDestroy(EVP_PKEY* pkey); +PALEXPORT void CryptoNative_EvpPkeyDestroy(EVP_PKEY* pkey); /* Used by System.Security.Cryptography.X509Certificates' OpenSslX509CertificateReader when @@ -31,4 +31,4 @@ duplicating a private key context as part of duplicating the Pal object. Returns the number (as of this call) of references to the EVP_PKEY. Anything less than 2 is an error, because the key is already in the process of being freed. */ -DLLEXPORT int32_t CryptoNative_UpRefEvpPkey(EVP_PKEY* pkey); +PALEXPORT int32_t CryptoNative_UpRefEvpPkey(EVP_PKEY* pkey); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_dsa.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_dsa.h index 7ea1743809b1ef..6779f82358bf4e 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_dsa.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_dsa.h @@ -11,7 +11,7 @@ Shims the EVP_PKEY_get1_DSA method. Returns the DSA instance for the EVP_PKEY. */ -DLLEXPORT DSA* CryptoNative_EvpPkeyGetDsa(EVP_PKEY* pkey); +PALEXPORT DSA* CryptoNative_EvpPkeyGetDsa(EVP_PKEY* pkey); /* Shims the EVP_PKEY_set1_DSA method to set the DSA @@ -19,4 +19,4 @@ instance on the EVP_KEY. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_EvpPkeySetDsa(EVP_PKEY* pkey, DSA* dsa); +PALEXPORT int32_t CryptoNative_EvpPkeySetDsa(EVP_PKEY* pkey, DSA* dsa); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.h index e97f4e26034f5b..3a424b3808b96b 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.h @@ -6,8 +6,8 @@ #include "pal_compiler.h" #include "opensslshim.h" -DLLEXPORT EVP_PKEY_CTX* CryptoNative_EvpPKeyCtxCreate(EVP_PKEY* pkey, EVP_PKEY* peerkey, uint32_t* secretLength); +PALEXPORT EVP_PKEY_CTX* CryptoNative_EvpPKeyCtxCreate(EVP_PKEY* pkey, EVP_PKEY* peerkey, uint32_t* secretLength); -DLLEXPORT int32_t CryptoNative_EvpPKeyDeriveSecretAgreement(uint8_t* secret, uint32_t secretLength, EVP_PKEY_CTX* ctx); +PALEXPORT int32_t CryptoNative_EvpPKeyDeriveSecretAgreement(uint8_t* secret, uint32_t secretLength, EVP_PKEY_CTX* ctx); -DLLEXPORT void CryptoNative_EvpPKeyCtxDestroy(EVP_PKEY_CTX* ctx); +PALEXPORT void CryptoNative_EvpPKeyCtxDestroy(EVP_PKEY_CTX* ctx); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_eckey.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_eckey.h index fbeea59bff0365..c015f7f13a67e1 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_eckey.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_eckey.h @@ -11,7 +11,7 @@ Shims the EVP_PKEY_get1_EC_KEY method. Returns the EC_KEY instance for the EVP_PKEY. */ -DLLEXPORT EC_KEY* CryptoNative_EvpPkeyGetEcKey(EVP_PKEY* pkey); +PALEXPORT EC_KEY* CryptoNative_EvpPkeyGetEcKey(EVP_PKEY* pkey); /* Shims the EVP_PKEY_set1_EC_KEY method to set the EC_KEY @@ -19,4 +19,4 @@ instance on the EVP_KEY. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_EvpPkeySetEcKey(EVP_PKEY* pkey, EC_KEY* key); +PALEXPORT int32_t CryptoNative_EvpPkeySetEcKey(EVP_PKEY* pkey, EC_KEY* key); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.h index d8ff369670c7c0..7b00edcb893c84 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.h @@ -11,7 +11,7 @@ Shims the EVP_PKEY_get1_RSA method. Returns the RSA instance for the EVP_PKEY. */ -DLLEXPORT RSA* CryptoNative_EvpPkeyGetRsa(EVP_PKEY* pkey); +PALEXPORT RSA* CryptoNative_EvpPkeyGetRsa(EVP_PKEY* pkey); /* Shims the EVP_PKEY_set1_RSA method to set the RSA @@ -19,4 +19,4 @@ instance on the EVP_KEY. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_EvpPkeySetRsa(EVP_PKEY* pkey, RSA* rsa); +PALEXPORT int32_t CryptoNative_EvpPkeySetRsa(EVP_PKEY* pkey, RSA* rsa); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_hmac.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_hmac.h index 1f10b81cddd16c..b1ca1c54a50cdd 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_hmac.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_hmac.h @@ -24,7 +24,7 @@ typedef struct hmac_ctx_st HMAC_CTX; * * Returns new HMAC_CTX on success, nullptr on failure. */ -DLLEXPORT HMAC_CTX* CryptoNative_HmacCreate(const uint8_t* key, int32_t keyLen, const EVP_MD* md); +PALEXPORT HMAC_CTX* CryptoNative_HmacCreate(const uint8_t* key, int32_t keyLen, const EVP_MD* md); /** * Cleans up and deletes an HMAC_CTX instance created by HmacCreate. @@ -37,14 +37,14 @@ DLLEXPORT HMAC_CTX* CryptoNative_HmacCreate(const uint8_t* key, int32_t keyLen, * The given HMAC_CTX pointer is invalid after this call. * Always succeeds. */ -DLLEXPORT void CryptoNative_HmacDestroy(HMAC_CTX* ctx); +PALEXPORT void CryptoNative_HmacDestroy(HMAC_CTX* ctx); /** * Resets an HMAC_CTX instance for a new computation, preserving the key and EVP_MD. * * Implemented by passing all null/0 values but ctx to HMAC_Init_ex. */ -DLLEXPORT int32_t CryptoNative_HmacReset(HMAC_CTX* ctx); +PALEXPORT int32_t CryptoNative_HmacReset(HMAC_CTX* ctx); /** * Appends data to the computation. @@ -53,7 +53,7 @@ DLLEXPORT int32_t CryptoNative_HmacReset(HMAC_CTX* ctx); * * Returns 1 for success or 0 for failure. (Always succeeds on platforms where HMAC_Update returns void.) */ -DLLEXPORT int32_t CryptoNative_HmacUpdate(HMAC_CTX* ctx, const uint8_t* data, int32_t len); +PALEXPORT int32_t CryptoNative_HmacUpdate(HMAC_CTX* ctx, const uint8_t* data, int32_t len); /** * Finalizes the computation and obtains the result. @@ -62,4 +62,4 @@ DLLEXPORT int32_t CryptoNative_HmacUpdate(HMAC_CTX* ctx, const uint8_t* data, in * * Returns 1 for success or 0 for failure. (Always succeeds on platforms where HMAC_Update returns void.) */ -DLLEXPORT int32_t CryptoNative_HmacFinal(HMAC_CTX* ctx, uint8_t* md, int32_t* len); +PALEXPORT int32_t CryptoNative_HmacFinal(HMAC_CTX* ctx, uint8_t* md, int32_t* len); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ocsp.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ocsp.h index e720582c420d2c..08430f2ae83273 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ocsp.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ocsp.h @@ -9,24 +9,24 @@ /* Direct shim to OCSP_REQUEST_free */ -DLLEXPORT void CryptoNative_OcspRequestDestroy(OCSP_REQUEST* request); +PALEXPORT void CryptoNative_OcspRequestDestroy(OCSP_REQUEST* request); /* Returns the number of bytes required to encode an OCSP_REQUEST */ -DLLEXPORT int32_t CryptoNative_GetOcspRequestDerSize(OCSP_REQUEST* req); +PALEXPORT int32_t CryptoNative_GetOcspRequestDerSize(OCSP_REQUEST* req); /* Encodes the OCSP_REQUEST req into the destination buffer, returning the number of bytes written. */ -DLLEXPORT int32_t CryptoNative_EncodeOcspRequest(OCSP_REQUEST* req, uint8_t* buf); +PALEXPORT int32_t CryptoNative_EncodeOcspRequest(OCSP_REQUEST* req, uint8_t* buf); /* Direct shim to d2i_OCSP_RESPONSE */ -DLLEXPORT OCSP_RESPONSE* CryptoNative_DecodeOcspResponse(const uint8_t* buf, int32_t len); +PALEXPORT OCSP_RESPONSE* CryptoNative_DecodeOcspResponse(const uint8_t* buf, int32_t len); /* Direct shim to OCSP_RESPONSE_free */ -DLLEXPORT void CryptoNative_OcspResponseDestroy(OCSP_RESPONSE* response); +PALEXPORT void CryptoNative_OcspResponseDestroy(OCSP_RESPONSE* response); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs12.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs12.h index b3eb1fce14135f..8091b32e18444f 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs12.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs12.h @@ -9,14 +9,14 @@ /* Shims the d2i_PKCS12 method and makes it easier to invoke from managed code. */ -DLLEXPORT PKCS12* CryptoNative_DecodePkcs12(const uint8_t* buf, int32_t len); +PALEXPORT PKCS12* CryptoNative_DecodePkcs12(const uint8_t* buf, int32_t len); /* Shims the d2i_PKCS12_bio method. Returns the new PKCS12 instance. */ -DLLEXPORT PKCS12* CryptoNative_DecodePkcs12FromBio(BIO* bio); +PALEXPORT PKCS12* CryptoNative_DecodePkcs12FromBio(BIO* bio); /* Cleans up and deletes a PKCS12 instance. @@ -27,32 +27,32 @@ No-op if p12 is null. The given PKCS12 pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_Pkcs12Destroy(PKCS12* p12); +PALEXPORT void CryptoNative_Pkcs12Destroy(PKCS12* p12); /* Shims the PKCS12_create method. Returns the new PKCS12 instance. */ -DLLEXPORT PKCS12* CryptoNative_Pkcs12Create(char* pass, EVP_PKEY* pkey, X509* cert, X509Stack* ca); +PALEXPORT PKCS12* CryptoNative_Pkcs12Create(char* pass, EVP_PKEY* pkey, X509* cert, X509Stack* ca); /* Returns the number of bytes it will take to convert the PKCS12 to a DER format. */ -DLLEXPORT int32_t CryptoNative_GetPkcs12DerSize(PKCS12* p12); +PALEXPORT int32_t CryptoNative_GetPkcs12DerSize(PKCS12* p12); /* Shims the i2d_PKCS12 method. Returns the number of bytes written to buf. */ -DLLEXPORT int32_t CryptoNative_EncodePkcs12(PKCS12* p12, uint8_t* buf); +PALEXPORT int32_t CryptoNative_EncodePkcs12(PKCS12* p12, uint8_t* buf); /* Shims the PKCS12_parse method. Returns 1 on success, otherwise 0. */ -DLLEXPORT int32_t +PALEXPORT int32_t CryptoNative_Pkcs12Parse(PKCS12* p12, const char* pass, EVP_PKEY** pkey, X509** cert, X509Stack** ca); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs7.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs7.h index 643965e22f06df..28d95ce32c9418 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs7.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs7.h @@ -13,12 +13,12 @@ Direct shim to PEM_read_bio_PKCS7. Returns the new PKCS7 instance. */ -DLLEXPORT PKCS7* CryptoNative_PemReadBioPkcs7(BIO* bp); +PALEXPORT PKCS7* CryptoNative_PemReadBioPkcs7(BIO* bp); /* Shims the d2i_PKCS7 method and makes it easier to invoke from managed code. */ -DLLEXPORT PKCS7* CryptoNative_DecodePkcs7(const uint8_t* buf, int32_t len); +PALEXPORT PKCS7* CryptoNative_DecodePkcs7(const uint8_t* buf, int32_t len); /* Reads a PKCS7 instance in DER format from a BIO. @@ -27,7 +27,7 @@ Direct shim to d2i_PKCS7_bio. Returns the new PKCS7 instance. */ -DLLEXPORT PKCS7* CryptoNative_D2IPkcs7Bio(BIO* bp); +PALEXPORT PKCS7* CryptoNative_D2IPkcs7Bio(BIO* bp); /* Create a new PKCS7 instance and prepare it to be a signed PKCS7 object @@ -35,7 +35,7 @@ with certificates only. Returns the new PKCS7 instance. */ -DLLEXPORT PKCS7* CryptoNative_Pkcs7CreateCertificateCollection(X509Stack* certs); +PALEXPORT PKCS7* CryptoNative_Pkcs7CreateCertificateCollection(X509Stack* certs); /* Cleans up and deletes a PKCS7 instance. @@ -46,7 +46,7 @@ No-op if p7 is null. The given PKCS7 pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_Pkcs7Destroy(PKCS7* p7); +PALEXPORT void CryptoNative_Pkcs7Destroy(PKCS7* p7); /* Function: @@ -60,17 +60,17 @@ Return values: 1 when the file format is understood, and *certs is assigned to the certificate contents of the structure. */ -DLLEXPORT int32_t CryptoNative_GetPkcs7Certificates(PKCS7* p7, X509Stack** certs); +PALEXPORT int32_t CryptoNative_GetPkcs7Certificates(PKCS7* p7, X509Stack** certs); /* Returns the number of bytes it will take to convert the PKCS7 to a DER format. */ -DLLEXPORT int32_t CryptoNative_GetPkcs7DerSize(PKCS7* p7); +PALEXPORT int32_t CryptoNative_GetPkcs7DerSize(PKCS7* p7); /* Shims the i2d_PKCS7 method. Returns the number of bytes written to buf. */ -DLLEXPORT int32_t CryptoNative_EncodePkcs7(PKCS7* p7, uint8_t* buf); +PALEXPORT int32_t CryptoNative_EncodePkcs7(PKCS7* p7, uint8_t* buf); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_rsa.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_rsa.h index b85fed627f4d96..8d982803fc9834 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_rsa.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_rsa.h @@ -22,14 +22,14 @@ Shims the RSA_new method. Returns the new RSA instance. */ -DLLEXPORT RSA* CryptoNative_RsaCreate(void); +PALEXPORT RSA* CryptoNative_RsaCreate(void); /* Shims the RSA_up_ref method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_RsaUpRef(RSA* rsa); +PALEXPORT int32_t CryptoNative_RsaUpRef(RSA* rsa); /* Cleans up and deletes a RSA instance. @@ -40,19 +40,19 @@ No-op if rsa is null. The given RSA pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_RsaDestroy(RSA* rsa); +PALEXPORT void CryptoNative_RsaDestroy(RSA* rsa); /* Shims the d2i_RSAPublicKey method and makes it easier to invoke from managed code. */ -DLLEXPORT RSA* CryptoNative_DecodeRsaPublicKey(const uint8_t* buf, int32_t len); +PALEXPORT RSA* CryptoNative_DecodeRsaPublicKey(const uint8_t* buf, int32_t len); /* Shims the RSA_public_encrypt method. Returns the size of the signature, or -1 on error. */ -DLLEXPORT int32_t +PALEXPORT int32_t CryptoNative_RsaPublicEncrypt(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa, RsaPadding padding); /* @@ -60,7 +60,7 @@ Shims the RSA_private_decrypt method. Returns the size of the signature, or -1 on error. */ -DLLEXPORT int32_t +PALEXPORT int32_t CryptoNative_RsaPrivateDecrypt(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa, RsaPadding padding); /* @@ -69,7 +69,7 @@ Shims RSA_private_encrypt with a fixed value of RSA_NO_PADDING. Requires that the input be the size of the key. Returns the number of bytes written (which should be flen), or -1 on error. */ -DLLEXPORT int32_t CryptoNative_RsaSignPrimitive(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa); +PALEXPORT int32_t CryptoNative_RsaSignPrimitive(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa); /* Shims RSA_public_decrypt with a fixed value of RSA_NO_PADDING. @@ -77,28 +77,28 @@ Shims RSA_public_decrypt with a fixed value of RSA_NO_PADDING. Requires that the input be the size of the key. Returns the number of bytes written (which should be flen), or -1 on error. */ -DLLEXPORT int32_t CryptoNative_RsaVerificationPrimitive(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa); +PALEXPORT int32_t CryptoNative_RsaVerificationPrimitive(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa); /* Shims the RSA_size method. Returns the RSA modulus size in bytes. */ -DLLEXPORT int32_t CryptoNative_RsaSize(RSA* rsa); +PALEXPORT int32_t CryptoNative_RsaSize(RSA* rsa); /* Shims the RSA_generate_key_ex method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_RsaGenerateKeyEx(RSA* rsa, int32_t bits, BIGNUM* e); +PALEXPORT int32_t CryptoNative_RsaGenerateKeyEx(RSA* rsa, int32_t bits, BIGNUM* e); /* Shims the RSA_sign method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t +PALEXPORT int32_t CryptoNative_RsaSign(int32_t type, const uint8_t* m, int32_t mlen, uint8_t* sigret, int32_t* siglen, RSA* rsa); /* @@ -106,7 +106,7 @@ Shims the RSA_verify method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t +PALEXPORT int32_t CryptoNative_RsaVerify(int32_t type, const uint8_t* m, int32_t mlen, uint8_t* sigbuf, int32_t siglen, RSA* rsa); /* @@ -114,7 +114,7 @@ Gets all the parameters from the RSA instance. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_GetRsaParameters(const RSA* rsa, +PALEXPORT int32_t CryptoNative_GetRsaParameters(const RSA* rsa, const BIGNUM** n, const BIGNUM** e, const BIGNUM** d, @@ -127,7 +127,7 @@ DLLEXPORT int32_t CryptoNative_GetRsaParameters(const RSA* rsa, /* Sets all the parameters on the RSA instance. */ -DLLEXPORT int32_t CryptoNative_SetRsaParameters(RSA* rsa, +PALEXPORT int32_t CryptoNative_SetRsaParameters(RSA* rsa, uint8_t* n, int32_t nLength, uint8_t* e, diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ssl.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ssl.h index 2db6e76d01cd06..9167e5cd81ab43 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ssl.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ssl.h @@ -130,40 +130,40 @@ typedef int32_t (*SslCtxSetAlpnCallback)(SSL* ssl, /* Ensures that libssl is correctly initialized and ready to use. */ -DLLEXPORT void CryptoNative_EnsureLibSslInitialized(void); +PALEXPORT void CryptoNative_EnsureLibSslInitialized(void); /* Shims the SSLv23_method method. Returns the requested SSL_METHOD. */ -DLLEXPORT const SSL_METHOD* CryptoNative_SslV2_3Method(void); +PALEXPORT const SSL_METHOD* CryptoNative_SslV2_3Method(void); /* Shims the SSL_CTX_new method. Returns the new SSL_CTX instance. */ -DLLEXPORT SSL_CTX* CryptoNative_SslCtxCreate(SSL_METHOD* method); +PALEXPORT SSL_CTX* CryptoNative_SslCtxCreate(SSL_METHOD* method); /* Sets the specified protocols in the SSL_CTX options. */ -DLLEXPORT void CryptoNative_SetProtocolOptions(SSL_CTX* ctx, SslProtocols protocols); +PALEXPORT void CryptoNative_SetProtocolOptions(SSL_CTX* ctx, SslProtocols protocols); /* Shims the SSL_new method. Returns the new SSL instance. */ -DLLEXPORT SSL* CryptoNative_SslCreate(SSL_CTX* ctx); +PALEXPORT SSL* CryptoNative_SslCreate(SSL_CTX* ctx); /* Shims the SSL_get_error method. Returns the error code for the specified result. */ -DLLEXPORT int32_t CryptoNative_SslGetError(SSL* ssl, int32_t ret); +PALEXPORT int32_t CryptoNative_SslGetError(SSL* ssl, int32_t ret); /* Cleans up and deletes an SSL instance. @@ -174,7 +174,7 @@ No-op if ssl is null. The given X509 SSL is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_SslDestroy(SSL* ssl); +PALEXPORT void CryptoNative_SslDestroy(SSL* ssl); /* Cleans up and deletes an SSL_CTX instance. @@ -185,24 +185,24 @@ No-op if ctx is null. The given X509 SSL_CTX is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_SslCtxDestroy(SSL_CTX* ctx); +PALEXPORT void CryptoNative_SslCtxDestroy(SSL_CTX* ctx); /* Shims the SSL_set_connect_state method. */ -DLLEXPORT void CryptoNative_SslSetConnectState(SSL* ssl); +PALEXPORT void CryptoNative_SslSetConnectState(SSL* ssl); /* Shims the SSL_set_accept_state method. */ -DLLEXPORT void CryptoNative_SslSetAcceptState(SSL* ssl); +PALEXPORT void CryptoNative_SslSetAcceptState(SSL* ssl); /* Shims the SSL_get_version method. Returns the protocol version string for the SSL instance. */ -DLLEXPORT const char* CryptoNative_SslGetVersion(SSL* ssl); +PALEXPORT const char* CryptoNative_SslGetVersion(SSL* ssl); /* Shims the SSL_write method. @@ -210,7 +210,7 @@ Shims the SSL_write method. Returns the positive number of bytes written when successful, 0 or a negative number when an error is encountered. */ -DLLEXPORT int32_t CryptoNative_SslWrite(SSL* ssl, const void* buf, int32_t num); +PALEXPORT int32_t CryptoNative_SslWrite(SSL* ssl, const void* buf, int32_t num); /* Shims the SSL_read method. @@ -218,14 +218,14 @@ Shims the SSL_read method. Returns the positive number of bytes read when successful, 0 or a negative number when an error is encountered. */ -DLLEXPORT int32_t CryptoNative_SslRead(SSL* ssl, void* buf, int32_t num); +PALEXPORT int32_t CryptoNative_SslRead(SSL* ssl, void* buf, int32_t num); /* Shims the SSL_renegotiate_pending method. Returns 1 when negotiation is requested; 0 once a handshake has finished. */ -DLLEXPORT int32_t CryptoNative_IsSslRenegotiatePending(SSL* ssl); +PALEXPORT int32_t CryptoNative_IsSslRenegotiatePending(SSL* ssl); /* Shims the SSL_shutdown method. @@ -235,12 +235,12 @@ Shims the SSL_shutdown method. 0 if the shutdown is not yet finished; <0 if the shutdown was not successful because a fatal error. */ -DLLEXPORT int32_t CryptoNative_SslShutdown(SSL* ssl); +PALEXPORT int32_t CryptoNative_SslShutdown(SSL* ssl); /* Shims the SSL_set_bio method. */ -DLLEXPORT void CryptoNative_SslSetBio(SSL* ssl, BIO* rbio, BIO* wbio); +PALEXPORT void CryptoNative_SslSetBio(SSL* ssl, BIO* rbio, BIO* wbio); /* Shims the SSL_do_handshake method. @@ -251,113 +251,113 @@ Shims the SSL_do_handshake method. and by the specifications of the TLS/SSL protocol; <0 if the handshake was not successful because of a fatal error. */ -DLLEXPORT int32_t CryptoNative_SslDoHandshake(SSL* ssl); +PALEXPORT int32_t CryptoNative_SslDoHandshake(SSL* ssl); /* Gets a value indicating whether the SSL_state is SSL_ST_OK. Returns 1 if the state is OK, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_IsSslStateOK(SSL* ssl); +PALEXPORT int32_t CryptoNative_IsSslStateOK(SSL* ssl); /* Shims the SSL_get_peer_certificate method. Returns the certificate presented by the peer. */ -DLLEXPORT X509* CryptoNative_SslGetPeerCertificate(SSL* ssl); +PALEXPORT X509* CryptoNative_SslGetPeerCertificate(SSL* ssl); /* Shims the SSL_get_peer_cert_chain method. Returns the certificate chain presented by the peer. */ -DLLEXPORT X509Stack* CryptoNative_SslGetPeerCertChain(SSL* ssl); +PALEXPORT X509Stack* CryptoNative_SslGetPeerCertChain(SSL* ssl); /* Shims the SSL_CTX_use_certificate method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_SslCtxUseCertificate(SSL_CTX* ctx, X509* x); +PALEXPORT int32_t CryptoNative_SslCtxUseCertificate(SSL_CTX* ctx, X509* x); /* Shims the SSL_CTX_use_PrivateKey method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_SslCtxUsePrivateKey(SSL_CTX* ctx, EVP_PKEY* pkey); +PALEXPORT int32_t CryptoNative_SslCtxUsePrivateKey(SSL_CTX* ctx, EVP_PKEY* pkey); /* Shims the SSL_CTX_check_private_key method. Returns 1 upon success, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_SslCtxCheckPrivateKey(SSL_CTX* ctx); +PALEXPORT int32_t CryptoNative_SslCtxCheckPrivateKey(SSL_CTX* ctx); /* Shims the SSL_CTX_set_quiet_shutdown method. */ -DLLEXPORT void CryptoNative_SslCtxSetQuietShutdown(SSL_CTX* ctx); +PALEXPORT void CryptoNative_SslCtxSetQuietShutdown(SSL_CTX* ctx); /* Shims the SSL_set_quiet_shutdown method. */ -DLLEXPORT void CryptoNative_SslSetQuietShutdown(SSL* ctx, int mode); +PALEXPORT void CryptoNative_SslSetQuietShutdown(SSL* ctx, int mode); /* Shims the SSL_get_client_CA_list method. Returns the list of CA names explicity set. */ -DLLEXPORT X509NameStack* CryptoNative_SslGetClientCAList(SSL* ssl); +PALEXPORT X509NameStack* CryptoNative_SslGetClientCAList(SSL* ssl); /* Shims the SSL_CTX_set_verify method. */ -DLLEXPORT void CryptoNative_SslCtxSetVerify(SSL_CTX* ctx, SslCtxSetVerifyCallback callback); +PALEXPORT void CryptoNative_SslCtxSetVerify(SSL_CTX* ctx, SslCtxSetVerifyCallback callback); /* Shims the SSL_CTX_set_cert_verify_callback method. */ -DLLEXPORT void +PALEXPORT void CryptoNative_SslCtxSetCertVerifyCallback(SSL_CTX* ctx, SslCtxSetCertVerifyCallbackCallback callback, void* arg); /* Sets the specified encryption policy on the SSL_CTX. */ -DLLEXPORT int32_t CryptoNative_SetEncryptionPolicy(SSL_CTX* ctx, EncryptionPolicy policy); +PALEXPORT int32_t CryptoNative_SetEncryptionPolicy(SSL_CTX* ctx, EncryptionPolicy policy); /* Sets ciphers (< TLS 1.3) and cipher suites (TLS 1.3) on the SSL_CTX */ -DLLEXPORT int32_t CryptoNative_SetCiphers(SSL_CTX* ctx, const char* cipherList, const char* cipherSuites); +PALEXPORT int32_t CryptoNative_SetCiphers(SSL_CTX* ctx, const char* cipherList, const char* cipherSuites); /* Determines if TLS 1.3 is supported by this OpenSSL implementation */ -DLLEXPORT int32_t CryptoNative_Tls13Supported(void); +PALEXPORT int32_t CryptoNative_Tls13Supported(void); /* Shims the SSL_CTX_set_client_cert_cb method */ -DLLEXPORT void CryptoNative_SslCtxSetClientCertCallback(SSL_CTX* ctx, SslClientCertCallback callback); +PALEXPORT void CryptoNative_SslCtxSetClientCertCallback(SSL_CTX* ctx, SslClientCertCallback callback); /* Shims the SSL_get_finished method. */ -DLLEXPORT int32_t CryptoNative_SslGetFinished(SSL* ssl, void* buf, int32_t count); +PALEXPORT int32_t CryptoNative_SslGetFinished(SSL* ssl, void* buf, int32_t count); /* Shims the SSL_get_peer_finished method. */ -DLLEXPORT int32_t CryptoNative_SslGetPeerFinished(SSL* ssl, void* buf, int32_t count); +PALEXPORT int32_t CryptoNative_SslGetPeerFinished(SSL* ssl, void* buf, int32_t count); /* Returns true/false based on if existing ssl session was re-used or not. Shims the SSL_session_reused macro. */ -DLLEXPORT int32_t CryptoNative_SslSessionReused(SSL* ssl); +PALEXPORT int32_t CryptoNative_SslSessionReused(SSL* ssl); /* adds the given certificate to the extra chain certificates associated with ctx that is associated with the ssl. @@ -365,36 +365,36 @@ adds the given certificate to the extra chain certificates associated with ctx t libssl frees the x509 object. Returns 1 if success and 0 in case of failure */ -DLLEXPORT int32_t CryptoNative_SslAddExtraChainCert(SSL* ssl, X509* x509); +PALEXPORT int32_t CryptoNative_SslAddExtraChainCert(SSL* ssl, X509* x509); /* Shims the ssl_ctx_set_alpn_select_cb method. */ -DLLEXPORT void CryptoNative_SslCtxSetAlpnSelectCb(SSL_CTX* ctx, SslCtxSetAlpnCallback cb, void *arg); +PALEXPORT void CryptoNative_SslCtxSetAlpnSelectCb(SSL_CTX* ctx, SslCtxSetAlpnCallback cb, void *arg); /* Shims the ssl_ctx_set_alpn_protos method. Returns 0 on success, non-zero on failure. */ -DLLEXPORT int32_t CryptoNative_SslCtxSetAlpnProtos(SSL_CTX* ctx, const uint8_t* protos, uint32_t protos_len); +PALEXPORT int32_t CryptoNative_SslCtxSetAlpnProtos(SSL_CTX* ctx, const uint8_t* protos, uint32_t protos_len); /* Shims the ssl_get0_alpn_selected method. */ -DLLEXPORT void CryptoNative_SslGet0AlpnSelected(SSL* ssl, const uint8_t** protocol, uint32_t* len); +PALEXPORT void CryptoNative_SslGet0AlpnSelected(SSL* ssl, const uint8_t** protocol, uint32_t* len); /* Shims the SSL_set_tlsext_host_name method. */ -DLLEXPORT int32_t CryptoNative_SslSetTlsExtHostName(SSL* ssl, uint8_t* name); +PALEXPORT int32_t CryptoNative_SslSetTlsExtHostName(SSL* ssl, uint8_t* name); /* Shims the SSL_get_current_cipher and SSL_CIPHER_get_id. */ -DLLEXPORT int32_t CryptoNative_SslGetCurrentCipherId(SSL* ssl, int32_t* cipherId); +PALEXPORT int32_t CryptoNative_SslGetCurrentCipherId(SSL* ssl, int32_t* cipherId); /* Looks up a cipher by the IANA identifier, returns a shared string for the OpenSSL name for the cipher, and emits a value indicating if the cipher belongs to the SSL2-TLS1.2 list, or the TLS1.3+ list. */ -DLLEXPORT const char* CryptoNative_GetOpenSslCipherSuiteName(SSL* ssl, int32_t cipherSuite, int32_t* isTls12OrLower); +PALEXPORT const char* CryptoNative_GetOpenSslCipherSuiteName(SSL* ssl, int32_t cipherSuite, int32_t* isTls12OrLower); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509.h index 1e8dfd61b5794e..d856095237f10a 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509.h @@ -68,30 +68,30 @@ GetX509EvpPublicKey Returns a EVP_PKEY* equivalent to the public key of the certificate. */ -DLLEXPORT EVP_PKEY* CryptoNative_GetX509EvpPublicKey(X509* x509); +PALEXPORT EVP_PKEY* CryptoNative_GetX509EvpPublicKey(X509* x509); /* Shims the d2i_X509_CRL method and makes it easier to invoke from managed code. */ -DLLEXPORT X509_CRL* CryptoNative_DecodeX509Crl(const uint8_t* buf, int32_t len); +PALEXPORT X509_CRL* CryptoNative_DecodeX509Crl(const uint8_t* buf, int32_t len); /* Shims the d2i_X509 method and makes it easier to invoke from managed code. */ -DLLEXPORT X509* CryptoNative_DecodeX509(const uint8_t* buf, int32_t len); +PALEXPORT X509* CryptoNative_DecodeX509(const uint8_t* buf, int32_t len); /* Returns the number of bytes it will take to convert the X509 to a DER format. */ -DLLEXPORT int32_t CryptoNative_GetX509DerSize(X509* x); +PALEXPORT int32_t CryptoNative_GetX509DerSize(X509* x); /* Shims the i2d_X509 method. Returns the number of bytes written to buf. */ -DLLEXPORT int32_t CryptoNative_EncodeX509(X509* x, uint8_t* buf); +PALEXPORT int32_t CryptoNative_EncodeX509(X509* x, uint8_t* buf); /* Cleans up and deletes an X509 instance. @@ -102,121 +102,121 @@ No-op if a is null. The given X509 pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_X509Destroy(X509* a); +PALEXPORT void CryptoNative_X509Destroy(X509* a); /* Shims the X509_dup method. Returns the duplicated X509 instance. */ -DLLEXPORT X509* CryptoNative_X509Duplicate(X509* x509); +PALEXPORT X509* CryptoNative_X509Duplicate(X509* x509); /* Shims the PEM_read_bio_X509 method. Returns the read X509 instance. */ -DLLEXPORT X509* CryptoNative_PemReadX509FromBio(BIO* bio); +PALEXPORT X509* CryptoNative_PemReadX509FromBio(BIO* bio); /* Shims the PEM_read_bio_X509_AUX method. Returns the read X509 instance. */ -DLLEXPORT X509* CryptoNative_PemReadX509FromBioAux(BIO* bio); +PALEXPORT X509* CryptoNative_PemReadX509FromBioAux(BIO* bio); /* Shims the X509_get_serialNumber method. Returns the ASN1_INTEGER for the serial number. */ -DLLEXPORT ASN1_INTEGER* CryptoNative_X509GetSerialNumber(X509* x509); +PALEXPORT ASN1_INTEGER* CryptoNative_X509GetSerialNumber(X509* x509); /* Shims the X509_get_issuer_name method. Returns the ASN1_INTEGER for the issuer name. */ -DLLEXPORT X509_NAME* CryptoNative_X509GetIssuerName(X509* x509); +PALEXPORT X509_NAME* CryptoNative_X509GetIssuerName(X509* x509); /* Shims the X509_get_subject_name method. Returns the X509_NAME for the subject name. */ -DLLEXPORT X509_NAME* CryptoNative_X509GetSubjectName(X509* x509); +PALEXPORT X509_NAME* CryptoNative_X509GetSubjectName(X509* x509); /* Shims the X509_check_purpose method. */ -DLLEXPORT int32_t CryptoNative_X509CheckPurpose(X509* x, int32_t id, int32_t ca); +PALEXPORT int32_t CryptoNative_X509CheckPurpose(X509* x, int32_t id, int32_t ca); /* Shims the X509_issuer_name_hash method. */ -DLLEXPORT uint64_t CryptoNative_X509IssuerNameHash(X509* x); +PALEXPORT uint64_t CryptoNative_X509IssuerNameHash(X509* x); /* Shims the X509_get_ext_count method. */ -DLLEXPORT int32_t CryptoNative_X509GetExtCount(X509* x); +PALEXPORT int32_t CryptoNative_X509GetExtCount(X509* x); /* Shims the X509_get_ext method. */ -DLLEXPORT X509_EXTENSION* CryptoNative_X509GetExt(X509* x, int32_t loc); +PALEXPORT X509_EXTENSION* CryptoNative_X509GetExt(X509* x, int32_t loc); /* Shims the X509_EXTENSION_get_object method. */ -DLLEXPORT ASN1_OBJECT* CryptoNative_X509ExtensionGetOid(X509_EXTENSION* x); +PALEXPORT ASN1_OBJECT* CryptoNative_X509ExtensionGetOid(X509_EXTENSION* x); /* Shims the X509_EXTENSION_get_data method. */ -DLLEXPORT ASN1_OCTET_STRING* CryptoNative_X509ExtensionGetData(X509_EXTENSION* x); +PALEXPORT ASN1_OCTET_STRING* CryptoNative_X509ExtensionGetData(X509_EXTENSION* x); /* Shims the X509_EXTENSION_get_critical method. */ -DLLEXPORT int32_t CryptoNative_X509ExtensionGetCritical(X509_EXTENSION* x); +PALEXPORT int32_t CryptoNative_X509ExtensionGetCritical(X509_EXTENSION* x); /* Returns the data portion of the first matched extension. */ -DLLEXPORT ASN1_OCTET_STRING* CryptoNative_X509FindExtensionData(X509* x, int32_t nid); +PALEXPORT ASN1_OCTET_STRING* CryptoNative_X509FindExtensionData(X509* x, int32_t nid); /* Shims the X509_STORE_free method. */ -DLLEXPORT void CryptoNative_X509StoreDestory(X509_STORE* v); +PALEXPORT void CryptoNative_X509StoreDestory(X509_STORE* v); /* Shims the X509_STORE_add_crl method. */ -DLLEXPORT int32_t CryptoNative_X509StoreAddCrl(X509_STORE* ctx, X509_CRL* x); +PALEXPORT int32_t CryptoNative_X509StoreAddCrl(X509_STORE* ctx, X509_CRL* x); /* Sets the correct flags on the X509_STORE for the specified X509RevocationFlag. Shims the X509_STORE_set_flags method. */ -DLLEXPORT int32_t CryptoNative_X509StoreSetRevocationFlag(X509_STORE* ctx, X509RevocationFlag revocationFlag); +PALEXPORT int32_t CryptoNative_X509StoreSetRevocationFlag(X509_STORE* ctx, X509RevocationFlag revocationFlag); /* Shims the X509_STORE_CTX_new method. */ -DLLEXPORT X509_STORE_CTX* CryptoNative_X509StoreCtxCreate(void); +PALEXPORT X509_STORE_CTX* CryptoNative_X509StoreCtxCreate(void); /* Shims the X509_STORE_CTX_free method. */ -DLLEXPORT void CryptoNative_X509StoreCtxDestroy(X509_STORE_CTX* v); +PALEXPORT void CryptoNative_X509StoreCtxDestroy(X509_STORE_CTX* v); /* Shims the X509_STORE_CTX_init method. */ -DLLEXPORT int32_t CryptoNative_X509StoreCtxInit(X509_STORE_CTX* ctx, +PALEXPORT int32_t CryptoNative_X509StoreCtxInit(X509_STORE_CTX* ctx, X509_STORE* store, X509* x509, X509Stack* extraStore); @@ -224,92 +224,92 @@ DLLEXPORT int32_t CryptoNative_X509StoreCtxInit(X509_STORE_CTX* ctx, /* Shims the X509_verify_cert method. */ -DLLEXPORT int32_t CryptoNative_X509VerifyCert(X509_STORE_CTX* ctx); +PALEXPORT int32_t CryptoNative_X509VerifyCert(X509_STORE_CTX* ctx); /* Shims the X509_STORE_CTX_get1_chain method. */ -DLLEXPORT X509Stack* CryptoNative_X509StoreCtxGetChain(X509_STORE_CTX* ctx); +PALEXPORT X509Stack* CryptoNative_X509StoreCtxGetChain(X509_STORE_CTX* ctx); /* Shims the X509_STORE_CTX_get_current_cert function. */ -DLLEXPORT X509* CryptoNative_X509StoreCtxGetCurrentCert(X509_STORE_CTX* ctx); +PALEXPORT X509* CryptoNative_X509StoreCtxGetCurrentCert(X509_STORE_CTX* ctx); /* Returns the interior pointer to the "untrusted" certificates collection for this X509_STORE_CTX */ -DLLEXPORT X509Stack* CryptoNative_X509StoreCtxGetSharedUntrusted(X509_STORE_CTX* ctx); +PALEXPORT X509Stack* CryptoNative_X509StoreCtxGetSharedUntrusted(X509_STORE_CTX* ctx); /* Returns the interior pointer to the target certificate for an X509 certificate chain */ -DLLEXPORT X509* CryptoNative_X509StoreCtxGetTargetCert(X509_STORE_CTX* ctx); +PALEXPORT X509* CryptoNative_X509StoreCtxGetTargetCert(X509_STORE_CTX* ctx); /* Shims the X509_STORE_CTX_get_error method. */ -DLLEXPORT X509VerifyStatusCode CryptoNative_X509StoreCtxGetError(X509_STORE_CTX* ctx); +PALEXPORT X509VerifyStatusCode CryptoNative_X509StoreCtxGetError(X509_STORE_CTX* ctx); /* Resets ctx to before the chain was built, preserving the target cert, trust store, extra cert context, and verify parameters. */ -DLLEXPORT int32_t CryptoNative_X509StoreCtxReset(X509_STORE_CTX* ctx); +PALEXPORT int32_t CryptoNative_X509StoreCtxReset(X509_STORE_CTX* ctx); /* Reset ctx and rebuild the chain. Returns -1 if CryptoNative_X509StoreCtxReset failed, otherwise returns the result of X509_verify_cert. */ -DLLEXPORT int32_t CryptoNative_X509StoreCtxRebuildChain(X509_STORE_CTX* ctx); +PALEXPORT int32_t CryptoNative_X509StoreCtxRebuildChain(X509_STORE_CTX* ctx); /* Shims the X509_STORE_CTX_get_error_depth method. */ -DLLEXPORT int32_t CryptoNative_X509StoreCtxGetErrorDepth(X509_STORE_CTX* ctx); +PALEXPORT int32_t CryptoNative_X509StoreCtxGetErrorDepth(X509_STORE_CTX* ctx); /* Shims the X509_STORE_CTX_set_verify_cb function. */ -DLLEXPORT void CryptoNative_X509StoreCtxSetVerifyCallback(X509_STORE_CTX* ctx, X509StoreVerifyCallback callback); +PALEXPORT void CryptoNative_X509StoreCtxSetVerifyCallback(X509_STORE_CTX* ctx, X509StoreVerifyCallback callback); /* Shims the X509_verify_cert_error_string method. */ -DLLEXPORT const char* CryptoNative_X509VerifyCertErrorString(X509VerifyStatusCode n); +PALEXPORT const char* CryptoNative_X509VerifyCertErrorString(X509VerifyStatusCode n); /* Shims the X509_CRL_free method. */ -DLLEXPORT void CryptoNative_X509CrlDestroy(X509_CRL* a); +PALEXPORT void CryptoNative_X509CrlDestroy(X509_CRL* a); /* Shims the PEM_write_bio_X509_CRL method. Returns the number of bytes written. */ -DLLEXPORT int32_t CryptoNative_PemWriteBioX509Crl(BIO* bio, X509_CRL* crl); +PALEXPORT int32_t CryptoNative_PemWriteBioX509Crl(BIO* bio, X509_CRL* crl); /* Shims the PEM_read_bio_X509_CRL method. The new X509_CRL instance. */ -DLLEXPORT X509_CRL* CryptoNative_PemReadBioX509Crl(BIO* bio); +PALEXPORT X509_CRL* CryptoNative_PemReadBioX509Crl(BIO* bio); /* Returns the number of bytes it will take to convert the SubjectPublicKeyInfo portion of the X509 to DER format. */ -DLLEXPORT int32_t CryptoNative_GetX509SubjectPublicKeyInfoDerSize(X509* x); +PALEXPORT int32_t CryptoNative_GetX509SubjectPublicKeyInfoDerSize(X509* x); /* Shims the i2d_X509_PUBKEY method, providing X509_get_X509_PUBKEY(x) as the input. Returns the number of bytes written to buf. */ -DLLEXPORT int32_t CryptoNative_EncodeX509SubjectPublicKeyInfo(X509* x, uint8_t* buf); +PALEXPORT int32_t CryptoNative_EncodeX509SubjectPublicKeyInfo(X509* x, uint8_t* buf); /* Increases the reference count of the X509*, thereby increasing the number of calls @@ -319,28 +319,28 @@ Unlike X509Duplicate, this modifies an existing object, so no new memory is allo Returns the input value. */ -DLLEXPORT X509* CryptoNative_X509UpRef(X509* x509); +PALEXPORT X509* CryptoNative_X509UpRef(X509* x509); /* Create a new X509_STORE, considering the certificates from systemTrust and userTrust */ -DLLEXPORT X509_STORE* CryptoNative_X509ChainNew(X509Stack* systemTrust, X509Stack* userTrust); +PALEXPORT X509_STORE* CryptoNative_X509ChainNew(X509Stack* systemTrust, X509Stack* userTrust); /* Adds all of the simple certificates from null-or-empty-password PFX files in storePath to stack. */ -DLLEXPORT int32_t CryptoNative_X509StackAddDirectoryStore(X509Stack* stack, char* storePath); +PALEXPORT int32_t CryptoNative_X509StackAddDirectoryStore(X509Stack* stack, char* storePath); /* Adds all of the certificates in src to dest and increases their reference count. */ -DLLEXPORT int32_t CryptoNative_X509StackAddMultiple(X509Stack* dest, X509Stack* src); +PALEXPORT int32_t CryptoNative_X509StackAddMultiple(X509Stack* dest, X509Stack* src); /* Removes any untrusted/extra certificates from the unstrusted collection that are not part of the current chain to make chain builds after Reset faster. */ -DLLEXPORT int32_t CryptoNative_X509StoreCtxCommitToChain(X509_STORE_CTX* storeCtx); +PALEXPORT int32_t CryptoNative_X509StoreCtxCommitToChain(X509_STORE_CTX* storeCtx); /* Duplicates any certificate at or below the level where the error marker is. @@ -348,25 +348,25 @@ Duplicates any certificate at or below the level where the error marker is. Outputs a new store with a clone of the root, if necessary. The new store does not have any properties set other than the trust. (Mainly, CRLs are lost) */ -DLLEXPORT int32_t CryptoNative_X509StoreCtxResetForSignatureError(X509_STORE_CTX* storeCtx, X509_STORE** newStore); +PALEXPORT int32_t CryptoNative_X509StoreCtxResetForSignatureError(X509_STORE_CTX* storeCtx, X509_STORE** newStore); /* Look for a cached OCSP response appropriate to the end-entity certificate using the issuer as determined by the chain in storeCtx. */ -DLLEXPORT X509VerifyStatusCode CryptoNative_X509ChainGetCachedOcspStatus(X509_STORE_CTX* storeCtx, char* cachePath, int chainDepth); +PALEXPORT X509VerifyStatusCode CryptoNative_X509ChainGetCachedOcspStatus(X509_STORE_CTX* storeCtx, char* cachePath, int chainDepth); /* Build an OCSP request appropriate for the end-entity certificate using the issuer (and trust) as determined by the chain in storeCtx. */ -DLLEXPORT OCSP_REQUEST* CryptoNative_X509ChainBuildOcspRequest(X509_STORE_CTX* storeCtx, int chainDepth); +PALEXPORT OCSP_REQUEST* CryptoNative_X509ChainBuildOcspRequest(X509_STORE_CTX* storeCtx, int chainDepth); /* Determine if the OCSP response is acceptable, and if acceptable report the status and cache the result (if appropriate) */ -DLLEXPORT X509VerifyStatusCode CryptoNative_X509ChainVerifyOcsp(X509_STORE_CTX* storeCtx, +PALEXPORT X509VerifyStatusCode CryptoNative_X509ChainVerifyOcsp(X509_STORE_CTX* storeCtx, OCSP_REQUEST* req, OCSP_RESPONSE* resp, char* cachePath, diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_name.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_name.h index a24fdef4f29608..cfd633e7cea5d8 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_name.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_name.h @@ -12,9 +12,9 @@ GetX509NameStackFieldCount Direct shim to sk_X509_NAME_num */ -DLLEXPORT int32_t CryptoNative_GetX509NameStackFieldCount(X509NameStack* sk); +PALEXPORT int32_t CryptoNative_GetX509NameStackFieldCount(X509NameStack* sk); /* Direct shim to sk_X509_NAME_value */ -DLLEXPORT X509_NAME* CryptoNative_GetX509NameStackField(X509NameStack* sk, int32_t loc); +PALEXPORT X509_NAME* CryptoNative_GetX509NameStackField(X509NameStack* sk, int32_t loc); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_root.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_root.h index f259a505fafeca..40a828e7ca736b 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_root.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_root.h @@ -9,11 +9,11 @@ Look up the directory in which all certificate files therein are considered trusted (root or trusted intermediate). */ -DLLEXPORT const char* CryptoNative_GetX509RootStorePath(void); +PALEXPORT const char* CryptoNative_GetX509RootStorePath(void); /* Look up the file in which all certificates are considered trusted (root or trusted intermediate), in addition to those files in the root store path. */ -DLLEXPORT const char* CryptoNative_GetX509RootStoreFile(void); +PALEXPORT const char* CryptoNative_GetX509RootStoreFile(void); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509ext.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509ext.h index 166f84d5c08d10..3b8b4f21ea464d 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509ext.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509ext.h @@ -13,7 +13,7 @@ Implemented by calling X509_EXTENSION_create_by_OBJ Returns new X509_EXTENSION on success, nullptr on failure. */ -DLLEXPORT X509_EXTENSION* +PALEXPORT X509_EXTENSION* CryptoNative_X509ExtensionCreateByObj(ASN1_OBJECT* obj, int32_t isCritical, ASN1_OCTET_STRING* data); /* @@ -25,14 +25,14 @@ No-op if a is null. The given X509_EXTENSION pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_X509ExtensionDestroy(X509_EXTENSION* a); +PALEXPORT void CryptoNative_X509ExtensionDestroy(X509_EXTENSION* a); /* Shims the X509V3_EXT_print method. Returns 1 on success, otherwise 0 if there was an error. */ -DLLEXPORT int32_t CryptoNative_X509V3ExtPrint(BIO* out, X509_EXTENSION* ext); +PALEXPORT int32_t CryptoNative_X509V3ExtPrint(BIO* out, X509_EXTENSION* ext); /* Decodes the X509 BASIC_CONSTRAINTS information and fills the out variables: @@ -43,7 +43,7 @@ Decodes the X509 BASIC_CONSTRAINTS information and fills the out variables: Returns 1 if the BASIC_CONSTRAINTS information was successfully decoded, otherwise 0. */ -DLLEXPORT int32_t CryptoNative_DecodeX509BasicConstraints2Extension(const uint8_t* encoded, +PALEXPORT int32_t CryptoNative_DecodeX509BasicConstraints2Extension(const uint8_t* encoded, int32_t encodedLength, int32_t* certificateAuthority, int32_t* hasPathLengthConstraint, @@ -52,7 +52,7 @@ DLLEXPORT int32_t CryptoNative_DecodeX509BasicConstraints2Extension(const uint8_ /* Shims the d2i_EXTENDED_KEY_USAGE method and makes it easier to invoke from managed code. */ -DLLEXPORT EXTENDED_KEY_USAGE* CryptoNative_DecodeExtendedKeyUsage(const uint8_t* buf, int32_t len); +PALEXPORT EXTENDED_KEY_USAGE* CryptoNative_DecodeExtendedKeyUsage(const uint8_t* buf, int32_t len); /* Cleans up and deletes an EXTENDED_KEY_USAGE instance. @@ -63,4 +63,4 @@ No-op if a is null. The given EXTENDED_KEY_USAGE pointer is invalid after this call. Always succeeds. */ -DLLEXPORT void CryptoNative_ExtendedKeyUsageDestory(EXTENDED_KEY_USAGE* a); +PALEXPORT void CryptoNative_ExtendedKeyUsageDestory(EXTENDED_KEY_USAGE* a); diff --git a/src/libraries/Native/Unix/configure.cmake b/src/libraries/Native/Unix/configure.cmake index e072d74a554c1e..bf323f6bae16b7 100644 --- a/src/libraries/Native/Unix/configure.cmake +++ b/src/libraries/Native/Unix/configure.cmake @@ -30,7 +30,8 @@ endif () # We compile with -Werror, so we need to make sure these code fragments compile without warnings. # Older CMake versions (3.8) do not assign the result of their tests, causing unused-value errors # which are not distinguished from the test failing. So no error for that one. -set(CMAKE_REQUIRED_FLAGS "-Werror -Wno-error=unused-value") +# For clang-5.0 avoid errors like "unused variable 'err' [-Werror,-Wunused-variable]". +set(CMAKE_REQUIRED_FLAGS "-Werror -Wno-error=unused-value -Wno-error=unused-variable") # Apple platforms like macOS/iOS allow targeting older operating system versions with a single SDK, # the mere presence of a symbol in the SDK doesn't tell us whether the deployment target really supports it. @@ -121,7 +122,7 @@ check_symbol_exists( check_symbol_exists( posix_fadvise64 - fnctl.h + fcntl.h HAVE_POSIX_FADVISE64) check_symbol_exists( @@ -305,10 +306,11 @@ check_c_source_compiles( check_c_source_compiles( " #include + #include int main(void) { - DIR* dir; - struct dirent* entry; + DIR* dir = NULL; + struct dirent* entry = NULL; struct dirent* result; readdir_r(dir, entry, &result); return 0; @@ -410,18 +412,19 @@ set(PREVIOUS_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(CMAKE_REQUIRED_FLAGS "-Werror -Wsign-conversion") check_c_source_compiles( " + #include #include #include int main(void) { const struct sockaddr *addr; - socklen_t addrlen; - char *host; - socklen_t hostlen; - char *serv; - socklen_t servlen; - int flags; + socklen_t addrlen = 0; + char *host = NULL; + socklen_t hostlen = 0; + char *serv = NULL; + socklen_t servlen = 0; + int flags = 0; int result = getnameinfo(addr, addrlen, host, hostlen, serv, servlen, flags); return 0; } @@ -496,13 +499,14 @@ set (CMAKE_REQUIRED_FLAGS "-Werror -Wsign-conversion") check_c_source_compiles( " + #include #include int main(void) { - int fd; - struct sockaddr* addr; - socklen_t addrLen; + int fd = -1; + struct sockaddr* addr = NULL; + socklen_t addrLen = 0; int err = bind(fd, addr, addrLen); return 0; @@ -712,7 +716,14 @@ set (CMAKE_REQUIRED_FLAGS "-Werror -Weverything") check_c_source_compiles( " #include - int main(void) { size_t namelen = 20; char name[20]; getdomainname(name, namelen); return 0; } + int main(void) + { + size_t namelen = 20; + char name[20]; + int dummy = getdomainname(name, namelen); + (void)dummy; + return 0; + } " HAVE_GETDOMAINNAME_SIZET ) diff --git a/src/libraries/System.AppContext/ref/System.AppContext.Forwards.cs b/src/libraries/System.AppContext/ref/System.AppContext.Forwards.cs index e0c637af2e4b5e..9a7e200f36e451 100644 --- a/src/libraries/System.AppContext/ref/System.AppContext.Forwards.cs +++ b/src/libraries/System.AppContext/ref/System.AppContext.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.AppContext))] diff --git a/src/libraries/System.Buffers/ref/System.Buffers.Forwards.cs b/src/libraries/System.Buffers/ref/System.Buffers.Forwards.cs index a42368f8556a30..e4f01380587da7 100644 --- a/src/libraries/System.Buffers/ref/System.Buffers.Forwards.cs +++ b/src/libraries/System.Buffers/ref/System.Buffers.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.ArrayPool<>))] diff --git a/src/libraries/System.CodeDom/ref/System.CodeDom.cs b/src/libraries/System.CodeDom/ref/System.CodeDom.cs index b3483c000fd302..0eb70cfb511fe5 100644 --- a/src/libraries/System.CodeDom/ref/System.CodeDom.cs +++ b/src/libraries/System.CodeDom/ref/System.CodeDom.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace Microsoft.CSharp diff --git a/src/libraries/System.CodeDom/ref/System.CodeDom.csproj b/src/libraries/System.CodeDom/ref/System.CodeDom.csproj index 0e84e7d2900321..33a978c2358776 100644 --- a/src/libraries/System.CodeDom/ref/System.CodeDom.csproj +++ b/src/libraries/System.CodeDom/ref/System.CodeDom.csproj @@ -1,8 +1,8 @@ true - net461;netstandard2.0;$(NetFrameworkCurrent) - true + netstandard2.0;net461;$(NetFrameworkCurrent) + true diff --git a/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs b/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs index 76806e79d1279c..bbfe3bf3bb1909 100644 --- a/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs +++ b/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs @@ -2703,7 +2703,7 @@ private string GetBaseTypeOutput(CodeTypeReference typeRef, bool preferBuiltInTy return "void"; } - string lowerCaseString = s.ToLower(CultureInfo.InvariantCulture).Trim(); + string lowerCaseString = s.ToLowerInvariant().Trim(); switch (lowerCaseString) { diff --git a/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs b/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs index 4eeaa42f367dd2..08880ebf037e02 100644 --- a/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs +++ b/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs @@ -379,7 +379,7 @@ private static void AppendEscapedChar(StringBuilder b, char value) { b.Append("&Global.Microsoft.VisualBasic.ChrW("); b.Append(((int)value).ToString(CultureInfo.InvariantCulture)); - b.Append(")"); + b.Append(')'); } protected override void ProcessCompilerOutputLine(CompilerResults results, string line) diff --git a/src/libraries/System.CodeDom/src/System.CodeDom.csproj b/src/libraries/System.CodeDom/src/System.CodeDom.csproj index f83003d256c3db..441673ef11f5b0 100644 --- a/src/libraries/System.CodeDom/src/System.CodeDom.csproj +++ b/src/libraries/System.CodeDom/src/System.CodeDom.csproj @@ -3,8 +3,8 @@ true true $(DefineConstants);CODEDOM - net461;netstandard2.0;$(NetFrameworkCurrent) - true + netstandard2.0;net461;$(NetFrameworkCurrent) + true diff --git a/src/libraries/System.CodeDom/src/System/Collections/Specialized/FixedStringLookup.cs b/src/libraries/System.CodeDom/src/System/Collections/Specialized/FixedStringLookup.cs index 6744e198d8a6f5..8789e70b804f08 100644 --- a/src/libraries/System.CodeDom/src/System/Collections/Specialized/FixedStringLookup.cs +++ b/src/libraries/System.CodeDom/src/System/Collections/Specialized/FixedStringLookup.cs @@ -44,7 +44,7 @@ private static bool Contains(string[] array, string value, bool ignoreCase) { if (ignoreCase) { - searchChar = char.ToLower(value[pos], CultureInfo.InvariantCulture); + searchChar = char.ToLowerInvariant(value[pos]); } else { diff --git a/src/libraries/System.Collections.Concurrent/ref/System.Collections.Concurrent.cs b/src/libraries/System.Collections.Concurrent/ref/System.Collections.Concurrent.cs index c6db222848c031..022d5ce0456e59 100644 --- a/src/libraries/System.Collections.Concurrent/ref/System.Collections.Concurrent.cs +++ b/src/libraries/System.Collections.Concurrent/ref/System.Collections.Concurrent.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Collections.Concurrent diff --git a/src/libraries/System.Collections.Concurrent/src/Resources/Strings.resx b/src/libraries/System.Collections.Concurrent/src/Resources/Strings.resx index f85665e6c3908e..8389f524bebb2e 100644 --- a/src/libraries/System.Collections.Concurrent/src/Resources/Strings.resx +++ b/src/libraries/System.Collections.Concurrent/src/Resources/Strings.resx @@ -114,9 +114,6 @@ The collections argument is a zero-length array. - - The operation was canceled. - The collection argument is null. diff --git a/src/libraries/System.Collections.Concurrent/src/System.Collections.Concurrent.csproj b/src/libraries/System.Collections.Concurrent/src/System.Collections.Concurrent.csproj index 90c616d5fcf43f..208ab764456eee 100644 --- a/src/libraries/System.Collections.Concurrent/src/System.Collections.Concurrent.csproj +++ b/src/libraries/System.Collections.Concurrent/src/System.Collections.Concurrent.csproj @@ -4,7 +4,7 @@ System.Collections.Concurrent true enable - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs index ce94e095581a68..4c4f2ad37edc2e 100644 --- a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs +++ b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs @@ -399,8 +399,7 @@ private bool TryAddWithNoTimeValidation(T item, int millisecondsTimeout, Cancell { CheckDisposed(); - if (cancellationToken.IsCancellationRequested) - throw new OperationCanceledException(SR.Common_OperationCanceled, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); if (IsAddingCompleted) { @@ -427,8 +426,7 @@ private bool TryAddWithNoTimeValidation(T item, int millisecondsTimeout, Cancell catch (OperationCanceledException) { //if cancellation was via external token, throw an OCE - if (cancellationToken.IsCancellationRequested) - throw new OperationCanceledException(SR.Common_OperationCanceled, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); //if cancellation was via internal token, this indicates invalid use, hence InvalidOpEx. //Debug.Assert(_ProducersCancellationTokenSource.Token.IsCancellationRequested); @@ -674,8 +672,7 @@ private bool TryTakeWithNoTimeValidation([MaybeNullWhen(false)] out T item, int CheckDisposed(); item = default(T)!; - if (cancellationToken.IsCancellationRequested) - throw new OperationCanceledException(SR.Common_OperationCanceled, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); //If the collection is completed then there is no need to wait. if (IsCompleted) @@ -701,9 +698,7 @@ private bool TryTakeWithNoTimeValidation([MaybeNullWhen(false)] out T item, int //The collection became completed while waiting on the semaphore. catch (OperationCanceledException) { - if (cancellationToken.IsCancellationRequested) - throw new OperationCanceledException(SR.Common_OperationCanceled, cancellationToken); - + cancellationToken.ThrowIfCancellationRequested(); return false; } finally @@ -1023,10 +1018,8 @@ private static int TryAddToAnyCore(BlockingCollection[] collections, T item, if (linkedTokenSource.IsCancellationRequested) { - if (externalCancellationToken.IsCancellationRequested) //case#3 - throw new OperationCanceledException(SR.Common_OperationCanceled, externalCancellationToken); - else //case#4 - throw new ArgumentException(SR.BlockingCollection_CantAddAnyWhenCompleted, nameof(collections)); + externalCancellationToken.ThrowIfCancellationRequested(); //case#3 + throw new ArgumentException(SR.BlockingCollection_CantAddAnyWhenCompleted, nameof(collections)); //case#4 } } @@ -1420,8 +1413,10 @@ private static int TryTakeFromAnyCoreSlow(BlockingCollection[] collections, [ handles.Add(linkedTokenSource.Token.WaitHandle); // add the combined token to the handles list int index = WaitHandle.WaitAny(handles.ToArray(), timeout); - if (linkedTokenSource.IsCancellationRequested && externalCancellationToken.IsCancellationRequested)//case#3 - throw new OperationCanceledException(SR.Common_OperationCanceled, externalCancellationToken); + if (linkedTokenSource.IsCancellationRequested) + { + externalCancellationToken.ThrowIfCancellationRequested(); //case#3 + } if (!linkedTokenSource.IsCancellationRequested) // if neither internal nor external cancellation requested { diff --git a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs index ff155065feee20..4ef5ecdf2927a3 100644 --- a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs +++ b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs @@ -918,11 +918,13 @@ public TValue this[TKey key] // as these are uncommonly needed and when inlined are observed to prevent the inlining // of important methods like TryGetValue and ContainsKey. + [DoesNotReturn] private static void ThrowKeyNotFoundException(object key) { throw new KeyNotFoundException(SR.Format(SR.Arg_KeyNotFoundWithKey, key.ToString())); } + [DoesNotReturn] private static void ThrowKeyNullException() { throw new ArgumentNullException("key"); diff --git a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs index 06df02667392a4..3d8371fde2a10b 100644 --- a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs +++ b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs @@ -1671,10 +1671,7 @@ private static int GetDefaultChunkSize() { int chunkSize; - // Because of the lack of typeof(T).IsValueType we need two pieces of information - // to determine this. default(T) will return a non null for Value Types, except those - // using Nullable<>, that is why we need a second condition. - if (default(TSource) != null || Nullable.GetUnderlyingType(typeof(TSource)) != null) + if (typeof(TSource).IsValueType) { // Marshal.SizeOf fails for value types that don't have explicit layouts. We // just fall back to some arbitrary constant in that case. Is there a better way? diff --git a/src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs b/src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs index 4fa9bee5715a04..0372629d7f8600 100644 --- a/src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs +++ b/src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs @@ -212,6 +212,7 @@ public void IEnumerable_GetAllExpectedItems() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16413", TestRuntimes.Mono)] public void ReferenceTypes_NulledAfterDequeue() { int iterations = 10; // any number <32 will do diff --git a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs index 0772ea7c7b1c7d..f00233360d7333 100644 --- a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs +++ b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Collections.Immutable diff --git a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.csproj b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.csproj index 2ecfe776956f96..b2875fd23dca7b 100644 --- a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.csproj +++ b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.csproj @@ -1,7 +1,7 @@ - netstandard1.0;netstandard1.3;netstandard2.0;$(NetCoreAppCurrent) - true + $(NetCoreAppCurrent);netstandard1.0;netstandard1.3;netstandard2.0 + true enable diff --git a/src/libraries/System.Collections.Immutable/src/GlobalSuppressions.cs b/src/libraries/System.Collections.Immutable/src/GlobalSuppressions.cs deleted file mode 100644 index 7f4af832de847e..00000000000000 --- a/src/libraries/System.Collections.Immutable/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Collections.Generic")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1016:MarkAssembliesWithAssemblyVersion", Justification = "The official build system adds this attribute.")] diff --git a/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj b/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj index c8521b06c4acf3..fce0ed64088cc1 100644 --- a/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj +++ b/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj @@ -4,13 +4,12 @@ System.Collections.Immutable 512 netstandard1.0;portable-net45+win8+wp8+wpa81 - netstandard1.0;netstandard1.3;netstandard2.0;$(NetCoreAppCurrent) - true + $(NetCoreAppCurrent);netstandard1.0;netstandard1.3;netstandard2.0 + true enable - diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/IHashKeyCollection.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/IHashKeyCollection.cs index 452ac0e71ff918..9a2fcaf84dcca1 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/IHashKeyCollection.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/IHashKeyCollection.cs @@ -8,7 +8,6 @@ namespace System.Collections.Generic /// Defined on a generic collection that hashes its contents using an . /// /// The type of element hashed in the collection. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] internal interface IHashKeyCollection { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/ISortKeyCollection.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/ISortKeyCollection.cs index b7896403e79613..aff634c2e52c1b 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/ISortKeyCollection.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/ISortKeyCollection.cs @@ -10,7 +10,6 @@ namespace System.Collections.Generic /// Defined on a generic collection that sorts its contents using an . /// /// The type of element sorted in the collection. - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] internal interface ISortKeyCollection { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/AllocFreeConcurrentStack.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/AllocFreeConcurrentStack.cs index 7d68ababec2f02..1c62a65fe34b2f 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/AllocFreeConcurrentStack.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/AllocFreeConcurrentStack.cs @@ -67,7 +67,7 @@ internal static class AllocFreeConcurrentStack // Please do not change the type, the name, or the semantic usage of this member without understanding the implication for tools. // Get in touch with the diagnostics team if you have questions. - // Workaround for https://github.com/dotnet/coreclr/issues/2191. + // Workaround for https://github.com/dotnet/runtime/issues/4731. // When that's fixed, a [ThreadStatic] Stack should be added back to AllocFreeConcurrentStack. [ThreadStatic] diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableDictionary.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableDictionary.cs index 2db135949b49ed..ef33b1c2663199 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableDictionary.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableDictionary.cs @@ -13,8 +13,6 @@ namespace System.Collections.Immutable /// /// The type of the key. /// The type of the value. - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public interface IImmutableDictionary : IReadOnlyDictionary { /// @@ -42,7 +40,6 @@ public interface IImmutableDictionary : IReadOnlyDictionaryThe pairs. /// The new dictionary containing the additional key-value pairs. /// Thrown when one of the given keys already exists in the dictionary but has a different value. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] IImmutableDictionary AddRange(IEnumerable> pairs); @@ -65,7 +62,6 @@ public interface IImmutableDictionary : IReadOnlyDictionaryThe key=value pairs to set on the dictionary. Any keys that conflict with existing keys will overwrite the previous values. /// An immutable dictionary. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] IImmutableDictionary SetItems(IEnumerable> items); /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableList.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableList.cs index b6e4297e184069..05545062d45708 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableList.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableList.cs @@ -16,7 +16,6 @@ namespace System.Collections.Immutable /// Mutations on this list generate new lists. Incremental changes to a list share as much memory as possible with the prior versions of a list, /// while allowing garbage collection to clean up any unique list data that is no longer being referenced. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public interface IImmutableList : IReadOnlyList { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableListQueries.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableListQueries.cs index 36bcbe5e0e0021..0a6e1f904d34ad 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableListQueries.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableListQueries.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Collections.Immutable { @@ -120,6 +121,7 @@ internal interface IImmutableListQueries : IReadOnlyList /// The first element that matches the conditions defined by the specified predicate, /// if found; otherwise, the default value for type . /// + [return: MaybeNull] T Find(Predicate match); /// @@ -193,6 +195,7 @@ internal interface IImmutableListQueries : IReadOnlyList /// The last element that matches the conditions defined by the specified predicate, /// if found; otherwise, the default value for type . /// + [return: MaybeNull] T FindLast(Predicate match); /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableQueue.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableQueue.cs index 588980f2b99894..9209b1a599d8b8 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableQueue.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableQueue.cs @@ -12,8 +12,6 @@ namespace System.Collections.Immutable /// An immutable queue. /// /// The type of elements in the queue. - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")] public interface IImmutableQueue : IEnumerable { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableSet.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableSet.cs index 9dce4cdb3177f0..45acf280f7a7a6 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableSet.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableSet.cs @@ -16,8 +16,6 @@ namespace System.Collections.Immutable /// Mutations on this set generate new sets. Incremental changes to a set share as much memory as possible with the prior versions of a set, /// while allowing garbage collection to clean up any unique set data that is no longer being referenced. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")] public interface IImmutableSet : IReadOnlyCollection { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableStack.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableStack.cs index 0a52496e1fd502..73a892c909edaf 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableStack.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableStack.cs @@ -12,8 +12,6 @@ namespace System.Collections.Immutable /// An immutable stack. /// /// The type of elements stored in the stack. - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public interface IImmutableStack : IEnumerable { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs index af69f23a374550..88f94fcf269c57 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs @@ -145,16 +145,18 @@ public static ImmutableArray CreateRange(IEnumerable items) [Pure] public static ImmutableArray Create(params T[]? items) { - if (items == null) + if (items == null || items.Length == 0) { - return Create(); + return ImmutableArray.Empty; } // We can't trust that the array passed in will never be mutated by the caller. // The caller may have passed in an array explicitly (not relying on compiler params keyword) // and could then change the array after the call, thereby violating the immutable // guarantee provided by this struct. So we always copy the array to ensure it won't ever change. - return CreateDefensiveCopy(items); + var tmp = new T[items.Length]; + Array.Copy(items, tmp, items.Length); + return new ImmutableArray(tmp); } /// @@ -541,24 +543,5 @@ public static int BinarySearch(this ImmutableArray array, int index, int l { return Array.BinarySearch(array.array!, index, length, value, comparer); } - - /// - /// Initializes a new instance of the struct. - /// - /// The array from which to copy. - internal static ImmutableArray CreateDefensiveCopy(T[] items) - { - Debug.Assert(items != null); - - if (items.Length == 0) - { - return ImmutableArray.Empty; // use just a shared empty array, allowing the input array to be potentially GC'd - } - - // defensive copy - var tmp = new T[items.Length]; - Array.Copy(items, tmp, items.Length); - return new ImmutableArray(tmp); - } } } diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs index 4fa82d95068fb4..6a7695d842959c 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs @@ -40,7 +40,9 @@ public partial struct ImmutableArray : IEnumerable, IEquatable /// An empty (initialized) instance of . /// -#pragma warning disable CA1825 // Array.Empty() doesn't exist in all configurations +#pragma warning disable CA1825 + // Array.Empty() doesn't exist in all configurations + // Switching to Array.Empty also has a non-negligible impact on the working set memory public static readonly ImmutableArray Empty = new ImmutableArray(new T[0]); #pragma warning restore CA1825 diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary.cs index c6d8239ab2f1b4..68b9bfc2670b27 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// A set of initialization methods for instances of . /// - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public static class ImmutableDictionary { /// @@ -66,7 +65,6 @@ public static ImmutableDictionary Create(IEqualityCo /// The items to prepopulate. /// The new immutable collection. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary CreateRange(IEnumerable> items) where TKey : notnull { return ImmutableDictionary.Empty.AddRange(items); @@ -81,7 +79,6 @@ public static ImmutableDictionary CreateRange(IEnume /// The items to prepopulate. /// The new immutable collection. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary CreateRange(IEqualityComparer? keyComparer, IEnumerable> items) where TKey : notnull { return ImmutableDictionary.Empty.WithComparers(keyComparer).AddRange(items); @@ -97,7 +94,6 @@ public static ImmutableDictionary CreateRange(IEqual /// The items to prepopulate. /// The new immutable collection. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary CreateRange(IEqualityComparer? keyComparer, IEqualityComparer? valueComparer, IEnumerable> items) where TKey : notnull { return ImmutableDictionary.Empty.WithComparers(keyComparer, valueComparer).AddRange(items); @@ -250,7 +246,6 @@ public static ImmutableDictionary ToImmutableDictionaryThe value comparer to use for the immutable map. /// An immutable map. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary ToImmutableDictionary(this IEnumerable> source, IEqualityComparer? keyComparer, IEqualityComparer? valueComparer) where TKey : notnull { Requires.NotNull(source, nameof(source)); @@ -273,7 +268,6 @@ public static ImmutableDictionary ToImmutableDictionaryThe key comparer to use when building the immutable map. /// An immutable map. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary ToImmutableDictionary(this IEnumerable> source, IEqualityComparer? keyComparer) where TKey : notnull { return ToImmutableDictionary(source, keyComparer, null); @@ -287,7 +281,6 @@ public static ImmutableDictionary ToImmutableDictionaryThe sequence of key=value pairs. /// An immutable map. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary ToImmutableDictionary(this IEnumerable> source) where TKey : notnull { return ToImmutableDictionary(source, null, null); diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs index 11717ea790ac64..5b94faa3d30b15 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// Contains the inner class. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableDictionary { /// @@ -29,8 +28,6 @@ public sealed partial class ImmutableDictionary /// Instance members of this class are not thread-safe. /// /// - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableDictionaryBuilderDebuggerProxy<,>))] public sealed class Builder : IDictionary, IReadOnlyDictionary, IDictionary @@ -435,7 +432,6 @@ public TValue this[TKey key] /// Adds a sequence of values to this collection. /// /// The items. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public void AddRange(IEnumerable> items) { var result = ImmutableDictionary.AddRange(items, this.Origin); diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.cs index d921380648fa99..1d5241c15c31db 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.cs @@ -22,7 +22,6 @@ public sealed partial class ImmutableDictionary : IImmutableDictio /// /// An empty immutable dictionary with default equality comparers. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ImmutableDictionary Empty = new ImmutableDictionary(); /// @@ -313,7 +312,6 @@ public ImmutableDictionary Add(TKey key, TValue value) /// See the interface. /// [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ImmutableDictionary AddRange(IEnumerable> pairs) { Requires.NotNull(pairs, nameof(pairs)); @@ -339,7 +337,6 @@ public ImmutableDictionary SetItem(TKey key, TValue value) /// The key=value pairs to set on the map. Any keys that conflict with existing keys will overwrite the previous values. /// An immutable dictionary. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ImmutableDictionary SetItems(IEnumerable> items) { Requires.NotNull(items, nameof(items)); diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.Minimal.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.Minimal.cs index 94fbc30d3e6ed2..859a68f55f0586 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.Minimal.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.Minimal.cs @@ -114,7 +114,7 @@ internal static bool TryCopyTo(this IEnumerable sequence, T[] array, int a // Array.Copy can throw an ArrayTypeMismatchException if the underlying type of // the destination array is not typeof(T[]), but is assignment-compatible with T[]. - // See https://github.com/dotnet/corefx/issues/2241 for more info. + // See https://github.com/dotnet/runtime/issues/14794 for more info. if (sequence.GetType() == typeof(T[])) { var sourceArray = (T[])sequence; diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.cs index c4f908b8c2779e..2c2f6cf45a3716 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.cs @@ -17,6 +17,9 @@ internal static partial class ImmutableExtensions { internal static bool IsValueType() { +#if NETCOREAPP + return typeof(T).IsValueType; +#else if (default(T) != null) { return true; @@ -29,6 +32,7 @@ internal static bool IsValueType() } return false; +#endif } #if EqualsStructurally diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.Builder.cs index 589a3e0796ce1f..d212581554bd8c 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.Builder.cs @@ -11,7 +11,6 @@ namespace System.Collections.Immutable /// /// Contains the inner class. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableHashSet { /// @@ -28,8 +27,6 @@ public sealed partial class ImmutableHashSet /// Instance members of this class are not thread-safe. /// /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")] [DebuggerDisplay("Count = {Count}")] public sealed class Builder : IReadOnlyCollection, ISet { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs index 8fc536af27da4a..0e7806fb1ed5ad 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs @@ -21,7 +21,6 @@ public sealed partial class ImmutableHashSet : IImmutableSet, IHashKeyColl /// /// An empty immutable hash set with the default comparer for . /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ImmutableHashSet Empty = new ImmutableHashSet(SortedInt32KeyNode.EmptyNode, EqualityComparer.Default, 0); /// @@ -221,7 +220,7 @@ public ImmutableHashSet Remove(T item) [Pure] public bool TryGetValue(T equalValue, out T actualValue) { - int hashCode = _equalityComparer.GetHashCode(equalValue); + int hashCode = equalValue != null ? _equalityComparer.GetHashCode(equalValue) : 0; HashBucket bucket; if (_root.TryGetValue(hashCode, out bucket)) { @@ -639,7 +638,7 @@ private static bool IsSupersetOf(IEnumerable other, MutationInput origin) private static MutationResult Add(T item, MutationInput origin) { OperationResult result; - int hashCode = origin.EqualityComparer.GetHashCode(item); + int hashCode = item != null ? origin.EqualityComparer.GetHashCode(item) : 0; HashBucket bucket = origin.Root.GetValueOrDefault(hashCode); var newBucket = bucket.Add(item, origin.EqualityComparer, out result); if (result == OperationResult.NoChangeRequired) @@ -658,7 +657,7 @@ private static MutationResult Add(T item, MutationInput origin) private static MutationResult Remove(T item, MutationInput origin) { var result = OperationResult.NoChangeRequired; - int hashCode = origin.EqualityComparer.GetHashCode(item); + int hashCode = item != null ? origin.EqualityComparer.GetHashCode(item) : 0; HashBucket bucket; var newRoot = origin.Root; if (origin.Root.TryGetValue(hashCode, out bucket)) @@ -680,7 +679,7 @@ private static MutationResult Remove(T item, MutationInput origin) /// private static bool Contains(T item, MutationInput origin) { - int hashCode = origin.EqualityComparer.GetHashCode(item); + int hashCode = item != null ? origin.EqualityComparer.GetHashCode(item) : 0; HashBucket bucket; if (origin.Root.TryGetValue(hashCode, out bucket)) { @@ -701,7 +700,7 @@ private static MutationResult Union(IEnumerable other, MutationInput origin) var newRoot = origin.Root; foreach (var item in other.GetEnumerableDisposable()) { - int hashCode = origin.EqualityComparer.GetHashCode(item); + int hashCode = item != null ? origin.EqualityComparer.GetHashCode(item) : 0; HashBucket bucket = newRoot.GetValueOrDefault(hashCode); OperationResult result; var newBucket = bucket.Add(item, origin.EqualityComparer, out result); @@ -812,7 +811,7 @@ private static MutationResult Except(IEnumerable other, IEqualityComparer var newRoot = root; foreach (var item in other.GetEnumerableDisposable()) { - int hashCode = equalityComparer.GetHashCode(item); + int hashCode = item != null ? equalityComparer.GetHashCode(item) : 0; HashBucket bucket; if (newRoot.TryGetValue(hashCode, out bucket)) { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs index bc64eb241dd55d..104ffe2e92f574 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// Contains the inner Builder class. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableList { /// @@ -29,8 +28,6 @@ public sealed partial class ImmutableList /// Instance members of this class are not thread-safe. /// /// - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableListBuilderDebuggerProxy<>))] public sealed class Builder : IList, IList, IOrderedCollection, IImmutableListQueries, IReadOnlyList @@ -130,7 +127,6 @@ private set /// /// The index of the desired element. /// The value at the specified index. - [SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow", MessageId = "index+1", Justification = "There is no chance of this overflowing")] public T this[int index] { get diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs index aa9053678af362..d7a0f7fcb6acd1 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs @@ -21,7 +21,6 @@ public sealed partial class ImmutableList : IImmutableList, IList, ILis /// /// An empty immutable list. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ImmutableList Empty = new ImmutableList(); /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue.cs index 7fe64df847c093..107fa536c11751 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// A set of initialization methods for instances of . /// - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public static class ImmutableQueue { /// @@ -105,7 +104,6 @@ public static ImmutableQueue Create(params T[] items) /// Receives the value from the head of the queue. /// The new queue with the head element removed. /// Thrown when the stack is empty. - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#")] [Pure] public static IImmutableQueue Dequeue(this IImmutableQueue queue, out T value) { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs index 2a894af2182ca0..c0263bcec802bc 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs @@ -16,8 +16,6 @@ namespace System.Collections.Immutable /// The type of elements stored in the queue. [DebuggerDisplay("IsEmpty = {IsEmpty}")] [DebuggerTypeProxy(typeof(ImmutableEnumerableDebuggerProxy<>))] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableQueue : IImmutableQueue { /// @@ -222,7 +220,6 @@ public ImmutableQueue Dequeue() /// Receives the value from the head of the queue. /// The new queue with the head element removed. /// Thrown when the queue is empty. - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")] [Pure] public ImmutableQueue Dequeue(out T value) { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary.cs index e5881dfeaf3a19..658c8299fdaf38 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// A set of initialization methods for instances of . /// - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public static class ImmutableSortedDictionary { /// @@ -61,7 +60,6 @@ public static ImmutableSortedDictionary Create(IComp /// The type of values stored by the dictionary. /// The items to prepopulate. /// The new immutable collection. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary CreateRange(IEnumerable> items) where TKey : notnull { @@ -76,7 +74,6 @@ public static ImmutableSortedDictionary CreateRange( /// The key comparer. /// The items to prepopulate. /// The new immutable collection. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary CreateRange(IComparer? keyComparer, IEnumerable> items) where TKey : notnull { @@ -92,7 +89,6 @@ public static ImmutableSortedDictionary CreateRange( /// The value comparer. /// The items to prepopulate. /// The new immutable collection. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary CreateRange(IComparer? keyComparer, IEqualityComparer? valueComparer, IEnumerable> items) where TKey : notnull { @@ -216,7 +212,6 @@ public static ImmutableSortedDictionary ToImmutableSortedDictionar /// The key comparer to use when building the immutable map. /// The value comparer to use for the immutable map. /// An immutable map. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary ToImmutableSortedDictionary(this IEnumerable> source, IComparer? keyComparer, IEqualityComparer? valueComparer) where TKey : notnull { @@ -239,7 +234,6 @@ public static ImmutableSortedDictionary ToImmutableSortedDictionar /// The sequence of key=value pairs. /// The key comparer to use when building the immutable map. /// An immutable map. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary ToImmutableSortedDictionary(this IEnumerable> source, IComparer? keyComparer) where TKey : notnull { @@ -253,7 +247,6 @@ public static ImmutableSortedDictionary ToImmutableSortedDictionar /// The type of value in the map. /// The sequence of key=value pairs. /// An immutable map. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary ToImmutableSortedDictionary(this IEnumerable> source) where TKey : notnull { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs index eee40acc4cd9b5..03b403bb4d6d87 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// Contains the inner class. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableSortedDictionary where TKey : notnull { /// @@ -27,8 +26,6 @@ public sealed partial class ImmutableSortedDictionary where TKey : /// Instance members of this class are not thread-safe. /// /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableSortedDictionaryBuilderDebuggerProxy<,>))] public sealed class Builder : IDictionary, IReadOnlyDictionary, IDictionary @@ -580,7 +577,6 @@ public bool ContainsValue(TValue value) /// Removes any entries from the dictionaries with keys that match those found in the specified sequence. /// /// The keys for entries to remove from the dictionary. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public void AddRange(IEnumerable> items) { Requires.NotNull(items, nameof(items)); diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs index af7c4821922d16..50a582cae96579 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs @@ -23,7 +23,6 @@ public sealed partial class ImmutableSortedDictionary : IImmutable /// /// An empty sorted dictionary with default sort and equality comparers. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ImmutableSortedDictionary Empty = new ImmutableSortedDictionary(); /// @@ -282,7 +281,6 @@ public ImmutableSortedDictionary SetItem(TKey key, TValue value) /// /// The key=value pairs to set on the map. Any keys that conflict with existing keys will overwrite the previous values. /// An immutable dictionary. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public ImmutableSortedDictionary SetItems(IEnumerable> items) { @@ -294,7 +292,6 @@ public ImmutableSortedDictionary SetItems(IEnumerable /// See the interface. /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public ImmutableSortedDictionary AddRange(IEnumerable> items) { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs index a31de704c31140..4cb1476d262bc2 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// Contains the inner class. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableSortedSet { /// @@ -29,8 +28,6 @@ public sealed partial class ImmutableSortedSet /// Instance members of this class are not thread-safe. /// /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableSortedSetBuilderDebuggerProxy<>))] public sealed class Builder : ISortKeyCollection, IReadOnlyCollection, ISet, ICollection diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs index bc1482baa8e4b3..94fca217387672 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs @@ -33,7 +33,6 @@ public sealed partial class ImmutableSortedSet : IImmutableSet, ISortKeyCo /// /// An empty sorted set with the default sort comparer. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ImmutableSortedSet Empty = new ImmutableSortedSet(); /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack.cs index 9361c6909f2f06..91cc379b79d460 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack.cs @@ -11,7 +11,6 @@ namespace System.Collections.Immutable /// /// A set of initialization methods for instances of . /// - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public static class ImmutableStack { /// @@ -87,7 +86,6 @@ public static ImmutableStack Create(params T[] items) /// A stack; never null /// /// Thrown when the stack is empty. - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#")] [Pure] public static IImmutableStack Pop(this IImmutableStack stack, out T value) { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs index 55decdba78ab0f..a6d0c1d8e22a1e 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs @@ -16,8 +16,6 @@ namespace System.Collections.Immutable /// The type of element stored by the stack. [DebuggerDisplay("IsEmpty = {IsEmpty}; Top = {_head}")] [DebuggerTypeProxy(typeof(ImmutableEnumerableDebuggerProxy<>))] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableStack : IImmutableStack { /// @@ -184,7 +182,6 @@ public ImmutableStack Pop() /// /// A stack; never null /// - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")] [Pure] public ImmutableStack Pop(out T value) { diff --git a/src/libraries/System.Collections.Immutable/src/Validation/Requires.cs b/src/libraries/System.Collections.Immutable/src/Validation/Requires.cs index 06e65df734c581..7305c45cbcc32f 100644 --- a/src/libraries/System.Collections.Immutable/src/Validation/Requires.cs +++ b/src/libraries/System.Collections.Immutable/src/Validation/Requires.cs @@ -121,7 +121,6 @@ public static void Argument(bool condition, string? parameterName, string? messa /// /// Throws an if a condition does not evaluate to true. /// - [SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly")] [DebuggerStepThrough] public static void Argument(bool condition) { diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableArrayTest.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableArrayTest.cs index dbdac72dfafd82..a1bc3d7db8805a 100644 --- a/src/libraries/System.Collections.Immutable/tests/ImmutableArrayTest.cs +++ b/src/libraries/System.Collections.Immutable/tests/ImmutableArrayTest.cs @@ -1978,7 +1978,7 @@ public static IEnumerable IStructuralEquatableEqualsNullComparerData() [Fact] public void IStructuralEquatableEqualsNullComparerInvalid() { - // This was not fixed for compatability reasons. See https://github.com/dotnet/corefx/issues/13410 + // This was not fixed for compatability reasons. See https://github.com/dotnet/runtime/issues/19265 Assert.Throws(() => ((IStructuralEquatable)ImmutableArray.Create(1, 2, 3)).Equals(ImmutableArray.Create(1, 2, 3), comparer: null)); Assert.Throws(() => ((IStructuralEquatable)s_emptyDefault).Equals(other: null, comparer: null)); } @@ -2105,7 +2105,7 @@ public void IStructuralComparableCompareToNullComparerNullReferenceInvalid(IEnum public static IEnumerable IStructuralComparableCompareToNullComparerNullReferenceInvalidData() { - // This was not fixed for compatability reasons. See https://github.com/dotnet/corefx/issues/13410 + // This was not fixed for compatability reasons. See https://github.com/dotnet/runtime/issues/19265 yield return new object[] { new[] { 1, 2, 3 }, new[] { 1, 2, 3 } }; yield return new object[] { new[] { 1, 2, 3 }, ImmutableArray.Create(1, 2, 3) }; // Cache this into a local so the comparands are reference-equal. @@ -2320,7 +2320,7 @@ private static IEnumerable> ChangeType(IEnumerable source) // The reason is since they are contiguous in memory, they call Array.Copy // if the source is an array as an optimization, which throws if the types // of the arrays do not exactly match up. - // More info here: https://github.com/dotnet/corefx/issues/2241 + // More info here: https://github.com/dotnet/runtime/issues/14794 if (!(source is T[]) || source.GetType() == typeof(T[])) { diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableListBuilderTest.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableListBuilderTest.cs index 115d731e39f5fe..0b038007f9f48e 100644 --- a/src/libraries/System.Collections.Immutable/tests/ImmutableListBuilderTest.cs +++ b/src/libraries/System.Collections.Immutable/tests/ImmutableListBuilderTest.cs @@ -185,7 +185,7 @@ public void RemoveAllBugTest() var builder = ImmutableList.CreateBuilder(); var elemsToRemove = new[]{0, 1, 2, 3, 4, 5}.ToImmutableHashSet(); // NOTE: this uses Add instead of AddRange because AddRange doesn't exhibit the same issue due to a different order of tree building. - // Don't change it without testing with the bug repro from https://github.com/dotnet/corefx/issues/20609. + // Don't change it without testing with the bug repro from https://github.com/dotnet/runtime/issues/22093. foreach (var elem in new[]{0, 1, 2, 3, 4, 5, 6}) builder.Add(elem); builder.RemoveAll(elemsToRemove.Contains); diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableSortedSetTest.nonnetstandard.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableSortedSetTest.nonnetstandard.cs index dda51875b2f013..ddd8992a615389 100644 --- a/src/libraries/System.Collections.Immutable/tests/ImmutableSortedSetTest.nonnetstandard.cs +++ b/src/libraries/System.Collections.Immutable/tests/ImmutableSortedSetTest.nonnetstandard.cs @@ -14,7 +14,7 @@ namespace System.Collections.Immutable.Tests public partial class ImmutableSortedSetTest : ImmutableSetTest { [Fact] - [ActiveIssue("Sporadic failure, needs a port of https://github.com/dotnet/coreclr/pull/4340", TargetFrameworkMonikers.NetFramework)] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Sporadic failure, needs a port of https://github.com/dotnet/coreclr/pull/4340")] public void EmptyTest() { this.EmptyTestHelper(Empty(), 5, null); diff --git a/src/libraries/System.Collections.NonGeneric/ref/System.Collections.NonGeneric.Forwards.cs b/src/libraries/System.Collections.NonGeneric/ref/System.Collections.NonGeneric.Forwards.cs index 0f25f2bd0b9fc4..48e957c27323ea 100644 --- a/src/libraries/System.Collections.NonGeneric/ref/System.Collections.NonGeneric.Forwards.cs +++ b/src/libraries/System.Collections.NonGeneric/ref/System.Collections.NonGeneric.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.ArrayList))] diff --git a/src/libraries/System.Collections.NonGeneric/ref/System.Collections.NonGeneric.cs b/src/libraries/System.Collections.NonGeneric/ref/System.Collections.NonGeneric.cs index e51e872e293bca..b57fb734a5cb55 100644 --- a/src/libraries/System.Collections.NonGeneric/ref/System.Collections.NonGeneric.cs +++ b/src/libraries/System.Collections.NonGeneric/ref/System.Collections.NonGeneric.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Collections diff --git a/src/libraries/System.Collections.Specialized/ref/System.Collections.Specialized.cs b/src/libraries/System.Collections.Specialized/ref/System.Collections.Specialized.cs index 43f8fc8aaebd04..fd2e1cbdd8de53 100644 --- a/src/libraries/System.Collections.Specialized/ref/System.Collections.Specialized.cs +++ b/src/libraries/System.Collections.Specialized/ref/System.Collections.Specialized.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Collections.Specialized diff --git a/src/libraries/System.Collections.Specialized/tests/NameValueCollection/NameValueCollection.CtorTests.cs b/src/libraries/System.Collections.Specialized/tests/NameValueCollection/NameValueCollection.CtorTests.cs index 0c8b980aa3fe01..95e9c402f0d43d 100644 --- a/src/libraries/System.Collections.Specialized/tests/NameValueCollection/NameValueCollection.CtorTests.cs +++ b/src/libraries/System.Collections.Specialized/tests/NameValueCollection/NameValueCollection.CtorTests.cs @@ -68,6 +68,7 @@ public void Ctor_Int(int capacity) } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/14858", TestRuntimes.Mono)] public void Ctor_NegativeCapacity_ThrowsArgumentOutOfRangeException() { AssertExtensions.Throws("capacity", () => new NameValueCollection(-1)); diff --git a/src/libraries/System.Collections/ref/System.Collections.cs b/src/libraries/System.Collections/ref/System.Collections.cs index d757dea3c7169c..bd55cac2091bad 100644 --- a/src/libraries/System.Collections/ref/System.Collections.cs +++ b/src/libraries/System.Collections/ref/System.Collections.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Collections @@ -415,6 +415,13 @@ public void Dispose() { } void System.Collections.IEnumerator.Reset() { } } } + public sealed class ReferenceEqualityComparer : System.Collections.Generic.IEqualityComparer, System.Collections.IEqualityComparer + { + private ReferenceEqualityComparer() { } + public static System.Collections.Generic.ReferenceEqualityComparer Instance { get { throw null; } } + public new bool Equals(object? x, object? y) { throw null; } + public int GetHashCode(object? obj) { throw null; } + } public partial class SortedDictionary : System.Collections.Generic.ICollection>, System.Collections.Generic.IDictionary, System.Collections.Generic.IEnumerable>, System.Collections.Generic.IReadOnlyCollection>, System.Collections.Generic.IReadOnlyDictionary, System.Collections.ICollection, System.Collections.IDictionary, System.Collections.IEnumerable where TKey : notnull { public SortedDictionary() { } diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/HashSet.cs b/src/libraries/System.Collections/src/System/Collections/Generic/HashSet.cs index 6b3864398c3572..e4db583d90ff79 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/HashSet.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/HashSet.cs @@ -47,7 +47,6 @@ namespace System.Collections.Generic /// [DebuggerTypeProxy(typeof(ICollectionDebugView<>))] [DebuggerDisplay("Count = {Count}")] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "By design")] [Serializable] [System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class HashSet : ICollection, ISet, IReadOnlyCollection, ISerializable, IDeserializationCallback @@ -267,7 +266,7 @@ public bool Contains(T item) { int hashCode = item == null ? 0 : InternalGetHashCode(item.GetHashCode()); - if (default(T) != null) + if (typeof(T).IsValueType) { // see note at "HashSet" level describing why "- 1" appears in for loop for (int i = buckets[hashCode % buckets.Length] - 1; i >= 0; i = slots[i].next) @@ -288,7 +287,7 @@ public bool Contains(T item) else { // Object type: Shared Generic, EqualityComparer.Default won't devirtualize - // https://github.com/dotnet/coreclr/issues/17273 + // https://github.com/dotnet/runtime/issues/10050 // So cache in a local rather than get EqualityComparer per loop iteration EqualityComparer defaultComparer = EqualityComparer.Default; @@ -369,7 +368,7 @@ public bool Remove(T item) hashCode = item == null ? 0 : InternalGetHashCode(item.GetHashCode()); bucket = hashCode % _buckets!.Length; - if (default(T) != null) + if (typeof(T).IsValueType) { for (i = _buckets[bucket] - 1; i >= 0; last = i, i = slots[i].next) { @@ -389,7 +388,7 @@ public bool Remove(T item) else { // Object type: Shared Generic, EqualityComparer.Default won't devirtualize - // https://github.com/dotnet/coreclr/issues/17273 + // https://github.com/dotnet/runtime/issues/10050 // So cache in a local rather than get EqualityComparer per loop iteration EqualityComparer defaultComparer = EqualityComparer.Default; @@ -1342,7 +1341,7 @@ private bool AddIfNotPresent(T value) hashCode = value == null ? 0 : InternalGetHashCode(value.GetHashCode()); bucket = hashCode % _buckets!.Length; - if (default(T) != null) + if (typeof(T).IsValueType) { for (int i = _buckets[bucket] - 1; i >= 0; i = slots[i].next) { @@ -1362,7 +1361,7 @@ private bool AddIfNotPresent(T value) else { // Object type: Shared Generic, EqualityComparer.Default won't devirtualize - // https://github.com/dotnet/coreclr/issues/17273 + // https://github.com/dotnet/runtime/issues/10050 // So cache in a local rather than get EqualityComparer per loop iteration EqualityComparer defaultComparer = EqualityComparer.Default; @@ -1578,7 +1577,7 @@ private int InternalIndexOf(T item) { int hashCode = item == null ? 0 : InternalGetHashCode(item.GetHashCode()); - if (default(T) != null) + if (typeof(T).IsValueType) { // see note at "HashSet" level describing why "- 1" appears in for loop for (int i = buckets[hashCode % buckets.Length] - 1; i >= 0; i = slots[i].next) @@ -1599,7 +1598,7 @@ private int InternalIndexOf(T item) else { // Object type: Shared Generic, EqualityComparer.Default won't devirtualize - // https://github.com/dotnet/coreclr/issues/17273 + // https://github.com/dotnet/runtime/issues/10050 // So cache in a local rather than get EqualityComparer per loop iteration EqualityComparer defaultComparer = EqualityComparer.Default; diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/HashSetEqualityComparer.cs b/src/libraries/System.Collections/src/System/Collections/Generic/HashSetEqualityComparer.cs index 5cfae13f3f31ec..8415e534569903 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/HashSetEqualityComparer.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/HashSetEqualityComparer.cs @@ -30,7 +30,10 @@ public int GetHashCode(HashSet? obj) { foreach (T t in obj) { - hashCode = hashCode ^ (_comparer.GetHashCode(t) & 0x7FFFFFFF); + if (t != null) + { + hashCode ^= (_comparer.GetHashCode(t) & 0x7FFFFFFF); + } } } // else returns hashcode of 0 for null hashsets return hashCode; diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs b/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs index d4c290148a6bb4..1a3ea108836c9d 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs @@ -526,7 +526,6 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, IEnumerator, ISerializable, IDeserializationCallback { private readonly LinkedList _list; diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/Queue.cs b/src/libraries/System.Collections/src/System/Collections/Generic/Queue.cs index f8e8b26892e1e9..410360ab0cadb3 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/Queue.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/Queue.cs @@ -390,7 +390,6 @@ public void TrimExcess() // Implements an enumerator for a Queue. The enumerator uses the // internal version number of the list to ensure that no modifications are // made to the list while an enumeration is in progress. - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, System.Collections.IEnumerator { diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs b/src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs index 5f59ab47609b1e..a62acb52c1b8cd 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs @@ -441,7 +441,6 @@ IEnumerator IEnumerable.GetEnumerator() return new Enumerator(this, Enumerator.KeyValuePair); } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator>, IDictionaryEnumerator { private TreeSet>.Enumerator _treeEnum; @@ -689,7 +688,6 @@ object ICollection.SyncRoot get { return ((ICollection)_dictionary).SyncRoot; } } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, IEnumerator { private SortedDictionary.Enumerator _dictEnum; @@ -873,7 +871,6 @@ object ICollection.SyncRoot get { return ((ICollection)_dictionary).SyncRoot; } } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, IEnumerator { private SortedDictionary.Enumerator _dictEnum; diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.TreeSubSet.cs b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.TreeSubSet.cs index bcbc46e8b7042b..4611785eb9ed80 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.TreeSubSet.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.TreeSubSet.cs @@ -341,7 +341,7 @@ internal override int TotalCount() // This passes functionality down to the underlying tree, clipping edges if necessary // There's nothing gained by having a nested subset. May as well draw it from the base // Cannot increase the bounds of the subset, can only decrease it - public override SortedSet GetViewBetween(T lowerValue, T upperValue) + public override SortedSet GetViewBetween([AllowNull] T lowerValue, [AllowNull] T upperValue) { if (_lBoundActive && Comparer.Compare(_min, lowerValue) > 0) { diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs index d82c4052aa86ec..f5d742411220eb 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs @@ -41,7 +41,6 @@ internal enum TreeRotation : byte RightLeft } - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "by design name choice")] [DebuggerTypeProxy(typeof(ICollectionDebugView<>))] [DebuggerDisplay("Count = {Count}")] [Serializable] @@ -806,7 +805,7 @@ public static IEqualityComparer> CreateSetComparer(IEqualityCompare /// The second set. /// The fallback comparer to use if the sets do not have equal comparers. /// true if the sets have equal contents; otherwise, false. - internal static bool SortedSetEquals(SortedSet set1, SortedSet set2, IComparer comparer) + internal static bool SortedSetEquals(SortedSet? set1, SortedSet? set2, IComparer comparer) { if (set1 == null) { @@ -1899,7 +1898,6 @@ private bool HasChildren(Node child1, Node child2) #endif } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, IEnumerator, ISerializable, IDeserializationCallback { private readonly SortedSet _tree; diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSetEqualityComparer.cs b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSetEqualityComparer.cs index e0e59ff8704c95..dc262258981d24 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSetEqualityComparer.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSetEqualityComparer.cs @@ -27,7 +27,7 @@ private SortedSetEqualityComparer(IComparer? comparer, IEqualityComparer? } // Use _comparer to keep equals properties intact; don't want to choose one of the comparers. - public bool Equals(SortedSet x, SortedSet y) => SortedSet.SortedSetEquals(x, y, _comparer); + public bool Equals(SortedSet? x, SortedSet? y) => SortedSet.SortedSetEquals(x, y, _comparer); // IMPORTANT: this part uses the fact that GetHashCode() is consistent with the notion of equality in the set. public int GetHashCode(SortedSet obj) @@ -37,7 +37,10 @@ public int GetHashCode(SortedSet obj) { foreach (T t in obj) { - hashCode = hashCode ^ (_memberEqualityComparer.GetHashCode(t) & 0x7FFFFFFF); + if (t != null) + { + hashCode ^= (_memberEqualityComparer.GetHashCode(t) & 0x7FFFFFFF); + } } } // Returns 0 for null sets. diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs b/src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs index 2b4fa1efd36a45..345ed27023786e 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs @@ -311,7 +311,6 @@ private void ThrowForEmptyStack() throw new InvalidOperationException(SR.InvalidOperation_EmptyStack); } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, System.Collections.IEnumerator { private readonly Stack _stack; diff --git a/src/libraries/System.Collections/tests/BitArray/BitArray_GetSetTests.cs b/src/libraries/System.Collections/tests/BitArray/BitArray_GetSetTests.cs index 96fbf050e4f102..72cc3718916aa7 100644 --- a/src/libraries/System.Collections/tests/BitArray/BitArray_GetSetTests.cs +++ b/src/libraries/System.Collections/tests/BitArray/BitArray_GetSetTests.cs @@ -385,7 +385,7 @@ public static void CopyToIntArray() } } - // https://github.com/dotnet/corefx/issues/39929 + // https://github.com/dotnet/runtime/issues/30440 [Fact] public static void CopyToByteArray_Regression39929() { diff --git a/src/libraries/System.Collections/tests/Generic/Comparers/ReferenceEqualityComparer.Tests.cs b/src/libraries/System.Collections/tests/Generic/Comparers/ReferenceEqualityComparer.Tests.cs new file mode 100644 index 00000000000000..c74a16a818c0c6 --- /dev/null +++ b/src/libraries/System.Collections/tests/Generic/Comparers/ReferenceEqualityComparer.Tests.cs @@ -0,0 +1,93 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Reflection; +using System.Runtime.CompilerServices; +using Xunit; + +namespace System.Collections.Generic.Tests +{ + public class ReferenceEqualityComparerTests + { + [Fact] + public void TypeHasNoPublicCtors() + { + ConstructorInfo[] ctors = typeof(ReferenceEqualityComparer).GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); + Assert.DoesNotContain(ctors, ctor => ctor.IsPublic || ctor.IsFamily || ctor.IsFamilyOrAssembly); + } + + [Fact] + public void InstanceProperty_ReturnsSingleton() + { + ReferenceEqualityComparer comparer1 = ReferenceEqualityComparer.Instance; + Assert.NotNull(comparer1); + + ReferenceEqualityComparer comparer2 = ReferenceEqualityComparer.Instance; + Assert.Same(comparer1, comparer2); + } + + [Fact] + public void Equals_UsesReferenceEquals() + { + MyClass o1 = new MyClass { SomeInt = 10 }; + MyClass o2 = new MyClass { SomeInt = 10 }; + Assert.Equal(o1, o2); + + ReferenceEqualityComparer comparer1 = ReferenceEqualityComparer.Instance; + IEqualityComparer comparer2 = ReferenceEqualityComparer.Instance; + IEqualityComparer comparer3 = ReferenceEqualityComparer.Instance; + IEqualityComparer comparer4 = ReferenceEqualityComparer.Instance; // test contravariance + + Assert.True(comparer1.Equals(null, null)); + Assert.False(comparer1.Equals(null, o2)); + Assert.False(comparer1.Equals(o1, o2)); + Assert.False(comparer1.Equals(o1, null)); + + Assert.True(comparer2.Equals(null, null)); + Assert.False(comparer2.Equals(null, o2)); + Assert.False(comparer2.Equals(o1, o2)); + Assert.False(comparer2.Equals(o1, null)); + + Assert.True(comparer3.Equals(null, null)); + Assert.False(comparer3.Equals(null, o2)); + Assert.False(comparer3.Equals(o1, o2)); + Assert.False(comparer3.Equals(o1, null)); + + Assert.True(comparer4.Equals(null, null)); + Assert.False(comparer4.Equals(null, o2)); + Assert.False(comparer4.Equals(o1, o2)); + Assert.False(comparer4.Equals(o1, null)); + } + + [Fact] + public void GetHashCode_UsesRuntimeHelpers() + { + ClassWithBadGetHashCodeImplementation o = new ClassWithBadGetHashCodeImplementation(); // make sure we don't call object.GetHashCode() + + ReferenceEqualityComparer comparer1 = ReferenceEqualityComparer.Instance; + IEqualityComparer comparer2 = ReferenceEqualityComparer.Instance; + IEqualityComparer comparer3 = ReferenceEqualityComparer.Instance; + IEqualityComparer comparer4 = ReferenceEqualityComparer.Instance; // test contravariance + + int runtimeHelpersHashCode = RuntimeHelpers.GetHashCode(o); + Assert.Equal(runtimeHelpersHashCode, comparer1.GetHashCode(o)); + Assert.Equal(runtimeHelpersHashCode, comparer2.GetHashCode(o)); + Assert.Equal(runtimeHelpersHashCode, comparer3.GetHashCode(o)); + Assert.Equal(runtimeHelpersHashCode, comparer4.GetHashCode(o)); + } + + private class ClassWithBadGetHashCodeImplementation + { + public override int GetHashCode() => throw new NotImplementedException(); + } + + private class MyClass + { + public int SomeInt; + + public override bool Equals(object obj) => obj is MyClass c && this.SomeInt == c.SomeInt; + public override int GetHashCode() => this.SomeInt; + } + } +} diff --git a/src/libraries/System.Collections/tests/System.Collections.Tests.csproj b/src/libraries/System.Collections/tests/System.Collections.Tests.csproj index 291cd7c1262f05..0614402205bbe6 100644 --- a/src/libraries/System.Collections/tests/System.Collections.Tests.csproj +++ b/src/libraries/System.Collections/tests/System.Collections.Tests.csproj @@ -74,6 +74,7 @@ + diff --git a/src/libraries/System.ComponentModel.Annotations/ref/System.ComponentModel.Annotations.cs b/src/libraries/System.ComponentModel.Annotations/ref/System.ComponentModel.Annotations.cs index 0b17bfc464da81..aee67b18a5c61b 100644 --- a/src/libraries/System.ComponentModel.Annotations/ref/System.ComponentModel.Annotations.cs +++ b/src/libraries/System.ComponentModel.Annotations/ref/System.ComponentModel.Annotations.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.ComponentModel.DataAnnotations diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/RequiredAttribute.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/RequiredAttribute.cs index e9760e480281f9..382947cf252cf0 100644 --- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/RequiredAttribute.cs +++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/RequiredAttribute.cs @@ -45,7 +45,7 @@ public override bool IsValid(object value) } // only check string length if empty strings are not allowed - return AllowEmptyStrings || !(value is string stringValue) || stringValue.Trim().Length != 0; + return AllowEmptyStrings || !(value is string stringValue) || !string.IsNullOrWhiteSpace(stringValue); } } } diff --git a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/CustomValidationAttributeTests.cs b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/CustomValidationAttributeTests.cs index 3906b128fb22a8..d57532dc7790bd 100644 --- a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/CustomValidationAttributeTests.cs +++ b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/CustomValidationAttributeTests.cs @@ -111,7 +111,7 @@ public static void RequiresValidationContext_Get_ReturnsExpected(string method, CustomValidationAttribute attribute = GetAttribute(method); // The .NET Framework has a bug where CustomValidationAttribute doesn't - // validate the context. See https://github.com/dotnet/corefx/issues/18360. + // validate the context. See https://github.com/dotnet/runtime/issues/21100. if (PlatformDetection.IsNetFramework) { Assert.False(attribute.RequiresValidationContext); @@ -139,7 +139,7 @@ public static IEnumerable BadlyFormed_TestData() } [Theory] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Core fixes a bug where CustomValidationAttribute doesn't validate the context. See https://github.com/dotnet/corefx/issues/18360")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Core fixes a bug where CustomValidationAttribute doesn't validate the context. See https://github.com/dotnet/runtime/issues/21100")] [MemberData(nameof(BadlyFormed_TestData))] public static void RequiresValidationContext_BadlyFormed_NetCore_ThrowsInvalidOperationException(Type validatorType, string method) { @@ -148,7 +148,7 @@ public static void RequiresValidationContext_BadlyFormed_NetCore_ThrowsInvalidOp } [Theory] - [SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework, "The .NET Framework has a bug where CustomValidationAttribute doesn't validate the context. See https://github.com/dotnet/corefx/issues/18360")] + [SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework, "The .NET Framework has a bug where CustomValidationAttribute doesn't validate the context. See https://github.com/dotnet/runtime/issues/21100")] [MemberData(nameof(BadlyFormed_TestData))] public static void RequiresValidationContext_BadlyFormed_NetFx_DoesNotThrow(Type validatorType, string method) { diff --git a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/DataTypeAttributeTests.cs b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/DataTypeAttributeTests.cs index 201fd208aebceb..dd4114898a1541 100644 --- a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/DataTypeAttributeTests.cs +++ b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/DataTypeAttributeTests.cs @@ -72,7 +72,7 @@ public static IEnumerable Ctor_String_TestData() yield return new object[] { null, false }; // .NET Core fixed a bug where whitespace strings were allowed as CustomDataType. - // See https://github.com/dotnet/corefx/issues/4465. + // See https://github.com/dotnet/runtime/issues/15690. yield return new object[] { " ", PlatformDetection.IsNetFramework }; } diff --git a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/MaxLengthAttributeTests.cs b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/MaxLengthAttributeTests.cs index 9974f7e991b134..a61235299073ff 100644 --- a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/MaxLengthAttributeTests.cs +++ b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/MaxLengthAttributeTests.cs @@ -83,7 +83,7 @@ public static void Ctor_Int(int length) [Theory] [MemberData(nameof(ValidValues_ICollection))] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "MaxLengthAttribute in the .NET Framework doesn't support ICollection.Count. See https://github.com/dotnet/corefx/issues/18361")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "MaxLengthAttribute in the .NET Framework doesn't support ICollection.Count. See https://github.com/dotnet/runtime/issues/21101")] public void Validate_ICollection_NetCore_Valid(MaxLengthAttribute attribute, object value) { attribute.Validate(value, new ValidationContext(new object())); @@ -92,7 +92,7 @@ public void Validate_ICollection_NetCore_Valid(MaxLengthAttribute attribute, obj [Theory] [MemberData(nameof(InvalidValues_ICollection))] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "MaxLengthAttribute in the .NET Framework doesn't support ICollection.Count. See https://github.com/dotnet/corefx/issues/18361")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "MaxLengthAttribute in the .NET Framework doesn't support ICollection.Count. See https://github.com/dotnet/runtime/issues/21101")] public void Validate_ICollection_NetCore_Invalid(MaxLengthAttribute attribute, object value) { Assert.Throws(() => attribute.Validate(value, new ValidationContext(new object()))); @@ -102,7 +102,7 @@ public void Validate_ICollection_NetCore_Invalid(MaxLengthAttribute attribute, o [Theory] [MemberData(nameof(ValidValues_ICollection))] [MemberData(nameof(InvalidValues_ICollection))] - [SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework, "MaxLengthAttribute in the .NET Core supports ICollection.Count. See https://github.com/dotnet/corefx/issues/18361")] + [SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework, "MaxLengthAttribute in the .NET Core supports ICollection.Count. See https://github.com/dotnet/runtime/issues/21101")] public void Validate_ICollection_NetFx_ThrowsInvalidCastException(MaxLengthAttribute attribute, object value) { Assert.Throws(() => attribute.Validate(value, new ValidationContext(new object()))); diff --git a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/MinLengthAttributeTests.cs b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/MinLengthAttributeTests.cs index b9cc9ef74a5d32..d2e30838651591 100644 --- a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/MinLengthAttributeTests.cs +++ b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/MinLengthAttributeTests.cs @@ -73,7 +73,7 @@ public static void Ctor(int length) [Theory] [MemberData(nameof(ValidValues_ICollection))] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "MinLengthAttribute in the .NET Framework doesn't support ICollection.Count. See https://github.com/dotnet/corefx/issues/18361")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "MinLengthAttribute in the .NET Framework doesn't support ICollection.Count. See https://github.com/dotnet/runtime/issues/21101")] public void Validate_ICollection_NetCore_Valid(MinLengthAttribute attribute, object value) { attribute.Validate(value, new ValidationContext(new object())); @@ -82,7 +82,7 @@ public void Validate_ICollection_NetCore_Valid(MinLengthAttribute attribute, obj [Theory] [MemberData(nameof(InvalidValues_ICollection))] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "MinLengthAttribute in the .NET Framework doesn't support ICollection.Count. See https://github.com/dotnet/corefx/issues/18361")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "MinLengthAttribute in the .NET Framework doesn't support ICollection.Count. See https://github.com/dotnet/runtime/issues/21101")] public void Validate_ICollection_NetCore_Invalid(MinLengthAttribute attribute, object value) { Assert.Throws(() => attribute.Validate(value, new ValidationContext(new object()))); @@ -92,7 +92,7 @@ public void Validate_ICollection_NetCore_Invalid(MinLengthAttribute attribute, o [Theory] [MemberData(nameof(ValidValues_ICollection))] [MemberData(nameof(InvalidValues_ICollection))] - [SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework, "MinLengthAttribute in .NET Core supports ICollection.Count. See https://github.com/dotnet/corefx/issues/18361")] + [SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework, "MinLengthAttribute in .NET Core supports ICollection.Count. See https://github.com/dotnet/runtime/issues/21101")] public void Validate_ICollection_NetFx_ThrowsInvalidCastException(MinLengthAttribute attribute, object value) { Assert.Throws(() => attribute.Validate(value, new ValidationContext(new object()))); diff --git a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/PhoneAttributeTests.cs b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/PhoneAttributeTests.cs index 2c7ee97938ea59..be987f75cd1436 100644 --- a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/PhoneAttributeTests.cs +++ b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/PhoneAttributeTests.cs @@ -42,7 +42,7 @@ protected override IEnumerable InvalidValues() yield return new TestCase(new PhoneAttribute(), "ext.123 1"); // By design, certain phone numbers are reported as valid with .NET Core, whereas .NET Framework - // considers them invalid. See https://github.com/dotnet/corefx/issues/17873. + // considers them invalid. See https://github.com/dotnet/runtime/issues/20884. if (PlatformDetection.IsNetFramework) { yield return new TestCase(new PhoneAttribute(), "+4+2+5+-+5+5+5+-+1+2++1+2++"); diff --git a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/ValidatorTests.cs b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/ValidatorTests.cs index 003ec189b54cbc..96c1bd46751cba 100644 --- a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/ValidatorTests.cs +++ b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/ValidatorTests.cs @@ -191,7 +191,7 @@ public IEnumerable Validate(ValidationContext validationContex } [Fact] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Null check not present in .NET Framework. See https://github.com/dotnet/corefx/issues/25495")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Null check not present in .NET Framework. See https://github.com/dotnet/runtime/issues/24237")] public void TryValidateObject_IValidatableObject_Null() { var instance = new ValidatableNull(); @@ -358,7 +358,7 @@ public void ValidateObject_IValidatableObject_Error() } [Fact] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Null check not present in .NET Framework. See https://github.com/dotnet/corefx/issues/25495")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Null check not present in .NET Framework. See https://github.com/dotnet/runtime/issues/24237")] public void ValidateObject_IValidatableObject_Null() { var instance = new ValidatableNull(); diff --git a/src/libraries/System.ComponentModel.Composition.Registration/ref/System.ComponentModel.Composition.Registration.cs b/src/libraries/System.ComponentModel.Composition.Registration/ref/System.ComponentModel.Composition.Registration.cs index e8aaffa2ae33ec..ff834d3845a1e4 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/ref/System.ComponentModel.Composition.Registration.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/ref/System.ComponentModel.Composition.Registration.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.ComponentModel.Composition.Registration diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/AssemblyInfo.cs b/src/libraries/System.ComponentModel.Composition.Registration/tests/AssemblyInfo.cs new file mode 100644 index 00000000000000..5dc2e1c959dfce --- /dev/null +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Xunit; + +[assembly: SkipOnMono("System.ComponentModel.Composition.Registration APIs are not supported on this platform")] \ No newline at end of file diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/System.ComponentModel.Composition.Registration.Tests.csproj b/src/libraries/System.ComponentModel.Composition.Registration/tests/System.ComponentModel.Composition.Registration.Tests.csproj index 8c0707afe31bbd..d7711c3f4dcde9 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/tests/System.ComponentModel.Composition.Registration.Tests.csproj +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/System.ComponentModel.Composition.Registration.Tests.csproj @@ -3,6 +3,7 @@ $(NetCoreAppCurrent) + diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationBuilderAttributedOverrideUnitTests.cs b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationBuilderAttributedOverrideUnitTests.cs index f6635e0ec7710b..f47bbd148914a2 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationBuilderAttributedOverrideUnitTests.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationBuilderAttributedOverrideUnitTests.cs @@ -11,7 +11,7 @@ namespace System.ComponentModel.Composition.Registration.Tests { - [SkipOnCoreClr("Test failures on stress tests", RuntimeTestModes.CheckedRuntime)] + [SkipOnCoreClr("Test failures on stress tests", RuntimeConfiguration.Checked)] [SkipOnMono("Test failures on stress tests")] public class RegistrationBuilderAttributedOverrideUnitTests { diff --git a/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.Forwards.cs b/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.Forwards.cs index 65c4618314e8ad..6a03d219ef8921 100644 --- a/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.Forwards.cs +++ b/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(destination: typeof(System.Lazy<,>))] diff --git a/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.cs b/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.cs index 1ade2b50735417..5bdaccd93bedbe 100644 --- a/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.cs +++ b/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.ComponentModel.Composition diff --git a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Collections/CollectionServices.cs b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Collections/CollectionServices.cs index 71a388e0e25e3c..6a1af13a3d4ae2 100644 --- a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Collections/CollectionServices.cs +++ b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Collections/CollectionServices.cs @@ -6,6 +6,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; using System.Linq; namespace Microsoft.Internal.Collections @@ -144,11 +145,13 @@ private static List FastAppendToListAllowNulls(this List? source, T val } public static List? FastAppendToListAllowNulls( - this List? source, T value, + this List? source, T? value, IEnumerable? second) + where T : class { if (second == null) { + Debug.Assert(value != null); source = source.FastAppendToListAllowNulls(value); } else diff --git a/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj b/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj index 69eadbf8757b14..bcd943cbd0b02c 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj +++ b/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj @@ -6,8 +6,8 @@ $(NoWarn);CS1573 SR.PlatformNotSupported_ComponentModel_Composition - netstandard2.0;netcoreapp2.0;$(NetCoreAppCurrent);_$(NetFrameworkCurrent) - true + $(NetCoreAppCurrent);netstandard2.0;netcoreapp2.0;_$(NetFrameworkCurrent) + true enable $(NoWarn);nullable diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModelServices.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModelServices.cs index c218156213f755..91146252cf3119 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModelServices.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModelServices.cs @@ -17,7 +17,6 @@ namespace System.ComponentModel.Composition { public static class AttributedModelServices { - [SuppressMessage("Microsoft.Design", "CA1004")] public static TMetadataView GetMetadataView(IDictionary metadata) { Requires.NotNull(metadata, nameof(metadata)); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CatalogReflectionContextAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CatalogReflectionContextAttribute.cs index 7328e03ddbb0e3..f5b427252c7374 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CatalogReflectionContextAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CatalogReflectionContextAttribute.cs @@ -11,7 +11,6 @@ namespace System.ComponentModel.Composition /// /// Enables the AssemblyCatalog to discover user provided ReflectionContexts. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = true)] public class CatalogReflectionContextAttribute : Attribute { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ContractNameServices.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ContractNameServices.cs index 97bf2e6f06d1d2..d5b376730fa3ec 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ContractNameServices.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ContractNameServices.cs @@ -91,7 +91,7 @@ internal static string GetTypeIdentityFromMethod(MethodInfo method, bool formatG WriteTypeWithNamespace(methodNameStringBuilder, method.ReturnType, formatGenericName); - methodNameStringBuilder.Append("("); + methodNameStringBuilder.Append('('); ParameterInfo[] parameters = method.GetParameters(); @@ -99,12 +99,12 @@ internal static string GetTypeIdentityFromMethod(MethodInfo method, bool formatG { if (i != 0) { - methodNameStringBuilder.Append(","); + methodNameStringBuilder.Append(','); } WriteTypeWithNamespace(methodNameStringBuilder, parameters[i].ParameterType, formatGenericName); } - methodNameStringBuilder.Append(")"); + methodNameStringBuilder.Append(')'); return methodNameStringBuilder.ToString(); } diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportAttribute.cs index ef5cc34ccf93c1..63878089e90bf4 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportAttribute.cs @@ -9,7 +9,6 @@ namespace System.ComponentModel.Composition /// /// Specifies that a type, property, field, or method provides a particular export. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = true, Inherited = false)] public class ExportAttribute : Attribute diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.cs index f016f950cc4053..6552b48bdf5540 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.cs @@ -83,7 +83,6 @@ internal static Func> CreateSemiStronglyTypedLazyFa return (Func>)Delegate.CreateDelegate(typeof(Func>), genericMethod); } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] internal static Lazy CreateStronglyTypedLazyOfTM(Export export) { if (export is IDisposable disposable) @@ -103,7 +102,6 @@ internal static Lazy CreateStronglyTypedLazyOfTM(Export export) } } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] internal static Lazy CreateStronglyTypedLazyOfT(Export export) { if (export is IDisposable disposable) @@ -119,7 +117,6 @@ internal static Lazy CreateStronglyTypedLazyOfT(Export export) } } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] internal static Lazy CreateSemiStronglyTypedLazy(Export export) { if (export is IDisposable disposable) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ApplicationCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ApplicationCatalog.cs index 8f583bab2cbe98..3fc5ad7a00b29b 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ApplicationCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ApplicationCatalog.cs @@ -85,7 +85,7 @@ private AggregateCatalog InnerCatalog string? relativeSearchPath = AppDomain.CurrentDomain.RelativeSearchPath; if (!string.IsNullOrEmpty(relativeSearchPath)) { - string[] probingPaths = relativeSearchPath.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); + string[] probingPaths = relativeSearchPath.Split(';', StringSplitOptions.RemoveEmptyEntries); foreach (var probingPath in probingPaths) { var path = Path.Combine(location, probingPath); @@ -200,7 +200,6 @@ public override string ToString() /// /// A containing a human-readable display name of the . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] string ICompositionElement.DisplayName { get { return GetDisplayName(); } @@ -212,7 +211,6 @@ string ICompositionElement.DisplayName /// /// This property always returns . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] ICompositionElement? ICompositionElement.Origin { get { return null; } diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs index 4a9fe60e5f0801..e810859890653b 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs @@ -479,7 +479,6 @@ public Assembly Assembly /// /// A containing a human-readable display name of the . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] string ICompositionElement.DisplayName { get { return GetDisplayName(); } @@ -491,7 +490,6 @@ string ICompositionElement.DisplayName /// /// This property always returns . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] ICompositionElement? ICompositionElement.Origin { get { return null; } @@ -570,7 +568,7 @@ private static Assembly LoadAssembly(string codeBase) { return Assembly.Load(assemblyName); } - //fallback attempt issue https://github.com/dotnet/corefx/issues/27433 + //fallback attempt issue https://github.com/dotnet/runtime/issues/25177 catch (FileNotFoundException) { return Assembly.LoadFrom(codeBase); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs index b7e606ca65d78e..fedf72f5cb7e79 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs @@ -76,7 +76,6 @@ public bool TryGetValue(object key, [MaybeNullWhen(false)] out T value) return TryGetValue(key, false, out value); } - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")] public bool TryGetValue(object key, bool localAtomicCompositionOnly, [MaybeNullWhen(false)] out T value) { ThrowIfDisposed(); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs index 3fe89135b7cdac..c2a2a5685d5a83 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs @@ -60,7 +60,6 @@ protected virtual CatalogPart GetPart() return _catalogExportProvider.GetExportedValue(GetPart(), _definition, IsSharedPart); } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] public static CatalogExport CreateExport(CatalogExportProvider catalogExportProvider, ComposablePartDefinition partDefinition, ExportDefinition definition, CreationPolicy importCreationPolicy) { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs index 9c06b88365406a..825bdbf61744e3 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs @@ -149,7 +149,6 @@ public ComposablePartCatalog Catalog /// This property must be set before accessing any methods on the /// . /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "EnsureCanSet ensures that the property is set only once, Dispose is not required")] [DisallowNull] public ExportProvider? SourceProvider { @@ -397,7 +396,6 @@ private static ExportDefinition[] GetExportsFromPartDefinitions(IEnumerable. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "EnsureCanSet ensures that the property is set only once, Dispose is not required")] [DisallowNull] public ExportProvider? SourceProvider { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs index 17ac42c5569206..e34ae080f0e96c 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs @@ -413,7 +413,6 @@ public void Compose(CompositionBatch batch) /// /// is . /// - [SuppressMessage("Microsoft.Performance", "CA1822")] public void ReleaseExport(Export export) { Requires.NotNull(export, nameof(export)); @@ -443,7 +442,6 @@ public void ReleaseExport(Export export) /// /// is . /// - [SuppressMessage("Microsoft.Performance", "CA1822")] public void ReleaseExport(Lazy export) { Requires.NotNull(export, nameof(export)); @@ -486,7 +484,6 @@ public void ReleaseExports(IEnumerable exports) /// /// contains an element that is . /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public void ReleaseExports(IEnumerable> exports) { Requires.NotNullOrNullElements(exports, nameof(exports)); @@ -508,7 +505,6 @@ public void ReleaseExports(IEnumerable> exports) /// /// contains an element that is . /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public void ReleaseExports(IEnumerable> exports) { Requires.NotNullOrNullElements(exports, nameof(exports)); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs index a6937445c3a015..16fffd4582b158 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs @@ -782,7 +782,6 @@ private void ThrowIfDisposed() /// /// A containing a human-readable display name of the . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] string ICompositionElement.DisplayName { get { return GetDisplayName(); } @@ -794,7 +793,6 @@ string ICompositionElement.DisplayName /// /// This property always returns . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] ICompositionElement? ICompositionElement.Origin { get { return null; } diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs index c986f2fdf89ba6..843e45694e3431 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs @@ -259,7 +259,6 @@ public abstract partial class ExportProvider /// /// The has been disposed of. /// - [SuppressMessage("Microsoft.Design", "CA1006")] public IEnumerable> GetExports(Type type, Type? metadataViewType, string? contractName) { IEnumerable exports = GetExportsCore(type, metadataViewType, contractName, ImportCardinality.ZeroOrMore); @@ -306,7 +305,6 @@ public IEnumerable> GetExports(Type type, Type? metadataVie /// /// The has been disposed of. /// - [SuppressMessage("Microsoft.Design", "CA1006")] public IEnumerable> GetExports() { return GetExports((string?)null); @@ -348,7 +346,6 @@ public IEnumerable> GetExports() /// /// The has been disposed of. /// - [SuppressMessage("Microsoft.Design", "CA1006")] public IEnumerable> GetExports(string? contractName) { return GetExportsCore(contractName); @@ -387,7 +384,6 @@ public IEnumerable> GetExports(string? contractName) /// /// The has been disposed of. /// - [SuppressMessage("Microsoft.Design", "CA1006")] public IEnumerable> GetExports() { return GetExports((string?)null); @@ -430,7 +426,6 @@ public IEnumerable> GetExports() /// /// The has been disposed of. /// - [SuppressMessage("Microsoft.Design", "CA1006")] public IEnumerable> GetExports(string? contractName) { return GetExportsCore(contractName); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/TypeCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/TypeCatalog.cs index a2723843544a00..7e014e3a744b51 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/TypeCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/TypeCatalog.cs @@ -230,7 +230,6 @@ public override IEnumerator GetEnumerator() /// /// A containing a human-readable display name of the . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] string ICompositionElement.DisplayName { get { return GetDisplayName(); } @@ -242,7 +241,6 @@ string ICompositionElement.DisplayName /// /// This property always returns . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] ICompositionElement? ICompositionElement.Origin { get { return null; } @@ -380,7 +378,7 @@ private string GetTypesDisplay() if (builder.Length > 0) { builder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator); - builder.Append(" "); + builder.Append(' '); } builder.Append(definition.GetPartType().GetDisplayName()); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportAttribute.cs index 73d0d6573c8819..ca047bc2739e6d 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportAttribute.cs @@ -10,7 +10,6 @@ namespace System.ComponentModel.Composition /// /// Specifies that a property, field, or parameter imports a particular export. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class ImportAttribute : Attribute, IAttributedImport diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportManyAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportManyAttribute.cs index 16530479dd69a0..64ac5a4e0351f1 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportManyAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportManyAttribute.cs @@ -10,7 +10,6 @@ namespace System.ComponentModel.Composition /// /// Specifies that a property, field, or parameter imports a particular set of exports. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class ImportManyAttribute : Attribute, IAttributedImport diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportingConstructorAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportingConstructorAttribute.cs index aae782bb62fd2b..a7443e23db7487 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportingConstructorAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportingConstructorAttribute.cs @@ -14,7 +14,6 @@ namespace System.ComponentModel.Composition /// construct an attributed part. Use this attribute to indicate that a specific constructor /// should be used. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] public class ImportingConstructorAttribute : Attribute { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/InheritedExportAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/InheritedExportAttribute.cs index f28cb9909708fe..df05c49f4b8d20 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/InheritedExportAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/InheritedExportAttribute.cs @@ -9,7 +9,6 @@ namespace System.ComponentModel.Composition /// /// Specifies that a type or interface that provides a particular export. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)] public class InheritedExportAttribute : ExportAttribute { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewProvider.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewProvider.cs index ac61aa5dc1b1e3..a1d4b4bb49db31 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewProvider.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewProvider.cs @@ -13,7 +13,6 @@ namespace System.ComponentModel.Composition { internal static class MetadataViewProvider { - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] public static TMetadataView GetMetadataView(IDictionary metadata) { if (metadata == null) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs index 2e3a3c7c129595..7060c1b6e2ec04 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs @@ -95,7 +95,6 @@ public virtual IQueryable Parts /// , return an empty . /// /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public virtual IEnumerable> GetExports(ImportDefinition definition) { ThrowIfDisposed(); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartDefinition.cs index 039e4642888196..31d7d84f6ced12 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartDefinition.cs @@ -103,7 +103,7 @@ protected ComposablePartDefinition() /// public abstract ComposablePart CreatePart(); - internal virtual bool TryGetExports(ImportDefinition definition, [NotNullWhen(true)] out Tuple? singleMatch, out IEnumerable>? multipleMatches) + internal virtual bool TryGetExports(ImportDefinition definition, out Tuple? singleMatch, out IEnumerable>? multipleMatches) { singleMatch = null; multipleMatches = null; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs index b8a57d69650dde..4612c45e6a6156 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs @@ -99,7 +99,6 @@ protected ContractBasedImportDefinition() /// is not one of the /// values. /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ContractBasedImportDefinition(string contractName, string? requiredTypeIdentity, IEnumerable>? requiredMetadata, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, CreationPolicy requiredCreationPolicy) : this(contractName, requiredTypeIdentity, requiredMetadata, cardinality, isRecomposable, isPrerequisite, requiredCreationPolicy, MetadataServices.EmptyMetadata) @@ -161,7 +160,6 @@ public ContractBasedImportDefinition(string contractName, string? requiredTypeId /// is not one of the /// values. /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ContractBasedImportDefinition(string contractName, string? requiredTypeIdentity, IEnumerable>? requiredMetadata, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, CreationPolicy requiredCreationPolicy, IDictionary metadata) : base(contractName, cardinality, isRecomposable, isPrerequisite, metadata) @@ -207,7 +205,6 @@ public virtual string? RequiredTypeIdentity /// return an empty instead. /// /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public virtual IEnumerable> RequiredMetadata { get @@ -381,7 +378,7 @@ public override string ToString() sb.Append(string.Format("\n\tRequiredCreationPolicy\t{0}", RequiredCreationPolicy)); } - if (_requiredMetadata.Count() > 0) + if (_requiredMetadata.Any()) { sb.Append("\n\tRequiredMetadata"); foreach (KeyValuePair metadataItem in _requiredMetadata) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/Export.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/Export.cs index d8a7e312782d8f..573e54384e34b5 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/Export.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/Export.cs @@ -233,7 +233,6 @@ public object? Value /// . /// /// - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] protected virtual object? GetExportedValueCore() { if (_exportedValueGetter != null) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs index abc220143790a9..e9a1ca30bfdd2d 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs @@ -9,7 +9,6 @@ namespace System.ComponentModel.Composition.Primitives { - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public class ExportedDelegate { private readonly object? _instance; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ImportDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ImportDefinition.cs index 83ddadfe4862f1..27210edd4cc1c3 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ImportDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ImportDefinition.cs @@ -79,7 +79,6 @@ protected ImportDefinition() /// is not one of the /// values. /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ImportDefinition(Expression> constraint, string? contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) : this(contractName, cardinality, isRecomposable, isPrerequisite, MetadataServices.EmptyMetadata) { @@ -88,7 +87,6 @@ public ImportDefinition(Expression> constraint, str _constraint = constraint; } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ImportDefinition(Expression> constraint, string? contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, IDictionary? metadata) : this(contractName, cardinality, isRecomposable, isPrerequisite, metadata) { @@ -200,7 +198,6 @@ public virtual ImportCardinality Cardinality /// Overriders of this property should never return . /// /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public virtual Expression> Constraint { get diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportType.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportType.cs index ebc0705dd8cde5..0f02be5bb1d2e3 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportType.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportType.cs @@ -23,13 +23,13 @@ internal class ImportType private readonly bool _isOpenGeneric = false; [ThreadStatic] - internal static Dictionary>? _castSingleValueCache; + internal static Dictionary?>? _castSingleValueCache; - private static Dictionary> CastSingleValueCache + private static Dictionary?> CastSingleValueCache { get { - return _castSingleValueCache = _castSingleValueCache ?? new Dictionary>(); + return _castSingleValueCache = _castSingleValueCache ?? new Dictionary?>(); } } @@ -170,7 +170,7 @@ private static bool IsLazyGenericType(Type genericType) return (genericType == LazyOfTType) || (genericType == LazyOfTMType); } - private static bool TryGetCastFunction(Type genericType, bool isOpenGeneric, Type[] arguments, [NotNullWhen(true)] out Func? castFunction) + private static bool TryGetCastFunction(Type genericType, bool isOpenGeneric, Type[] arguments, out Func? castFunction) { castFunction = null; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs index 3e7dfa2df8ed10..fd8733b6a3cf49 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs @@ -188,7 +188,6 @@ private ICollection GetNormalizedCollection(Type itemType, object? insta return CollectionServices.GetCollectionWrapper(itemType, collectionObject); } - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void EnsureCollectionIsWritable(ICollection? collection) { bool isReadOnly = true; @@ -221,7 +220,6 @@ private void EnsureCollectionIsWritable(ICollection? collection) } } - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void PopulateCollection(ICollection collection, IEnumerable values) { if (collection == null) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs index 356575699af209..3c227852ef3a30 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs @@ -522,7 +522,6 @@ private bool TryGetImportValue(ImportDefinition definition, out object? value) return false; } - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void NotifyImportSatisfied() { if (_invokeImportsSatisfied) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs index 5cce60871db19b..bb7791d13d3a98 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs @@ -131,7 +131,6 @@ internal bool IsDisposalRequired } } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] public override ComposablePart CreatePart() { if (IsDisposalRequired) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs index 3b4b6b572b4d95..742d46248be553 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs @@ -124,7 +124,6 @@ public static ContractBasedImportDefinition GetExportFactoryProductImportDefinit return partCreatorImportDefinition.ProductImportDefinition; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ComposablePartDefinition CreatePartDefinition( Lazy partType, bool isDisposalRequired, @@ -145,7 +144,6 @@ public static ComposablePartDefinition CreatePartDefinition( origin)); } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ExportDefinition CreateExportDefinition( LazyMemberInfo exportingMember, string contractName, @@ -161,7 +159,6 @@ public static ExportDefinition CreateExportDefinition( origin); } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ContractBasedImportDefinition CreateImportDefinition( LazyMemberInfo importingMember, string contractName, @@ -175,7 +172,6 @@ public static ContractBasedImportDefinition CreateImportDefinition( return CreateImportDefinition(importingMember, contractName, requiredTypeIdentity, requiredMetadata, cardinality, isRecomposable, requiredCreationPolicy, MetadataServices.EmptyMetadata, false, origin); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ContractBasedImportDefinition CreateImportDefinition( LazyMemberInfo importingMember, string contractName, @@ -202,7 +198,6 @@ public static ContractBasedImportDefinition CreateImportDefinition( origin); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ContractBasedImportDefinition CreateImportDefinition( LazyMemberInfo importingMember, string contractName, @@ -250,7 +245,6 @@ public static ContractBasedImportDefinition CreateImportDefinition( } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ContractBasedImportDefinition CreateImportDefinition( Lazy parameter, string contractName, @@ -263,7 +257,6 @@ public static ContractBasedImportDefinition CreateImportDefinition( return CreateImportDefinition(parameter, contractName, requiredTypeIdentity, requiredMetadata, cardinality, requiredCreationPolicy, MetadataServices.EmptyMetadata, false, origin); } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ContractBasedImportDefinition CreateImportDefinition( Lazy parameter, string contractName, diff --git a/src/libraries/System.ComponentModel.Composition/tests/AssemblyInfo.cs b/src/libraries/System.ComponentModel.Composition/tests/AssemblyInfo.cs new file mode 100644 index 00000000000000..68af85566d6924 --- /dev/null +++ b/src/libraries/System.ComponentModel.Composition/tests/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Xunit; + +[assembly: SkipOnMono("Flaky tests: https://github.com/mono/mono/issues/16417")] diff --git a/src/libraries/System.ComponentModel.Composition/tests/System.ComponentModel.Composition.Tests.csproj b/src/libraries/System.ComponentModel.Composition/tests/System.ComponentModel.Composition.Tests.csproj index 2c47c61615e323..52d0ec7cfa6448 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System.ComponentModel.Composition.Tests.csproj +++ b/src/libraries/System.ComponentModel.Composition/tests/System.ComponentModel.Composition.Tests.csproj @@ -1,5 +1,5 @@ - + true $(NetCoreAppCurrent) @@ -16,6 +16,7 @@ Common\System\IO\TempFile.cs + diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AdvancedValueComposition.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AdvancedValueComposition.cs index ae396333e449fb..f5899cd778b0f3 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AdvancedValueComposition.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AdvancedValueComposition.cs @@ -24,6 +24,7 @@ public interface ITrans_CollectionOfStrings public class AdvancedValueComposition { [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void RepeatedContainerUse() { var container = ContainerFactory.Create(); @@ -41,6 +42,7 @@ public void RepeatedContainerUse() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void FunctionsFieldsAndProperties() { Consumer c; @@ -55,6 +57,7 @@ public void FunctionsFieldsAndProperties() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void FunctionsFieldsAndProperties2() { Consumer c; @@ -69,7 +72,7 @@ public void FunctionsFieldsAndProperties2() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void FunctionsFieldsAndProperties2_WithCatalog() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -97,7 +100,7 @@ public void FunctionsFieldsAndProperties2_WithCatalog() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void FunctionsFieldsAndProperties2_StronglyTypedMetadata() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -122,7 +125,7 @@ public void FunctionsFieldsAndProperties2_StronglyTypedMetadata() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void InAdditionToCatalogTest() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -163,7 +166,7 @@ public void InAdditionToCatalogTest() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void CollectionMetadataPropertyTest() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -178,7 +181,7 @@ public void CollectionMetadataPropertyTest() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ImportExportSansNameTest() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -189,7 +192,7 @@ public void ImportExportSansNameTest() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void MultipleInstantiationOfStaticCatalogItem() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -208,7 +211,7 @@ public void MultipleInstantiationOfStaticCatalogItem() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void MultipleInstantiationOfNonStaticCatalogItem() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -224,7 +227,7 @@ public void MultipleInstantiationOfNonStaticCatalogItem() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void ImportIntoUntypedExportTest() { var container = ContainerFactory.Create(); @@ -252,6 +255,7 @@ public void ImportIntoUntypedExportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportIntoDerivationOfExportException() { var container = ContainerFactory.Create(); @@ -269,6 +273,7 @@ public void ImportIntoDerivationOfExportException() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportIntoDerivationOfExportsException() { var container = ContainerFactory.Create(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AllowNonPublicCompositionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AllowNonPublicCompositionTests.cs index 0d18d712a5975e..f0d34627e7ed5c 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AllowNonPublicCompositionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AllowNonPublicCompositionTests.cs @@ -11,6 +11,7 @@ namespace System.ComponentModel.Composition public class AllowNonPublicCompositionTests { [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PublicFromPublic() { var container = ContainerFactory.Create(); @@ -25,6 +26,7 @@ public void PublicFromPublic() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PublicToSelf() { var container = ContainerFactory.Create(); @@ -38,6 +40,7 @@ public void PublicToSelf() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PublicFromPrivate() { var container = ContainerFactory.Create(); @@ -52,6 +55,7 @@ public void PublicFromPrivate() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PrivateFromPublic() { var container = ContainerFactory.Create(); @@ -66,6 +70,7 @@ public void PrivateFromPublic() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PrivateToSelf() { var container = ContainerFactory.Create(); @@ -79,6 +84,7 @@ public void PrivateToSelf() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PrivateData() { var container = ContainerFactory.Create(); @@ -91,7 +97,7 @@ public void PrivateData() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void TestPublicImportsExpectingPublicExportsFromCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -100,7 +106,7 @@ public void TestPublicImportsExpectingPublicExportsFromCatalog() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void TestInternalImportsExpectingPublicExportsFromCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -109,7 +115,7 @@ public void TestInternalImportsExpectingPublicExportsFromCatalog() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void TestPublicImportsExpectingInternalExportsFromCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -118,7 +124,7 @@ public void TestPublicImportsExpectingInternalExportsFromCatalog() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void TestInternalImportsExpectingInternalExportsFromCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -127,7 +133,7 @@ public void TestInternalImportsExpectingInternalExportsFromCatalog() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void TestPublicImportsExpectingProtectedExportsFromCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -136,7 +142,7 @@ public void TestPublicImportsExpectingProtectedExportsFromCatalog() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void TestInternalImportsExpectingProtectedExportsFromCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -145,7 +151,7 @@ public void TestInternalImportsExpectingProtectedExportsFromCatalog() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void TestPublicImportsExpectingProtectedInternalExportsFromCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -154,7 +160,7 @@ public void TestPublicImportsExpectingProtectedInternalExportsFromCatalog() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void TestInternalImportsExpectingProtectedInternalExportsFromCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -163,7 +169,7 @@ public void TestInternalImportsExpectingProtectedInternalExportsFromCatalog() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void TestPublicImportsExpectingPrivateExportsFromCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -172,7 +178,7 @@ public void TestPublicImportsExpectingPrivateExportsFromCatalog() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void TestInternalImportsExpectingPrivateExportsFromCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AttributedModelCompositionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AttributedModelCompositionTests.cs index c197d1043c42aa..127e43a8cf1202 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AttributedModelCompositionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AttributedModelCompositionTests.cs @@ -10,6 +10,7 @@ namespace System.ComponentModel.Composition.AttributedModel { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class AttributedModelCompositionTests { [Fact] @@ -257,7 +258,7 @@ public void ImportValueMismatchFromInt32ToSingle() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void MemberExports() { var exporter = PartFactory.CreateAttributed(new ObjectWithMemberExports()); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscoveryTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscoveryTests.cs index c534a20d8b1f2b..50813648b82b92 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscoveryTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscoveryTests.cs @@ -16,6 +16,7 @@ namespace System.ComponentModel.Composition.AttributedModel public class AttributedModelDiscoveryTests { [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void CreatePartDefinition_TypeWithExports_ShouldHaveMultipleExports() { var definition = CreateDefinition(typeof(PublicComponentWithPublicExports)); @@ -34,6 +35,7 @@ public class DerivedClassWithInheritedPropertyExports : BaseClassWithPropertyExp } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void CreatePartDefinition_TypeWithImports_ShouldHaveMultipleImports() { var definition = CreateDefinition(typeof(PublicImportsExpectingPublicExports)); @@ -156,6 +158,7 @@ public void CreatePartDefinition_MultipleMarkedConstructorsAsPartTypeArgument_Sh } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void CreatePartDefinition_OneMarkedConstructorsAsPartTypeArgument_ShouldSetConstructorToMarked() { var definition = CreateDefinition(typeof(SimpleConstructorInjectedObject)); @@ -167,6 +170,7 @@ public void CreatePartDefinition_OneMarkedConstructorsAsPartTypeArgument_ShouldS } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void CreatePartDefinition_OneDefaultConstructorAsPartTypeArgument_ShouldSetConstructorToDefault() { var definition = CreateDefinition(typeof(PublicComponentWithPublicExports)); @@ -179,6 +183,7 @@ public void CreatePartDefinition_OneDefaultConstructorAsPartTypeArgument_ShouldS } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void CreatePartDefinition_OneMarkedAndOneDefaultConstructorsAsPartTypeArgument_ShouldSetConstructorToMarked() { var definition = CreateDefinition(typeof(ClassWithOneMarkedAndOneDefaultConstructor)); @@ -216,7 +221,7 @@ public void CreatePartDefinition_TwoZeroParameterConstructors_ShouldPickNonStati } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void IsDiscoverable() { var expectations = new ExpectationCollection(); @@ -241,7 +246,7 @@ public void IsDiscoverable() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void CreatePartDefinition_EnsureIsDiscoverable() { var expectations = new ExpectationCollection(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/INotifyImportTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/INotifyImportTests.cs index 5be65a203dd534..d7c6da2853b2e9 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/INotifyImportTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/INotifyImportTests.cs @@ -23,6 +23,7 @@ public void OnImportsSatisfied() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportsSatisfiedOnComponentWithoutImports() { CompositionContainer container = ContainerFactory.CreateWithAttributedCatalog(typeof(PartWithoutImports)); @@ -35,6 +36,7 @@ public void ImportsSatisfiedOnComponentWithoutImports() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportCompletedTest() { var container = ContainerFactory.Create(); @@ -56,6 +58,7 @@ public void ImportCompletedTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportCompletedWithRecomposing() { var container = ContainerFactory.Create(); @@ -94,6 +97,7 @@ public void ImportCompletedWithRecomposing() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportCompletedAddPartAndBindComponent() { var container = ContainerFactory.Create(); @@ -109,7 +113,7 @@ public void ImportCompletedAddPartAndBindComponent() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ImportCompletedChildNeedsParentContainer() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -152,7 +156,7 @@ public void ImportCompletedChildNeedsParentContainer() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ImportCompletedChildDoesnotNeedParentContainer() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -190,7 +194,7 @@ public void ImportCompletedChildDoesnotNeedParentContainer() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ImportCompletedBindChildIndirectlyThroughParentContainerBind() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -224,7 +228,7 @@ public void ImportCompletedBindChildIndirectlyThroughParentContainerBind() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ImportCompletedGetExportedValueLazy() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -245,7 +249,7 @@ public void ImportCompletedGetExportedValueLazy() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ImportCompletedGetExportedValueEager() { var cat = CatalogFactory.CreateDefaultAttributed(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModelServicesTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModelServicesTests.cs index 0355f4e2cc6bae..a86ba6ea643eb5 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModelServicesTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModelServicesTests.cs @@ -145,6 +145,7 @@ public void Imports_Throws_OnNullContractName() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Imports() { ComposablePartDefinition part1 = typeof(PartImportingContract1).AsPart(); @@ -158,6 +159,7 @@ public void Imports() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Imports_CardinalityIgnored_WhenNotSpecified() { ComposablePartDefinition part1 = typeof(PartImportingContract1).AsPart(); @@ -170,6 +172,7 @@ public void Imports_CardinalityIgnored_WhenNotSpecified() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Imports_CardinalityNotIgnored_WhenSpecified() { ComposablePartDefinition part1 = typeof(PartImportingContract1).AsPart(); @@ -200,6 +203,7 @@ public void ImportsGeneric_Throws_OnNullPart() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportsGeneric() { ComposablePartDefinition part1 = typeof(PartImportingContract1).AsPart(); @@ -213,6 +217,7 @@ public void ImportsGeneric() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportsGeneric_CardinalityIgnored_WhenNotSpecified() { ComposablePartDefinition part1 = typeof(PartImportingContract1).AsPart(); @@ -225,6 +230,7 @@ public void ImportsGeneric_CardinalityIgnored_WhenNotSpecified() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportsGeneric_CardinalityNotIgnored_WhenSpecified() { ComposablePartDefinition part1 = typeof(PartImportingContract1).AsPart(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ComponentServicesTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ComponentServicesTests.cs index b397beef287c6d..d269c0e7271653 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ComponentServicesTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ComponentServicesTests.cs @@ -14,7 +14,7 @@ namespace System.ComponentModel.Composition public class ComponentServicesTests { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void GetValuesByType() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -74,6 +74,7 @@ public void GetValuesTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void NoResolverExceptionTest() { var container = ContainerFactory.Create(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerCollectionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerCollectionTests.cs index ca2c7fcc07d3ec..a81915a67b7032 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerCollectionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerCollectionTests.cs @@ -13,6 +13,7 @@ namespace System.ComponentModel.Composition { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class CompositionContainerCollectionTests { public class SupportedImportCollectionAssignments diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs index bddb8f4e02f378..ddcf7f593a4b94 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs @@ -45,7 +45,7 @@ public void CompositionContainer_CanBeExported() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void CanBeCollectedAfterDispose() { AggregateExportProvider exportProvider = new AggregateExportProvider(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerImportTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerImportTests.cs index a6821758c0765d..303b3a4177ba10 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerImportTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerImportTests.cs @@ -13,6 +13,7 @@ namespace System.ComponentModel.Composition { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class CompositionContainerImportTests { // Exporting collectin values is not supported @@ -184,7 +185,7 @@ public void ImportValueExceptionLazily() [ConditionalFact(Helpers.ComImportAvailable)] [PlatformSpecific(TestPlatforms.Windows)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void ImportValueComComponent() { CTaskScheduler scheduler = new CTaskScheduler(); @@ -210,7 +211,7 @@ public void ImportValueComComponent() [ConditionalFact(Helpers.ComImportAvailable)] [PlatformSpecific(TestPlatforms.Windows)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void DelayImportValueComComponent() { CTaskScheduler scheduler = new CTaskScheduler(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerTests.cs index 9bfd35e6650fe1..7c51f52073eb30 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionContainerTests.cs @@ -1630,6 +1630,7 @@ public void GetExportedValuesOfT2_AskingForContractWithExportInBothParentAndChil } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/32295", TestRuntimes.Mono)] public void GetExportOfTTMetadataView1_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstraint() { var metadata = new Dictionary(); @@ -1726,6 +1727,7 @@ public void GetExports2_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstrain } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportsOfTTMetadataView1_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstraint() { var metadata = new Dictionary(); @@ -1750,6 +1752,7 @@ public void GetExportsOfTTMetadataView1_TypeAsMetadataViewTypeArgument_IsUsedAsM } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportsOfTTMetadataView2_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstraint() { var metadata = new Dictionary(); @@ -1870,6 +1873,7 @@ public void RemovePart_PartAlreadyRemovedAsPartArgument_ShouldNotThrow() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void TryComposeSimple() { var container = CreateCompositionContainer(); @@ -1883,6 +1887,7 @@ public void TryComposeSimple() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void TryComposeSimpleFail() { var container = CreateCompositionContainer(); @@ -1900,6 +1905,7 @@ public void TryComposeSimpleFail() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ComposeDisposableChildContainer() { var outerContainer = CreateCompositionContainer(); @@ -1959,6 +1965,7 @@ public void RemoveValueTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] [Trait("Type", "Integration")] public void OptionalImportsOfValueTypeBoundToDefaultValueShouldNotAffectAvailableValues() { @@ -1978,6 +1985,7 @@ public void OptionalImportsOfValueTypeBoundToDefaultValueShouldNotAffectAvailabl } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] [Trait("Type", "Integration")] public void OptionalImportsOfNullableValueTypeBoundToDefaultValueShouldNotAffectAvailableValues() { @@ -1997,6 +2005,7 @@ public void OptionalImportsOfNullableValueTypeBoundToDefaultValueShouldNotAffect } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] [Trait("Type", "Integration")] public void OptionalImportsOfReferenceTypeBoundToDefaultValueShouldNotAffectAvailableValues() { @@ -2392,7 +2401,7 @@ public class ExportSimpleIntWithException } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // Actual: typeof(System.Reflection.ReflectionTypeLoadException) + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // Actual: typeof(System.Reflection.ReflectionTypeLoadException) public void TryGetValueWithCatalogVerifyExecptionDuringGet() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -2405,6 +2414,7 @@ public void TryGetValueWithCatalogVerifyExecptionDuringGet() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void TryGetExportedValueWhileLockedForNotify() { var container = CreateCompositionContainer(); @@ -2480,6 +2490,7 @@ public void RemoveFromWrongContainerTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] [Trait("Type", "Integration")] public void AddPartSimple() { @@ -2494,6 +2505,7 @@ public void AddPartSimple() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] [Trait("Type", "Integration")] public void AddPart() { @@ -2508,6 +2520,7 @@ public void AddPart() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ComposeReentrantChildContainerDisposed() { var container = CreateCompositionContainer(); @@ -2537,6 +2550,7 @@ public void ComposeReentrantChildContainerDisposed() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ComposeSimple() { var container = CreateCompositionContainer(); @@ -2550,6 +2564,7 @@ public void ComposeSimple() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ComposeSimpleFail() { var container = CreateCompositionContainer(); @@ -2567,6 +2582,7 @@ public void ComposeSimpleFail() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ExceptionDuringNotify() { var container = CreateCompositionContainer(); @@ -2584,6 +2600,7 @@ public void ExceptionDuringNotify() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void NeutralComposeWhileNotified() { var container = CreateCompositionContainer(); @@ -2641,6 +2658,7 @@ public class SimpleExporter } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ThreadSafeCompositionContainer() { TypeCatalog catalog = new TypeCatalog(typeof(SimpleExporter)); @@ -2660,6 +2678,7 @@ public void ThreadSafeCompositionContainer() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ThreadSafeCompositionOptionsCompositionContainer() { TypeCatalog catalog = new TypeCatalog(typeof(SimpleExporter)); @@ -2678,6 +2697,7 @@ public void ThreadSafeCompositionOptionsCompositionContainer() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void DisableSilentRejectionCompositionOptionsCompositionContainer() { TypeCatalog catalog = new TypeCatalog(typeof(SimpleExporter)); @@ -2696,6 +2716,7 @@ public void DisableSilentRejectionCompositionOptionsCompositionContainer() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void DisableSilentRejectionThreadSafeCompositionOptionsCompositionContainer() { TypeCatalog catalog = new TypeCatalog(typeof(SimpleExporter)); @@ -2947,6 +2968,7 @@ public void ComposeExportedValueOfT_ValidContractName_ExportedValue_ImportsAreNo } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void TestExportedValueCachesNullValue() { var container = ContainerFactory.Create(); @@ -2960,6 +2982,7 @@ public void TestExportedValueCachesNullValue() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void TestExportedValueUsingWhereClause_ExportSuccessful() { CompositionContainer container = new CompositionContainer(new TypeCatalog(typeof(MefCollection<,>))); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionResultTest.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionResultTest.cs index fc574ae2e22847..cd618cd002ed2c 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionResultTest.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionResultTest.cs @@ -159,7 +159,7 @@ public void Constructor3_ValuesAsErrorsArgument_ShouldSetSucceededPropertyToTrue } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void MergeResult_ResultWithNullErrorsAsResultArgument_ShouldReturnResultWithSameErrors() { var emptyResult = CreateCompositionResult((IEnumerable)null); @@ -177,7 +177,7 @@ public void MergeResult_ResultWithNullErrorsAsResultArgument_ShouldReturnResultW } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void MergeResult_ResultWithEmptyErrorsAsResultArgument_ShouldReturnResultWithSameErrors() { var emptyResult = CreateCompositionResult(Enumerable.Empty()); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionServiceExportFactoryTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionServiceExportFactoryTests.cs index 5facc6c902f121..c28a6c40746cf2 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionServiceExportFactoryTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionServiceExportFactoryTests.cs @@ -42,6 +42,7 @@ public class App } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] [Description("Verifies CompositionServices.SatisfyImportsOne with Scoped ExportFactories")] public void ComposeAppInNewScopeChildrenInRoot_ShouldSucceed() { @@ -66,6 +67,7 @@ public void ComposeAppInNewScopeChildrenInRoot_ShouldSucceed() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] [Description("Verifies CompositionServices.SatisfyImportsOne with Scoped ExportFactories")] public void ComposeAppInNewScopeChildrenInScope_ShouldSucceed() { @@ -90,6 +92,7 @@ public void ComposeAppInNewScopeChildrenInScope_ShouldSucceed() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] [Description("Verifies CompositionServices.SatisfyImportsOne with Scoped ExportFactories")] public void ComposeAppInNewScopeChildrenInBoth_ShouldSucceed() { @@ -114,6 +117,7 @@ public void ComposeAppInNewScopeChildrenInBoth_ShouldSucceed() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] [Description("Verifies CompositionServices.SatisfyImportsOne with NonScoped ExportFactories")] public void ComposeAppInRootScope_ShouldSucceed() { diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionServicesTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionServicesTests.cs index 0b01085fe86c31..d9a4e347106ea6 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionServicesTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionServicesTests.cs @@ -38,6 +38,7 @@ public void ContractNameServicesAddCustomModifiersTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/15168", TestRuntimes.Mono)] [Description("Verifies CompositionServices.GetDefaultContractName method.")] public void GetDefaultContractNameTest() { diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/DynamicMetadata.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/DynamicMetadata.cs index 9da62f07715004..dc33c46ee8a93d 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/DynamicMetadata.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/DynamicMetadata.cs @@ -13,6 +13,7 @@ namespace System.ComponentModel.Composition public class DynamicMetadata : IDisposable { [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SimpleAttachment() { MetadataStore.Container = new CompositionContainer(); @@ -34,6 +35,7 @@ public void SimpleAttachment() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void LocalContainer() { var container1 = new CompositionContainer(); @@ -60,6 +62,7 @@ public void LocalContainer() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void DualContainers() { var container1 = new CompositionContainer(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportAttributeTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportAttributeTests.cs index 8f5b5db508c9a4..e4698493c9ea7e 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportAttributeTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportAttributeTests.cs @@ -71,6 +71,7 @@ public void Constructor2_ValueAsContractNameArgument_ShouldSetContractNameProper } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ExportIndexers_ShouldThrowSomething() { var con = new CompositionContainer( diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportCollectionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportCollectionTests.cs index 2844d0dac13dac..487e4457e0638b 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportCollectionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportCollectionTests.cs @@ -142,6 +142,7 @@ public class ExporterDefault42 } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/31792", TestRuntimes.Mono)] [Trait("Type", "Integration")] public void ImportCollectionsFromContainerOnly() { @@ -162,7 +163,7 @@ public void ImportCollectionsFromContainerOnly() [Fact] [Trait("Type", "Integration")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ImportCollectionsFromCatalogOnly() { var cat = CatalogFactory.CreateDefaultAttributed(); @@ -178,7 +179,7 @@ public void ImportCollectionsFromCatalogOnly() [Fact] [Trait("Type", "Integration")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ImportCollectionsFormContainerAndCatalog() { var cat = CatalogFactory.CreateDefaultAttributed(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportFactoryTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportFactoryTests.cs index 03bf5f822aa95e..5082b0e259f5c2 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportFactoryTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportFactoryTests.cs @@ -14,6 +14,7 @@ namespace Tests.Integration { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class ExportFactoryTests { public interface IId @@ -392,7 +393,7 @@ public void Dispose() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ExportFactory_SimpleDispose() { var catalog = new AssemblyCatalog(Assembly.GetExecutingAssembly()); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportableAttributeTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportableAttributeTests.cs index 95c2934d4fd495..a8040bcbe70269 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportableAttributeTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ExportableAttributeTests.cs @@ -37,6 +37,7 @@ public void UntypedStructureTest() // Silverlight doesn't support strongly typed metadata [Fact] [Trait("Type", "Integration")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/32295", TestRuntimes.Mono)] public void StronglyTypedStructureTest() { var container = ContainerFactory.Create(); @@ -56,6 +57,7 @@ public void StronglyTypedStructureTest() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/32030", TestRuntimes.Mono)] [Trait("Type", "Integration")] public void StronglyTypedStructureTestWithTransparentViews() { diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/GenericsTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/GenericsTests.cs index 0eb49672771318..afc7a0290563a3 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/GenericsTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/GenericsTests.cs @@ -304,6 +304,7 @@ public class OpenGenericPartWithClosedGenericImport : IExport } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithClosedGenericImportTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfImport<>), typeof(OpenGenericPartWithClosedGenericImport<>)); @@ -331,6 +332,7 @@ public void SelfExportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PropertyExportTest() { TypeCatalog catalog = new TypeCatalog(typeof(PropertyExport<,>)); @@ -344,6 +346,7 @@ public void PropertyExportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PropertyExportWithContractInferredTest() { TypeCatalog catalog = new TypeCatalog(typeof(PropertyExportWithContractInferred<,>)); @@ -357,6 +360,7 @@ public void PropertyExportWithContractInferredTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithPropertyImportTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithPropertyImport<,>), typeof(SelfImport<,>)); @@ -371,6 +375,7 @@ public void SelfExportWithPropertyImportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithLazyPropertyImportTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithLazyPropertyImport<,>), typeof(SelfImport<,>)); @@ -385,6 +390,7 @@ public void SelfExportWithLazyPropertyImportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithNakedLazyPropertyImportTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithNakedLazyPropertyImport<>), typeof(Foo)); @@ -399,6 +405,7 @@ public void SelfExportWithNakedLazyPropertyImportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithExportFactoryPropertyImportTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithExportFactoryPropertyImport<,>), typeof(SelfImport<,>)); @@ -420,6 +427,7 @@ public void SelfExportWithExportFactoryPropertyImportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithNakedExportFactoryPropertyImportTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithNakedExportFactoryPropertyImport<>), typeof(Foo)); @@ -441,6 +449,7 @@ public void SelfExportWithNakedExportFactoryPropertyImportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithExportFactoryParameterImportTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithExportFactoryParameterImport<,>), typeof(SelfImport<,>)); @@ -462,6 +471,7 @@ public void SelfExportWithExportFactoryParameterImportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithCollectionPropertyImportTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithCollectionPropertyImport<,>), typeof(SelfImport<,>)); @@ -476,6 +486,7 @@ public void SelfExportWithCollectionPropertyImportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithLazyCollectionPropertyImportTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithLazyCollectionPropertyImport<,>), typeof(SelfImport<,>)); @@ -490,6 +501,7 @@ public void SelfExportWithLazyCollectionPropertyImportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithPropertyImportWithContractInferredTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithPropertyImportWithContractInferred<,>), typeof(SelfImport<,>)); @@ -504,6 +516,7 @@ public void SelfExportWithPropertyImportWithContractInferredTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithParameterImportTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithParameterImport<,>), typeof(SelfImport<,>)); @@ -518,6 +531,7 @@ public void SelfExportWithParameterImportTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SelfExportWithMultipleGenericImportsTest() { TypeCatalog catalog = new TypeCatalog(typeof(SelfExportWithMultipleGenericImports<,>), typeof(SelfImport<,>), typeof(SelfImport<>), typeof(Foo)); @@ -549,6 +563,7 @@ public void SpecilzationMakesGeneric() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SingletonBehavior() { TypeCatalog catalog = new TypeCatalog(typeof(SingletonExport<,>)); @@ -707,6 +722,7 @@ public void PartWithNakedConstraintTest() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PartWithExportParametersInReverseOrder() { TypeCatalog catalog = new TypeCatalog(typeof(PropertyExportWithChangedParameterOrder<,>)); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AggregateCatalogTest.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AggregateCatalogTest.cs index ca639ca3dda6ba..bf085d8c879f85 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AggregateCatalogTest.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AggregateCatalogTest.cs @@ -46,7 +46,7 @@ public void Constructor3_EmptyIEnumerableAsCatalogsArgument_ShouldSetCatalogsPro } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor3_ArrayWithNullAsCatalogsArgument_ShouldThrowArgument() { var catalogs = new ComposablePartCatalog[] { null }; @@ -95,7 +95,7 @@ public void GetExports_WhenCatalogDisposed_ShouldThrowObjectDisposed() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void GetExports_NullAsConstraintArgument_ShouldThrowArgumentNull() { var catalog = CreateAggregateCatalog(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxyTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxyTests.cs index d4cbb1f6fbeed9..7959ecd0f0331f 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxyTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxyTests.cs @@ -11,7 +11,7 @@ namespace System.ComponentModel.Composition.Hosting public class AssemblyCatalogDebuggerProxyTests { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor_NullAsCatalogArgument_ShouldThrowArgumentNull() { AssertExtensions.Throws("catalog", () => @@ -21,7 +21,7 @@ public void Constructor_NullAsCatalogArgument_ShouldThrowArgumentNull() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void Constructor_ValueAsCatalogArgument_ShouldSetPartsProperty() { var expectations = Expectations.GetAssemblies(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs index 3027e73d37b7da..d655f945456a90 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs @@ -169,7 +169,7 @@ internal static void Constructor_NullDefinitionOriginArgument_ShouldThrowArgumen // Test cases for AssemblyCatalog(string codebase) constructor //========================================================================================================================================= [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor1_ValueAsCodebaseArgument_ShouldSetAssemblyProperty() { AssemblyCatalogConstructorTests.Constructor_ValueAsCodebaseArgument_ShouldSetAssemblyProperty((s) => @@ -216,7 +216,7 @@ public void Constructor1_InvalidFileNameAsCodeBaseArgument_ShouldThrowArgument_D } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] // Also see https://github.com/dotnet/corefx/issues/27269 + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] // Also see https://github.com/dotnet/runtime/issues/25099 [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void Constructor1_InvalidFileNameAsCodeBaseArgument_ShouldThrowIO_Core() { @@ -227,7 +227,7 @@ public void Constructor1_InvalidFileNameAsCodeBaseArgument_ShouldThrowIO_Core() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor1_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad() { AssemblyCatalogConstructorTests.Constructor_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad((s) => @@ -237,7 +237,7 @@ public void Constructor1_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor1_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLong() { AssemblyCatalogConstructorTests.Constructor_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLong((s) => @@ -247,7 +247,7 @@ public void Constructor1_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLon } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // fault segmentation - AnyUnix + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // fault segmentation - AnyUnix public void Constructor1_NonAssemblyFileNameAsCodeBaseArgument_ShouldThrowBadImageFormat() { AssemblyCatalogConstructorTests.Constructor_NonAssemblyFileNameAsCodeBaseArgument_ShouldThrowBadImageFormat((s) => @@ -266,7 +266,7 @@ public void Constructor1_NonExistentFileNameAsCodeBaseArgument_ShouldThrowFileNo } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor1_ShouldSetOriginToNull() { var catalog = (ICompositionElement)new AssemblyCatalog(GetAttributedAssemblyCodeBase()); @@ -279,7 +279,7 @@ public void Constructor1_ShouldSetOriginToNull() //========================================================================================================================================= [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor2_ValueAsCodebaseArgument_ShouldSetAssemblyProperty() { AssemblyCatalogConstructorTests.Constructor_ValueAsCodebaseArgument_ShouldSetAssemblyProperty((s) => @@ -326,7 +326,7 @@ public void Constructor2_InvalidFileNameAsCodeBaseArgument_ShouldThrowArgument_D } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] // Also see https://github.com/dotnet/corefx/issues/27269 + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] // Also see https://github.com/dotnet/runtime/issues/25099 [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void Constructor2_InvalidFileNameAsCodeBaseArgument_ShouldThrowArgument() { @@ -337,7 +337,7 @@ public void Constructor2_InvalidFileNameAsCodeBaseArgument_ShouldThrowArgument() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor2_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad() { AssemblyCatalogConstructorTests.Constructor_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad((s) => @@ -347,7 +347,7 @@ public void Constructor2_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor2_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLong() { AssemblyCatalogConstructorTests.Constructor_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLong((s) => @@ -357,7 +357,7 @@ public void Constructor2_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLon } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // fault segmentation - AnyUnix + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // fault segmentation - AnyUnix public void Constructor2_NonAssemblyFileNameAsCodeBaseArgument_ShouldThrowBadImageFormat() { AssemblyCatalogConstructorTests.Constructor_NonAssemblyFileNameAsCodeBaseArgument_ShouldThrowBadImageFormat((s) => @@ -388,7 +388,7 @@ public void Constructor2_NullReflectionContextArgument_ShouldThrowArgumentNull() // Test cases for AssemblyCatalog(string codebase, ICompositionElement definitonOrigin) constructor //========================================================================================================================================= [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor3_ValueAsCodebaseArgument_ShouldSetAssemblyProperty() { AssemblyCatalogConstructorTests.Constructor_ValueAsCodebaseArgument_ShouldSetAssemblyProperty((s) => @@ -435,7 +435,7 @@ public void Constructor3_InvalidFileNameAsCodeBaseArgument_ShouldThrowArgument() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] // // Also see https://github.com/dotnet/corefx/issues/27269 + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] // // Also see https://github.com/dotnet/runtime/issues/25099 [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void Constructor3_InvalidFileNameAsCodeBaseArgument_ShouldThrowIO_Core() { @@ -446,7 +446,7 @@ public void Constructor3_InvalidFileNameAsCodeBaseArgument_ShouldThrowIO_Core() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor3_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad() { AssemblyCatalogConstructorTests.Constructor_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad((s) => @@ -456,7 +456,7 @@ public void Constructor3_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor3_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLong() { AssemblyCatalogConstructorTests.Constructor_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLong((s) => @@ -466,7 +466,7 @@ public void Constructor3_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLon } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // fault segmentation - AnyUnix + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // fault segmentation - AnyUnix public void Constructor3_NonAssemblyFileNameAsCodeBaseArgument_ShouldThrowBadImageFormat() { AssemblyCatalogConstructorTests.Constructor_NonAssemblyFileNameAsCodeBaseArgument_ShouldThrowBadImageFormat((s) => @@ -543,7 +543,7 @@ public void Constructor4_InvalidFileNameAsCodeBaseArgument_ShouldThrowArgument_D } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] // Also see https://github.com/dotnet/corefx/issues/27269 + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] // Also see https://github.com/dotnet/runtime/issues/25099 [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void Constructor4_InvalidFileNameAsCodeBaseArgument_ShouldThrowIO_Core() { @@ -554,7 +554,7 @@ public void Constructor4_InvalidFileNameAsCodeBaseArgument_ShouldThrowIO_Core() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor4_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad() { AssemblyCatalogConstructorTests.Constructor_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad((s) => @@ -564,7 +564,7 @@ public void Constructor4_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor4_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLong() { AssemblyCatalogConstructorTests.Constructor_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLong((s) => @@ -574,7 +574,7 @@ public void Constructor4_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLon } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // fault segmentation - AnyUnix + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // fault segmentation - AnyUnix public void Constructor4_NonAssemblyFileNameAsCodeBaseArgument_ShouldThrowBadImageFormat() { AssemblyCatalogConstructorTests.Constructor_NonAssemblyFileNameAsCodeBaseArgument_ShouldThrowBadImageFormat((s) => @@ -613,7 +613,7 @@ public void Constructor4_NullDefinitionOriginArgument_ShouldThrowArgumentNull() // Test cases for AssemblyCatalog(string codebase, ICompositionElement definitonOrigin) constructor //========================================================================================================================================= [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor7_ValueAsAssemblyArgument_ShouldSetAssemblyProperty() { AssemblyCatalogConstructorTests.Constructor_ValueAsCodebaseArgument_ShouldSetAssemblyProperty((a) => @@ -647,7 +647,7 @@ public void Constructor6_ValueAsAssemblyArgument_ShouldSetAssemblyProperty() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor6_NullReflectionContextArgument_ShouldThrowArgumentNull() { AssemblyCatalogConstructorTests.Constructor_NullReflectionContextArgument_ShouldThrowArgumentNull((rc) => @@ -657,7 +657,7 @@ public void Constructor6_NullReflectionContextArgument_ShouldThrowArgumentNull() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor7_NullDefinitionOriginArgument_ShouldThrowArgumentNull() { AssemblyCatalogConstructorTests.Constructor_NullDefinitionOriginArgument_ShouldThrowArgumentNull((dO) => @@ -709,7 +709,7 @@ public void Constructor8_NullDefinitionOriginArgument_ShouldThrowArgumentNull() //========================================================================================================================================= [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void DiscoverCatalogUsingReflectionContextCatalogDiscoveryAttribute() { var catalog = new AssemblyCatalog(typeof(TestAssemblyOne).Assembly); @@ -722,7 +722,7 @@ public void DiscoverCatalogUsingReflectionContextCatalogDiscoveryAttribute() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void DiscoverCatalogUsingDerivedReflectionContextCatalogDiscoveryAttribute() { var catalog = new AssemblyCatalog(typeof(TestAssemblyTwo).Assembly); @@ -735,7 +735,7 @@ public void DiscoverCatalogUsingDerivedReflectionContextCatalogDiscoveryAttribut } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void DiscoverCatalogUsingNoDefaultConstructorReflectionContextCatalogDiscoveryAttribute_ShouldThrowArgumentException() { AssertExtensions.Throws(() => @@ -746,7 +746,7 @@ public void DiscoverCatalogUsingNoDefaultConstructorReflectionContextCatalogDisc } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void DiscoverCatalogUsingDerivedReflectionContextCatalogDiscoveryAttribute_ShouldThrowArgumentException() { @@ -819,7 +819,7 @@ public void GetExports_WhenCatalogDisposed_ShouldThrowObjectDisposed() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void GetExports_NullAsConstraintArgument_ShouldThrowArgumentNull() { var catalog = CreateAssemblyCatalog(); @@ -845,7 +845,7 @@ public void Dispose_CanBeCalledMultipleTimes() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void Parts() { var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); @@ -854,7 +854,7 @@ public void Parts() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void Parts_ShouldSetDefinitionOriginToCatalogItself() { var catalog = CreateAssemblyCatalog(); @@ -867,7 +867,7 @@ public void Parts_ShouldSetDefinitionOriginToCatalogItself() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void AddAssemblyUsingFile() { var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly.Location); @@ -877,7 +877,7 @@ public void AddAssemblyUsingFile() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void TwoTypesWithSameSimpleName() { var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); @@ -895,7 +895,7 @@ public void TwoTypesWithSameSimpleName() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void GettingFunctionExports() { var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); @@ -906,7 +906,7 @@ public void GettingFunctionExports() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void AnExportOfAnInstanceThatFailsToCompose() { var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); @@ -922,7 +922,7 @@ public void AnExportOfAnInstanceThatFailsToCompose() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void SharedPartCreation() { var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); @@ -940,7 +940,7 @@ public void SharedPartCreation() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void NonSharedPartCreation() { var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); @@ -958,7 +958,7 @@ public void NonSharedPartCreation() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void RecursiveNonSharedPartCreation() { var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); @@ -996,7 +996,7 @@ public void RecursiveNonSharedPartCreation() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // typeof(System.Reflection.ReflectionTypeLoadException) + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // typeof(System.Reflection.ReflectionTypeLoadException) public void RecursiveNonSharedPartCreationDisableSilentRejection() { var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); @@ -1034,7 +1034,7 @@ public void RecursiveNonSharedPartCreationDisableSilentRejection() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void TryToDiscoverExportWithGenericParameter() { var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/CatalogExportProviderTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/CatalogExportProviderTests.cs index 3784aa2c16bb16..8b271e5640e296 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/CatalogExportProviderTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/CatalogExportProviderTests.cs @@ -118,7 +118,7 @@ public void GetExports_WhenMultipleRejectedDefinitionsRequiredImportsAreAdded_Sh [Fact] [Trait("Type", "Integration")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void BasicTest() { var catalog = CatalogFactory.CreateDefaultAttributed(); @@ -141,7 +141,7 @@ public void BasicTest() [Fact] [Trait("Type", "Integration")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void BasicTestWithRequiredMetadata_NoTypeConstraint() { var catalog = CatalogFactory.CreateDefaultAttributed(); @@ -159,7 +159,7 @@ public void BasicTestWithRequiredMetadata_NoTypeConstraint() [Fact] [Trait("Type", "Integration")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void BasicTestWithRequiredMetadata_TypeConstraint() { var catalog = CatalogFactory.CreateDefaultAttributed(); @@ -177,7 +177,7 @@ public void BasicTestWithRequiredMetadata_TypeConstraint() [Fact] [Trait("Type", "Integration")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void BasicTestWithRequiredMetadata_WrongTypeConstraint() { var catalog = CatalogFactory.CreateDefaultAttributed(); @@ -195,7 +195,7 @@ public void BasicTestWithRequiredMetadata_WrongTypeConstraint() [Fact] [Trait("Type", "Integration")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ComponentCatalogResolverGetStaticExport() { var catalog = CatalogFactory.CreateDefaultAttributed(); @@ -209,7 +209,7 @@ public void ComponentCatalogResolverGetStaticExport() [Fact] [Trait("Type", "Integration")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ComponentCatalogResolverComponentCatalogExportReference() { var catalog = CatalogFactory.CreateDefaultAttributed(); @@ -228,7 +228,7 @@ public void ComponentCatalogResolverComponentCatalogExportReference() [Fact] [Trait("Type", "Integration")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ValueTypeFromCatalog() { var catalog = CatalogFactory.CreateDefaultAttributed(); @@ -295,7 +295,7 @@ public class CreationPolicyNonShared } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void CreationPolicyNonShared_MultipleCallsReturnsDifferentInstances() { var catalog = CatalogFactory.CreateAttributed(typeof(CreationPolicyNonShared)); @@ -317,7 +317,7 @@ public void CreationPolicyNonShared_MultipleCallsReturnsDifferentInstances() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void CanBeCollectedAfterDispose() { AggregateExportProvider sourceExportProvider = new AggregateExportProvider(); @@ -339,6 +339,7 @@ public void CanBeCollectedAfterDispose() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void RemovingAndReAddingMultipleDefinitionsFromCatalog() { var fixedParts = new TypeCatalog(typeof(RootMultipleImporter), typeof(ExportedService)); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/CompositionBatchTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/CompositionBatchTests.cs index 705051f7df1888..48d9eebe738565 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/CompositionBatchTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/CompositionBatchTests.cs @@ -803,6 +803,7 @@ public void AddPart_ReturnedComposablePart_NullAsExportsArgumentToSetImports_Sho } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void AddPart_ReturnedComposablePart_ExportsArrayWithNullElementAsExportsArgumentToSetImports_ShouldThrowArgument() { CompositionBatch batch = new CompositionBatch(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs index 3c3d7e7156f4e2..7cc7e29785b722 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs @@ -39,7 +39,7 @@ public void Constructor_ValueAsCatalogArgument_ShouldSetPartsProperty() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor_ValueAsCatalogArgument_ShouldSetAssemblyProperty() { string directoryPath = GetTemporaryDirectory(); @@ -68,7 +68,7 @@ public void Constuctor_ValueAsCatalogArgument_ShouldSetPathProperty() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void Constuctor_ValueAsCatalogArgument_ShouldSetSearchPatternProperty() { string directoryPath = GetTemporaryDirectory(); @@ -90,7 +90,7 @@ public void Constuctor_ValueAsCatalogArgument_ShouldSetSearchPatternProperty() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] [PlatformSpecific(TestPlatforms.Windows)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void FullPath_ValidPath_ShouldBeFine() { string directoryPath = GetTemporaryDirectory(); @@ -116,7 +116,7 @@ public void FullPath_ValidPath_ShouldBeFine() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void LoadedFiles_EmptyDirectory_ShouldBeFine() { string directoryPath = GetTemporaryDirectory(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs index 44f611b860556d..c3b8909fe8afa9 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs @@ -91,7 +91,7 @@ public void Constructor4_NullDefinitionOriginArgument_ShouldThrowArgumentNull() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.IO.DirectoryNotFoundException : Could not find a part of the path '/HOME/HELIXBOT/DOTNETBUILD/WORK/E77C2FB6-5244-4437-8E27-6DD709101152/WORK/D9EBA0EA-A511-4F42-AC8B-AC8054AAF606/UNZIP/'. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.IO.DirectoryNotFoundException : Could not find a part of the path '/HOME/HELIXBOT/DOTNETBUILD/WORK/E77C2FB6-5244-4437-8E27-6DD709101152/WORK/D9EBA0EA-A511-4F42-AC8B-AC8054AAF606/UNZIP/'. public void ICompositionElementDisplayName_ShouldIncludeCatalogTypeNameAndDirectoryPath() { var paths = GetPathExpectations(); @@ -107,7 +107,7 @@ public void ICompositionElementDisplayName_ShouldIncludeCatalogTypeNameAndDirect } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.IO.DirectoryNotFoundException : Could not find a part of the path '/HOME/HELIXBOT/DOTNETBUILD/WORK/E77C2FB6-5244-4437-8E27-6DD709101152/WORK/D9EBA0EA-A511-4F42-AC8B-AC8054AAF606/UNZIP/'. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.IO.DirectoryNotFoundException : Could not find a part of the path '/HOME/HELIXBOT/DOTNETBUILD/WORK/E77C2FB6-5244-4437-8E27-6DD709101152/WORK/D9EBA0EA-A511-4F42-AC8B-AC8054AAF606/UNZIP/'. public void ICompositionElementDisplayName_ShouldIncludeDerivedCatalogTypeNameAndAssemblyFullName() { var paths = GetPathExpectations(); @@ -123,7 +123,7 @@ public void ICompositionElementDisplayName_ShouldIncludeDerivedCatalogTypeNameAn } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.IO.DirectoryNotFoundException : Could not find a part of the path '/HOME/HELIXBOT/DOTNETBUILD/WORK/E77C2FB6-5244-4437-8E27-6DD709101152/WORK/D9EBA0EA-A511-4F42-AC8B-AC8054AAF606/UNZIP/'. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.IO.DirectoryNotFoundException : Could not find a part of the path '/HOME/HELIXBOT/DOTNETBUILD/WORK/E77C2FB6-5244-4437-8E27-6DD709101152/WORK/D9EBA0EA-A511-4F42-AC8B-AC8054AAF606/UNZIP/'. public void ToString_ShouldReturnICompositionElementDisplayName() { var paths = GetPathExpectations(); @@ -243,7 +243,7 @@ public void AddAssembly1_EmptyPathArgument_ShouldThrowArgument() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void AddAssembly1_TooLongPathNameArgument_ShouldThrowPathTooLongException() { Assert.Throws(() => @@ -253,7 +253,7 @@ public void AddAssembly1_TooLongPathNameArgument_ShouldThrowPathTooLongException } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Parts() { var catalog = new DirectoryCatalog(TemporaryFileCopier.GetTemporaryDirectory()); @@ -262,7 +262,7 @@ public void Parts() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Parts_ShouldSetDefinitionOriginToCatalogItself() { var catalog = new DirectoryCatalog(TemporaryFileCopier.GetTemporaryDirectory()); @@ -275,7 +275,7 @@ public void Parts_ShouldSetDefinitionOriginToCatalogItself() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Path_ValidPath_ShouldBeFine() { var expectations = new ExpectationCollection(); @@ -294,7 +294,7 @@ public void Path_ValidPath_ShouldBeFine() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void FullPath_ValidPath_ShouldBeFine() { var expectations = new ExpectationCollection(); @@ -375,7 +375,7 @@ public void Constructor_NonExistentDirectory_ShouldThrow() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Constructor_PassExistingFileName_ShouldThrow() { using (File.CreateText(Path.Combine(TemporaryFileCopier.GetTemporaryDirectory(), "Test.txt"))) { } @@ -391,7 +391,7 @@ public void Constructor_PassNonExistingFileName_ShouldThrow() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Refresh_AssemblyAdded_ShouldFireOnChanged() { bool changedFired = false; @@ -421,7 +421,7 @@ public void Refresh_AssemblyAdded_ShouldFireOnChanged() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Refresh_AssemblyRemoved_ShouldFireOnChanged() { string file = Path.Combine(TemporaryFileCopier.GetTemporaryDirectory(), "Test.dll"); @@ -453,7 +453,7 @@ public void Refresh_NoChanges_ShouldNotFireOnChanged() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void Refresh_DirectoryRemoved_ShouldThrowDirectoryNotFound() { DirectoryCatalog cat; @@ -494,7 +494,7 @@ public void GetExports() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void AddAndRemoveDirectory() { var cat = new AggregateCatalog(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/FilteredCatalogTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/FilteredCatalogTests.cs index 54695ae3887548..7790a5c85a96a0 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/FilteredCatalogTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/FilteredCatalogTests.cs @@ -81,6 +81,7 @@ public void GetExports() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportsWithGenerics() { var originalCatalog = new TypeCatalog(typeof(GenericExporter<,>), typeof(Exporter11), typeof(Exporter22)); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/FilteredCatalogTransitiveClosureTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/FilteredCatalogTransitiveClosureTests.cs index 3b8a5534a54e72..0587151ba3ef6f 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/FilteredCatalogTransitiveClosureTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/FilteredCatalogTransitiveClosureTests.cs @@ -8,6 +8,7 @@ namespace System.ComponentModel.Composition.Hosting { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class FilteredCatalogTransitiveClosureTests { public interface IContract1 { } diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/ScopeExtensionsTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/ScopeExtensionsTests.cs index 08100595b7ca07..019efb3a3871eb 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/ScopeExtensionsTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/ScopeExtensionsTests.cs @@ -68,6 +68,7 @@ public void Imports_Throws_OnNullContractName() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Imports() { ComposablePartDefinition part1 = typeof(PartImportingContract1).AsPart(); @@ -81,6 +82,7 @@ public void Imports() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Imports_CardinalityIgnored_WhenNotSpecified() { ComposablePartDefinition part1 = typeof(PartImportingContract1).AsPart(); @@ -93,6 +95,7 @@ public void Imports_CardinalityIgnored_WhenNotSpecified() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Imports_CardinalityNotIgnored_WhenSpecified() { ComposablePartDefinition part1 = typeof(PartImportingContract1).AsPart(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/TypeCatalogTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/TypeCatalogTests.cs index 76bde0d38859ae..7bb8643bd5c30c 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/TypeCatalogTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/TypeCatalogTests.cs @@ -259,7 +259,7 @@ public void Dispose_CanBeCalledMultipleTimes() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void Parts() { var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); @@ -280,7 +280,7 @@ public void Parts_ShouldSetDefinitionOriginToCatalogItself() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ICompositionElementDisplayName_SingleTypeAsTypesArgument_ShouldIncludeCatalogTypeNameAndTypeFullName() { var expectations = Expectations.GetAttributedTypes(); @@ -326,7 +326,7 @@ public void ICompositionElementDisplayName_ValueAsTypesArgument_ShouldIncludeCat } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ICompositionElementDisplayName_ShouldIncludeDerivedCatalogTypeNameAndTypeFullNames() { var expectations = Expectations.GetAttributedTypes(); @@ -342,7 +342,7 @@ public void ICompositionElementDisplayName_ShouldIncludeDerivedCatalogTypeNameAn } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ToString_ShouldReturnICompositionElementDisplayName() { var expectations = Expectations.GetAttributedTypes(); @@ -356,7 +356,7 @@ public void ToString_ShouldReturnICompositionElementDisplayName() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void GetExports() { var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); @@ -372,7 +372,7 @@ public void GetExports() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void TwoTypesWithSameSimpleName() { var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); @@ -392,7 +392,7 @@ public void TwoTypesWithSameSimpleName() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void GettingFunctionExports() { var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); @@ -403,7 +403,7 @@ public void GettingFunctionExports() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void AnExportOfAnInstanceThatFailsToCompose() { var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); @@ -419,7 +419,7 @@ public void AnExportOfAnInstanceThatFailsToCompose() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void SharedPartCreation() { var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); @@ -437,7 +437,7 @@ public void SharedPartCreation() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void NonSharedPartCreation() { var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); @@ -455,7 +455,7 @@ public void NonSharedPartCreation() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void RecursiveNonSharedPartCreation() { var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); @@ -493,7 +493,7 @@ public void RecursiveNonSharedPartCreation() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void TryToDiscoverExportWithGenericParameter() { var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ImportAttributeTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ImportAttributeTests.cs index cb667c1bc96b87..bee7c342120ed0 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ImportAttributeTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ImportAttributeTests.cs @@ -169,6 +169,7 @@ public void AllowRecomposition_ValueAsValueArgument_ShouldSetProperty() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportIndexers_ShouldThrowSomething() { var con = new CompositionContainer( diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ImportDefinitionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ImportDefinitionTests.cs index e42347e90ef075..b63a972e39eaa6 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ImportDefinitionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ImportDefinitionTests.cs @@ -159,7 +159,7 @@ public void ToString_WhenConstraintPropertyNotOverridden_ShouldThrowNotImplement } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void ToString_ValueAsConstraintArgument_ShouldReturnConstraintProperty() { var expectations = new ExpectationCollection>, string>(); @@ -177,7 +177,7 @@ public void ToString_ValueAsConstraintArgument_ShouldReturnConstraintProperty() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void ToString_DerivedImportDefinition_ShouldReturnOverriddenConstraintProperty() { var expectations = new ExpectationCollection>, string>(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/MetadataTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/MetadataTests.cs index b46e1a40af1ba4..69f410cc46f83e 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/MetadataTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/MetadataTests.cs @@ -169,7 +169,7 @@ public void ValidMetadataTest() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ValidMetadataDiscoveredByComponentCatalogTest() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -273,6 +273,7 @@ public class ClassWithInvalidDuplicateMetadataOnMember } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void InvalidDuplicateMetadataOnMember_ShouldThrow() { var part = AttributedModelServices.CreatePart(new ClassWithInvalidDuplicateMetadataOnMember()); @@ -319,6 +320,7 @@ public class ClassWithDuplicateMetadataOnMember } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ValidDuplicateMetadataOnMember_ShouldDiscoverAllMetadata() { var container = ContainerFactory.Create(); @@ -424,7 +426,7 @@ private static ImportDefinition CreateImportDefinition(Type type, string metadat #region Tests for strongly typed metadata as part of contract [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void SelectiveImportBySTMThroughComponentCatalog1() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -453,7 +455,7 @@ private static void SelectiveImportBySTMThroughCatalog2(CompositionContainer con } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void TestMultipleStronglyTypedAttributes() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -464,7 +466,7 @@ public void TestMultipleStronglyTypedAttributes() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void TestMultipleStronglyTypedAttributesAsIEnumerable() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -475,7 +477,7 @@ public void TestMultipleStronglyTypedAttributesAsIEnumerable() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void TestMultipleStronglyTypedAttributesAsArray() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); @@ -486,7 +488,7 @@ public void TestMultipleStronglyTypedAttributesAsArray() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void TestMultipleStronglyTypedAttributesWithInvalidType() { var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/MetadataViewProviderTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/MetadataViewProviderTests.cs index fe2ef1eb4ea2f9..8e3bea04518c32 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/MetadataViewProviderTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/MetadataViewProviderTests.cs @@ -93,6 +93,7 @@ public void GetMetadataView_InterfaceWithEvent_ShouldThrowNotSupportedException( } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/15169", TestRuntimes.Mono)] public void GetMetadataView_InterfaceWithIndexer_ShouldThrowNotSupportedException() { var metadata = new Dictionary(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxyTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxyTests.cs index 242fcb30a4f0de..2d3b0c20754099 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxyTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxyTests.cs @@ -20,7 +20,7 @@ public void Constructor_NullAsCatalogArgument_ShouldThrowArgumentNull() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void Constructor_ValueAsCatalogArgument_ShouldSetPartsProperty() { var expectations = Expectations.GetCatalogs(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/CompositionScopeDefinitionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/CompositionScopeDefinitionTests.cs index d5aa3170520afb..631b09737c3195 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/CompositionScopeDefinitionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/CompositionScopeDefinitionTests.cs @@ -133,6 +133,7 @@ public void Parts_DelegateToCatalog() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Constructor_PublicSurface() { var catalog = new TypeCatalog(typeof(FooImpl), typeof(FooImpl2), typeof(FooImpl2)); @@ -152,6 +153,7 @@ public void Constructor_PublicSurface_MultipleExportsPerPart() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExports_DelegateToCatalog() { var parts = new TypeCatalog(typeof(FooImpl), typeof(FooImpl2), typeof(FooImpl2)).Parts; @@ -214,6 +216,7 @@ public void Notifications() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Dispose() { var parts = new TypeCatalog(typeof(FooImpl), typeof(FooImpl2), typeof(FooImpl2)).Parts; @@ -250,6 +253,7 @@ public void Dispose() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SimpleComposition() { var catalog = new TypeCatalog(typeof(FooImpl), typeof(FooImpl2), typeof(FooImpl2)); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinitionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinitionTests.cs index a98d213c8fa58a..6f150baf1327f2 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinitionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinitionTests.cs @@ -235,7 +235,7 @@ public void ImportaAndExports_CreatorsShouldBeCalledLazilyAndOnce() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ICompositionElementDisplayName_ShouldReturnTypeDisplayName() { var expectations = Expectations.GetAttributedTypes(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartTests.cs index 8b90ffe7e6b239..828d2bb4bf5f3a 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartTests.cs @@ -16,7 +16,7 @@ namespace System.ComponentModel.Composition.ReflectionModel public class ReflectionComposablePartTests { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types.Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types.Retrieve the LoaderExceptions property for more information. public void Constructor1_DefinitionAsDefinitionArgument_ShouldSetOriginProperty() { var expectations = Expectations.GetAttributedDefinitions(); @@ -141,6 +141,7 @@ public void OnComposed_WhenDisposed_ShouldThrowObjectDisposed() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void OnComposed_MissingPostImportsOnInstance_ShouldThrowComposition() { var part = CreatePart(new MySharedPartExport()); @@ -153,6 +154,7 @@ public void OnComposed_MissingPostImportsOnInstance_ShouldThrowComposition() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void OnComposed_ProperlyComposed_ShouldSucceed() { var import = new TrivialImporter(); @@ -167,6 +169,7 @@ public void OnComposed_ProperlyComposed_ShouldSucceed() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void OnComposed_UnhandledExceptionThrowInOnImportsSatisfied_ShouldThrowComposablePart() { var part = CreatePart(typeof(ExceptionDuringINotifyImport)); @@ -180,6 +183,7 @@ public void OnComposed_UnhandledExceptionThrowInOnImportsSatisfied_ShouldThrowCo } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SetImport_WhenDisposed_ShouldThrowObjectDisposed() { var part = CreateDefaultDisposablePart(); @@ -205,6 +209,7 @@ public void SetImport_NullAsImportDefinitionArgument_ShouldThrowArgumentNull() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SetImport_NullAsExportsArgument_ShouldThrowArgumentNull() { var part = CreatePart(typeof(MySharedPartExport)); @@ -217,6 +222,7 @@ public void SetImport_NullAsExportsArgument_ShouldThrowArgumentNull() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SetImport_ExportsArrayWithNullElementAsExportsArgument_ShouldThrowArgument() { var part = CreatePart(typeof(MySharedPartExport)); @@ -242,6 +248,7 @@ public void SetImport_WrongDefinitionAsDefinitionArgument_ShouldThrowArgument() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SetImport_SetNonRecomposableDefinitionAsDefinitionArgumentAfterOnComposed_ShouldThrowInvalidOperation() { var part = CreatePartWithNonRecomposableImport(); @@ -257,6 +264,7 @@ public void SetImport_SetNonRecomposableDefinitionAsDefinitionArgumentAfterOnCom } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SetImport_ZeroOrOneDefinitionAsDefinitionArgumentAndTwoExportsAsExportsArgument_ShouldThrowArgument() { var part = CreatePartWithZeroOrOneImport(); @@ -271,6 +279,7 @@ public void SetImport_ZeroOrOneDefinitionAsDefinitionArgumentAndTwoExportsAsExpo } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SetImport_ExactlyOneDefinitionAsDefinitionArgumentAndTwoExportsAsExportsArgument_ShouldThrowArgument() { var part = CreatePartWithExactlyOneImport(); @@ -285,6 +294,7 @@ public void SetImport_ExactlyOneDefinitionAsDefinitionArgumentAndTwoExportsAsExp } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SetImport_ExactlyOneDefinitionAsDefinitionArgumentAndEmptyExportsAsExportsArgument_ShouldThrowArgument() { var part = CreatePartWithExactlyOneImport(); @@ -299,6 +309,7 @@ public void SetImport_ExactlyOneDefinitionAsDefinitionArgumentAndEmptyExportsAsE } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SetImport_WrongTypeExportGiven_ShouldThrowComposablePart() { var part = CreatePart(new MySharedPartExport()); @@ -311,6 +322,7 @@ public void SetImport_WrongTypeExportGiven_ShouldThrowComposablePart() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SetImport_SetPostValueAndSetAgainOnInstance_ShouldSetProperty() { var import = new MySharedPartExport(); @@ -334,6 +346,7 @@ public void SetImport_SetPostValueAndSetAgainOnInstance_ShouldSetProperty() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportedValue_WhenDisposed_ShouldThrowObjectDisposed() { var part = CreateDefaultDisposablePart(); @@ -371,6 +384,7 @@ public void GetExportedValue_WrongDefinitionAsDefinitionArgument_ShouldThrowArgu } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportedValue_MissingPrerequisiteImport_ShouldThrowInvalidOperation() { var part = CreatePart(typeof(SimpleConstructorInjectedObject)); @@ -409,6 +423,7 @@ public void GetExportedValue_UnhandledExceptionThrowInConstructor_ShouldThrowCom } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportedValue_GetObjectAfterSetPreImport_ShouldGetValue() { var part = CreatePart(typeof(SimpleConstructorInjectedObject)); @@ -425,6 +440,7 @@ public void GetExportedValue_GetObjectAfterSetPreImport_ShouldGetValue() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportedValue_GetObjectAfterSetPostImport_ShouldGetValue() { var part = CreatePart(typeof(MySharedPartExport)); @@ -442,6 +458,7 @@ public void GetExportedValue_GetObjectAfterSetPostImport_ShouldGetValue() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportedValue_CallMultipleTimes_ShouldReturnSame() { var part = CreatePart(typeof(MySharedPartExport)); @@ -471,6 +488,7 @@ public void GetExportedValue_FromStaticClass_ShouldReturnExport() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportedValue_OptionalPostNotGiven_ShouldReturnValidObject() { var part = CreatePart(typeof(ClassWithOptionalPostImport)); @@ -483,6 +501,7 @@ public void GetExportedValue_OptionalPostNotGiven_ShouldReturnValidObject() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportedValue_OptionalPreNotGiven_ShouldReturnValidObject() { var part = CreatePart(typeof(ClassWithOptionalPreImport)); @@ -495,7 +514,7 @@ public void GetExportedValue_OptionalPreNotGiven_ShouldReturnValidObject() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types.Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types.Retrieve the LoaderExceptions property for more information. public void ICompositionElementDisplayName_ShouldReturnTypeDisplayName() { var expectations = Expectations.GetAttributedTypes(); @@ -508,7 +527,7 @@ public void ICompositionElementDisplayName_ShouldReturnTypeDisplayName() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void ToString_ShouldReturnICompositionElementDisplayName() { var expectations = Expectations.GetAttributedTypes(); @@ -548,6 +567,7 @@ public class TypeExporter } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportedObjectAlwaysReturnsSameReference_ForProperty() { var cp = CreatePart(new PropertyExporter()); @@ -558,6 +578,7 @@ public void GetExportedObjectAlwaysReturnsSameReference_ForProperty() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportedObjectAlwaysReturnsSameReference_ForField() { var exporter = new FieldExporter(); @@ -628,6 +649,7 @@ void InvalidImport() { } } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportDefinitions_ImportWithCustomAttributeImports() { var part = CreatePart(typeof(ImportWithCustomImport)); @@ -661,6 +683,7 @@ void InvalidImportMany() { } } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportDefinitions_ImportManyWithCustomAttributeImportManys() { var part = CreatePart(typeof(ImportManyWithCustomImportMany)); @@ -729,6 +752,7 @@ void InvalidImportingConstructor() { } } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportDefinitions_ImportingConstructorWithCustomAttributeImportingConstructors() { var part = CreatePart(typeof(ImportingConstructorWithCustomImportingConstructor)); @@ -741,6 +765,7 @@ public void ImportDefinitions_ImportingConstructorWithCustomAttributeImportingCo } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportDefinitions_ImportingConstructorWithCustomAttributeImportingConstructorsWithAllowMultiple_ShouldNotThrowInvalidOperation() { var part = CreatePart(typeof(ImportingConstructorWithCustomImportingConstructorAllowMultiple)); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ScopeExportFactoryTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ScopeExportFactoryTests.cs index 15e8c016a89657..c2675ed408f8db 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ScopeExportFactoryTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ScopeExportFactoryTests.cs @@ -8,6 +8,7 @@ namespace System.ComponentModel.Composition { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class ScopeExportFactoryTests { public interface IFooContract @@ -269,6 +270,7 @@ public void ExportFactoryCausesRejectionBasedOnCardinality() } } + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class ScopeExportFactoryWithPublicSurface { [Export] public class ClassA { } @@ -311,6 +313,7 @@ public void FilteredScopeFactoryOfTM_ShouldSucceed() } } + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class ScopeFactoryAutoResolveFromAncestorScope { [Export] public class Root { } @@ -368,6 +371,7 @@ public void ScopeFactoryAutoResolveFromAncestorScopeShouldSucceed() } } + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class DeeplyNestedCatalog { [Export] @@ -446,6 +450,7 @@ public void DeeplyNestedCatalogOverlappedCatalog_ShouldWork() } } + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class LocalSharedNonLocalInSameContainer { [Export] @@ -542,6 +547,7 @@ public void LocalSharedNonLocalInSameContainer_ShouldSucceed() } } + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class ScopeBridgingAdaptersConstructorInjection { [Export] @@ -630,6 +636,7 @@ public void ScopeBridgingAdapters_ShouldSucceed() } } + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class ScopeBridgingAdaptersImportExportProperty { [Export] @@ -713,6 +720,7 @@ public void ScopeBridgingAdaptersImportExportProperty_ShouldSucceed() } } + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class SelfExportFromExportFactory { [Export] diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ScopedCompositionServicetests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ScopedCompositionServicetests.cs index d33b20462eb612..76d0efa06d755b 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ScopedCompositionServicetests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ScopedCompositionServicetests.cs @@ -8,6 +8,7 @@ namespace System.ComponentModel.Composition { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class ScopedCompositionServiceTests { [Export] diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/AdaptingCollectionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/AdaptingCollectionTests.cs index 6cd24c4e13ab95..45b6472c91db95 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/AdaptingCollectionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/AdaptingCollectionTests.cs @@ -155,6 +155,7 @@ public bool Remove(Lazy item) #endregion } + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class AdaptingCollectionTests { public interface IContract { } diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/CatalogFilteringTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/CatalogFilteringTests.cs index 516a6689d3ac96..f981f0dc8a9915 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/CatalogFilteringTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/CatalogFilteringTests.cs @@ -9,6 +9,7 @@ namespace System.ComponentModel.Composition { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class CatalogFilteringTests { [Fact] diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/CompositionContainerAttributedModelCycleTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/CompositionContainerAttributedModelCycleTests.cs index 73bf3e56db4481..58d58217ad99d9 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/CompositionContainerAttributedModelCycleTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/CompositionContainerAttributedModelCycleTests.cs @@ -30,6 +30,7 @@ public class CompositionContainerAttributedModelCycleTests // [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void APrerequisiteDependsOnBPrerequisite_ShouldThrowComposition() { AssertCycle(typeof(APrerequisiteDependsOnBPrerequisite), @@ -37,6 +38,7 @@ public void APrerequisiteDependsOnBPrerequisite_ShouldThrowComposition() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void APrerequisiteDependsOnBPost_ShouldThrowComposition() { AssertCycle(typeof(APrerequisiteDependsOnBPost), @@ -44,7 +46,7 @@ public void APrerequisiteDependsOnBPost_ShouldThrowComposition() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void APrerequisiteDependsOnBNone_ShouldNotThrow() { AssertNotCycle(typeof(APrerequisiteDependsOnBNone), @@ -52,6 +54,7 @@ public void APrerequisiteDependsOnBNone_ShouldNotThrow() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void APostDependsOnBPrerequisite_ShouldThrowComposition() { AssertCycle(typeof(APostDependsOnBPrerequisite), @@ -59,7 +62,7 @@ public void APostDependsOnBPrerequisite_ShouldThrowComposition() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void APostDependsOnBPost_ShouldNotThrow() { AssertNotCycle(typeof(APostDependsOnBPost), @@ -67,7 +70,7 @@ public void APostDependsOnBPost_ShouldNotThrow() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void APostDependsOnBNone_ShouldNotThrow() { AssertNotCycle(typeof(APostDependsOnBNone), @@ -75,7 +78,7 @@ public void APostDependsOnBNone_ShouldNotThrow() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void BPrerequisiteDependsOnANone_ShouldNotThrow() { AssertNotCycle(typeof(ANone), @@ -83,7 +86,7 @@ public void BPrerequisiteDependsOnANone_ShouldNotThrow() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void BPostDependsOnANone_ShouldNotThrow() { AssertNotCycle(typeof(ANone), @@ -91,7 +94,7 @@ public void BPostDependsOnANone_ShouldNotThrow() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void ANoneWithBNone_ShouldNotThrow() { AssertNotCycle(typeof(ANone), @@ -99,7 +102,7 @@ public void ANoneWithBNone_ShouldNotThrow() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void PartWithHasPrerequisteImportThatIsInAPostCycle_ShouldNotThrow() { AssertNotCycle(typeof(PartWithHasPrerequisteImportThatIsInAPostCycle) diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/ConstructorInjectionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/ConstructorInjectionTests.cs index e4afd108a306a0..9e42da871fbf6a 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/ConstructorInjectionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/ConstructorInjectionTests.cs @@ -13,6 +13,7 @@ namespace Tests.Integration public class ConstructorInjectionTests { [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SimpleConstructorInjection() { var container = ContainerFactory.Create(); @@ -47,7 +48,7 @@ public AWithOptionalParameter([Import(AllowDefault = true)]IOptionalRef import, } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // Actual: typeof(System.Reflection.ReflectionTypeLoadException): Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // Actual: typeof(System.Reflection.ReflectionTypeLoadException): Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void OptionalConstructorArgument() { var container = GetContainerWithCatalog(); @@ -72,7 +73,7 @@ public AWithCollectionArgument([ImportMany("MyConstructorCollectionItem")]IEnume } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // Actual: typeof(System.Reflection.ReflectionTypeLoadException): Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // Actual: typeof(System.Reflection.ReflectionTypeLoadException): Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void RebindingShouldNotHappenForConstructorArguments() { var container = GetContainerWithCatalog(); @@ -124,7 +125,7 @@ public void MissingConstructorArgsWithAlreadyCreatedInstance() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // Actual: typeof(System.Reflection.ReflectionTypeLoadException): Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // Actual: typeof(System.Reflection.ReflectionTypeLoadException): Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void MissingConstructorArgsWithTypeFromCatalogMissingArg() { var container = GetContainerWithCatalog(); @@ -139,7 +140,7 @@ public void MissingConstructorArgsWithTypeFromCatalogMissingArg() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498", TestPlatforms.AnyUnix)] // Actual: typeof(System.Reflection.ReflectionTypeLoadException): Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240", TestPlatforms.AnyUnix)] // Actual: typeof(System.Reflection.ReflectionTypeLoadException): Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. public void MissingConstructorArgsWithWithTypeFromCatalogWithArg() { var container = GetContainerWithCatalog(); @@ -177,6 +178,7 @@ public InvalidImportManyCI( } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ImportMany_ConstructorParameter_OnNonAssiganbleType_ShouldThrowCompositionException() { var container = ContainerFactory.CreateWithAttributedCatalog(typeof(InvalidImportManyCI)); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DelayLoadingTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DelayLoadingTests.cs index 3bc754a234c1cb..57d9d24e1de631 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DelayLoadingTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DelayLoadingTests.cs @@ -14,6 +14,7 @@ namespace Tests.Integration { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class DelayLoadingTests { [Fact] diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DelegateCompositionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DelegateCompositionTests.cs index 7bd54f8be79c71..54f76515302b24 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DelegateCompositionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DelegateCompositionTests.cs @@ -175,6 +175,7 @@ public class ImportCustomExportedDelegates } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void CustomExportedDelegate_ShouldWork() { var container = ContainerFactory.CreateWithAttributedCatalog( diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DiscoveryTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DiscoveryTests.cs index fec0fb4cca21d0..07c977a5e7e18c 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DiscoveryTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/DiscoveryTests.cs @@ -72,6 +72,7 @@ public class DerivedBaseWithNonPublicImportAndExport : BaseWithNonPublicImportAn } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Import_PrivateOnClass_ShouldSetImport() { var container = ContainerFactory.CreateWithAttributedCatalog(typeof(BaseWithNonPublicImportAndExport)); @@ -82,6 +83,7 @@ public void Import_PrivateOnClass_ShouldSetImport() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Import_PrivateOnBase_ShouldSetImport() { var container = ContainerFactory.CreateWithAttributedCatalog(typeof(DerivedBaseWithNonPublicImportAndExport)); @@ -120,6 +122,7 @@ public class ClassWithInterfaceInheritedImport : InterfaceWithImport } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Import_InheritImportFromInterface_ShouldExposeImport() { var container = ContainerFactory.CreateWithAttributedCatalog( @@ -168,6 +171,7 @@ public class DerivedWithOverrideExport : BaseWithVirtualExport } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Export_BaseAndDerivedShouldAmountInTwoExports() { var container = ContainerFactory.CreateWithAttributedCatalog( @@ -303,6 +307,7 @@ public class Plugin1 : Plugin } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Export_Plugin1() { var container = ContainerFactory.CreateWithAttributedCatalog( @@ -327,6 +332,7 @@ public override int Version } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Export_Plugin2() { var container = ContainerFactory.CreateWithAttributedCatalog( @@ -354,6 +360,7 @@ public override int Version } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Export_Plugin3() { var container = ContainerFactory.CreateWithAttributedCatalog( @@ -386,6 +393,7 @@ public override int Version } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Export_Plugin4() { var container = ContainerFactory.CreateWithAttributedCatalog( @@ -406,6 +414,7 @@ public class MyPlugin : IPlugin } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Export_MyPlugin() { var container = ContainerFactory.CreateWithAttributedCatalog( @@ -441,6 +450,7 @@ public class MyToolbarPlugin : IToolbarPlugin } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void TestInterfaces() { var container = ContainerFactory.CreateWithAttributedCatalog( @@ -499,6 +509,7 @@ public override int VirtualImport } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Import_VirtualPropertyOverrideWithSameContract_ShouldSucceed() { var container = ContainerFactory.Create(); @@ -530,6 +541,7 @@ public override int VirtualImport } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Import_VirtualPropertyOverrideWithDifferentContract_ShouldSucceed() { var container = ContainerFactory.Create(); @@ -657,6 +669,7 @@ public void Shutdown() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void DiscoverAddinsWithCombinedCustomExportAndMetadataAttribute() { var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Addin1), typeof(Addin2), typeof(Addin3)); @@ -715,6 +728,7 @@ public int Property } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Test_CustomInheritedExportAttribute_OnInterface() { var container = ContainerFactory.CreateWithAttributedCatalog(typeof(UsesCustomInheritedExportOnInterface)); @@ -737,6 +751,7 @@ public DerivedFromBaseWithCustomInheritedExport() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void Test_CustomInheritedExportAttribute_OnBaseClass() { var container = ContainerFactory.CreateWithAttributedCatalog(typeof(DerivedFromBaseWithCustomInheritedExport)); @@ -820,7 +835,7 @@ public interface IFoo3 : IFoo1 { } public class FooWithInterfaceWithMultipleFoos : IFoo3 { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void InheritedExport_InterfaceHiearchy() { var container = ContainerFactory.CreateWithAttributedCatalog(typeof(FooWithInterfaceWithMultipleFoos)); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/LifetimeTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/LifetimeTests.cs index b16921ec3b958f..714347fef1fc13 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/LifetimeTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/LifetimeTests.cs @@ -55,6 +55,7 @@ public void Dispose() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PartAddedViaAddExportedValue_ShouldNotBeDisposedWithContainer() { var container = new CompositionContainer(); @@ -68,6 +69,7 @@ public void PartAddedViaAddExportedValue_ShouldNotBeDisposedWithContainer() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void PartAddedTwice_AppearsTwice() { // You probably shouldn't be adding a part to the container twice, but it's not something we're going to check for and throw an exception on @@ -105,6 +107,7 @@ public void AnyPart_Simple_ShouldNotBeCollected() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void AnyPart_Disposable_ShouldNotBeCollected() { var catalog = new TypeCatalog(typeof(AnyPartDisposable)); @@ -119,6 +122,7 @@ public void AnyPart_Disposable_ShouldNotBeCollected() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void AnyPart_Disposable_ShouldBeDisposedWithContainer() { var catalog = new TypeCatalog(typeof(AnyPartDisposable)); @@ -134,6 +138,7 @@ public void AnyPart_Disposable_ShouldBeDisposedWithContainer() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void AnyPart_RecomposabeImport_ShouldNotBeCollected() { var catalog = new TypeCatalog(typeof(AnyPartRecomposable)); @@ -165,6 +170,7 @@ public void AnyPart_RecomposabeImport_ShouldNotBeCollected() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void AnyPart_DisposableRecomposabeImport_ShouldNotBeCollected() { var catalog = new TypeCatalog(typeof(AnyPartDisposableRecomposable)); @@ -259,6 +265,7 @@ public void SharedPart_Simple_ShouldNotBeCollected() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SharedPart_Disposable_ShouldNotBeCollected() { var catalog = new TypeCatalog(typeof(SharedPartDisposable)); @@ -275,6 +282,7 @@ public void SharedPart_Disposable_ShouldNotBeCollected() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SharedPart_Disposable_ShouldBeDisposedWithContainer() { var catalog = new TypeCatalog(typeof(SharedPartDisposable)); @@ -290,6 +298,7 @@ public void SharedPart_Disposable_ShouldBeDisposedWithContainer() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SharedPart_RecomposabeImport_ShouldNotBeCollected() { var catalog = new TypeCatalog(typeof(SharedPartRecomposable)); @@ -322,6 +331,7 @@ public void SharedPart_RecomposabeImport_ShouldNotBeCollected() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void SharedPart_DisposableRecomposabeImport_ShouldNotBeCollected() { var catalog = new TypeCatalog(typeof(SharedPartDisposableRecomposable)); @@ -414,6 +424,7 @@ public void Dispose() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void NonSharedPart_Disposable_ShouldNotBeCollected() { var catalog = new TypeCatalog(typeof(NonSharedPartDisposable)); @@ -430,6 +441,7 @@ public void NonSharedPart_Disposable_ShouldNotBeCollected() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void NonSharedPart_Disposable_ShouldBeDisposedWithContainer() { var catalog = new TypeCatalog(typeof(NonSharedPartDisposable)); @@ -445,6 +457,7 @@ public void NonSharedPart_Disposable_ShouldBeDisposedWithContainer() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void NonSharedPart_RecomposableImport_WithReference_ShouldNotBeCollected() { var catalog = new TypeCatalog(typeof(NonSharedPartRecomposable)); @@ -477,6 +490,7 @@ public void NonSharedPart_RecomposableImport_WithReference_ShouldNotBeCollected( } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void NonSharedPart_DisposableRecomposabeImport_NoReference_ShouldNotBeCollected() { var catalog = new TypeCatalog(typeof(NonSharedPartDisposableRecomposable)); @@ -531,6 +545,7 @@ public class NonSharedState } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void NonSharedPart_TwoRecomposablePartsSameExportedValue() { // This test is primarily used to ensure that we allow for multiple parts to be associated @@ -590,6 +605,7 @@ private static CompositionContainer GetContainer() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetReleaseExport_SharedRoot_ShouldNotDisposeChain() { var container = GetContainer(); @@ -604,6 +620,7 @@ public void GetReleaseExport_SharedRoot_ShouldNotDisposeChain() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void AddRemovePart_SharedRoot_ShouldNotDisposeChain() { var container = GetContainer(); @@ -623,6 +640,7 @@ public void AddRemovePart_SharedRoot_ShouldNotDisposeChain() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ContainerDispose_SharedRoot_ShouldDisposeChain() { var container = GetContainer(); @@ -637,6 +655,7 @@ public void ContainerDispose_SharedRoot_ShouldDisposeChain() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetReleaseExport_NonSharedRoot_ShouldDisposeChain() { var container = GetContainer(); @@ -667,6 +686,7 @@ public void GetReleaseExport_NonSharedRoot_ShouldDisposeChain() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetReleaseExport_NonSharedRoot_ShouldDisposeChain_WithMetadata() { var container = GetContainer(); @@ -697,6 +717,7 @@ public void GetReleaseExport_NonSharedRoot_ShouldDisposeChain_WithMetadata() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ReleaseExports_ShouldDispose_NonSharedParts() { var container = GetContainer(); @@ -717,6 +738,7 @@ public void ReleaseExports_ShouldDispose_NonSharedParts() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void AddRemovePart_NonSharedRoot_ShouldDisposeChain() { var container = GetContainer(); @@ -736,6 +758,7 @@ public void AddRemovePart_NonSharedRoot_ShouldDisposeChain() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ContainerDispose_NonSharedRoot_ShouldNotDisposeChain() { var container = GetContainer(); @@ -750,6 +773,7 @@ public void ContainerDispose_NonSharedRoot_ShouldNotDisposeChain() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetReleaseExport_NonSharedPart_ShouldNotRecomposeAfterRelease() { var catalog = new TypeCatalog(typeof(NonSharedPartRecomposable)); @@ -777,6 +801,7 @@ public void GetReleaseExport_NonSharedPart_ShouldNotRecomposeAfterRelease() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void GetExportManualDisposeThenRecompose_NonSharedDisposableRecomposablePart_ShouldThrowComposition() { var catalog = new TypeCatalog(typeof(NonSharedPartDisposableRecomposable)); @@ -817,6 +842,7 @@ public class MyImporter } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void RecomposeCausesOldImportedValuesToBeDisposed() { var cat = new AggregateCatalog(); @@ -859,6 +885,7 @@ private static CompositionContainer CreateParentChildContainerWithNonSharedImpor } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ChildContainerGetReleaseExport_NonSharedRoot_ShouldDisposeChain() { var child = CreateParentChildContainerWithNonSharedImporter(); @@ -873,6 +900,7 @@ public void ChildContainerGetReleaseExport_NonSharedRoot_ShouldDisposeChain() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ChildContainerAddRemovePart_NonSharedRoot_ShouldDisposeChain() { var child = CreateParentChildContainerWithNonSharedImporter(); @@ -892,6 +920,7 @@ public void ChildContainerAddRemovePart_NonSharedRoot_ShouldDisposeChain() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ChildContainerAddRemovePart_NonSharedRoot_ShouldNotDisposeChain() { var child = CreateParentChildContainerWithNonSharedImporter(); @@ -905,7 +934,7 @@ public void ChildContainerAddRemovePart_NonSharedRoot_ShouldNotDisposeChain() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void NonSharedPart_Simple_ShouldBeCollected() { var catalog = new TypeCatalog(typeof(NonSharedPartSimple)); @@ -922,7 +951,7 @@ public void NonSharedPart_Simple_ShouldBeCollected() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void ContainerDispose_SharedPart_ShouldCollectWholeObjectChain() { // Test only works properly with while using the real ConditionalWeakTable @@ -951,7 +980,7 @@ public void ContainerDispose_SharedPart_ShouldCollectWholeObjectChain() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void AddRemovePart_SharedPart_ShouldCollectOnlyRoot() { var container = GetContainer(); @@ -988,7 +1017,7 @@ public void AddRemovePart_SharedPart_ShouldCollectOnlyRoot() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void AddRemovePart_NonSharedPart_ShouldCollectWholeObjectChain() { var container = GetContainer(); @@ -1023,7 +1052,7 @@ public void AddRemovePart_NonSharedPart_ShouldCollectWholeObjectChain() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void ContainerDispose_NonSharedPart_ShouldCollectWholeObjectChain() { // Test only works properly with while using the real ConditionalWeakTable @@ -1052,7 +1081,7 @@ public void ContainerDispose_NonSharedPart_ShouldCollectWholeObjectChain() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void NonSharedImporter_ReleaseReference_ShouldCollectWholeChain() { var container = GetContainer(); @@ -1082,7 +1111,7 @@ public void NonSharedImporter_ReleaseReference_ShouldCollectWholeChain() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void ChildContainerDispose_NonSharedPart_ShouldOnlyCleanupChildAndSimpleNonShared() { var child = CreateParentChildContainerWithNonSharedImporter(); @@ -1111,7 +1140,7 @@ public void ChildContainerDispose_NonSharedPart_ShouldOnlyCleanupChildAndSimpleN } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void ChildContainerGetReleaseExport_NonSharedPart_ShouldCollectWholeObjectChain() { var child = CreateParentChildContainerWithNonSharedImporter(); @@ -1139,7 +1168,7 @@ public void ChildContainerGetReleaseExport_NonSharedPart_ShouldCollectWholeObjec } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void NonSharedPart_RecomposableImport_NoReference_ShouldBeCollected() { var catalog = new TypeCatalog(typeof(NonSharedPartRecomposable)); @@ -1169,7 +1198,7 @@ public void NonSharedPart_RecomposableImport_NoReference_ShouldBeCollected() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void ChildContainerAddRemovePart_NonSharedPart_ShouldCollectWholeObjectChain() { var child = CreateParentChildContainerWithNonSharedImporter(); @@ -1204,7 +1233,7 @@ public void ChildContainerAddRemovePart_NonSharedPart_ShouldCollectWholeObjectCh } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void GetReleaseExport_SharedPart_ShouldCollectOnlyRoot() { var container = GetContainer(); @@ -1234,7 +1263,7 @@ public void GetReleaseExport_SharedPart_ShouldCollectOnlyRoot() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25498")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24240")] public void GetReleaseExport_NonSharedPart_ShouldCollectWholeObjectChain() { var container = GetContainer(); @@ -1262,6 +1291,7 @@ public void GetReleaseExport_NonSharedPart_ShouldCollectWholeObjectChain() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public void ReleaseExports_ShouldWorkWithExportCollection() { var container = GetContainer(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RecompositionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RecompositionTests.cs index 6e7b4812366ca8..7455e6af70bd99 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RecompositionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RecompositionTests.cs @@ -11,6 +11,7 @@ namespace Tests.Integration { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class RecompositionTests { public class Class_OptIn_AllowRecompositionImports diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RejectionTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RejectionTests.cs index 51d84c355e62b2..76690fbb07770d 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RejectionTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RejectionTests.cs @@ -12,6 +12,7 @@ namespace Tests.Integration { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class RejectionTests { public interface IExtension diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RequiredCreationPolicyTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RequiredCreationPolicyTests.cs index 74505c8891f03a..82801b0855efaa 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RequiredCreationPolicyTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/Integration/RequiredCreationPolicyTests.cs @@ -12,6 +12,7 @@ namespace Tests.Integration { + [ActiveIssue("https://github.com/mono/mono/issues/16417", TestRuntimes.Mono)] public class RequiredCreationPolicyTests { // Matrix that details which policy to use for a given part to satisfy a given import. diff --git a/src/libraries/System.ComponentModel.EventBasedAsync/ref/System.ComponentModel.EventBasedAsync.cs b/src/libraries/System.ComponentModel.EventBasedAsync/ref/System.ComponentModel.EventBasedAsync.cs index e84d180041c366..fac1fa73e226d6 100644 --- a/src/libraries/System.ComponentModel.EventBasedAsync/ref/System.ComponentModel.EventBasedAsync.cs +++ b/src/libraries/System.ComponentModel.EventBasedAsync/ref/System.ComponentModel.EventBasedAsync.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.ComponentModel diff --git a/src/libraries/System.ComponentModel.Primitives/ref/System.ComponentModel.Primitives.cs b/src/libraries/System.ComponentModel.Primitives/ref/System.ComponentModel.Primitives.cs index 9ae724327f0185..3047b2ef95b76f 100644 --- a/src/libraries/System.ComponentModel.Primitives/ref/System.ComponentModel.Primitives.cs +++ b/src/libraries/System.ComponentModel.Primitives/ref/System.ComponentModel.Primitives.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.ComponentModel diff --git a/src/libraries/System.ComponentModel.Primitives/src/FxCopBaseline.cs b/src/libraries/System.ComponentModel.Primitives/src/FxCopBaseline.cs deleted file mode 100644 index 4175d277014aa4..00000000000000 --- a/src/libraries/System.ComponentModel.Primitives/src/FxCopBaseline.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ComponentModel.Component.#Dispose(System.Boolean)")] diff --git a/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj b/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj index 78bc218a4526cf..53e44fa05eac16 100644 --- a/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj +++ b/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj @@ -34,9 +34,6 @@ - - - diff --git a/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.Forwards.cs b/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.Forwards.cs index f83931be49f778..7956fdf7552726 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.Forwards.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.InvalidAsynchronousStateException))] diff --git a/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs index bb5e41bd721651..4d680373e3430b 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AmbientValueAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AmbientValueAttribute.cs index 9f265671bc251c..b68c4666a1b40f 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AmbientValueAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AmbientValueAttribute.cs @@ -10,7 +10,6 @@ namespace System.ComponentModel /// Specifies the ambient value for a property. The ambient value is the value you /// can set into a property to make it inherit its ambient. /// - [SuppressMessage("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments")] [AttributeUsage(AttributeTargets.All)] public sealed class AmbientValueAttribute : Attribute { diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs index 5ee2e185d516b8..d7671a15bfa15f 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs @@ -6,8 +6,6 @@ using System.Collections; using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Security", "CA2112:SecuredTypesShouldNotExposeFields", Scope = "type", Target = "System.ComponentModel.AttributeCollection")] - namespace System.ComponentModel { /// @@ -121,7 +119,6 @@ public static AttributeCollection FromExisting(AttributeCollection existing, par /// /// Gets the attributes collection. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Matches constructor input type")] protected virtual Attribute[] Attributes => _attributes; /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeProviderAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeProviderAttribute.cs index d1c8cf7c7927e6..f6124b19dc91be 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeProviderAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeProviderAttribute.cs @@ -6,7 +6,6 @@ namespace System.ComponentModel { - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Property)] public class AttributeProviderAttribute : Attribute { diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/BindingList.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/BindingList.cs index e299b2791f765b..8af3871637bc5a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/BindingList.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/BindingList.cs @@ -9,8 +9,6 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -[assembly: SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "System.ComponentModel.BindingList`1")] - namespace System.ComponentModel { [Serializable] @@ -305,7 +303,6 @@ object IBindingList.AddNew() /// supply a custom item to add to the list. Otherwise an item of type T is created. /// The new item is then added to the end of the list. /// - [SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods")] protected virtual object AddNewCore() { // Allow event handler to supply the new item for us diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerOptionService.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerOptionService.cs index 599153fe0317ff..f80f2c00babdd0 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerOptionService.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerOptionService.cs @@ -225,7 +225,6 @@ public PropertyDescriptorCollection Properties /// public DesignerOptionCollection this[int index] { - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")] get { EnsurePopulated(); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerVerb.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerVerb.cs index 8751c702ab4d14..297cbc32fee891 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerVerb.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerVerb.cs @@ -15,7 +15,6 @@ public class DesignerVerb : MenuCommand /// /// Initializes a new instance of the class. /// - [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public DesignerVerb(string text, EventHandler handler) : base(handler, StandardCommands.VerbFirst) { Properties["Text"] = text == null ? null : Regex.Replace(text, @"\(\&.\)", ""); @@ -25,7 +24,6 @@ public DesignerVerb(string text, EventHandler handler) : base(handler, StandardC /// Initializes a new instance of the /// class. /// - [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public DesignerVerb(string text, EventHandler handler, CommandID startCommandID) : base(handler, startCommandID) { Properties["Text"] = text == null ? null : Regex.Replace(text, @"\(\&.\)", ""); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContext.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContext.cs index 629b85a0d8d45e..58ba383de3e7bc 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContext.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContext.cs @@ -99,7 +99,7 @@ public override string GetSavedLicenseKey(Type type, Assembly resourceAssembly) if (s != null) { - DesigntimeLicenseContextSerializer.Deserialize(s, fileName.ToUpper(CultureInfo.InvariantCulture), this); + DesigntimeLicenseContextSerializer.Deserialize(s, fileName.ToUpperInvariant(), this); break; } } @@ -140,7 +140,7 @@ public override string GetSavedLicenseKey(Type type, Assembly resourceAssembly) } if (s != null) { - DesigntimeLicenseContextSerializer.Deserialize(s, fileName.ToUpper(CultureInfo.InvariantCulture), this); + DesigntimeLicenseContextSerializer.Deserialize(s, fileName.ToUpperInvariant(), this); } } } diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs index ff50426fbeffc5..82a1f3bd8fe8ce 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs @@ -30,7 +30,6 @@ public static void Serialize(Stream o, string cryptoKey, DesigntimeLicenseContex formatter.Serialize(o, new object[] { cryptoKey, context._savedLicenseKeys }); } - [SuppressMessage("Microsoft.Security", "CA2107:ReviewDenyAndPermitOnlyUsage")] // Use of PermitOnly here is appropriate. internal static void Deserialize(Stream o, string cryptoKey, RuntimeLicenseContext context) { IFormatter formatter = new BinaryFormatter(); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/MenuCommand.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/MenuCommand.cs index 9f16502f83c300..77b3e5da270871 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/MenuCommand.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/MenuCommand.cs @@ -157,7 +157,6 @@ public virtual void Invoke() /// Provides notification and is called in response to /// a event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers")] // Safe: FullTrust LinkDemand to instantiate an object of this class. protected virtual void OnCommandChanged(EventArgs e) => CommandChanged?.Invoke(this, e); /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/PropertyTabAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/PropertyTabAttribute.cs index a85b08a76d28f5..6d0860e3d96152 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/PropertyTabAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/PropertyTabAttribute.cs @@ -5,8 +5,6 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; -[assembly: SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods", Scope = "member", Target = "System.ComponentModel.PropertyTabAttribute.get_TabClasses():System.Type[]")] - namespace System.ComponentModel { /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/Serialization/MemberRelationshipService.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/Serialization/MemberRelationshipService.cs index 3ea1facf0684ab..c5bceb6e9d450a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/Serialization/MemberRelationshipService.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/Serialization/MemberRelationshipService.cs @@ -35,7 +35,6 @@ public abstract class MemberRelationshipService /// can also be passed as the property value, in which case the relationship will /// be cleared. /// - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] public MemberRelationship this[MemberRelationship source] { get @@ -71,7 +70,6 @@ public MemberRelationship this[MemberRelationship source] /// Also sets a relationship between two objects. Null can be passed as the property value, in which /// case the relationship will be cleared. /// - [SuppressMessage("Microsoft.Design", "CA1023:IndexersShouldNotBeMultidimensional")] public MemberRelationship this[object sourceOwner, MemberDescriptor sourceMember] { get diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs index ee6b5fea0ad19c..49249ceed18dba 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs @@ -7,8 +7,6 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Security", "CA2112:SecuredTypesShouldNotExposeFields", Scope = "type", Target = "System.ComponentModel.EventDescriptorCollection")] - namespace System.ComponentModel { /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingList.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingList.cs index dab1d1938ca6a4..106ae55d13f1f0 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingList.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingList.cs @@ -5,8 +5,6 @@ using System.Collections; using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "System.ComponentModel.IBindingList")] - namespace System.ComponentModel { public interface IBindingList : IList diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingListView.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingListView.cs index 79031f8debce70..71e99da62c89dd 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingListView.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingListView.cs @@ -6,7 +6,6 @@ namespace System.ComponentModel { - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] public interface IBindingListView : IBindingList { void ApplySort(ListSortDescriptionCollection sorts); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IIntellisenseBuilder.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IIntellisenseBuilder.cs index 85c0407ed2c482..9b804c646a5013 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IIntellisenseBuilder.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IIntellisenseBuilder.cs @@ -21,7 +21,6 @@ public interface IIntellisenseBuilder /// value - expression being edited /// newValue - return the new value /// - [SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")] bool Show(string language, string value, ref string newValue); } } diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InstallerTypeAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InstallerTypeAttribute.cs index ba482a87eadeaa..61edcc5982efd3 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InstallerTypeAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InstallerTypeAttribute.cs @@ -4,8 +4,6 @@ using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods", Scope = "member", Target = "System.ComponentModel.InstallerTypeAttribute.get_InstallerType():System.Type")] - namespace System.ComponentModel { /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InterlockedBitVector32.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InterlockedBitVector32.cs index 815cc96f112b22..11cd3a0cf71fc4 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InterlockedBitVector32.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InterlockedBitVector32.cs @@ -20,14 +20,13 @@ public bool this[int bit] get => (Volatile.Read(ref _data) & bit) == bit; set { - while (true) + if (value) { - int oldValue = _data; - int newValue = value ? oldValue | bit : oldValue &= ~bit; - if (Interlocked.CompareExchange(ref _data, newValue, oldValue) == oldValue) - { - break; - } + Interlocked.Or(ref _data, bit); + } + else + { + Interlocked.And(ref _data, ~bit); } } } diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseException.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseException.cs index de6c1692ec7fdc..c027d8f52196d2 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseException.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseException.cs @@ -13,7 +13,6 @@ namespace System.ComponentModel /// [Serializable] [TypeForwardedFrom("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] - [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")] // must not, a Type is required in all constructors. public class LicenseException : SystemException { private const int LicenseHResult = unchecked((int)0x80131901); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseProviderAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseProviderAttribute.cs index 18631cf320a087..de1b27431ec30a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseProviderAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseProviderAttribute.cs @@ -52,7 +52,6 @@ public LicenseProviderAttribute(Type type) /// public Type LicenseProvider { - [SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods")] get { if (_licenseProviderType == null && _licenseProviderName != null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ListChangedEventArgs.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ListChangedEventArgs.cs index 33669a24e1639c..7d1a3a4d3132ac 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ListChangedEventArgs.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ListChangedEventArgs.cs @@ -5,9 +5,6 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.ComponentModel.ListChangedEventArgs..ctor(System.ComponentModel.ListChangedType,System.Int32,System.ComponentModel.PropertyDescriptor)")] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.ComponentModel.ListChangedEventArgs..ctor(System.ComponentModel.ListChangedType,System.ComponentModel.PropertyDescriptor)")] - namespace System.ComponentModel { public class ListChangedEventArgs : EventArgs diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MarshalByValueComponent.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MarshalByValueComponent.cs index 5149b75f0efe95..5538f600a60858 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MarshalByValueComponent.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MarshalByValueComponent.cs @@ -60,7 +60,6 @@ public virtual ISite Site /// /// Disposes of the resources (other than memory) used by the component. /// - [SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed")] public void Dispose() { Dispose(true); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs index bdfdfaac32ad6d..f60ac9f532d6d0 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs @@ -468,7 +468,6 @@ private void Initialize() /// Derived classes can override this method and call base.Clone to get proper cloning semantics but must /// implement the full-parameter constructor (passing parameters to the base constructor as well). /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods")] public object Clone() { MaskedTextProvider clonedProvider; @@ -1177,7 +1176,6 @@ public int FindUnassignedEditPositionFrom(int position, bool direction) /// from the specified position included. /// Returns InvalidIndex if it doesn't find one. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow")] public int FindUnassignedEditPositionInRange(int startPosition, int endPosition, bool direction) { int position; diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MultilineStringConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MultilineStringConverter.cs index cb3d17a2dc459a..4bcf0ac15dec6f 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MultilineStringConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MultilineStringConverter.cs @@ -9,7 +9,6 @@ namespace System.ComponentModel /// /// Provides a type converter to convert multiline strings to a simple string. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public class MultilineStringConverter : TypeConverter { /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs index ca110bf65b1186..e0128a7c28f68d 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs @@ -378,7 +378,6 @@ protected Type GetTypeFromName(string typeName) /// This should be called by your property descriptor implementation /// when the property value has changed. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers")] protected virtual void OnValueChanged(object component, EventArgs e) { if (component != null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs index 1479542b17d63f..2a2d2a319dd9d1 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs @@ -7,11 +7,6 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "member", Target = "System.ComponentModel.PropertyDescriptorCollection.System.Collections.IDictionary.Add(System.Object,System.Object):System.Void")] -[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "member", Target = "System.ComponentModel.PropertyDescriptorCollection.System.Collections.IList.set_Item(System.Int32,System.Object):System.Void")] -[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "member", Target = "System.ComponentModel.PropertyDescriptorCollection.System.Collections.IDictionary.set_Item(System.Object,System.Object):System.Void")] -[assembly: SuppressMessage("Microsoft.Security", "CA2112:SecuredTypesShouldNotExposeFields", Scope = "type", Target = "System.ComponentModel.PropertyDescriptorCollection")] - namespace System.ComponentModel { /// @@ -22,7 +17,6 @@ public class PropertyDescriptorCollection : ICollection, IList, IDictionary /// /// An empty PropertyDescriptorCollection that can used instead of creating a new one with no items. /// - [SuppressMessage("Microsoft.Security", "CA2112:SecuredTypesShouldNotExposeFields")] public static readonly PropertyDescriptorCollection Empty = new PropertyDescriptorCollection(null, true); private IDictionary _cachedFoundProperties; diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/SyntaxCheck.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/SyntaxCheck.cs index c0ed8f443e495f..f2e4bce1ab01bb 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/SyntaxCheck.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/SyntaxCheck.cs @@ -36,12 +36,12 @@ public static bool CheckPath(string value) if (value == null) return false; - value = value.Trim(); + value = value.TrimStart(); if (value.Equals(string.Empty)) return false; // Path names should start with "\\" - return value.StartsWith("\\\\"); + return value.StartsWith("\\\\", StringComparison.Ordinal); } /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ToolboxItemAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ToolboxItemAttribute.cs index 588729c5741e77..28cb56fa0a9a2a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ToolboxItemAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ToolboxItemAttribute.cs @@ -4,8 +4,6 @@ using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods", Scope = "member", Target = "System.ComponentModel.ToolboxItemAttribute.get_ToolboxItemType():System.Type")] - namespace System.ComponentModel { /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeConverter.cs index 046d5fd9984405..ed746442c1f77a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeConverter.cs @@ -146,7 +146,6 @@ public string ConvertToInvariantString(object value) /// /// Converts the specified value to a culture-invariant string representation. /// - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] public string ConvertToInvariantString(ITypeDescriptorContext context, object value) { return ConvertToString(context, CultureInfo.InvariantCulture, value); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs index b63ab0d5ef335b..6d91d412d2ce76 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs @@ -2598,8 +2598,6 @@ internal ComNativeDescriptionProvider(IComNativeDescriptorHandler handler) /// Implements GetTypeDescriptor. This creates a custom type /// descriptor that walks the linked list for each of its calls. /// - - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")] public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) { if (objectType == null) @@ -3163,7 +3161,6 @@ public override Type GetRuntimeType(Type objectType) /// Implements GetTypeDescriptor. This creates a custom type /// descriptor that walks the linked list for each of its calls. /// - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")] public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) { if (objectType == null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/ColorConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/ColorConverter.cs index a9d727b046116c..2a83103ed8384b 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/ColorConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/ColorConverter.cs @@ -36,7 +36,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs index 5197af31bd4501..55a9cf179060d5 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs @@ -23,7 +23,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) @@ -103,8 +102,6 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul return base.ConvertTo(context, culture, value, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues) { if (propertyValues == null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs index 6dd107f7dc9766..54c099eeb743b7 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs @@ -23,7 +23,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) @@ -41,7 +40,7 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c } char sep = culture.TextInfo.ListSeparator[0]; - string[] tokens = text.Split(new char[] { sep }); + string[] tokens = text.Split(sep); int[] values = new int[tokens.Length]; TypeConverter intConverter = TypeDescriptor.GetConverter(typeof(int)); for (int i = 0; i < values.Length; i++) @@ -106,8 +105,6 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul return base.ConvertTo(context, culture, value, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues) { if (propertyValues == null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs index 9592c8fdad39ef..9c0eefe0b829d6 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs @@ -23,7 +23,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) @@ -101,8 +100,6 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul return base.ConvertTo(context, culture, value, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues) { if (propertyValues == null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs index 3eafc9940c0101..1bb8a8698d7514 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs @@ -23,7 +23,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) @@ -60,7 +59,6 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c return base.ConvertFrom(context, culture, value); } - [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) @@ -99,7 +97,6 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul return base.ConvertTo(context, culture, value, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues) { if (propertyValues == null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/Resources/TestResx.Designer.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/Resources/TestResx.Designer.cs index 5de9c6bbe355c5..809ece1425c030 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/Resources/TestResx.Designer.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/Resources/TestResx.Designer.cs @@ -29,7 +29,6 @@ internal class TestResx { private static global::System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal TestResx() { } diff --git a/src/libraries/System.ComponentModel/ref/System.ComponentModel.cs b/src/libraries/System.ComponentModel/ref/System.ComponentModel.cs index 7fd5d5fd7b5f78..77434cc43e76d2 100644 --- a/src/libraries/System.ComponentModel/ref/System.ComponentModel.cs +++ b/src/libraries/System.ComponentModel/ref/System.ComponentModel.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System diff --git a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ExportAttribute.cs b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ExportAttribute.cs index 7a6602b17c1d80..319384b3b756f3 100644 --- a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ExportAttribute.cs +++ b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ExportAttribute.cs @@ -9,7 +9,6 @@ namespace System.Composition /// /// Specifies that a type, property, field, or method provides a particular export. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = true, Inherited = false)] public class ExportAttribute : Attribute diff --git a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportAttribute.cs b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportAttribute.cs index a709cfa4a8b758..38bce0e92af489 100644 --- a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportAttribute.cs +++ b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportAttribute.cs @@ -9,7 +9,6 @@ namespace System.Composition /// /// Specifies that a property, field, or parameter imports a particular export. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class ImportAttribute : Attribute diff --git a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportManyAttribute.cs b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportManyAttribute.cs index 5db7370db3792e..2e260d02e5e18c 100644 --- a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportManyAttribute.cs +++ b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportManyAttribute.cs @@ -9,7 +9,6 @@ namespace System.Composition /// /// Specifies that a property, field, or parameter imports a particular set of exports. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class ImportManyAttribute : Attribute diff --git a/src/libraries/System.Composition.Convention/src/System/Composition/Convention/PartConventionBuilder.cs b/src/libraries/System.Composition.Convention/src/System/Composition/Convention/PartConventionBuilder.cs index 95bc6333673a34..d956c2e80c8d2b 100644 --- a/src/libraries/System.Composition.Convention/src/System/Composition/Convention/PartConventionBuilder.cs +++ b/src/libraries/System.Composition.Convention/src/System/Composition/Convention/PartConventionBuilder.cs @@ -606,8 +606,8 @@ internal bool BuildConstructorAttributes(Type type, ref List attributes = Attribute.GetCustomAttributes(ci, typeof(ImportingConstructorAttribute), false); - if (attributes.Count() != 0) + Attribute[] attributes = Attribute.GetCustomAttributes(ci, typeof(ImportingConstructorAttribute), false); + if (attributes.Length != 0) { CompositionTrace.Registration_ConstructorConventionOverridden(type); return true; diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorProvider.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorProvider.cs index 4820ae4e1a78a1..c3db3f3caa4588 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorProvider.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorProvider.cs @@ -19,19 +19,16 @@ public abstract class ExportDescriptorProvider /// /// Constant value provided so that subclasses can avoid creating additional duplicate values. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] protected static readonly IEnumerable NoExportDescriptors = Enumerable.Empty(); /// /// Constant value provided so that subclasses can avoid creating additional duplicate values. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] protected static readonly IDictionary NoMetadata = new ReadOnlyDictionary(new Dictionary()); /// /// Constant value provided so that subclasses can avoid creating additional duplicate values. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] protected static readonly Func> NoDependencies = () => Enumerable.Empty(); /// diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Util/Formatters.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Util/Formatters.cs index ad934f65fd27c6..8edc9727cdf0b8 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Util/Formatters.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Util/Formatters.cs @@ -46,7 +46,7 @@ private static string FormatClosedGeneric(Type closedGenericType) throw new Exception(SR.Diagnostic_InternalExceptionMessage); } - var name = closedGenericType.Name.Substring(0, closedGenericType.Name.IndexOf("`")); + var name = closedGenericType.Name.Substring(0, closedGenericType.Name.IndexOf('`')); var args = closedGenericType.GenericTypeArguments.Select(t => Format(t)); return string.Format("{0}<{1}>", name, string.Join(", ", args)); } diff --git a/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/CompositionHostTests.cs b/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/CompositionHostTests.cs index 59e87a1bcab482..18eeac42ae5fd2 100644 --- a/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/CompositionHostTests.cs +++ b/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/CompositionHostTests.cs @@ -11,7 +11,7 @@ namespace System.Composition.Hosting.Core.Tests public class CompositionHostTests { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetExport_CompositionContextContract_ReturnsExpected() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -22,7 +22,7 @@ public void GetExport_CompositionContextContract_ReturnsExpected() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetExport_MultipleDependencies_ReturnsExpected() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new MultipleDependency())) @@ -57,7 +57,7 @@ public override IEnumerable GetExportDescriptors(Compos } [Theory] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] [InlineData(typeof(int), new Type[] { typeof(int) })] [InlineData(typeof(IList<>), new Type[] { typeof(IList<>) })] [InlineData(typeof(ICollection<>), new Type[] { typeof(ICollection<>) })] @@ -87,7 +87,7 @@ public void GetExport_LazyOrExportFactoryContractType_ReturnsExpected(Type type, } [Theory] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] [InlineData(typeof(string[]), new Type[] { typeof(string[]), typeof(string) })] [InlineData(typeof(IList), new Type[] { typeof(IList), typeof(string) })] [InlineData(typeof(ICollection), new Type[] { typeof(ICollection), typeof(string) })] @@ -106,7 +106,7 @@ public void GetExport_ImoportManyWithMetadataConstraints_ReturnsExpected(Type co } [Theory] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] [InlineData(typeof(ExportFactory), null, new Type[] { typeof(int), typeof(ExportFactory) })] [InlineData(typeof(ExportFactory), new string[] { "1", "2", "3" }, new Type[] { typeof(int), typeof(ExportFactory) })] [InlineData(typeof(ExportFactory), null, new Type[] { typeof(int), typeof(ExportFactory) })] @@ -135,7 +135,7 @@ public override IEnumerable GetExportDescriptors(Compos } [Theory] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] [InlineData(typeof(Lazy))] [InlineData(typeof(Lazy>))] [InlineData(typeof(Lazy))] @@ -149,7 +149,7 @@ public void GetExport_InvalidMetadata_ThrowsComposititionFailedException(Type ty } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetExport_AbstractMetadata_ThrowsInvalidOperationException() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -159,7 +159,7 @@ public void GetExport_AbstractMetadata_ThrowsInvalidOperationException() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetExport_NullProviderInProviders_ThrowsNullReferenceException() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[] { null })) @@ -178,7 +178,7 @@ public void TryGetExport_NullContract_ThrowsArgumentNullException() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetExport_MultipleReturns_ThrowsCompositionFailedException() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new MultiplePromises())) @@ -201,7 +201,7 @@ public override IEnumerable GetExportDescriptors(Compos } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetExport_FailedDependency_ThrowsCompositionFailedException() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new FailedDependency())) diff --git a/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/CompositionOperationTests.cs b/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/CompositionOperationTests.cs index 164ba75a5a24cf..f9137b57573a1e 100644 --- a/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/CompositionOperationTests.cs +++ b/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/CompositionOperationTests.cs @@ -10,7 +10,7 @@ namespace System.Composition.Hosting.Core.Tests public class CompositionOperationTests { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void Run_ValidContextAndAction_ReturnsExpected() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -50,7 +50,7 @@ public void Run_NullOutmostContext_ThrowsArgumentNullException() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void Run_NullActivator_ThrowsArgumentNullException() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -63,7 +63,7 @@ public void Run_NullActivator_ThrowsArgumentNullException() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void AddNonPrequisiteAction_NullAction_ThrowsArgumentNullException() { object Activator(LifetimeContext context, CompositionOperation operation) @@ -82,7 +82,7 @@ object Activator(LifetimeContext context, CompositionOperation operation) } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void AddPostCompositionAction_NullAction_ThrowsArgumentNullException() { object Activator(LifetimeContext context, CompositionOperation operation) diff --git a/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/LifetimeContextTests.cs b/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/LifetimeContextTests.cs index 2511e6ca15154e..e4009413578c6d 100644 --- a/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/LifetimeContextTests.cs +++ b/src/libraries/System.Composition.Hosting/tests/System/Composition/Hosting/Core/LifetimeContextTests.cs @@ -15,7 +15,7 @@ public void AllocateSharingId_InvokeMultipleTimes_ReturnsDifferentValue() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void AddBoundInstance_NonNullInstance_DisposesInstanceOnDisposal() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -36,7 +36,7 @@ public void AddBoundInstance_NonNullInstance_DisposesInstanceOnDisposal() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void AddBoundInstance_NullInstance_ThrowsNullReferenceExceptionOnDisposal() { CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0]); @@ -48,7 +48,7 @@ public void AddBoundInstance_NullInstance_ThrowsNullReferenceExceptionOnDisposal } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void AddBoundInstance_Disposed_ThrowsObjectDisposedException() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -62,7 +62,7 @@ public void AddBoundInstance_Disposed_ThrowsObjectDisposedException() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetOrCreate_ValidActivatorDuringInitialization_Success() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -91,7 +91,7 @@ object GetOrCreateActivate(LifetimeContext getOrCreateContext, CompositionOperat } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetOrCreate_ValidActivatorAfterInitialization_Success() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -121,7 +121,7 @@ object Activator(LifetimeContext activatorContext, CompositionOperation activato } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetOrCreate_NullActivator_ThrowsNullReferenceException() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -140,7 +140,7 @@ object Activator(LifetimeContext activatorContext, CompositionOperation activato } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetOrCreate_NullOperation_ThrowsNullReferenceException() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -153,7 +153,7 @@ public void GetOrCreate_NullOperation_ThrowsNullReferenceException() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void FindContextWithin_NullSharingBoundary_ReturnsRoot() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -166,7 +166,7 @@ public void FindContextWithin_NullSharingBoundary_ReturnsRoot() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void FindContextWithin_UnknownSharingBoundary_ThrowsCompositionFailedException() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) @@ -179,7 +179,7 @@ public void FindContextWithin_UnknownSharingBoundary_ThrowsCompositionFailedExce } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ToString_NoParent_ReturnsExpected() { using (CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0])) diff --git a/src/libraries/System.Composition.Runtime/src/System/Composition/Runtime/Util/Formatters.cs b/src/libraries/System.Composition.Runtime/src/System/Composition/Runtime/Util/Formatters.cs index 292a30dd2b074d..1c403dddd77eea 100644 --- a/src/libraries/System.Composition.Runtime/src/System/Composition/Runtime/Util/Formatters.cs +++ b/src/libraries/System.Composition.Runtime/src/System/Composition/Runtime/Util/Formatters.cs @@ -35,7 +35,7 @@ private static string FormatClosedGeneric(Type closedGenericType) { Debug.Assert(closedGenericType != null); Debug.Assert(closedGenericType.IsConstructedGenericType); - var name = closedGenericType.Name.Substring(0, closedGenericType.Name.IndexOf("`")); + var name = closedGenericType.Name.Substring(0, closedGenericType.Name.IndexOf('`')); IEnumerable args = closedGenericType.GenericTypeArguments.Select(t => Format(t)); return string.Format("{0}<{1}>", name, string.Join(SR.Formatter_ListSeparatorWithSpace, args)); } diff --git a/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs b/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs index 73e549ecc3c923..647d443d6ad202 100644 --- a/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs +++ b/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs @@ -16,7 +16,7 @@ namespace System.Composition.Hosting.Tests public class ContainerConfigurationTests { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WithProvider_ValidProvider_RegistersProvider() { var configuration = new ContainerConfiguration(); @@ -63,7 +63,7 @@ public void WithProvider_NullProvider_ThrowsArgumentNullException() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WithDefaultConventions_PartWithNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -78,7 +78,7 @@ public void WithDefaultConventions_PartWithNoMatchingConvention_Success() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WithDefaultConventions_IEnumerablePartsWithNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -93,7 +93,7 @@ public void WithDefaultConventions_IEnumerablePartsWithNoMatchingConvention_Succ } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WithDefaultConventions_PartsArrayWithNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -108,7 +108,7 @@ public void WithDefaultConventions_PartsArrayWithNoMatchingConvention_Success() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WithDefaultConventions_PartTNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -144,7 +144,7 @@ public void WithDefaultConventions_AlreadyHasDefaultConventions_ThrowsInvalidOpe } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WithPartT_Convention_Success() { var conventions = new ConventionBuilder(); @@ -158,7 +158,7 @@ public void WithPartT_Convention_Success() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WithPart_Convention_Success() { var conventions = new ConventionBuilder(); @@ -180,7 +180,7 @@ public void WithPart_NullPartType_ThrowsArgumentNullException() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WithParts_Convention_Success() { var conventions = new ConventionBuilder(); @@ -263,7 +263,7 @@ public void WithAssemby_Null_ThrowsNullReferenceExceptionOnCreation() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_ExportedSubClass_Success() { CompositionHost container = new ContainerConfiguration() @@ -284,7 +284,7 @@ public class Base } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_OpenGenericTypes_Success() { var conventions = new ConventionBuilder(); @@ -314,7 +314,7 @@ public EFRepository(IContainer test) { } } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_ImportConventionsWithInheritedProperties_Success() { var conventions = new ConventionBuilder(); @@ -342,7 +342,7 @@ public class BaseWithImport public class DerivedFromBaseWithImport : BaseWithImport { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_ExportConventionsWithInheritedProperties_Success() { var conventions = new ConventionBuilder(); @@ -364,7 +364,7 @@ public class BaseWithExport public class DerivedFromBaseWithExport : BaseWithExport { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_ExportsToInheritedProperties_DontInterfereWithBase() { var conventions = new ConventionBuilder(); @@ -388,7 +388,7 @@ public class BaseWithExport2 public class DerivedFromBaseWithExport2 : BaseWithExport { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_HasConventions_ClassExportsAreNotInherited() { CompositionHost container = new ContainerConfiguration() @@ -398,7 +398,7 @@ public void CreateContainer_HasConventions_ClassExportsAreNotInherited() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_HasConventions_PropertyExportsAreNotInherited() { CompositionHost container = new ContainerConfiguration() @@ -421,7 +421,7 @@ public class DerivedFromBaseWithDeclaredExports : BaseWithDeclaredExports { } public class CustomExport : ExportAttribute { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_HasConventions_CustomAttributesAreNotInherited() { CompositionHost container = new ContainerConfiguration() @@ -436,7 +436,7 @@ public class BaseWithCustomExport { } public class DerivedFromBaseWithCustomExport : BaseWithCustomExport { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_OpenGenericTypePart_Success() { ContainerConfiguration configuration = new ContainerConfiguration().WithParts(typeof(GenericExportedType<>)); @@ -490,7 +490,7 @@ public void CreateContainer_UnassignableType_ThrowsCompositionFailedException() public class ContractExportedType { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_AbstractOrStructType_Success() { ContainerConfiguration configuration = new ContainerConfiguration().WithParts(typeof(AbstractClass), typeof(StructType)); @@ -504,7 +504,7 @@ public abstract class AbstractClass { } public struct StructType { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_MetadataProperty_Success() { ContainerConfiguration configuration = new ContainerConfiguration().WithPart(typeof(MetadataProperty)); @@ -542,7 +542,7 @@ public class MetadataProperty } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreateContainer_MetadataClass_Success() { ContainerConfiguration configuration = new ContainerConfiguration().WithPart(typeof(MetadataClass)); diff --git a/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs b/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs index 11a5a6f820b671..55f2be15f05492 100644 --- a/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs +++ b/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs @@ -17,7 +17,7 @@ public class ReflectionTests public static bool HasMultiplerProcessors { get; } = Environment.ProcessorCount > 1; /// - /// Regression test for https://github.com/dotnet/corefx/issues/6857 + /// Regression test for https://github.com/dotnet/runtime/issues/16683 /// System.Composition: Bug in Resolving Activators Due to the .NET Type System /// Non-deterministic /// @@ -28,7 +28,7 @@ public class ReflectionTests /// revert to a default value during GetExport. /// [ConditionalFact(nameof(HasMultiplerProcessors))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MultiThreadedGetExportsWorkWithImportingConstuctor() { var errors = new ConcurrentBag(); diff --git a/src/libraries/System.Composition/tests/ActivationEventOrderingTests.cs b/src/libraries/System.Composition/tests/ActivationEventOrderingTests.cs index 957c502a122bac..f8cc3729295af2 100644 --- a/src/libraries/System.Composition/tests/ActivationEventOrderingTests.cs +++ b/src/libraries/System.Composition/tests/ActivationEventOrderingTests.cs @@ -32,7 +32,7 @@ public void OnImportsSatisfied() public class ActivationEventOrderingTests : ContainerTests { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void OnImportsSatisfiedIsCalledAfterPropertyInjection() { var cc = CreateContainer(typeof(TracksImportSatisfaction), typeof(Imported)); diff --git a/src/libraries/System.Composition/tests/CardinalityTests.cs b/src/libraries/System.Composition/tests/CardinalityTests.cs index 5008eed8d31867..4b82e0d16f32ea 100644 --- a/src/libraries/System.Composition/tests/CardinalityTests.cs +++ b/src/libraries/System.Composition/tests/CardinalityTests.cs @@ -32,7 +32,7 @@ public UsesLog(ILog log) { } } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void RequestingOneWhereMultipleArePresentFails() { var c = CreateContainer(typeof(LogA), typeof(LogB)); @@ -43,7 +43,7 @@ public void RequestingOneWhereMultipleArePresentFails() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ImportingOneWhereMultipleArePresentFails() { var c = CreateContainer(typeof(LogA), typeof(LogB), typeof(UsesLog)); diff --git a/src/libraries/System.Composition/tests/CircularityTests.cs b/src/libraries/System.Composition/tests/CircularityTests.cs index 068855192a760c..0e404b81c89ea7 100644 --- a/src/libraries/System.Composition/tests/CircularityTests.cs +++ b/src/libraries/System.Composition/tests/CircularityTests.cs @@ -117,7 +117,7 @@ public PrDepB(PrDepA a) { } } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CanHandleDefinitionCircularity() { var cc = CreateContainer(typeof(ACircular), typeof(BLazy)); @@ -127,7 +127,7 @@ public void CanHandleDefinitionCircularity() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CanHandleDefinitionCircularity2() { var cc = CreateContainer(typeof(ACircular), typeof(BLazy)); @@ -136,7 +136,7 @@ public void CanHandleDefinitionCircularity2() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void HandlesPropertyPropertyCircularity() { var cc = CreateContainer(typeof(PropertyPropertyA), typeof(PropertyPropertyB)); @@ -145,7 +145,7 @@ public void HandlesPropertyPropertyCircularity() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void HandlesPropertyPropertyCircularityReversed() { var cc = CreateContainer(typeof(PropertyPropertyA), typeof(PropertyPropertyB)); @@ -154,7 +154,7 @@ public void HandlesPropertyPropertyCircularityReversed() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void HandlesConstructorPropertyCircularity() { var cc = CreateContainer(typeof(ConstructorPropertyA), typeof(ConstructorPropertyB)); @@ -163,7 +163,7 @@ public void HandlesConstructorPropertyCircularity() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void HandlesConstructorPropertyCircularityReversed() { var cc = CreateContainer(typeof(ConstructorPropertyA), typeof(ConstructorPropertyB)); @@ -172,7 +172,7 @@ public void HandlesConstructorPropertyCircularityReversed() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void HandlesMetadataCircularity() { var cc = CreateContainer(typeof(MetadataCircularityA), typeof(MetadataCircularityB)); @@ -183,7 +183,7 @@ public void HandlesMetadataCircularity() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void SharedPartCanHaveNonPrereqDependencyOnSelf() { var cc = CreateContainer(typeof(NonPrereqSelfDependency)); @@ -192,7 +192,7 @@ public void SharedPartCanHaveNonPrereqDependencyOnSelf() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void PrerequisiteCircularitiesAreDetected() { var cc = CreateContainer(typeof(PrDepA), typeof(PrDepB)); diff --git a/src/libraries/System.Composition/tests/CompositionContextExtensionsTests.cs b/src/libraries/System.Composition/tests/CompositionContextExtensionsTests.cs index d397462ac06a64..91916bc9b6a850 100644 --- a/src/libraries/System.Composition/tests/CompositionContextExtensionsTests.cs +++ b/src/libraries/System.Composition/tests/CompositionContextExtensionsTests.cs @@ -16,7 +16,7 @@ public class CompositionContextExtensionsTests : ContainerTests public interface IUnregistered { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GettingAnOptionalExportThatDoesntExistReturnsNull() { var c = CreateContainer(); diff --git a/src/libraries/System.Composition/tests/ConcurrencyTests.cs b/src/libraries/System.Composition/tests/ConcurrencyTests.cs index c2334a2e050374..97a05620e42cc6 100644 --- a/src/libraries/System.Composition/tests/ConcurrencyTests.cs +++ b/src/libraries/System.Composition/tests/ConcurrencyTests.cs @@ -29,7 +29,7 @@ public void OnImportsSatisfied() // This does not test the desired behaviour deterministically, // but is close enough to be repeatable at least on my machine :) [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void SharedInstancesAreNotVisibleUntilActivationCompletes() { var c = CreateContainer(typeof(PausesDuringActivation)); diff --git a/src/libraries/System.Composition/tests/ConstraintTests.cs b/src/libraries/System.Composition/tests/ConstraintTests.cs index 573e9572ea2269..367d0ff18195a8 100644 --- a/src/libraries/System.Composition/tests/ConstraintTests.cs +++ b/src/libraries/System.Composition/tests/ConstraintTests.cs @@ -42,7 +42,7 @@ public class UnrelatedThings : ObservableCollection, IUnrelatedThing } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GenericPartDiscoveryIgnoresAPartAndDoesntThrowAnExceptionWhenItsConstraintOnTypeParameterIsNotAssignableFromTheExportTarget() { var container = CreateContainer(typeof(ThingHandler<>), typeof(BookHandler<>)); @@ -54,7 +54,7 @@ public void GenericPartDiscoveryIgnoresAPartAndDoesntThrowAnExceptionWhenItsCons } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GenericPartDiscoveryIncludesAPartWhenItsConstraintOnTypeParameterIsAssignableFromTheExportTarget() { var container = CreateContainer(typeof(ThingHandler<>), typeof(BookHandler<>)); @@ -67,7 +67,7 @@ public void GenericPartDiscoveryIncludesAPartWhenItsConstraintOnTypeParameterIsA } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetExport_ComplexConstraint_ExportSuccessful() { CompositionContext container = CreateContainer(typeof(UnrelatedThings<,>)); @@ -79,8 +79,8 @@ public void GetExport_ComplexConstraint_ExportSuccessful() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/23607")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23356")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetExport_WhereClause_ExportSuccessful() { CompositionContext container = CreateContainer(typeof(InheritedThings<,>)); diff --git a/src/libraries/System.Composition/tests/CustomerReportedMetadataBug.cs b/src/libraries/System.Composition/tests/CustomerReportedMetadataBug.cs index d2959a66d0c90d..2f873fc8154d57 100644 --- a/src/libraries/System.Composition/tests/CustomerReportedMetadataBug.cs +++ b/src/libraries/System.Composition/tests/CustomerReportedMetadataBug.cs @@ -38,7 +38,7 @@ public class LooseImporter } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void SampleServicesCorrectlyImported() { var container = new ContainerConfiguration() diff --git a/src/libraries/System.Composition/tests/DictionaryImportTests.cs b/src/libraries/System.Composition/tests/DictionaryImportTests.cs index b234e1a8d80f4e..3359ebbbc54283 100644 --- a/src/libraries/System.Composition/tests/DictionaryImportTests.cs +++ b/src/libraries/System.Composition/tests/DictionaryImportTests.cs @@ -69,7 +69,7 @@ private CompositionContext CreateContainer(params Type[] types) } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DictionaryImportsKeyedByMetadata() { var container = CreateContainer(new[] { typeof(ValueA), typeof(ValueB), typeof(Consumer) }); @@ -82,7 +82,7 @@ public void DictionaryImportsKeyedByMetadata() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DictionaryImportsReceiveMetadataFromNestedAdapters() { var container = CreateContainer(new[] { typeof(ValueA), typeof(ValueB), typeof(LazyConsumer) }); @@ -94,7 +94,7 @@ public void DictionaryImportsReceiveMetadataFromNestedAdapters() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WhenAMetadataKeyIsDuplicatedAnInformativeExceptionIsThrown() { var container = CreateContainer(typeof(ValueA), typeof(ValueA), typeof(Consumer)); @@ -103,7 +103,7 @@ public void WhenAMetadataKeyIsDuplicatedAnInformativeExceptionIsThrown() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WhenAMetadataKeyIsMissingAnInformativeExceptionIsThrown() { var container = CreateContainer(typeof(ValueA), typeof(ValueMissing), typeof(Consumer)); @@ -112,7 +112,7 @@ public void WhenAMetadataKeyIsMissingAnInformativeExceptionIsThrown() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WhenAMetadataValueIsOfTheWrongTypeAnInformativeExceptionIsThrown() { var container = CreateContainer(typeof(ValueA), typeof(NonStringValue), typeof(Consumer)); @@ -121,7 +121,7 @@ public void WhenAMetadataValueIsOfTheWrongTypeAnInformativeExceptionIsThrown() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DictionaryImportsCompatibleWithConventionBuilder() { var rb = new ConventionBuilder(); diff --git a/src/libraries/System.Composition/tests/DiscoveryTests.cs b/src/libraries/System.Composition/tests/DiscoveryTests.cs index 8ebe6dcc5ed022..97b4a7f3ac535b 100644 --- a/src/libraries/System.Composition/tests/DiscoveryTests.cs +++ b/src/libraries/System.Composition/tests/DiscoveryTests.cs @@ -41,7 +41,7 @@ public class IncompatibleRuleProperty public class NotDiscoverable { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DiscoversCustomExportAttributes() { var container = CreateContainer(typeof(UnfairRule)); @@ -50,7 +50,7 @@ public void DiscoversCustomExportAttributes() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DiscoversCustomExportAttributesUnderConventions() { var container = CreateContainer(new ConventionBuilder(), typeof(UnfairRule)); @@ -59,7 +59,7 @@ public void DiscoversCustomExportAttributesUnderConventions() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void InstanceExportsOfIncompatibleContractsAreDetected() { var x = Assert.Throws(() => CreateContainer(typeof(IncompatibleRule))); @@ -67,7 +67,7 @@ public void InstanceExportsOfIncompatibleContractsAreDetected() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void PropertyExportsOfIncompatibleContractsAreDetected() { var x = Assert.Throws(() => CreateContainer(typeof(IncompatibleRuleProperty))); @@ -75,7 +75,7 @@ public void PropertyExportsOfIncompatibleContractsAreDetected() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ANonDiscoverablePartIsIgnored() { var container = CreateContainer(typeof(NotDiscoverable)); @@ -91,7 +91,7 @@ public class CloudBus : IBus { } public class SpecialCloudBus : CloudBus { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DoesNotDiscoverExportAttributesFromBase() { var container = CreateContainer(typeof(SpecialCloudBus)); @@ -112,7 +112,7 @@ public class HomeController : BaseController } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void SatisfiesImportsAppliedToBase() { var container = CreateContainer(typeof(HomeController), typeof(CloudBus)); @@ -130,7 +130,7 @@ public class MultipleImportsOnProperty } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MultipleImportAttributesAreDetected() { var c = new ContainerConfiguration() diff --git a/src/libraries/System.Composition/tests/ErrorMessageQualityTests.cs b/src/libraries/System.Composition/tests/ErrorMessageQualityTests.cs index 7c425cb2b4758b..8fde112f2ec02f 100644 --- a/src/libraries/System.Composition/tests/ErrorMessageQualityTests.cs +++ b/src/libraries/System.Composition/tests/ErrorMessageQualityTests.cs @@ -64,7 +64,7 @@ public class RequiresOnlyOne } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MissingTopLevelExportMessageIsInformative() { var cc = CreateContainer(); @@ -73,7 +73,7 @@ public void MissingTopLevelExportMessageIsInformative() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MissingTopLevelNamedExportMessageIsInformative() { var cc = CreateContainer(); @@ -82,7 +82,7 @@ public void MissingTopLevelNamedExportMessageIsInformative() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MissingDependencyMessageIsInformative() { var cc = CreateContainer(typeof(UserOfUnregistered)); @@ -93,7 +93,7 @@ public void MissingDependencyMessageIsInformative() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CycleMessageIsInformative() { var cc = CreateContainer(typeof(CycleA), typeof(CycleB), typeof(CycleC)); @@ -107,7 +107,7 @@ public void CycleMessageIsInformative() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CardinalityViolationMessageIsInformative() { var cc = CreateContainer(typeof(ShouldBeOne), typeof(ButThereIsAnother), typeof(RequiresOnlyOne)); diff --git a/src/libraries/System.Composition/tests/ExportDescriptorProviderTests.cs b/src/libraries/System.Composition/tests/ExportDescriptorProviderTests.cs index febf47d476888b..e38675744d0788 100644 --- a/src/libraries/System.Composition/tests/ExportDescriptorProviderTests.cs +++ b/src/libraries/System.Composition/tests/ExportDescriptorProviderTests.cs @@ -41,7 +41,7 @@ public class ExportsObject } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ProvidersCanLocateImplementationsOfAContractItSupports() { var container = new ContainerConfiguration() @@ -54,7 +54,7 @@ public void ProvidersCanLocateImplementationsOfAContractItSupports() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ProvidersCanDetectAbsenceOfAContractItSupports() { var container = new ContainerConfiguration() diff --git a/src/libraries/System.Composition/tests/ExportFactoryTests.cs b/src/libraries/System.Composition/tests/ExportFactoryTests.cs index 1ef92601ad8c9c..f07d772c8f974c 100644 --- a/src/libraries/System.Composition/tests/ExportFactoryTests.cs +++ b/src/libraries/System.Composition/tests/ExportFactoryTests.cs @@ -106,7 +106,7 @@ public void Dispose() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void SharedPartsAreSharedBetweenAllScopes() { var cc = CreateContainer(typeof(SharedUnbounded), typeof(DataConsistencyBoundaryProvider)); @@ -117,7 +117,7 @@ public void SharedPartsAreSharedBetweenAllScopes() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void TheSameSharedInstanceIsReusedWithinItsSharingBoundary() { var cc = CreateContainer(typeof(SharedBoundedByDC), typeof(SharedPartConsumer), typeof(DataConsistencyBoundaryProvider)); @@ -131,7 +131,7 @@ public void TheSameSharedInstanceIsReusedWithinItsSharingBoundary() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void NonSharedInstancesCreatedByAnExportFactoryAreControlledByTheirExportLifetimeContext() { var cc = CreateContainer(typeof(A), typeof(UseExportFactory)); @@ -144,7 +144,7 @@ public void NonSharedInstancesCreatedByAnExportFactoryAreControlledByTheirExport } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DependenciesOfSharedPartsAreResolvedInTheGlobalScope() { var cc = new ContainerConfiguration() @@ -160,7 +160,7 @@ public void DependenciesOfSharedPartsAreResolvedInTheGlobalScope() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WhenABoundaryIsPresentBoundedPartsCannotBeCreatedOutsideIt() { var container = CreateContainer(typeof(DataConsistencyBoundaryProvider), typeof(SharedBoundedByDC)); @@ -168,7 +168,7 @@ public void WhenABoundaryIsPresentBoundedPartsCannotBeCreatedOutsideIt() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void TheProductOfAnExportFactoryCanBeDisposedDuringDisposalOfTheParent() { var container = new ContainerConfiguration() @@ -200,7 +200,7 @@ public class AConsumer } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ExportFactoryCanBeComposedWithImportManyAndNames() { var cc = CreateContainer(typeof(AConsumer), typeof(A1), typeof(A2)); @@ -234,7 +234,7 @@ public class HasFactory } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void WhenReleasingAnExportFromAnExportFactoryItsNonSharedDependenciesAreDisposed() { var cc = CreateContainer(typeof(Disposable), typeof(HasDisposableDependency), typeof(HasFactory)); diff --git a/src/libraries/System.Composition/tests/ExportMetadataDiscoveryTests.cs b/src/libraries/System.Composition/tests/ExportMetadataDiscoveryTests.cs index fe8942843c6bc2..147ab8d5c47633 100644 --- a/src/libraries/System.Composition/tests/ExportMetadataDiscoveryTests.cs +++ b/src/libraries/System.Composition/tests/ExportMetadataDiscoveryTests.cs @@ -52,7 +52,7 @@ public class Prioritized {[DefaultValue(0)] public int Priority { get; set; } } public class MultipleNames { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DiscoversMetadataSpecifiedUsingMetadataAttributeOnExportAttribute() { var cc = CreateContainer(typeof(SingleNamedExport)); @@ -61,7 +61,7 @@ public void DiscoversMetadataSpecifiedUsingMetadataAttributeOnExportAttribute() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void IfMetadataIsSpecifiedOnAnExportAttributeOtherExportsDoNotHaveIt() { var cc = CreateContainer(typeof(MultipleExportsOneNamedAndBothPrioritized)); @@ -71,7 +71,7 @@ public void IfMetadataIsSpecifiedOnAnExportAttributeOtherExportsDoNotHaveIt() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DiscoversStandaloneExportMetadata() { var cc = CreateContainer(typeof(NamedAndPrioritized)); @@ -80,7 +80,7 @@ public void DiscoversStandaloneExportMetadata() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DiscoversStandaloneExportMetadataUsingMetadataAttributes() { var cc = CreateContainer(typeof(NamedWithCustomMetadata)); @@ -89,7 +89,7 @@ public void DiscoversStandaloneExportMetadataUsingMetadataAttributes() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void StandaloneExportMetadataAppliesToAllExportsOnAMember() { var cc = CreateContainer(typeof(MultipleExportsOneNamedAndBothPrioritized)); @@ -99,7 +99,7 @@ public void StandaloneExportMetadataAppliesToAllExportsOnAMember() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MultiplePiecesOfMetadataAreCombinedIntoAnArray() { var cc = CreateContainer(typeof(MultipleNames)); @@ -120,7 +120,7 @@ public MultipleExportsNonDefaultConstructor(ConstructorImported c) { } } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MultipleExportsCanBeRetrievedWhenANonDefaultConstructorExists() { var c = CreateContainer(typeof(ConstructorImported), typeof(MultipleExportsNonDefaultConstructor)); diff --git a/src/libraries/System.Composition/tests/ImportManyTests.cs b/src/libraries/System.Composition/tests/ImportManyTests.cs index d8f7d952474754..b40d0a3724b84b 100644 --- a/src/libraries/System.Composition/tests/ImportManyTests.cs +++ b/src/libraries/System.Composition/tests/ImportManyTests.cs @@ -42,7 +42,7 @@ public ImportManyPropsOfA() } } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ImportsMany() { var cc = CreateContainer(typeof(A), typeof(A2), typeof(ImportManyIA)); @@ -51,7 +51,7 @@ public void ImportsMany() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ImportsManyProperties() { var cc = CreateContainer(typeof(A), typeof(A2), typeof(ImportManyPropsOfA)); diff --git a/src/libraries/System.Composition/tests/ImportOrderingTests.cs b/src/libraries/System.Composition/tests/ImportOrderingTests.cs index ed12df1573dc91..7a1db6d1fdcacb 100644 --- a/src/libraries/System.Composition/tests/ImportOrderingTests.cs +++ b/src/libraries/System.Composition/tests/ImportOrderingTests.cs @@ -49,7 +49,7 @@ public class HasImportedItems } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CollectionsImportedWithAnOrderingAttributeComeInOrder() { var container = CreateExtendedContainer(typeof(HasImportedItems), typeof(Item1), typeof(Item4), typeof(Item2), typeof(Item3)); @@ -63,7 +63,7 @@ public void CollectionsImportedWithAnOrderingAttributeComeInOrder() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void IfAnItemIsMissingMetadataAnInformativeExceptionIsThrown() { var container = CreateExtendedContainer(typeof(HasImportedItems), typeof(Item1), typeof(ItemWithoutOrder)); diff --git a/src/libraries/System.Composition/tests/InheritanceTests.cs b/src/libraries/System.Composition/tests/InheritanceTests.cs index c987fedb43b002..55b585265d0e98 100644 --- a/src/libraries/System.Composition/tests/InheritanceTests.cs +++ b/src/libraries/System.Composition/tests/InheritanceTests.cs @@ -26,7 +26,7 @@ public class Base public class Derived : Base { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ClassExportsAreNotInherited() { var cc = CreateContainer(typeof(Derived)); @@ -35,7 +35,7 @@ public void ClassExportsAreNotInherited() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void PropertyExportsAreNotInherited() { var cc = CreateContainer(typeof(Derived)); @@ -47,7 +47,7 @@ public void PropertyExportsAreNotInherited() public class ExportingDerived : Base { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ExportsAtTheClassLevelAreAppliedIgnoringBaseExports() { var cc = CreateContainer(typeof(ExportingDerived)); @@ -88,7 +88,7 @@ public class OverridingImporter : BaseImporter public class NonOverridingImporter : BaseImporter { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ImportsOnOverriddenPropertiesOverrideImportsOnTheBase() { var c = CreateContainer(typeof(Exporter), typeof(OverridingImporter), typeof(NonOverridingImporter)); @@ -99,7 +99,7 @@ public void ImportsOnOverriddenPropertiesOverrideImportsOnTheBase() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void LooseImportsOnDerivedPropertiesOverrideImportsOnTheBase() { var c = CreateContainer(typeof(Exporter)); @@ -112,7 +112,7 @@ public void LooseImportsOnDerivedPropertiesOverrideImportsOnTheBase() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ImportsOnBaseAreInherited() { var c = CreateContainer(typeof(Exporter), typeof(NonOverridingImporter)); @@ -122,7 +122,7 @@ public void ImportsOnBaseAreInherited() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void LooseImportsOnBaseAreInherited() { var c = CreateContainer(typeof(Exporter)); @@ -138,7 +138,7 @@ public class NotDiscoverableBase { } public class DiscoverableDerived : NotDiscoverableBase { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void PartNotDiscoverableAttributeIsNotInherited() { var c = CreateContainer(typeof(DiscoverableDerived)); @@ -153,7 +153,7 @@ public class SharedBase { } public class SharedDerived : SharedBase { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void PartMetadataIsNotInherited() { var c = CreateContainer(typeof(SharedDerived)); @@ -174,7 +174,7 @@ public class HasImportsSatisfied public class InheritsImportsSatisfied : HasImportsSatisfied { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void OnImportsSatisfiedAttributeIsInherited() { var c = CreateContainer(typeof(InheritsImportsSatisfied)); @@ -193,7 +193,7 @@ public class AHandler : IHandler { } public class ABHandler : AHandler { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MetadataIsOnlyDrawnFromTheTypeToWhichItIsApplied() { var c = CreateContainer(typeof(ABHandler)); @@ -215,7 +215,7 @@ public class DerivedOverrideExporter : BaseVirtualExporter } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ExportsOnOverridePropertiesOverrideExportsOnTheBase() { var c = CreateContainer(typeof(DerivedOverrideExporter)); diff --git a/src/libraries/System.Composition/tests/LazyTests.cs b/src/libraries/System.Composition/tests/LazyTests.cs index 5edd9a1bf2ac47..1146438b35f214 100644 --- a/src/libraries/System.Composition/tests/LazyTests.cs +++ b/src/libraries/System.Composition/tests/LazyTests.cs @@ -36,7 +36,7 @@ public class NamedFred { } public class Named { public string Name { get; set; } } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ComposesLazily() { var cc = CreateContainer(typeof(A), typeof(BLazy)); @@ -45,7 +45,7 @@ public void ComposesLazily() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void SupportsExportMetadata() { var cc = CreateContainer(typeof(NamedFred)); @@ -54,7 +54,7 @@ public void SupportsExportMetadata() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ReturnsExportMetadataAsADictionary() { var cc = CreateContainer(typeof(NamedFred)); @@ -76,7 +76,7 @@ public class AConsumer } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void LazyCanBeComposedWithImportManyAndNames() { var cc = CreateContainer(typeof(AConsumer), typeof(A1), typeof(A2)); diff --git a/src/libraries/System.Composition/tests/LightContainerTests.cs b/src/libraries/System.Composition/tests/LightContainerTests.cs index f90cab7f5c72c6..b173fa72d22cb8 100644 --- a/src/libraries/System.Composition/tests/LightContainerTests.cs +++ b/src/libraries/System.Composition/tests/LightContainerTests.cs @@ -54,7 +54,7 @@ public class HasPropertyA } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CreatesInstanceWithNoDependencies() { var cc = CreateContainer(typeof(A)); @@ -63,7 +63,7 @@ public void CreatesInstanceWithNoDependencies() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DefaultLifetimeIsNonShared() { var cc = CreateContainer(typeof(A)); @@ -73,7 +73,7 @@ public void DefaultLifetimeIsNonShared() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void Composes() { var cc = CreateContainer(typeof(A), typeof(B)); @@ -82,7 +82,7 @@ public void Composes() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CanSpecifyExportsWithConventionBuilder() { var rb = new ConventionBuilder(); @@ -93,7 +93,7 @@ public void CanSpecifyExportsWithConventionBuilder() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CanSpecifyLifetimeWithConventionBuilder() { var rb = new ConventionBuilder(); @@ -105,7 +105,7 @@ public void CanSpecifyLifetimeWithConventionBuilder() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void InjectsPropertyImports() { var rb = new ConventionBuilder(); @@ -116,7 +116,7 @@ public void InjectsPropertyImports() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void VerifyAssemblyNameCanBeUsedWithContainer() { var test = new ContainerConfiguration() @@ -128,7 +128,7 @@ public void VerifyAssemblyNameCanBeUsedWithContainer() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void VerifyAssemblyWithTwoBaseTypeWithOnlyOneExportedWorks() { var test = new ContainerConfiguration() diff --git a/src/libraries/System.Composition/tests/LooseImportsTests.cs b/src/libraries/System.Composition/tests/LooseImportsTests.cs index 942dc52c48378e..acdbee8f2f8223 100644 --- a/src/libraries/System.Composition/tests/LooseImportsTests.cs +++ b/src/libraries/System.Composition/tests/LooseImportsTests.cs @@ -24,7 +24,7 @@ public class SaveChangesAttribute } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void SatisfyImportsSetsLooseImportsOnAttributedPart() { var container = CreateContainer(typeof(Transaction)); diff --git a/src/libraries/System.Composition/tests/MetadataConstraintTests.cs b/src/libraries/System.Composition/tests/MetadataConstraintTests.cs index dbcebd276ff389..9764719f91fcbc 100644 --- a/src/libraries/System.Composition/tests/MetadataConstraintTests.cs +++ b/src/libraries/System.Composition/tests/MetadataConstraintTests.cs @@ -32,7 +32,7 @@ public class ManySettingUser } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void AnImportMetadataConstraintMatchesMetadataOnTheExport() { var cc = CreateContainer(typeof(SomeSetting), typeof(SomeSettingUser)); @@ -41,7 +41,7 @@ public void AnImportMetadataConstraintMatchesMetadataOnTheExport() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void AnImportMetadataConstraintMatchesMetadataOnTheExportEvenIfDiscoveryHasCompletedForTheExport() { var cc = CreateContainer(typeof(SomeSetting), typeof(SomeSettingUser)); @@ -51,7 +51,7 @@ public void AnImportMetadataConstraintMatchesMetadataOnTheExportEvenIfDiscoveryH } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ImportMetadataConstraintsComposeWithOtherRelationshipTypes() { var cc = CreateContainer(typeof(SomeSetting), typeof(ManySettingUser)); @@ -63,7 +63,7 @@ public void ImportMetadataConstraintsComposeWithOtherRelationshipTypes() public class SomeSetting { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ConstraintsCanBeAppliedToGenerics() { var contract = new CompositionContract(typeof(SomeSetting), null, new Dictionary @@ -87,7 +87,7 @@ public class Controller } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ItemEqualityIsUsedWhenMatchingMetadataValuesThatAreArrays() { var c = CreateContainer(typeof(Presenter), typeof(Controller)); diff --git a/src/libraries/System.Composition/tests/MetadataTests.cs b/src/libraries/System.Composition/tests/MetadataTests.cs index dcdb045ce9e6bf..94d18025129918 100644 --- a/src/libraries/System.Composition/tests/MetadataTests.cs +++ b/src/libraries/System.Composition/tests/MetadataTests.cs @@ -32,7 +32,7 @@ public class MetadataCircularityB } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void HandlesMetadataCircularity() { var cc = CreateContainer(typeof(MetadataCircularityA), typeof(MetadataCircularityB)); @@ -91,7 +91,7 @@ public class MultiValuedName { public string[] Name { get; set; } } public class Prioritized {[DefaultValue(0)] public int Priority { get; set; } } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MultipleMetadataAttributesWithAPropertyThatReturnsNull() { var cc = CreateContainer(typeof(NameNullTwiceExport)); @@ -100,7 +100,7 @@ public void MultipleMetadataAttributesWithAPropertyThatReturnsNull() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DiscoversMetadataSpecifiedUsingMetadataAttributeOnExportAttribute() { var cc = CreateContainer(typeof(SingleNamedExport)); @@ -109,7 +109,7 @@ public void DiscoversMetadataSpecifiedUsingMetadataAttributeOnExportAttribute() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void IfMetadataIsSpecifiedOnAnExportAttributeOtherExportsDoNotHaveIt() { var cc = CreateContainer(typeof(MultipleExportsOneNamedAndBothPrioritized)); @@ -119,7 +119,7 @@ public void IfMetadataIsSpecifiedOnAnExportAttributeOtherExportsDoNotHaveIt() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DiscoversStandaloneExportMetadata() { var cc = CreateContainer(typeof(NamedAndPrioritized)); @@ -128,7 +128,7 @@ public void DiscoversStandaloneExportMetadata() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void DiscoversStandaloneExportMetadataUsingMetadataAttributes() { var cc = CreateContainer(typeof(NamedWithCustomMetadata)); @@ -137,7 +137,7 @@ public void DiscoversStandaloneExportMetadataUsingMetadataAttributes() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void StandaloneExportMetadataAppliesToAllExportsOnAMember() { var cc = CreateContainer(typeof(MultipleExportsOneNamedAndBothPrioritized)); @@ -147,7 +147,7 @@ public void StandaloneExportMetadataAppliesToAllExportsOnAMember() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MultiplePiecesOfMetadataAreCombinedIntoAnArray() { var cc = CreateContainer(typeof(MultipleNames)); @@ -161,7 +161,7 @@ public void MultiplePiecesOfMetadataAreCombinedIntoAnArray() public class NamedFred { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void SupportsExportMetadata() { var cc = CreateContainer(typeof(NamedFred)); diff --git a/src/libraries/System.Composition/tests/MetadataViewGenerationTests.cs b/src/libraries/System.Composition/tests/MetadataViewGenerationTests.cs index a81a3109447fbe..46435b984d13c0 100644 --- a/src/libraries/System.Composition/tests/MetadataViewGenerationTests.cs +++ b/src/libraries/System.Composition/tests/MetadataViewGenerationTests.cs @@ -22,7 +22,7 @@ public class HasNameA { } public class Named { public string Name { get; set; } } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void AConcreteTypeWithWritablePropertiesIsAMetadataView() { var cc = new ContainerConfiguration() @@ -40,7 +40,7 @@ public class HasNoName { } public class OptionallyNamed {[DefaultValue("B")] public string Name { get; set; } } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MetadataViewsCanCarryDefaultValues() { var cc = new ContainerConfiguration() @@ -63,7 +63,7 @@ public DictionaryName(IDictionary metadata) } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void AConcreteTypeWithDictionaryConstructorIsAMetadataView() { var cc = new ContainerConfiguration() @@ -81,7 +81,7 @@ public InvalidConcreteView(string unsupported) { } } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void AConcreteTypeWithUnsupportedConstructorsCannotBeUsedAsAMetadataView() { var cc = new ContainerConfiguration() @@ -106,7 +106,7 @@ public class ImportsWithMetadataInterface } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void UnsupportedMetadataViewMessageIsInformative() { var cc = new ContainerConfiguration().WithParts(typeof(ImportsWithMetadataInterface), typeof(ExportsWithMetadata)).CreateContainer(); @@ -124,7 +124,7 @@ public class ReadonlyNameOrderMetadata public class HasOrder { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ReadOnlyPropertiesOnMetadataViewsAreIgnored() { var c = new ContainerConfiguration() diff --git a/src/libraries/System.Composition/tests/OpenGenericsTests.cs b/src/libraries/System.Composition/tests/OpenGenericsTests.cs index eac42dd269d4a5..0d0436ffbbaab0 100644 --- a/src/libraries/System.Composition/tests/OpenGenericsTests.cs +++ b/src/libraries/System.Composition/tests/OpenGenericsTests.cs @@ -65,7 +65,7 @@ private class SomeGenericType { } private class ExportsBase : SomeGenericType { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CanExportBasicOpenGeneric() { var cc = CreateContainer(typeof(BasicRepository<>)); @@ -74,7 +74,7 @@ public void CanExportBasicOpenGeneric() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void OpenGenericProvidesMultipleInstantiations() { var cc = CreateContainer(typeof(BasicRepository<>)); @@ -84,7 +84,7 @@ public void OpenGenericProvidesMultipleInstantiations() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CanExportOpenGenericProperty() { var cc = CreateContainer(typeof(RepositoryProperty<>)); @@ -93,7 +93,7 @@ public void CanExportOpenGenericProperty() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ASharedOpenGenericWithTwoExportsIsProvidedByASingleInstance() { var cc = CreateContainer(typeof(TwoGenericExports<>)); @@ -105,7 +105,7 @@ public void ASharedOpenGenericWithTwoExportsIsProvidedByASingleInstance() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void APartWithMultipleGenericExportsIsOnlyDiscoveredOnce() { var cc = CreateContainer(typeof(BasicRepository<>), typeof(TwoGenericExports<>)); @@ -119,7 +119,7 @@ public void APartWithMultipleGenericExportsIsOnlyDiscoveredOnce() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MultipleGenericExportsCanBeSpecifiedAtTheClassLevel() { var cc = CreateContainer(typeof(FirstAndSecond<>)); @@ -130,7 +130,7 @@ public void MultipleGenericExportsCanBeSpecifiedAtTheClassLevel() // In future, the set of allowable generic type mappings will be expanded (see // ignored tests above). [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void TypesWithMismatchedGenericParameterListsAreDetectedDuringDiscovery() { var x = Assert.Throws(() => CreateContainer(typeof(RepositoryWithKey<,>))); @@ -138,7 +138,7 @@ public void TypesWithMismatchedGenericParameterListsAreDetectedDuringDiscovery() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void TypesWithNonGenericExportsAreDetectedDuringDiscovery() { var x = Assert.Throws(() => CreateContainer(typeof(RepositoryWithNonGenericExport<>))); @@ -146,7 +146,7 @@ public void TypesWithNonGenericExportsAreDetectedDuringDiscovery() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void OpenGenericsCanExportSelf() { var cc = CreateContainer(typeof(ExportSelf<>)); @@ -155,7 +155,7 @@ public void OpenGenericsCanExportSelf() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void OpenGenericsCanExportBase() { var cc = CreateContainer(typeof(ExportsBase<>)); diff --git a/src/libraries/System.Composition/tests/OptionalImportTests.cs b/src/libraries/System.Composition/tests/OptionalImportTests.cs index 42d97368bd4349..932c679dbe0208 100644 --- a/src/libraries/System.Composition/tests/OptionalImportTests.cs +++ b/src/libraries/System.Composition/tests/OptionalImportTests.cs @@ -55,7 +55,7 @@ public Missing Missing } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MissingOptionalConstructorParametersAreSuppliedTheirDefaultValue() { var cc = CreateContainer(typeof(Supplied), typeof(HasOptionalConstructorParameter)); @@ -65,7 +65,7 @@ public void MissingOptionalConstructorParametersAreSuppliedTheirDefaultValue() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MissingOptionalPropertyImportsAreIgnored() { var cc = CreateContainer(typeof(Supplied), typeof(HasOptionalProperty)); diff --git a/src/libraries/System.Composition/tests/PropertyExportTests.cs b/src/libraries/System.Composition/tests/PropertyExportTests.cs index 5a8e839e55600e..7ed01c5e19cc74 100644 --- a/src/libraries/System.Composition/tests/PropertyExportTests.cs +++ b/src/libraries/System.Composition/tests/PropertyExportTests.cs @@ -20,7 +20,7 @@ public class Messenger } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CanExportProperty() { var cc = CreateContainer(typeof(Messenger)); @@ -45,7 +45,7 @@ public class Selfless } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ExportedPropertiesShareTheSameSharedPartInstance() { var cc = CreateContainer(typeof(SelfObsessed), typeof(Selfless)); diff --git a/src/libraries/System.Composition/tests/SharingTests.cs b/src/libraries/System.Composition/tests/SharingTests.cs index a73bee256baf6e..24cf2fc1ef5606 100644 --- a/src/libraries/System.Composition/tests/SharingTests.cs +++ b/src/libraries/System.Composition/tests/SharingTests.cs @@ -319,7 +319,7 @@ public class SharingTest : ContainerTests /// we fail only when we create instance of B.. is that correct. /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void BoundaryExposedBoundaryButNoneImported() { try @@ -339,7 +339,7 @@ public void BoundaryExposedBoundaryButNoneImported() /// Needs to be fixed so that specifying boundary would automatically create the shared /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void BoundarySharingTest() { var cc = CreateContainer(typeof(A), typeof(B), typeof(C), typeof(D)); @@ -361,7 +361,7 @@ public void BoundarySharingTest() /// CirA root of the composition has to be shared explicitly. /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void CircularBoundarySharingTest() { var cc = CreateContainer(typeof(CirA), typeof(CirB), typeof(CirC)); @@ -378,7 +378,7 @@ public void CircularBoundarySharingTest() /// Something is badly busted here.. I am getting a null ref exception /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void MultipleBoundarySpecified() { var cc = CreateContainer(typeof(ProjA), typeof(ProjB), typeof(SolA), typeof(DocA), typeof(DocB), typeof(ColA), typeof(ColB)); @@ -388,7 +388,7 @@ public void MultipleBoundarySpecified() [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void SharedPartExportingMultipleContractsSharesAnInstance() { var cc = CreateContainer(typeof(XY)); @@ -398,7 +398,7 @@ public void SharedPartExportingMultipleContractsSharesAnInstance() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetExportsCreatesInstancedObjectByDefault() { var cc = CreateContainer(typeof(NonSharedClass)); @@ -408,7 +408,7 @@ public void GetExportsCreatesInstancedObjectByDefault() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetExportsCreatesSharedObjectsWhenSpecified() { var cc = CreateContainer(typeof(SharedClass)); @@ -423,7 +423,7 @@ public void GetExportsCreatesSharedObjectsWhenSpecified() /// verify that On Method call different instances are returned. /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ExportFactoryCreatesNewInstances() { var cc = CreateContainer(typeof(ClassWithExportFactoryShared), typeof(NonSharedClass)); @@ -439,7 +439,7 @@ public void ExportFactoryCreatesNewInstances() /// ExportFactory should be importable as a property /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ClassWithExportFactoryAsAProperty() { var cc = CreateContainer(typeof(ClassWithExportFactoryAsAProperty), typeof(NonSharedClass)); @@ -456,7 +456,7 @@ public void ClassWithExportFactoryAsAProperty() /// is creating a part which is shared, it will return back the same instance of the part. /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ClassWithExportFactoryAndSharedExport() { var cc = CreateContainer(typeof(ClassWithExportFactoryShared), typeof(SharedClass)); @@ -473,7 +473,7 @@ public void ClassWithExportFactoryAndSharedExport() /// Two instances of the root class are created , the part created using export factory should not be shared /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ClassWithNonSharedExportFactoryCreatesSharedInstances() { var cc = CreateContainer(typeof(ClassWithExportFactoryNonShared), typeof(SharedClass)); @@ -489,7 +489,7 @@ public void ClassWithNonSharedExportFactoryCreatesSharedInstances() public class ASharedPart { } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void ConsistentResultsAreReturneWhenResolvingLargeNumbersOfSharedParts() { var config = new ContainerConfiguration(); diff --git a/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.cs b/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.cs index d3e151801ce5a4..5fd3d48328a934 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System diff --git a/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.csproj b/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.csproj index a02f4d1e07ae4e..1a58ecd7cfb1b4 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.csproj +++ b/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.csproj @@ -2,7 +2,7 @@ true netstandard2.0;net461;$(NetFrameworkCurrent) - true + true diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj b/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj index c254bbe1671cbd..6de345cee06256 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj @@ -2,7 +2,7 @@ true netstandard2.0;net461;$(NetFrameworkCurrent) - true + true diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs index 41cbde86f94a0e..1d37a0de5e03c8 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs @@ -97,7 +97,7 @@ private ClientConfigPaths(string exePath, bool includeUserConfig) if (string.IsNullOrEmpty(namePrefix)) namePrefix = Validate(ProductName, limitSize: true); string applicationUriLower = !string.IsNullOrEmpty(ApplicationUri) - ? ApplicationUri.ToLower(CultureInfo.InvariantCulture) + ? ApplicationUri.ToLowerInvariant() : null; string hashSuffix = GetTypeAndHashSuffix(applicationUriLower); string part2 = !string.IsNullOrEmpty(namePrefix) && !string.IsNullOrEmpty(hashSuffix) @@ -272,7 +272,7 @@ private void SetNamesAndVersion(string applicationFilename, Assembly exeAssembly // Try the remainder of the namespace if (ns != null) { - int lastDot = ns.LastIndexOf(".", StringComparison.Ordinal); + int lastDot = ns.LastIndexOf('.'); if ((lastDot != -1) && (lastDot < ns.Length - 1)) ProductName = ns.Substring(lastDot + 1); else ProductName = ns; @@ -291,7 +291,7 @@ private void SetNamesAndVersion(string applicationFilename, Assembly exeAssembly // Try the first part of the namespace if (ns != null) { - int firstDot = ns.IndexOf(".", StringComparison.Ordinal); + int firstDot = ns.IndexOf('.'); _companyName = firstDot != -1 ? ns.Substring(0, firstDot) : ns; _companyName = _companyName.Trim(); diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationElement.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationElement.cs index 59bcf785131049..d8444128481e77 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationElement.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationElement.cs @@ -1138,7 +1138,7 @@ protected internal virtual bool SerializeElement(XmlWriter writer, bool serializ ((_itemLockedFlag & ConfigurationValueFlags.XmlParentInherited) == 0)) { dataToWrite = true; - writer?.WriteAttributeString(LockItemKey, true.ToString().ToLower(CultureInfo.InvariantCulture)); + writer?.WriteAttributeString(LockItemKey, true.ToString().ToLowerInvariant()); } } @@ -1246,9 +1246,9 @@ internal void ReportInvalidLock(string attribToLockTrim, ConfigurationLockCollec { if (sb.Length != 0) sb.Append(", "); - sb.Append("'"); + sb.Append('\''); sb.Append(validProp.Name); - sb.Append("'"); + sb.Append('\''); } } else @@ -1257,9 +1257,9 @@ internal void ReportInvalidLock(string attribToLockTrim, ConfigurationLockCollec { if (sb.Length != 0) sb.Append(", "); - sb.Append("'"); + sb.Append('\''); sb.Append(validProp.Name); - sb.Append("'"); + sb.Append('\''); } } } diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/IdnElement.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/IdnElement.cs index b3439e9c03bf1c..82959a6a3aaf3e 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/IdnElement.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/IdnElement.cs @@ -50,11 +50,9 @@ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceT public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { - string s = value as string; - if (s != null) + if (value is string s) { - s = s.ToLower(CultureInfo.InvariantCulture); - switch (s) + switch (s.ToLowerInvariant()) { case "all": return UriIdnScope.All; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/RsaProtectedConfigurationProvider.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/RsaProtectedConfigurationProvider.cs index 33760ba9fb76b5..79f3610e4f5c96 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/RsaProtectedConfigurationProvider.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/RsaProtectedConfigurationProvider.cs @@ -12,7 +12,7 @@ namespace System.Configuration // Need the System.Security.Cryptography.Xml package published before this can be enabled, // for now, make it throw PlatformNotSupported. // - // https://github.com/dotnet/corefx/issues/14950 + // https://github.com/dotnet/runtime/issues/19838 public sealed class RsaProtectedConfigurationProvider : ProtectedConfigurationProvider { diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/XmlUtil.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/XmlUtil.cs index a1fbb239926ed4..d483c6d6a5df07 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/XmlUtil.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/XmlUtil.cs @@ -834,22 +834,22 @@ private string RetrieveFullOpenElementTag() // Start with element tag name StringBuilder element = new StringBuilder(64); - element.Append("<"); + element.Append('<'); element.Append(Reader.Name); // Add attributes while (Reader.MoveToNextAttribute()) { - element.Append(" "); + element.Append(' '); element.Append(Reader.Name); - element.Append("="); + element.Append('='); element.Append('\"'); element.Append(Reader.Value); element.Append('\"'); } // Now close the element tag - element.Append(">"); + element.Append('>'); return element.ToString(); } diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationLockCollectionTest.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationLockCollectionTest.cs index 8e50d58bb0a924..ebe01e9fb4b589 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationLockCollectionTest.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationLockCollectionTest.cs @@ -141,7 +141,7 @@ public void SetFromList() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/18195", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21027", TargetFrameworkMonikers.NetFramework)] public void DuplicateAdd() { SysConfig cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationManagerTest.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationManagerTest.cs index 34da945abc2306..412117a59595a4 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationManagerTest.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationManagerTest.cs @@ -43,7 +43,7 @@ namespace MonoTests.System.Configuration public class ConfigurationManagerTest { [Fact] // OpenExeConfiguration (ConfigurationUserLevel) - [ActiveIssue("https://github.com/dotnet/corefx/issues/19384", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21528", TargetFrameworkMonikers.NetFramework)] public void OpenExeConfiguration1_UserLevel_None() { SysConfig config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); @@ -66,8 +66,8 @@ public void OpenExeConfiguration1_UserLevel_PerUserRoaming() Assert.Equal("user.config", fi.Name); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/corefx/issues/29752 - [ActiveIssue("https://github.com/dotnet/corefx/issues/15065", TestPlatforms.AnyUnix)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/runtime/issues/26195 + [ActiveIssue("https://github.com/dotnet/runtime/issues/19875", TestPlatforms.AnyUnix)] public void OpenExeConfiguration1_UserLevel_PerUserRoamingAndLocal() { SysConfig config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal); @@ -132,7 +132,7 @@ public void OpenExeConfiguration2_ExePath_DoesNotExist() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/18831", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21319", TargetFrameworkMonikers.NetFramework)] public void exePath_UserLevelNone() { string name = TestUtil.ThisApplicationPath; @@ -155,8 +155,8 @@ public void exePath_UserLevelPerRoaming() Assert.Equal("user.config", Path.GetFileName(filePath)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/corefx/issues/29752 - [ActiveIssue("https://github.com/dotnet/corefx/issues/15066", TestPlatforms.AnyUnix)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/runtime/issues/26195 + [ActiveIssue("https://github.com/dotnet/runtime/issues/19876", TestPlatforms.AnyUnix)] public void exePath_UserLevelPerRoamingAndLocal() { SysConfig config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal); @@ -261,7 +261,7 @@ public void mapped_MachineConfig() [Fact] // Doesn't pass on Mono // [Category("NotWorking")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/19384", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21528", TargetFrameworkMonikers.NetFramework)] public void mapped_ExeConfiguration_null() { SysConfig config = ConfigurationManager.OpenMappedExeConfiguration(null, ConfigurationUserLevel.None); diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/Resources/Strings.Designer.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/Resources/Strings.Designer.cs index b5517858628fd4..765402a2308cdf 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/Resources/Strings.Designer.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/Resources/Strings.Designer.cs @@ -29,7 +29,6 @@ internal class Strings { private static global::System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Strings() { } diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/AppSettingsTests.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/AppSettingsTests.cs index ff9c22039bf77e..a4e6324ce65be4 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/AppSettingsTests.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/AppSettingsTests.cs @@ -62,7 +62,7 @@ public void AddToAppSettings_NoSave() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/19336", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21510", TargetFrameworkMonikers.NetFramework)] public void AddToAppSettings_Save() { using (var temp = new TempConfig(TestData.EmptyConfig)) diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ApplicationSettingsBaseTests.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ApplicationSettingsBaseTests.cs index ee3f32fae4fadb..b080ff29ad1885 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ApplicationSettingsBaseTests.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ApplicationSettingsBaseTests.cs @@ -102,7 +102,7 @@ public void GetSetIntProperty_SimpleSettings_Ok(bool isSynchronized) [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer)), InlineData(true), InlineData(false)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/35668")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/28833")] public void Save_SimpleSettings_Ok(bool isSynchronized) { PersistedSimpleSettings settings = isSynchronized diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ConfigurationElementCollectionTests.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ConfigurationElementCollectionTests.cs index c5421e63a706d5..12dc72ff2e288e 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ConfigurationElementCollectionTests.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ConfigurationElementCollectionTests.cs @@ -204,7 +204,7 @@ public void BasicThrowOnDuplicateIsFalse() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/19338", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21512", TargetFrameworkMonikers.NetFramework)] public void EqualsNullIsFalse() { // Note: this null refs on desktop diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ConfigurationPropertyTests.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ConfigurationPropertyTests.cs index a03429631fbb8c..b0e5f252b196d8 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ConfigurationPropertyTests.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ConfigurationPropertyTests.cs @@ -139,7 +139,7 @@ public void TypeConverterRecognized() } [Fact] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix https://github.com/dotnet/corefx/issues/41873")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix https://github.com/dotnet/corefx/pull/41873")] public void DescriptionValueIsExposed() { FooFailsValidator validator = new FooFailsValidator(); diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/LocalFileSettingsProviderTests.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/LocalFileSettingsProviderTests.cs index 615a6301405e87..8b5bd96d609fea 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/LocalFileSettingsProviderTests.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/LocalFileSettingsProviderTests.cs @@ -15,7 +15,7 @@ public class LocalFileSettingsProviderTests ["SettingsKey"] = "SettingsKeyFoo" }; - [ActiveIssue("https://github.com/dotnet/corefx/issues/37364")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/29429")] [Fact] public void GetPropertyValues_NotStoredProperty_ValueEqualsNull() { @@ -31,7 +31,7 @@ public void GetPropertyValues_NotStoredProperty_ValueEqualsNull() Assert.Null(propertyValues["PropertyName"].PropertyValue); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/37364")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/29429")] [Fact] public void GetPropertyValues_NotStoredConnectionStringProperty_ValueEqualsEmptyString() { diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/SectionGroupsTests.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/SectionGroupsTests.cs index 83a5ecac481044..9e2fe188a85300 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/SectionGroupsTests.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/SectionGroupsTests.cs @@ -53,7 +53,7 @@ public void EmptySectionGroup() "; [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/19383", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21527", TargetFrameworkMonikers.NetFramework)] public void SimpleSectionGroup() { using (var temp = new TempConfig(SimpleSectionGroupConfiguration)) diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/SettingElementTests.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/SettingElementTests.cs index d08f8dd95e389d..709aad4a981ff4 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/SettingElementTests.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/SettingElementTests.cs @@ -53,7 +53,7 @@ public void DefaultConstructorEquality() Assert.True(ElementOne.Equals(ElementTwo)); } - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix for https://github.com/dotnet/corefx/issues/27875")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix for https://github.com/dotnet/runtime/issues/25369")] [Fact] public void DefaultConstructorEqualHashCodes() { diff --git a/src/libraries/System.Console/ref/System.Console.cs b/src/libraries/System.Console/ref/System.Console.cs index ce7fdaa1e5cd1f..24ebcf1845b91b 100644 --- a/src/libraries/System.Console/ref/System.Console.cs +++ b/src/libraries/System.Console/ref/System.Console.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System diff --git a/src/libraries/System.Console/src/FxCopBaseline.cs b/src/libraries/System.Console/src/FxCopBaseline.cs deleted file mode 100644 index a5fac4ae97b6a9..00000000000000 --- a/src/libraries/System.Console/src/FxCopBaseline.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#Dispose(System.Boolean)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#Peek():System.Int32")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#Read():System.Int32")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#Read(System.Char[],System.Int32,System.Int32):System.Int32")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#ReadBlock(System.Char[],System.Int32,System.Int32):System.Int32")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#ReadLine():System.String")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#ReadToEnd():System.String")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#ReadKey(System.Boolean&):System.ConsoleKeyInfo")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#get_KeyAvailable():System.Boolean")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#ResetColor()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#TryGetCursorPosition(System.Int32&,System.Int32&,System.Boolean):System.Boolean")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#RefreshColors(System.ConsoleColor&,System.ConsoleColor)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#EnsureInitializedCore()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#WriteStdoutAnsiString(System.String,System.Boolean)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#ForegroundColor")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#BackgroundColor")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#SetCursorPosition(System.Int32,System.Int32)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#GetWindowSize(System.Int32&,System.Int32&)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#UpdatedCachedCursorPosition(System.Byte*,System.Int32,System.Int32)")] diff --git a/src/libraries/System.Console/src/System.Console.csproj b/src/libraries/System.Console/src/System.Console.csproj index d93b446b720433..c24b37c5cfb1d1 100644 --- a/src/libraries/System.Console/src/System.Console.csproj +++ b/src/libraries/System.Console/src/System.Console.csproj @@ -3,12 +3,9 @@ System.Console System.Console true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix enable - - - diff --git a/src/libraries/System.Console/src/System/ConsolePal.Windows.cs b/src/libraries/System.Console/src/System/ConsolePal.Windows.cs index b77ce66db198c4..c09e5800b18703 100644 --- a/src/libraries/System.Console/src/System/ConsolePal.Windows.cs +++ b/src/libraries/System.Console/src/System/ConsolePal.Windows.cs @@ -1215,7 +1215,7 @@ private static unsafe int WriteFileNative(IntPtr hFile, byte[] bytes, int offset int numBytesWritten; writeSuccess = (0 != Interop.Kernel32.WriteFile(hFile, p + offset, count, out numBytesWritten, IntPtr.Zero)); // In some cases we have seen numBytesWritten returned that is twice count; - // so we aren't asserting the value of it. See https://github.com/dotnet/corefx/issues/24508 + // so we aren't asserting the value of it. See https://github.com/dotnet/runtime/issues/23776 } else { diff --git a/src/libraries/System.Console/src/System/IO/SyncTextReader.Unix.cs b/src/libraries/System.Console/src/System/IO/SyncTextReader.Unix.cs index 9e830b9e6f4197..d405a6fea14f2d 100644 --- a/src/libraries/System.Console/src/System/IO/SyncTextReader.Unix.cs +++ b/src/libraries/System.Console/src/System/IO/SyncTextReader.Unix.cs @@ -7,7 +7,7 @@ namespace System.IO { /* SyncTextReader intentionally locks on itself rather than a private lock object. - * This is done to synchronize different console readers (https://github.com/dotnet/corefx/issues/2855). + * This is done to synchronize different console readers (https://github.com/dotnet/corefx/pull/2855). */ internal sealed partial class SyncTextReader : TextReader { diff --git a/src/libraries/System.Console/src/System/IO/SyncTextReader.cs b/src/libraries/System.Console/src/System/IO/SyncTextReader.cs index 637c824234ba89..3e2aad0fdaf807 100644 --- a/src/libraries/System.Console/src/System/IO/SyncTextReader.cs +++ b/src/libraries/System.Console/src/System/IO/SyncTextReader.cs @@ -9,7 +9,7 @@ namespace System.IO { /* SyncTextReader intentionally locks on itself rather than a private lock object. - * This is done to synchronize different console readers (https://github.com/dotnet/corefx/issues/2855). + * This is done to synchronize different console readers (https://github.com/dotnet/corefx/pull/2855). */ internal sealed partial class SyncTextReader : TextReader { diff --git a/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs b/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs index 345843f9fac852..ab85a77880babe 100644 --- a/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs +++ b/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs @@ -13,7 +13,7 @@ public partial class CancelKeyPressTests { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/39172")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30130")] [PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invokes public void HandlerInvokedForSigInt() { @@ -21,7 +21,7 @@ public void HandlerInvokedForSigInt() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/39172")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30130")] [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.OSX)] // Jenkins blocks SIGQUIT on OS X, causing the test to fail in CI public void HandlerInvokedForSigQuit() { @@ -29,7 +29,7 @@ public void HandlerInvokedForSigQuit() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/39172")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30130")] [PlatformSpecific(TestPlatforms.AnyUnix)] // events are triggered by Unix signals (SIGINT, SIGQUIT, SIGCHLD). public void ExitDetectionNotBlockedByHandler() { diff --git a/src/libraries/System.Data.Common/ref/System.Data.Common.Forwards.cs b/src/libraries/System.Data.Common/ref/System.Data.Common.Forwards.cs index eb148f16f86ae7..26117a9fb711c2 100644 --- a/src/libraries/System.Data.Common/ref/System.Data.Common.Forwards.cs +++ b/src/libraries/System.Data.Common/ref/System.Data.Common.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.DBNull))] diff --git a/src/libraries/System.Data.Common/ref/System.Data.Common.cs b/src/libraries/System.Data.Common/ref/System.Data.Common.cs index 110f5f5bada891..d47c6f982b3f59 100644 --- a/src/libraries/System.Data.Common/ref/System.Data.Common.cs +++ b/src/libraries/System.Data.Common/ref/System.Data.Common.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Data diff --git a/src/libraries/System.Data.Common/ref/System.Data.Common.manual.cs b/src/libraries/System.Data.Common/ref/System.Data.Common.manual.cs index 687e5a0340c11f..d8bc355ddea174 100644 --- a/src/libraries/System.Data.Common/ref/System.Data.Common.manual.cs +++ b/src/libraries/System.Data.Common/ref/System.Data.Common.manual.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/AdapterUtil.Common.cs b/src/libraries/System.Data.Common/src/System/Data/Common/AdapterUtil.Common.cs index d538b6ed476113..d914b982b279f6 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/AdapterUtil.Common.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/AdapterUtil.Common.cs @@ -788,7 +788,7 @@ internal static void BuildSchemaTableInfoTableNames(string[] columnNameArray) string columnName = columnNameArray[i]; if ((null != columnName) && (0 < columnName.Length)) { - columnName = columnName.ToLower(CultureInfo.InvariantCulture); + columnName = columnName.ToLowerInvariant(); int index; if (hash.TryGetValue(columnName, out index)) { @@ -814,7 +814,7 @@ internal static void BuildSchemaTableInfoTableNames(string[] columnNameArray) } else { - columnName = columnName.ToLower(CultureInfo.InvariantCulture); + columnName = columnName.ToLowerInvariant(); if (i != hash[columnName]) { GenerateUniqueName(hash, ref columnNameArray[i], i, 1); @@ -828,7 +828,7 @@ private static int GenerateUniqueName(Dictionary hash, ref string c for (; ; ++uniqueIndex) { string uniqueName = columnName + uniqueIndex.ToString(CultureInfo.InvariantCulture); - string lowerName = uniqueName.ToLower(CultureInfo.InvariantCulture); + string lowerName = uniqueName.ToLowerInvariant(); if (hash.TryAdd(lowerName, index)) { columnName = uniqueName; diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/DbConnectionOptions.cs b/src/libraries/System.Data.Common/src/System/Data/Common/DbConnectionOptions.cs index 2a66db8d95cb33..53ed0493952f06 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/DbConnectionOptions.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/DbConnectionOptions.cs @@ -167,7 +167,7 @@ internal string ExpandKeyword(string keyword, string replacementValue) [Conditional("DEBUG")] static partial void DebugTraceKeyValuePair(string keyname, string keyvalue, Dictionary synonyms) { - Debug.Assert(keyname == keyname.ToLower(CultureInfo.InvariantCulture), "missing ToLower"); + Debug.Assert(keyname == keyname.ToLowerInvariant(), "missing ToLower"); string realkeyname = ((null != synonyms) ? (string)synonyms[keyname] : keyname); if ((KEY.Password != realkeyname) && (SYNONYM.Pwd != realkeyname)) diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/DbProviderFactory.CreatePermission.cs b/src/libraries/System.Data.Common/src/System/Data/Common/DbProviderFactory.CreatePermission.cs index eb7ddd594df2a3..2ea64ea5d4d047 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/DbProviderFactory.CreatePermission.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/DbProviderFactory.CreatePermission.cs @@ -5,7 +5,7 @@ using System.Security.Permissions; // Additional implementation to keep public API in Mono (it has a reference to this file) -// https://github.com/dotnet/corefx/issues/16184 +// https://github.com/dotnet/runtime/issues/20232 namespace System.Data.Common { diff --git a/src/libraries/System.Data.Common/src/System/Data/DataTable.cs b/src/libraries/System.Data.Common/src/System/Data/DataTable.cs index a5665e65a67500..181ec8b5df4aaf 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataTable.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataTable.cs @@ -3690,7 +3690,7 @@ internal IndexField[] ParseSortString(string sortString) IndexField[] indexDesc = Array.Empty(); if ((null != sortString) && (0 < sortString.Length)) { - string[] split = sortString.Split(new char[] { ',' }); + string[] split = sortString.Split(','); indexDesc = new IndexField[split.Length]; for (int i = 0; i < split.Length; i++) @@ -3711,9 +3711,9 @@ internal IndexField[] ParseSortString(string sortString) } // handle brackets. - if (current.StartsWith("[", StringComparison.Ordinal)) + if (current.StartsWith('[')) { - if (current.EndsWith("]", StringComparison.Ordinal)) + if (current.EndsWith(']')) { current = current.Substring(1, current.Length - 2); } diff --git a/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs b/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs index 65c6740723aa28..524afb5b5f026c 100644 --- a/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs +++ b/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs @@ -486,7 +486,8 @@ public SqlDecimal(decimal value) // m_data1 = *pInt++; // lo part // m_data2 = *pInt++; // mid part - int[] bits = decimal.GetBits(value); + Span bits = stackalloc int[4]; + decimal.GetBits(value, bits); uint sgnscl; unchecked @@ -1880,7 +1881,7 @@ private void ZeroToMaxLen(int cUI4sCur) { // The array in Shiloh. Listed here for comparison. //private static readonly byte[] rgCLenFromPrec = new byte[] {5,5,5,5,5,5,5,5,5,9,9,9,9,9, // 9,9,9,9,9,13,13,13,13,13,13,13,13,13,17,17,17,17,17,17,17,17,17,17}; - private static readonly byte[] s_rgCLenFromPrec = new byte[] + private static ReadOnlySpan RgCLenFromPrec => new byte[] // rely on C# compiler optimization to eliminate allocation { 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, @@ -1891,7 +1892,7 @@ private static byte CLenFromPrec(byte bPrec) { Debug.Assert(bPrec <= MaxPrecision && bPrec > 0, "bPrec <= MaxPrecision && bPrec > 0", "Invalid numeric precision"); - return s_rgCLenFromPrec[bPrec - 1]; + return RgCLenFromPrec[bPrec - 1]; } // check whether is zero diff --git a/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs b/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs index 726c377f61e150..fd95e93c6cf20c 100644 --- a/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs +++ b/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs @@ -1161,7 +1161,7 @@ internal DataColumn FindField(DataTable table, string field) bool attribute = false; string colName = field; - if (field.StartsWith("@", StringComparison.Ordinal)) + if (field.StartsWith('@')) { attribute = true; colName = field.Substring(1); diff --git a/src/libraries/System.Data.Common/tests/System/Data/Common/DbCommandTests.cs b/src/libraries/System.Data.Common/tests/System/Data/Common/DbCommandTests.cs index dc06d62ab8e79e..53f5de97e32019 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/Common/DbCommandTests.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/Common/DbCommandTests.cs @@ -153,8 +153,7 @@ protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior) } } - [Fact] - [SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "GC has different behavior on Mono")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void CanBeFinalized() { FinalizingCommand.CreateAndRelease(); diff --git a/src/libraries/System.Data.Common/tests/System/Data/Common/DbConnectionTests.cs b/src/libraries/System.Data.Common/tests/System/Data/Common/DbConnectionTests.cs index de8e954cf6d187..c6d0ae306751ed 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/Common/DbConnectionTests.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/Common/DbConnectionTests.cs @@ -136,8 +136,7 @@ private class TestDbProviderFactory : DbProviderFactory public static DbProviderFactory Instance = new TestDbProviderFactory(); } - [Fact] - [SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "GC has different behavior on Mono")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void CanBeFinalized() { FinalizingConnection.CreateAndRelease(); @@ -147,6 +146,7 @@ public void CanBeFinalized() } [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/15180", TestRuntimes.Mono)] public void ProviderFactoryTest() { DbProviderFactoryConnection con = new DbProviderFactoryConnection(); diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataSetTest.cs b/src/libraries/System.Data.Common/tests/System/Data/DataSetTest.cs index 28d26023c88c77..5ef04ff8d23226 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataSetTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataSetTest.cs @@ -666,7 +666,7 @@ public void SerializeDataSet2() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/39229")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30154")] public void SerializeDataSet3() { string xml = @""; @@ -1710,7 +1710,7 @@ public void CloneSubClassTest() #region DataSet.GetChanges Tests [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/39171")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30129")] public void GetChanges_Relations_DifferentRowStatesTest() { DataSet ds = new DataSet("ds"); diff --git a/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlBinaryTest.cs b/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlBinaryTest.cs index f44ad06769221e..224bf2a4bf45f1 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlBinaryTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlBinaryTest.cs @@ -79,7 +79,7 @@ public void Properties() Assert.Equal((byte)128, testBinary[1]); Assert.Equal((byte)64, testBinary[0]); - // See https://github.com/dotnet/corefx/issues/39883 + // See https://github.com/dotnet/runtime/issues/30416 Assert.Throws(() => testBinary[testBinary.Length]); Assert.Throws(() => SqlBinary.Null[2]); diff --git a/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs b/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs index 89ff24b068c490..a4403b41c6feb6 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs @@ -37,7 +37,7 @@ public static class SqlStringSortingTest private static readonly UnicodeEncoding s_unicodeEncoding = new UnicodeEncoding(bigEndian: false, byteOrderMark: false, throwOnInvalidBytes: true); - [ActiveIssue("https://github.com/dotnet/corefx/issues/12518", TestPlatforms.AnyUnix)] // TODO: Add this to the theory below when the issue is addressed on Unix + [ActiveIssue("https://github.com/dotnet/runtime/issues/18912", TestPlatforms.AnyUnix)] // TODO: Add this to the theory below when the issue is addressed on Unix [Theory] [InlineData("ja-JP", 0x0411)] // Japanese - Japan public static void SqlStringValidComparisonTest_Windows(string cultureName, int localeId) => SqlStringValidComparisonTest(cultureName, localeId); diff --git a/src/libraries/System.Data.Odbc/ref/System.Data.Odbc.cs b/src/libraries/System.Data.Odbc/ref/System.Data.Odbc.cs index c4e6dc0f1cd1e8..7cbd37e34e8a00 100644 --- a/src/libraries/System.Data.Odbc/ref/System.Data.Odbc.cs +++ b/src/libraries/System.Data.Odbc/ref/System.Data.Odbc.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Data.Odbc diff --git a/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DBConnectionString.cs b/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DBConnectionString.cs index a1358402ef98ca..2e889a4aab28d8 100644 --- a/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DBConnectionString.cs +++ b/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DBConnectionString.cs @@ -307,7 +307,7 @@ private void ValidateCombinedSet(DBConnectionString componentSet, DBConnectionSt // Component==Allow, Combined==Allow // All values in the Combined Set should also be in the Component Set // Combined - Component == null - Debug.Assert(combinedSet._restrictionValues.Except(componentSet._restrictionValues).Count() == 0, "Combined set allows values not allowed by component set"); + Debug.Assert(!combinedSet._restrictionValues.Except(componentSet._restrictionValues).Any(), "Combined set allows values not allowed by component set"); } else if (combinedSet._behavior == KeyRestrictionBehavior.PreventUsage) { @@ -326,14 +326,14 @@ private void ValidateCombinedSet(DBConnectionString componentSet, DBConnectionSt // Component==PreventUsage, Combined==Allow // There shouldn't be any of the values from the Component Set in the Combined Set // Intersect(Component, Combined) == null - Debug.Assert(combinedSet._restrictionValues.Intersect(componentSet._restrictionValues).Count() == 0, "Combined values allows values prevented by component set"); + Debug.Assert(!combinedSet._restrictionValues.Intersect(componentSet._restrictionValues).Any(), "Combined values allows values prevented by component set"); } else if (combinedSet._behavior == KeyRestrictionBehavior.PreventUsage) { // Component==PreventUsage, Combined==PreventUsage // All values in the Component Set should also be in the Combined Set // Component - Combined == null - Debug.Assert(componentSet._restrictionValues.Except(combinedSet._restrictionValues).Count() == 0, "Combined values does not prevent all of the values prevented by the component set"); + Debug.Assert(!componentSet._restrictionValues.Except(combinedSet._restrictionValues).Any(), "Combined values does not prevent all of the values prevented by the component set"); } else { diff --git a/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionOptions.cs b/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionOptions.cs index 92f3ff44997970..de20697095a9b7 100644 --- a/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionOptions.cs +++ b/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionOptions.cs @@ -132,7 +132,7 @@ internal static void AppendKeyValuePairBuilder(StringBuilder builder, string key if ((0 < builder.Length) && (';' != builder[builder.Length - 1])) { - builder.Append(";"); + builder.Append(';'); } if (useOdbcRules) @@ -143,7 +143,7 @@ internal static void AppendKeyValuePairBuilder(StringBuilder builder, string key { builder.Append(keyName.Replace("=", "==")); } - builder.Append("="); + builder.Append('='); if (null != keyValue) { // else =; diff --git a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj index 92156ab91c74e3..08dd86496591e8 100644 --- a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj +++ b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj @@ -5,8 +5,8 @@ true SR.Odbc_PlatformNotSupported netcoreapp2.0-FreeBSD;netcoreapp2.0-Linux;netcoreapp2.0-OSX;netcoreapp2.0-Windows_NT;net461-Windows_NT;netstandard2.0;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-Windows_NT;$(NetFrameworkCurrent)-Windows_NT - true - true + true + true diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnection.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnection.cs index 4d85b611d786e5..99c23d527a32d4 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnection.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnection.cs @@ -882,7 +882,6 @@ internal bool TestRestrictedSqlBindType(ODBC32.SQL_TYPE sqltype) } // suppress this message - we cannot use SafeHandle here. Also, see notes in the code (VSTFDEVDIV# 560355) - [SuppressMessage("Microsoft.Reliability", "CA2004:RemoveCallsToGCKeepAlive")] protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) { DbTransaction transaction = InnerConnection.BeginTransaction(isolationLevel); @@ -940,7 +939,7 @@ internal void Open_ChangeDatabase(string value) CheckState(ADP.ChangeDatabase); // Database name must not be null, empty or whitspace - if ((null == value) || (0 == value.Trim().Length)) + if (string.IsNullOrWhiteSpace(value)) { // MDAC 62679 throw ADP.EmptyDatabaseName(); } diff --git a/src/libraries/System.Data.Odbc/tests/CommandBuilderTests.cs b/src/libraries/System.Data.Odbc/tests/CommandBuilderTests.cs index 7513455afdc6d2..0dabff6ce72ca5 100644 --- a/src/libraries/System.Data.Odbc/tests/CommandBuilderTests.cs +++ b/src/libraries/System.Data.Odbc/tests/CommandBuilderTests.cs @@ -8,7 +8,7 @@ namespace System.Data.Odbc.Tests { public class CommandBuilderTests : IntegrationTestBase { - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void QuoteIdentifier_UseConnection() { var commandBuilder = new OdbcCommandBuilder(); @@ -37,7 +37,7 @@ public void QuoteIdentifier_UseConnection() Assert.Throws(() => commandBuilder.UnquoteIdentifier("Test")); } - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void QuoteIdentifier_CustomPrefixSuffix() { var commandBuilder = new OdbcCommandBuilder(); diff --git a/src/libraries/System.Data.Odbc/tests/ReaderTests.cs b/src/libraries/System.Data.Odbc/tests/ReaderTests.cs index 844767da9917a4..4cb5bc777b7758 100644 --- a/src/libraries/System.Data.Odbc/tests/ReaderTests.cs +++ b/src/libraries/System.Data.Odbc/tests/ReaderTests.cs @@ -8,7 +8,7 @@ namespace System.Data.Odbc.Tests { public class ReaderTests : IntegrationTestBase { - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void EmptyReader() { command.CommandText = @@ -42,7 +42,7 @@ public void EmptyReader() } } - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void GetValues() { command.CommandText = @@ -75,7 +75,7 @@ public void GetValues() } } - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void GetValueFailsWithBigIntWithBackwardsCompatibility() { command.CommandText = @@ -110,7 +110,7 @@ public void GetValueFailsWithBigIntWithBackwardsCompatibility() } } - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void GetDataTypeName() { command.CommandText = @@ -136,7 +136,7 @@ public void GetDataTypeName() } } - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void GetFieldTypeIsNotSupportedInSqlite() { command.CommandText = @@ -167,7 +167,7 @@ public void GetFieldTypeIsNotSupportedInSqlite() } } - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void IsDbNullIsNotSupportedInSqlite() { command.CommandText = @@ -198,7 +198,7 @@ public void IsDbNullIsNotSupportedInSqlite() } } - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void InvalidRowIndex() { command.CommandText = @@ -230,7 +230,7 @@ public void InvalidRowIndex() } } - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void InvalidRowName() { command.CommandText = diff --git a/src/libraries/System.Data.Odbc/tests/SmokeTest.cs b/src/libraries/System.Data.Odbc/tests/SmokeTest.cs index 594cf81459bb45..20ceaee5084a39 100644 --- a/src/libraries/System.Data.Odbc/tests/SmokeTest.cs +++ b/src/libraries/System.Data.Odbc/tests/SmokeTest.cs @@ -8,7 +8,7 @@ namespace System.Data.Odbc.Tests { public class SmokeTest : IntegrationTestBase { - [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/corefx/issues/15776.")] + [Fact(Skip = "Native dependencies missing in CI. See https://github.com/dotnet/runtime/issues/20097.")] public void CreateInsertSelectTest() { command.CommandText = diff --git a/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj b/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj index ae2e714a7a3a6c..f686cd8940a613 100644 --- a/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj +++ b/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj @@ -1,7 +1,7 @@ $(DefineConstants);TargetsWindows - $(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-Windows_NT;$(NetFrameworkCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetFrameworkCurrent)-Windows_NT diff --git a/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.Manual.cs b/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.Manual.cs index 3e18f43a567aea..58fc40704baf0c 100644 --- a/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.Manual.cs +++ b/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.Manual.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Data.OleDb diff --git a/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.cs b/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.cs index af3e14bb69d753..216cc2df1270b8 100644 --- a/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.cs +++ b/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Data.OleDb diff --git a/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.csproj b/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.csproj index 033fa7a4d3ce19..bf322a4768a8d1 100644 --- a/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.csproj +++ b/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.csproj @@ -2,7 +2,7 @@ true netstandard2.0;net461;$(NetFrameworkCurrent) - true + true $(NoWarn);0618 diff --git a/src/libraries/System.Data.OleDb/src/DbConnectionOptions.cs b/src/libraries/System.Data.OleDb/src/DbConnectionOptions.cs index acf49eb6d0f4fb..f28ba7f837d8ee 100644 --- a/src/libraries/System.Data.OleDb/src/DbConnectionOptions.cs +++ b/src/libraries/System.Data.OleDb/src/DbConnectionOptions.cs @@ -193,7 +193,7 @@ internal static void AppendKeyValuePairBuilder(StringBuilder builder, string key if ((0 < builder.Length) && (';' != builder[builder.Length - 1])) { - builder.Append(";"); + builder.Append(';'); } if (useOdbcRules) @@ -204,7 +204,7 @@ internal static void AppendKeyValuePairBuilder(StringBuilder builder, string key { builder.Append(keyName.Replace("=", "==")); } - builder.Append("="); + builder.Append('='); if (null != keyValue) { // else =; @@ -484,7 +484,7 @@ internal string ExpandDataDirectories(ref string filename, ref int position) [System.Diagnostics.Conditional("DEBUG")] private static void DebugTraceKeyValuePair(string keyname, string keyvalue, Hashtable synonyms) { - Debug.Assert(keyname == keyname.ToLower(CultureInfo.InvariantCulture), "missing ToLower"); + Debug.Assert(keyname == keyname.ToLowerInvariant(), "missing ToLower"); string realkeyname = ((null != synonyms) ? (string)synonyms[keyname] : keyname); if ((KEY.Password != realkeyname) && (SYNONYM.Pwd != realkeyname)) @@ -505,7 +505,7 @@ private static string GetKeyName(StringBuilder buffer) { count--; // trailing whitespace } - return buffer.ToString(0, count).ToLower(CultureInfo.InvariantCulture); + return buffer.ToString(0, count).ToLowerInvariant(); } private static string GetKeyValue(StringBuilder buffer, bool trimWhitespace) @@ -795,7 +795,7 @@ private static Hashtable SplitConnectionString(string connectionString, Hashtabl CaptureCollection keyvalues = match.Groups[ValueIndex].Captures; foreach (Capture keypair in match.Groups[KeyIndex].Captures) { - string keyname = (firstKey ? keypair.Value : keypair.Value.Replace("==", "=")).ToLower(CultureInfo.InvariantCulture); + string keyname = (firstKey ? keypair.Value : keypair.Value.Replace("==", "=")).ToLowerInvariant(); string keyvalue = keyvalues[indexValue++].Value; if (0 < keyvalue.Length) { diff --git a/src/libraries/System.Data.OleDb/src/OleDbCommand.cs b/src/libraries/System.Data.OleDb/src/OleDbCommand.cs index 0f8581f708e582..23d7124e8434ee 100644 --- a/src/libraries/System.Data.OleDb/src/OleDbCommand.cs +++ b/src/libraries/System.Data.OleDb/src/OleDbCommand.cs @@ -411,14 +411,38 @@ private void CreateAccessor() _dbBindings = bindings; } - private void ApplyParameterBindings(UnsafeNativeMethods.ICommandWithParameters commandWithParameters, tagDBPARAMBINDINFO[] bindInfo) + private unsafe void ApplyParameterBindings(UnsafeNativeMethods.ICommandWithParameters commandWithParameters, tagDBPARAMBINDINFO[] bindInfo) { IntPtr[] ordinals = new IntPtr[bindInfo.Length]; for (int i = 0; i < ordinals.Length; ++i) { ordinals[i] = (IntPtr)(i + 1); } - OleDbHResult hr = commandWithParameters.SetParameterInfo((IntPtr)bindInfo.Length, ordinals, bindInfo); + + OleDbHResult hr; + + if (ODB.IsRunningOnX86) + { + tagDBPARAMBINDINFO_x86[] bindInfo_x86 = new tagDBPARAMBINDINFO_x86[bindInfo.Length]; + for (int i = 0; i < bindInfo.Length; i++) + { + fixed (tagDBPARAMBINDINFO* p = &bindInfo[i]) + { + bindInfo_x86[i] = *(tagDBPARAMBINDINFO_x86*)p; + } + } + fixed (tagDBPARAMBINDINFO_x86* p = &bindInfo_x86[0]) + { + hr = commandWithParameters.SetParameterInfo((IntPtr)bindInfo.Length, ordinals, (IntPtr)p); + } + } + else + { + fixed (tagDBPARAMBINDINFO* p = &bindInfo[0]) + { + hr = commandWithParameters.SetParameterInfo((IntPtr)bindInfo.Length, ordinals, (IntPtr)p); + } + } if (hr < 0) { diff --git a/src/libraries/System.Data.OleDb/src/OleDbCommandBuilder.cs b/src/libraries/System.Data.OleDb/src/OleDbCommandBuilder.cs index 994339d046ed47..7aea900b25b86b 100644 --- a/src/libraries/System.Data.OleDb/src/OleDbCommandBuilder.cs +++ b/src/libraries/System.Data.OleDb/src/OleDbCommandBuilder.cs @@ -275,7 +275,7 @@ private static OleDbParameter[] DeriveParametersFromStoredProcedure(OleDbConnect value = dataRow[backendtype, DataRowVersion.Default]; if (value is string) { - string backendtypename = ((string)value).ToLower(CultureInfo.InvariantCulture); + string backendtypename = ((string)value).ToLowerInvariant(); switch (backendtypename) { case "binary": diff --git a/src/libraries/System.Data.OleDb/src/OleDbConnection.cs b/src/libraries/System.Data.OleDb/src/OleDbConnection.cs index 3a9a17c7e897f1..913475fff15a8d 100644 --- a/src/libraries/System.Data.OleDb/src/OleDbConnection.cs +++ b/src/libraries/System.Data.OleDb/src/OleDbConnection.cs @@ -319,7 +319,7 @@ internal int QuotedIdentifierCase() public override void ChangeDatabase(string value) { CheckStateOpen(ADP.ChangeDatabase); - if ((null == value) || (0 == value.Trim().Length)) + if (string.IsNullOrWhiteSpace(value)) { throw ADP.EmptyDatabaseName(); } @@ -366,7 +366,6 @@ private void DisposeMe(bool disposing) } // suppress this message - we cannot use SafeHandle here. - [SuppressMessage("Microsoft.Reliability", "CA2004:RemoveCallsToGCKeepAlive")] protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) { DbTransaction transaction = InnerConnection.BeginTransaction(isolationLevel); diff --git a/src/libraries/System.Data.OleDb/src/OleDbConnectionString.cs b/src/libraries/System.Data.OleDb/src/OleDbConnectionString.cs index 3a0dbd3b872298..cc06e1f386b29e 100644 --- a/src/libraries/System.Data.OleDb/src/OleDbConnectionString.cs +++ b/src/libraries/System.Data.OleDb/src/OleDbConnectionString.cs @@ -416,9 +416,9 @@ private string ValidateConnectionString(string connectionString) StringBuilder builder = new StringBuilder(); builder.Append(KEY.Ole_DB_Services); - builder.Append("="); + builder.Append('='); builder.Append(_oledbServices.ToString(CultureInfo.InvariantCulture)); - builder.Append(";"); + builder.Append(';'); builder.Append(connectionString); connectionString = builder.ToString(); } @@ -448,7 +448,7 @@ private static void ValidateProvider(string progid) { throw ODB.InvalidProviderSpecified(); } - progid = progid.ToLower(CultureInfo.InvariantCulture); + progid = progid.ToLowerInvariant(); if (IsMSDASQL(progid)) { // fail msdasql even if not on the machine. diff --git a/src/libraries/System.Data.OleDb/src/OleDbConnectionStringBuilder.cs b/src/libraries/System.Data.OleDb/src/OleDbConnectionStringBuilder.cs index bc92ee884f4dd8..258538540e00d3 100644 --- a/src/libraries/System.Data.OleDb/src/OleDbConnectionStringBuilder.cs +++ b/src/libraries/System.Data.OleDb/src/OleDbConnectionStringBuilder.cs @@ -566,7 +566,7 @@ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContex if (DBSOURCETYPE_DATASOURCE_TDP == sourceType || DBSOURCETYPE_DATASOURCE_MDP == sourceType) { string progid = (string)row[column2]; - if (!OleDbConnectionString.IsMSDASQL(progid.ToLower(CultureInfo.InvariantCulture))) + if (!OleDbConnectionString.IsMSDASQL(progid.ToLowerInvariant())) { if (0 > providerNames.IndexOf(progid)) { diff --git a/src/libraries/System.Data.OleDb/src/OleDbDataReader.cs b/src/libraries/System.Data.OleDb/src/OleDbDataReader.cs index 5ee968c3c07a02..38d750038223c7 100644 --- a/src/libraries/System.Data.OleDb/src/OleDbDataReader.cs +++ b/src/libraries/System.Data.OleDb/src/OleDbDataReader.cs @@ -1927,7 +1927,7 @@ private int IndexOf(Hashtable hash, string name) } // via case insensitive search, first match with lowest ordinal matches - string tmp = name.ToLower(CultureInfo.InvariantCulture); + string tmp = name.ToLowerInvariant(); index = hash[tmp]; // match via lowercase return ((null != index) ? (int)index : -1); } @@ -2027,7 +2027,7 @@ private void AppendSchemaInfo() string basecolumname = _metadata[i].baseColumnName; if (!ADP.IsEmpty(basecolumname)) { - basecolumname = basecolumname.ToLower(CultureInfo.InvariantCulture); + basecolumname = basecolumname.ToLowerInvariant(); if (!baseColumnNames.Contains(basecolumname)) { baseColumnNames[basecolumname] = i; diff --git a/src/libraries/System.Data.OleDb/src/OleDbMetaDataFactory.cs b/src/libraries/System.Data.OleDb/src/OleDbMetaDataFactory.cs index e4641a2e24fe31..e1151d216011cc 100644 --- a/src/libraries/System.Data.OleDb/src/OleDbMetaDataFactory.cs +++ b/src/libraries/System.Data.OleDb/src/OleDbMetaDataFactory.cs @@ -218,7 +218,7 @@ private DataTable GetDataSourceInformationTable(OleDbConnection connection, OleD compositeSeparatorPattern.Append(patternEscaped.ToString()); if ((schemaSeparatorPattern != null) && (schemaSeparatorPattern != catalogSeparatorPattern)) { - compositeSeparatorPattern.Append("|"); + compositeSeparatorPattern.Append('|'); patternEscaped.Length = 0; ADP.EscapeSpecialCharacters(schemaSeparatorPattern, patternEscaped); compositeSeparatorPattern.Append(patternEscaped.ToString()); diff --git a/src/libraries/System.Data.OleDb/src/OleDbStruct.cs b/src/libraries/System.Data.OleDb/src/OleDbStruct.cs index 1254602394db7a..2dfff4fc61101e 100644 --- a/src/libraries/System.Data.OleDb/src/OleDbStruct.cs +++ b/src/libraries/System.Data.OleDb/src/OleDbStruct.cs @@ -33,11 +33,36 @@ typedef struct tagDBPARAMBINDINFO { } #endif -#if (WIN32 && !ARCH_arm) - [StructLayoutAttribute(LayoutKind.Sequential, Pack = 2)] -#else - [StructLayout(LayoutKind.Sequential, Pack = 8)] + + [StructLayout(LayoutKind.Sequential, Pack = 2)] + internal struct tagDBPARAMBINDINFO_x86 + { + internal IntPtr pwszDataSourceType; + internal IntPtr pwszName; + internal IntPtr ulParamSize; + internal int dwFlags; + internal byte bPrecision; + internal byte bScale; + +#if DEBUG + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + builder.Append("tagDBPARAMBINDINFO_x86").Append(Environment.NewLine); + if (IntPtr.Zero != pwszDataSourceType) + { + builder.Append("pwszDataSourceType =").Append(Marshal.PtrToStringUni(pwszDataSourceType)).Append(Environment.NewLine); + } + builder.Append("\tulParamSize =" + ulParamSize.ToInt64().ToString(CultureInfo.InvariantCulture)).Append(Environment.NewLine); + builder.Append("\tdwFlags =0x" + dwFlags.ToString("X4", CultureInfo.InvariantCulture)).Append(Environment.NewLine); + builder.Append("\tPrecision =" + bPrecision.ToString(CultureInfo.InvariantCulture)).Append(Environment.NewLine); + builder.Append("\tScale =" + bScale.ToString(CultureInfo.InvariantCulture)).Append(Environment.NewLine); + return builder.ToString(); + } #endif + } + + [StructLayout(LayoutKind.Sequential, Pack = 8)] internal struct tagDBPARAMBINDINFO { internal IntPtr pwszDataSourceType; diff --git a/src/libraries/System.Data.OleDb/src/OleDb_Util.cs b/src/libraries/System.Data.OleDb/src/OleDb_Util.cs index 0d68b7a11d0fb4..475c8f4d44bc4c 100644 --- a/src/libraries/System.Data.OleDb/src/OleDb_Util.cs +++ b/src/libraries/System.Data.OleDb/src/OleDb_Util.cs @@ -687,6 +687,8 @@ internal static InvalidOperationException IDBInfoNotSupported() internal const string DbInfoKeywords = "DbInfoKeywords"; internal const string Keyword = "Keyword"; + internal static readonly bool IsRunningOnX86 = RuntimeInformation.ProcessArchitecture == Architecture.X86; + // Debug error string writeline internal static string ELookup(OleDbHResult hr) { @@ -698,7 +700,7 @@ internal static string ELookup(OleDbHResult hr) } builder.Append("(0x"); builder.Append(((int)hr).ToString("X8", CultureInfo.InvariantCulture)); - builder.Append(")"); + builder.Append(')'); return builder.ToString(); } diff --git a/src/libraries/System.Data.OleDb/src/PropertyInfoSet.cs b/src/libraries/System.Data.OleDb/src/PropertyInfoSet.cs index 78e3f3adb8a74e..c89a6065f13108 100644 --- a/src/libraries/System.Data.OleDb/src/PropertyInfoSet.cs +++ b/src/libraries/System.Data.OleDb/src/PropertyInfoSet.cs @@ -89,7 +89,7 @@ internal Dictionary GetValues() propertyInfo._vtype = propinfo.vtType; propertyInfo._supportedValues = propinfo.vValue; propertyInfo._description = propinfo.pwszDescription; - propertyInfo._lowercase = propinfo.pwszDescription.ToLower(CultureInfo.InvariantCulture); + propertyInfo._lowercase = propinfo.pwszDescription.ToLowerInvariant(); propertyInfo._type = PropertyInfoSet.FromVtType(propinfo.vtType); propertyLookup[propertyInfo._lowercase] = propertyInfo; diff --git a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj index 7899a9d6060048..9c2b886ca0671b 100644 --- a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj +++ b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj @@ -3,10 +3,10 @@ true $(NoWarn);CS1573 true - SR.PlatformNotSupported_OleDb - $(NoWarn);CS0618 + SR.PlatformNotSupported_OleDb + $(NoWarn);CS0618 netstandard2.0-Windows_NT;netstandard2.0;net461-Windows_NT;$(NetFrameworkCurrent)-Windows_NT - true + true true diff --git a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPool.cs b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPool.cs index d0a8669c091101..aaba1bededf59c 100644 --- a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPool.cs +++ b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPool.cs @@ -1104,7 +1104,6 @@ internal bool TryGetConnection(DbConnection owningObject, TaskCompletionSource System.Diagnostics.Debug true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSource.cs b/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSource.cs index 7082e9aafc041d..b3805210060cdf 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSource.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSource.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Diagnostics diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSource.csproj b/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSource.csproj index e7d9e1518fae26..db385a8be9a166 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSource.csproj +++ b/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSource.csproj @@ -1,7 +1,7 @@ - netstandard1.1;netstandard1.3;net45;netstandard2.0;$(NetFrameworkCurrent) - true + netstandard2.0;netstandard1.1;netstandard1.3;net45;$(NetFrameworkCurrent) + true true false enable diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs b/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs index 4527e34ca27a92..8de9ac09bb0a7e 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Diagnostics diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj b/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj index 1ba56a2a361383..eb0dc38fc393ab 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj @@ -13,9 +13,9 @@ $(DefineConstants);EVENTSOURCE_ACTIVITY_SUPPORT $(DefineConstants);EVENTSOURCE_ENUMERATE_SUPPORT $(DefineConstants);ALLOW_PARTIALLY_TRUSTED_CALLERS;ENABLE_HTTP_HANDLER - netstandard1.1;netstandard1.3;net45;net46;$(NetCoreAppCurrent);netstandard2.0;$(NetFrameworkCurrent) - true - true + $(NetCoreAppCurrent);netstandard1.1;netstandard1.3;net45;net46;netstandard2.0;$(NetFrameworkCurrent) + true + true true @@ -28,6 +28,9 @@ + + Common\System\HexConverter.cs + diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs index 7dcf650c848f5b..b98571feffb22d 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs @@ -131,7 +131,7 @@ public string? Id { // Convert flags to binary. Span flagsChars = stackalloc char[2]; - ActivityTraceId.ByteToHexDigits(flagsChars, (byte)((~ActivityTraceFlagsIsSet) & _w3CIdFlags)); + HexConverter.ToCharsBuffer((byte)((~ActivityTraceFlagsIsSet) & _w3CIdFlags), flagsChars, 0, HexConverter.Casing.Lower); string id = "00-" + _traceId + "-" + _spanId + "-" + flagsChars.ToString(); Interlocked.CompareExchange(ref _id, id, null); @@ -1018,7 +1018,7 @@ public static ActivityTraceId CreateFromBytes(ReadOnlySpan idData) if (idData.Length != 16) throw new ArgumentOutOfRangeException(nameof(idData)); - return new ActivityTraceId(SpanToHexString(idData)); + return new ActivityTraceId(HexConverter.ToString(idData, HexConverter.Casing.Lower)); } public static ActivityTraceId CreateFromUtf8String(ReadOnlySpan idData) => new ActivityTraceId(idData); @@ -1079,14 +1079,14 @@ private ActivityTraceId(ReadOnlySpan idData) if (!Utf8Parser.TryParse(idData.Slice(0, 16), out span[0], out _, 'x')) { - // Invalid Id, use random https://github.com/dotnet/corefx/issues/38486 + // Invalid Id, use random https://github.com/dotnet/runtime/issues/29859 _hexString = CreateRandom()._hexString; return; } if (!Utf8Parser.TryParse(idData.Slice(16, 16), out span[1], out _, 'x')) { - // Invalid Id, use random https://github.com/dotnet/corefx/issues/38486 + // Invalid Id, use random https://github.com/dotnet/runtime/issues/29859 _hexString = CreateRandom()._hexString; return; } @@ -1097,7 +1097,7 @@ private ActivityTraceId(ReadOnlySpan idData) span[1] = BinaryPrimitives.ReverseEndianness(span[1]); } - _hexString = ActivityTraceId.SpanToHexString(MemoryMarshal.AsBytes(span)); + _hexString = HexConverter.ToString(MemoryMarshal.AsBytes(span), HexConverter.Casing.Lower); } /// @@ -1120,26 +1120,6 @@ internal static unsafe void SetToRandomBytes(Span outBytes) guidBytes.Slice(0, outBytes.Length).CopyTo(outBytes); } - // CONVERSION binary spans to hex spans, and hex spans to binary spans - /* It would be nice to use generic Hex number conversion routines, but there - * is nothing that is exposed publicly and efficient */ - /// - /// Converts each byte in 'bytes' to hex (thus two characters) and concatenates them - /// and returns the resulting string. - /// - internal static string SpanToHexString(ReadOnlySpan bytes) - { - Debug.Assert(bytes.Length <= 16); // We want it to not be very big - Span result = stackalloc char[bytes.Length * 2]; - int pos = 0; - foreach (byte b in bytes) - { - result[pos++] = BinaryToHexDigit(b >> 4); - result[pos++] = BinaryToHexDigit(b); - } - return result.ToString(); - } - /// /// Converts 'idData' which is assumed to be HEX Unicode characters to binary /// puts it in 'outBytes' @@ -1162,20 +1142,6 @@ private static byte HexDigitToBinary(char c) return (byte)(c - ('a' - 10)); throw new ArgumentOutOfRangeException("idData"); } - private static char BinaryToHexDigit(int val) - { - val &= 0xF; - if (val <= 9) - return (char)('0' + val); - return (char)(('a' - 10) + val); - } - - internal static void ByteToHexDigits(Span outChars, byte val) - { - Debug.Assert(outChars.Length == 2); - outChars[0] = BinaryToHexDigit((val >> 4) & 0xF); - outChars[1] = BinaryToHexDigit(val & 0xF); - } internal static bool IsLowerCaseHexAndNotAllZeros(ReadOnlySpan idData) { @@ -1232,14 +1198,14 @@ public static unsafe ActivitySpanId CreateRandom() { ulong id; ActivityTraceId.SetToRandomBytes(new Span(&id, sizeof(ulong))); - return new ActivitySpanId(ActivityTraceId.SpanToHexString(new ReadOnlySpan(&id, sizeof(ulong)))); + return new ActivitySpanId(HexConverter.ToString(new ReadOnlySpan(&id, sizeof(ulong)), HexConverter.Casing.Lower)); } public static ActivitySpanId CreateFromBytes(ReadOnlySpan idData) { if (idData.Length != 8) throw new ArgumentOutOfRangeException(nameof(idData)); - return new ActivitySpanId(ActivityTraceId.SpanToHexString(idData)); + return new ActivitySpanId(HexConverter.ToString(idData, HexConverter.Casing.Lower)); } public static ActivitySpanId CreateFromUtf8String(ReadOnlySpan idData) => new ActivitySpanId(idData); @@ -1297,7 +1263,7 @@ private unsafe ActivitySpanId(ReadOnlySpan idData) if (!Utf8Parser.TryParse(idData, out ulong id, out _, 'x')) { - // Invalid Id, use random https://github.com/dotnet/corefx/issues/38486 + // Invalid Id, use random https://github.com/dotnet/runtime/issues/29859 _hexString = CreateRandom()._hexString; return; } @@ -1307,7 +1273,7 @@ private unsafe ActivitySpanId(ReadOnlySpan idData) id = BinaryPrimitives.ReverseEndianness(id); } - _hexString = ActivityTraceId.SpanToHexString(new ReadOnlySpan(&id, sizeof(ulong))); + _hexString = HexConverter.ToString(new ReadOnlySpan(&id, sizeof(ulong)), HexConverter.Casing.Lower); } /// diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityDateTimeTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityDateTimeTests.cs index a1e29ee169752a..8beb3eb33d10dd 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityDateTimeTests.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityDateTimeTests.cs @@ -10,7 +10,7 @@ namespace System.Diagnostics.Tests public class ActivityDateTimeTests { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/19545", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21594", TargetFrameworkMonikers.NetFramework)] public void StartStopReturnsPreciseDuration() { var activity = new Activity("test"); diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs index bf3dee43042386..153990a6ee49b0 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs @@ -1190,7 +1190,7 @@ public void StopTwice() } [Fact] - [OuterLoop("https://github.com/dotnet/corefx/issues/23072")] + [OuterLoop("https://github.com/dotnet/runtime/issues/23104")] public void DiagnosticSourceStartStop() { using (DiagnosticListener listener = new DiagnosticListener("Testing")) diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/DiagnosticSourceTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/DiagnosticSourceTests.cs index da80dd890ec7da..a9e63028bfe7ff 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/DiagnosticSourceTests.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/DiagnosticSourceTests.cs @@ -501,7 +501,7 @@ public void AllListenersCheckCatchupList() /// Stresses the AllListeners by having many threads be adding and removing. /// [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35539")] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28772")] [InlineData(100, 100)] // run multiple times to stress it further [InlineData(100, 101)] [InlineData(100, 102)] diff --git a/src/libraries/System.Diagnostics.EventLog/ref/System.Diagnostics.EventLog.cs b/src/libraries/System.Diagnostics.EventLog/ref/System.Diagnostics.EventLog.cs index 749427f7ce99a4..062eb3d60179c3 100644 --- a/src/libraries/System.Diagnostics.EventLog/ref/System.Diagnostics.EventLog.cs +++ b/src/libraries/System.Diagnostics.EventLog/ref/System.Diagnostics.EventLog.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Diagnostics diff --git a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj index 31b13ca7d4d7f4..7bf58b00f29540 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj +++ b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj @@ -4,8 +4,8 @@ true SR.PlatformNotSupported_EventLog netcoreapp2.0-Windows_NT;net461;netstandard2.0;$(NetCoreAppCurrent)-Windows_NT;$(NetFrameworkCurrent) - true - true + true + true diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogEntry.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogEntry.cs index e569833cb47b28..ca73268166b33d 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogEntry.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogEntry.cs @@ -158,9 +158,9 @@ public string Message { if (i != 0) msgBuf.Append(", "); - msgBuf.Append("'"); + msgBuf.Append('\''); msgBuf.Append(strings[i]); - msgBuf.Append("'"); + msgBuf.Append('\''); } msg = msgBuf.ToString(); @@ -418,9 +418,9 @@ private string GetMessageLibraryNames(string libRegKey) { result.Append(@"\\"); result.Append(owner.MachineName); - result.Append(@"\"); + result.Append('\\'); result.Append(fileNames[i][0]); - result.Append("$"); + result.Append('$'); result.Append(fileNames[i], 2, fileNames[i].Length - 2); result.Append(';'); } diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventMetadata.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventMetadata.cs index 1da0bfaa2b40b6..d28d2ea35fd92a 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventMetadata.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventMetadata.cs @@ -64,7 +64,6 @@ public EventLevel Level } } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public EventOpcode Opcode { get diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventOpcode.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventOpcode.cs index 11197712dc524a..987b07b8a43989 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventOpcode.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventOpcode.cs @@ -11,7 +11,6 @@ namespace System.Diagnostics.Eventing.Reader /// The metadata for a specific Opcode defined by a Provider. /// An instance of this class is obtained from a ProviderMetadata object. /// - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public sealed class EventOpcode { private readonly int _value; diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventRecord.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventRecord.cs index 65d7c38180674c..dfb656706b289f 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventRecord.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventRecord.cs @@ -18,7 +18,6 @@ public abstract class EventRecord : IDisposable public abstract byte? Level { get; } public abstract int? Task { get; } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public abstract short? Opcode { get; } public abstract long? Keywords { get; } @@ -43,7 +42,6 @@ public abstract class EventRecord : IDisposable public abstract string LevelDisplayName { get; } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public abstract string OpcodeDisplayName { get; } public abstract string TaskDisplayName { get; } public abstract IEnumerable KeywordsDisplayNames { get; } diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadata.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadata.cs index b77b4d76378dc1..0464e2f60a3823 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadata.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadata.cs @@ -436,7 +436,6 @@ public IList Levels } } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcodes", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public IList Opcodes { get diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/Winmeta.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/Winmeta.cs index 98a40058fe81ce..95bffd3b390462 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/Winmeta.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/Winmeta.cs @@ -51,7 +51,6 @@ public enum StandardEventTask /// /// EventOpcode /// - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public enum StandardEventOpcode { /// diff --git a/src/libraries/System.Diagnostics.EventLog/tests/EventLogEntryCollectionTests.cs b/src/libraries/System.Diagnostics.EventLog/tests/EventLogEntryCollectionTests.cs index 22d502fc58973d..123ca0eec1591d 100644 --- a/src/libraries/System.Diagnostics.EventLog/tests/EventLogEntryCollectionTests.cs +++ b/src/libraries/System.Diagnostics.EventLog/tests/EventLogEntryCollectionTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Xunit; +using Microsoft.DotNet.XUnitExtensions; namespace System.Diagnostics.Tests { @@ -10,6 +11,7 @@ public class EventLogEntryCollectionTests { private const string message = "EntryCollectionMessage"; + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void CopyingEventLogEntryCollection() { @@ -44,6 +46,7 @@ public void CopyingEventLogEntryCollection() } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void CheckingEntryEqualityWithNull() { @@ -69,6 +72,7 @@ public void CheckingEntryEqualityWithNull() } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void CheckingEntryEqualityAndIndex() { @@ -99,6 +103,7 @@ public void CheckingEntryEqualityAndIndex() } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void CheckingEntryInEquality() { diff --git a/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogEntryWrittenTest.cs b/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogEntryWrittenTest.cs index e33360595bf02f..f4aa957496fc25 100644 --- a/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogEntryWrittenTest.cs +++ b/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogEntryWrittenTest.cs @@ -4,6 +4,7 @@ using System.Threading; using Xunit; +using Microsoft.DotNet.XUnitExtensions; namespace System.Diagnostics.Tests { @@ -52,6 +53,7 @@ private void RaisingEvent(string log, string methodName, bool waitOnEvent = true } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void EntryWrittenEventRaised() { @@ -59,6 +61,7 @@ public void EntryWrittenEventRaised() Assert.NotEqual(0, eventCounter); } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void EntryWrittenEventRaiseDisable() { diff --git a/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogSourceCreationTests.cs b/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogSourceCreationTests.cs index 453817319de72f..29bfba9dcbe8b4 100644 --- a/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogSourceCreationTests.cs +++ b/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogSourceCreationTests.cs @@ -3,11 +3,13 @@ // See the LICENSE file in the project root for more information. using Xunit; +using Microsoft.DotNet.XUnitExtensions; namespace System.Diagnostics.Tests { public class EventLogSourceCreationTests { + [Trait(XunitConstants.Category, "EventLog")] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void CheckSourceExistenceAndDeletion() { @@ -27,6 +29,7 @@ public void CheckSourceExistenceAndDeletion() Assert.False(EventLog.SourceExists(source)); } + [Trait(XunitConstants.Category, "EventLog")] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void LogNameWithSame8FirstChars_NetCore() @@ -53,6 +56,7 @@ public void LogNameWithSame8FirstChars_NetCore() } } + [Trait(XunitConstants.Category, "EventLog")] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)] public void LogNameWithSame8FirstChars_NetFramework() @@ -141,6 +145,7 @@ public void SourceDataNull() Assert.Throws(() => EventLog.CreateEventSource(null)); } + [Trait(XunitConstants.Category, "EventLog")] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void SourceAlreadyExistsWhenCreatingSource() { diff --git a/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogTests.cs b/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogTests.cs index a0a18fbe03064d..64b164a5838a6d 100644 --- a/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogTests.cs +++ b/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogTests.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using Xunit; +using Microsoft.DotNet.XUnitExtensions; namespace System.Diagnostics.Tests { @@ -22,6 +23,7 @@ public void EventLogReinitializationException() } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void ClearLog() { @@ -57,6 +59,7 @@ public void ApplicationEventLog_Count() } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void DeleteLog() { @@ -128,6 +131,7 @@ public void EventLogs_Get() Assert.Contains(eventLogCollection, eventlog => eventlog.Log.Equals("System")); } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void GetMaxKilobytes_Set() { @@ -162,6 +166,7 @@ public void MaxKilobytesOutOfRangeException() } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void OverflowAndRetention_Set() { @@ -190,6 +195,7 @@ public void OverflowAndRetention_Set() } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void Overflow_OverWriteOlderAndRetention_Set() { @@ -248,6 +254,7 @@ public void MachineName_Set() } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void RegisterDisplayLogName() { @@ -314,6 +321,7 @@ public void InvalidMachineName() Assert.Throws(() => EventLog.DeleteEventSource("", "")); } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void LogDisplayNameDefault() { diff --git a/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogWriteEntryTests.cs b/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogWriteEntryTests.cs index 84ab4878f7b952..cfe05bc3596509 100644 --- a/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogWriteEntryTests.cs +++ b/src/libraries/System.Diagnostics.EventLog/tests/EventLogTests/EventLogWriteEntryTests.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using Xunit; +using Microsoft.DotNet.XUnitExtensions; namespace System.Diagnostics.Tests { @@ -121,6 +122,7 @@ private EventLogEntry WriteLogEntryEvent(string source, bool data = false) } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [InlineData(false)] [InlineData(true)] @@ -153,6 +155,7 @@ public void WriteEntry(bool sourceFlag) } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [InlineData(false)] [InlineData(true)] @@ -182,6 +185,7 @@ public void WriteEntryWithType(bool sourceFlag) } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [InlineData(false)] [InlineData(true)] @@ -211,6 +215,7 @@ public void WriteEntryWithTypeAndId(bool sourceFlag) } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [InlineData(false)] [InlineData(true)] @@ -246,6 +251,7 @@ public void WriteEntryWithTypeIdAndCategory(bool sourceFlag) } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [InlineData(false)] [InlineData(true)] @@ -302,6 +308,7 @@ public void WriteEntryWithNullOrEmptySource() Assert.Throws(() => EventLog.WriteEntry("", message)); } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [InlineData(false)] [InlineData(true)] @@ -328,6 +335,7 @@ public void WriteEvent(bool SourceFlag) } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [InlineData(false)] [InlineData(true)] diff --git a/src/libraries/System.Diagnostics.EventLog/tests/EventLogTraceListenerTests.cs b/src/libraries/System.Diagnostics.EventLog/tests/EventLogTraceListenerTests.cs index c5b32f2ae7261c..faa149017b0c8e 100644 --- a/src/libraries/System.Diagnostics.EventLog/tests/EventLogTraceListenerTests.cs +++ b/src/libraries/System.Diagnostics.EventLog/tests/EventLogTraceListenerTests.cs @@ -7,6 +7,7 @@ using System.Globalization; using System.Text; using Xunit; +using Microsoft.DotNet.XUnitExtensions; namespace System.Diagnostics.Tests { @@ -87,6 +88,7 @@ public void CloseSucceeds() listener.Close(); // shouldn't fail. } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void WriteTest() { @@ -113,7 +115,7 @@ public void WriteTest() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/40224", TestPlatforms.Windows)] + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [InlineData(TraceEventType.Information, EventLogEntryType.Information, ushort.MaxValue + 1, ushort.MaxValue)] [InlineData(TraceEventType.Error, EventLogEntryType.Error, ushort.MinValue - 1, ushort.MinValue)] @@ -155,6 +157,7 @@ public static IEnumerable GetTraceDataParams_MemberData() yield return new object[] { new object[] { "one string + null", null } }; } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [MemberData(nameof(GetTraceDataParams_MemberData))] public void TraceDataParamsData(object[] parameters) @@ -195,7 +198,7 @@ public static IEnumerable GetTraceEventFormat_MemberData() yield return new object[] { null, new object[] { "thanks, 00", "i like it...", 111 } }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/40224", TestPlatforms.Windows)] + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] [MemberData(nameof(GetTraceEventFormat_MemberData))] public void TraceEventFormatAndParams(string format, object[] parameters) @@ -251,6 +254,7 @@ public void TraceEventFormatAndParams(string format, object[] parameters) } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void TraceWithFilters() { diff --git a/src/libraries/System.Diagnostics.EventLog/tests/System/Diagnostics/Reader/EventLogRecordTests.cs b/src/libraries/System.Diagnostics.EventLog/tests/System/Diagnostics/Reader/EventLogRecordTests.cs index e94168f9afffbc..140eb7d831b21a 100644 --- a/src/libraries/System.Diagnostics.EventLog/tests/System/Diagnostics/Reader/EventLogRecordTests.cs +++ b/src/libraries/System.Diagnostics.EventLog/tests/System/Diagnostics/Reader/EventLogRecordTests.cs @@ -6,6 +6,7 @@ using System.Diagnostics.Eventing.Reader; using System.Security.Principal; using Xunit; +using Microsoft.DotNet.XUnitExtensions; namespace System.Diagnostics.Tests { @@ -28,7 +29,8 @@ public void GetPropertyValues() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/34547")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/28403")] + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalTheory(typeof(Helpers), nameof(Helpers.SupportsEventLogs))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] [InlineData("System")] diff --git a/src/libraries/System.Diagnostics.EventLog/tests/System/Diagnostics/Reader/EventLogWatcherTests.cs b/src/libraries/System.Diagnostics.EventLog/tests/System/Diagnostics/Reader/EventLogWatcherTests.cs index 18aba369c8bb4e..3357d8d3ba1e16 100644 --- a/src/libraries/System.Diagnostics.EventLog/tests/System/Diagnostics/Reader/EventLogWatcherTests.cs +++ b/src/libraries/System.Diagnostics.EventLog/tests/System/Diagnostics/Reader/EventLogWatcherTests.cs @@ -5,6 +5,7 @@ using System.Diagnostics.Eventing.Reader; using System.Threading; using Xunit; +using Microsoft.DotNet.XUnitExtensions; namespace System.Diagnostics.Tests { @@ -94,6 +95,7 @@ private void RaisingEvent(string log, string methodName, bool waitOnEvent = true } } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void RecordWrittenEventRaised() { @@ -101,6 +103,7 @@ public void RecordWrittenEventRaised() Assert.NotEqual(0, eventCounter); } + [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))] public void RecordWrittenEventRaiseDisable() { diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/ref/System.Diagnostics.FileVersionInfo.cs b/src/libraries/System.Diagnostics.FileVersionInfo/ref/System.Diagnostics.FileVersionInfo.cs index 9a4d67c58442cd..6cd2cc34156c12 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/ref/System.Diagnostics.FileVersionInfo.cs +++ b/src/libraries/System.Diagnostics.FileVersionInfo/ref/System.Diagnostics.FileVersionInfo.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Diagnostics diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/src/System.Diagnostics.FileVersionInfo.csproj b/src/libraries/System.Diagnostics.FileVersionInfo/src/System.Diagnostics.FileVersionInfo.csproj index 4e28dc75d90de5..e2a81f05dd6719 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/src/System.Diagnostics.FileVersionInfo.csproj +++ b/src/libraries/System.Diagnostics.FileVersionInfo/src/System.Diagnostics.FileVersionInfo.csproj @@ -3,7 +3,7 @@ System.Diagnostics.FileVersionInfo true $(NoWarn);CS1573 - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix enable diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/tests/NativeConsoleApp/NativeConsoleApp.vcxproj b/src/libraries/System.Diagnostics.FileVersionInfo/tests/NativeConsoleApp/NativeConsoleApp.vcxproj index 183a0e93977f40..4355768ac333f1 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/tests/NativeConsoleApp/NativeConsoleApp.vcxproj +++ b/src/libraries/System.Diagnostics.FileVersionInfo/tests/NativeConsoleApp/NativeConsoleApp.vcxproj @@ -63,4 +63,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/tests/NativeLibrary/NativeLibrary.vcxproj b/src/libraries/System.Diagnostics.FileVersionInfo/tests/NativeLibrary/NativeLibrary.vcxproj index 36901eb7d2cb8d..cc1f6501bf6af5 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/tests/NativeLibrary/NativeLibrary.vcxproj +++ b/src/libraries/System.Diagnostics.FileVersionInfo/tests/NativeLibrary/NativeLibrary.vcxproj @@ -65,4 +65,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/tests/SecondNativeLibrary/SecondNativeLibrary.vcxproj b/src/libraries/System.Diagnostics.FileVersionInfo/tests/SecondNativeLibrary/SecondNativeLibrary.vcxproj index f44bb0c34069fd..78d7c1716bd7c3 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/tests/SecondNativeLibrary/SecondNativeLibrary.vcxproj +++ b/src/libraries/System.Diagnostics.FileVersionInfo/tests/SecondNativeLibrary/SecondNativeLibrary.vcxproj @@ -65,4 +65,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/ref/System.Diagnostics.PerformanceCounter.cs b/src/libraries/System.Diagnostics.PerformanceCounter/ref/System.Diagnostics.PerformanceCounter.cs index b4463f269215c0..25e59808948027 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/ref/System.Diagnostics.PerformanceCounter.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/ref/System.Diagnostics.PerformanceCounter.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Diagnostics diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/ref/System.Diagnostics.PerformanceCounter.csproj b/src/libraries/System.Diagnostics.PerformanceCounter/ref/System.Diagnostics.PerformanceCounter.csproj index f7a5a0b4a87c3f..9dd662dce81159 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/ref/System.Diagnostics.PerformanceCounter.csproj +++ b/src/libraries/System.Diagnostics.PerformanceCounter/ref/System.Diagnostics.PerformanceCounter.csproj @@ -1,7 +1,7 @@ true - net461;$(NetFrameworkCurrent);netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) true diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj index a94eee45f31b90..2e1be8425bad80 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj @@ -5,8 +5,8 @@ true SR.PlatformNotSupported_PerfCounters netcoreapp2.0-Windows_NT;netstandard2.0;net461;$(NetCoreAppCurrent)-Windows_NT;$(NetFrameworkCurrent) - true - true + true + true diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/InstanceDataCollection.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/InstanceDataCollection.cs index 52df99b0ceb7e8..c075eff64fb77f 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/InstanceDataCollection.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/InstanceDataCollection.cs @@ -48,14 +48,14 @@ public InstanceData this[string instanceName] if (instanceName.Length == 0) instanceName = PerformanceCounterLib.SingleInstanceName; - string objectName = instanceName.ToLower(CultureInfo.InvariantCulture); + string objectName = instanceName.ToLowerInvariant(); return (InstanceData)Dictionary[objectName]; } } internal void Add(string instanceName, InstanceData value) { - string objectName = instanceName.ToLower(CultureInfo.InvariantCulture); + string objectName = instanceName.ToLowerInvariant(); Dictionary.Add(objectName, value); } @@ -64,7 +64,7 @@ public bool Contains(string instanceName) if (instanceName == null) throw new ArgumentNullException(nameof(instanceName)); - string objectName = instanceName.ToLower(CultureInfo.InvariantCulture); + string objectName = instanceName.ToLowerInvariant(); return Dictionary.Contains(objectName); } diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/InstanceDataCollectionCollection.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/InstanceDataCollectionCollection.cs index 8100b8dc25d9ab..dda9425d25cc66 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/InstanceDataCollectionCollection.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/InstanceDataCollectionCollection.cs @@ -26,7 +26,7 @@ public InstanceDataCollection this[string counterName] if (counterName == null) throw new ArgumentNullException(nameof(counterName)); - object objectName = counterName.ToLower(CultureInfo.InvariantCulture); + object objectName = counterName.ToLowerInvariant(); return (InstanceDataCollection)Dictionary[objectName]; } } @@ -46,7 +46,7 @@ public ICollection Values internal void Add(string counterName, InstanceDataCollection value) { - object objectName = counterName.ToLower(CultureInfo.InvariantCulture); + object objectName = counterName.ToLowerInvariant(); Dictionary.Add(objectName, value); } @@ -55,7 +55,7 @@ public bool Contains(string counterName) if (counterName == null) throw new ArgumentNullException(nameof(counterName)); - object objectName = counterName.ToLower(CultureInfo.InvariantCulture); + object objectName = counterName.ToLowerInvariant(); return Dictionary.Contains(objectName); } diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs index a25f7011c9b11f..f1637f4998c360 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs @@ -521,7 +521,7 @@ private void InitializeImpl() if (string.IsNullOrEmpty(_instanceName) && InstanceLifetime == PerformanceCounterInstanceLifetime.Process) throw new InvalidOperationException(SR.InstanceLifetimeProcessforSingleInstance); - _sharedCounter = new SharedPerformanceCounter(currentCategoryName.ToLower(CultureInfo.InvariantCulture), _counterName.ToLower(CultureInfo.InvariantCulture), _instanceName.ToLower(CultureInfo.InvariantCulture), _instanceLifetime); + _sharedCounter = new SharedPerformanceCounter(currentCategoryName.ToLowerInvariant(), _counterName.ToLowerInvariant(), _instanceName.ToLowerInvariant(), _instanceLifetime); _initialized = true; } } @@ -593,7 +593,7 @@ public void RemoveInstance() throw new InvalidOperationException(SR.ReadOnlyRemoveInstance); Initialize(); - _sharedCounter.RemoveInstance(_instanceName.ToLower(CultureInfo.InvariantCulture), _instanceLifetime); + _sharedCounter.RemoveInstance(_instanceName.ToLowerInvariant(), _instanceLifetime); } } } diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs index 27b67bb77270f3..4af24f4be7aae5 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs @@ -384,7 +384,7 @@ public static void Delete(string categoryName) CheckValidCategory(categoryName); string machineName = "."; - categoryName = categoryName.ToLower(CultureInfo.InvariantCulture); + categoryName = categoryName.ToLowerInvariant(); Mutex mutex = null; try diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PrivilegedConfigurationManager.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PrivilegedConfigurationManager.cs index 017b0f2a0e8d1e..885a54cf989477 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PrivilegedConfigurationManager.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PrivilegedConfigurationManager.cs @@ -9,7 +9,6 @@ namespace System.Configuration { internal static class PrivilegedConfigurationManager { internal static ConnectionStringSettingsCollection ConnectionStrings { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] get { return ConfigurationManager.ConnectionStrings; } diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs b/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs index 7cda7baa48d52b..63488d4f36b90b 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs @@ -144,7 +144,7 @@ public static void PerformanceCounter_GetRawValue_CounterDoesNotExist() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/38180")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/29753")] [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndCanWriteToPerfCounters))] public static void PerformanceCounter_NextValue_ProcessorCounter() { @@ -222,7 +222,7 @@ public static void PerformanceCounter_IncrementBy_IncrementBy2() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/25349")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24176")] [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndCanWriteToPerfCounters))] public static void PerformanceCounter_IncrementBy_IncrementByReadOnly() { diff --git a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs index 95c3aa40b1b9d1..34abf288b39955 100644 --- a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs +++ b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace Microsoft.Win32.SafeHandles @@ -123,6 +123,7 @@ public void Refresh() { } public override string ToString() { throw null; } public void WaitForExit() { } public bool WaitForExit(int milliseconds) { throw null; } + public System.Threading.Tasks.Task WaitForExitAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; } public bool WaitForInputIdle() { throw null; } public bool WaitForInputIdle(int milliseconds) { throw null; } } diff --git a/src/libraries/System.Diagnostics.Process/src/FxCopBaseline.cs b/src/libraries/System.Diagnostics.Process/src/FxCopBaseline.cs deleted file mode 100644 index 1d3b6208e1bbec..00000000000000 --- a/src/libraries/System.Diagnostics.Process/src/FxCopBaseline.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.Process.#EnsureWatchingForExit()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.Process.#RaiseOnExited()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.Process.#StopWatchingForExit()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.Process.#CompletionCallback(System.Object,System.Boolean)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.Process.Close()")] \ No newline at end of file diff --git a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj index dafbb77266abdc..c0e27a2a322fab 100644 --- a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj +++ b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj @@ -5,16 +5,13 @@ $(DefineConstants);FEATURE_REGISTRY true $(NoWarn);CS1573 - $(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX enable $(NoWarn);0649 - - - @@ -45,6 +42,9 @@ Common\Interop\Windows\Interop.Errors.cs + + Common\System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs + diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/PerformanceCounterLib.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/PerformanceCounterLib.cs index a5e340f3e1b59f..354acdffeb49c1 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/PerformanceCounterLib.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/PerformanceCounterLib.cs @@ -74,7 +74,7 @@ internal static PerformanceCounterLib GetPerformanceCounterLib(string machineNam return PerformanceCounterLib.s_libraryTable.GetOrAdd((machineName, lcidString), (key) => new PerformanceCounterLib(key.machineName, key.lcidString)); } - internal byte[] GetPerformanceData(string item) + internal byte[]? GetPerformanceData(string item) { if (_performanceMonitor == null) { @@ -85,7 +85,7 @@ internal byte[] GetPerformanceData(string item) } } - return _performanceMonitor.GetData(item); + return _performanceMonitor.GetData(item)!; } private Dictionary GetStringTable(bool isHelp) @@ -113,9 +113,9 @@ private Dictionary GetStringTable(bool isHelp) try { if (!isHelp) - names = (string[])libraryKey.GetValue("Counter " + _perfLcid); + names = (string[]?)libraryKey.GetValue("Counter " + _perfLcid); else - names = (string[])libraryKey.GetValue("Explain " + _perfLcid); + names = (string[]?)libraryKey.GetValue("Explain " + _perfLcid); if ((names == null) || (names.Length == 0)) { @@ -225,7 +225,7 @@ private void Init() // we wait may not be sufficient if the Win32 code keeps running into this deadlock again // and again. A condition very rare but possible in theory. We would get back to the user // in this case with InvalidOperationException after the wait time expires. - internal byte[] GetData(string item) + internal byte[]? GetData(string item) { #if FEATURE_REGISTRY int waitRetries = 17; //2^16*10ms == approximately 10mins @@ -237,7 +237,7 @@ internal byte[] GetData(string item) { try { - data = (byte[])_perfDataKey.GetValue(item); + data = (byte[]?)_perfDataKey.GetValue(item); return data; } catch (IOException e) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs index c2c0bd7267e026..1084f16c95631e 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs @@ -83,7 +83,7 @@ private static DateTime BootTime // It includes suspended time and is updated based on the system time (settimeofday). const string StatFile = Interop.procfs.ProcStatFilePath; string text = File.ReadAllText(StatFile); - int btimeLineStart = text.IndexOf("\nbtime "); + int btimeLineStart = text.IndexOf("\nbtime ", StringComparison.Ordinal); if (btimeLineStart >= 0) { int btimeStart = btimeLineStart + "\nbtime ".Length; diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs index ec8601c1217bc3..99ac93fd33bc61 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs @@ -676,7 +676,7 @@ private static StringBuilder BuildCommandLine(string executableFileName, string // is the file to execute). StringBuilder commandLine = new StringBuilder(); string fileName = executableFileName.Trim(); - bool fileNameIsQuoted = (fileName.StartsWith("\"", StringComparison.Ordinal) && fileName.EndsWith("\"", StringComparison.Ordinal)); + bool fileNameIsQuoted = (fileName.StartsWith('\"') && fileName.EndsWith('\"')); if (!fileNameIsQuoted) { commandLine.Append("\""); @@ -691,7 +691,7 @@ private static StringBuilder BuildCommandLine(string executableFileName, string if (!string.IsNullOrEmpty(arguments)) { - commandLine.Append(" "); + commandLine.Append(' '); commandLine.Append(arguments); } diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs index 03ab37719a0834..7d5b28f678ba2d 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs @@ -10,6 +10,7 @@ using System.Runtime.Serialization; using System.Text; using System.Threading; +using System.Threading.Tasks; namespace System.Diagnostics { @@ -1346,6 +1347,107 @@ public bool WaitForExit(int milliseconds) return exited; } + /// + /// Instructs the Process component to wait for the associated process to exit, or + /// for the to be canceled. + /// + /// + /// Calling this method will set to . + /// + /// + /// A task that will complete when the process has exited, cancellation has been requested, + /// or an error occurs. + /// + public async Task WaitForExitAsync(CancellationToken cancellationToken = default) + { + // Because the process has already started by the time this method is called, + // we're in a race against the process to set up our exit handlers before the process + // exits. As a result, there are several different flows that must be handled: + // + // CASE 1: WE ENABLE EVENTS + // This is the "happy path". In this case we enable events. + // + // CASE 1.1: PROCESS EXITS OR IS CANCELED AFTER REGISTERING HANDLER + // This case continues the "happy path". The process exits or waiting is canceled after + // registering the handler and no special cases are needed. + // + // CASE 1.2: PROCESS EXITS BEFORE REGISTERING HANDLER + // It's possible that the process can exit after we enable events but before we reigster + // the handler. In that case we must check for exit after registering the handler. + // + // + // CASE 2: PROCESS EXITS BEFORE ENABLING EVENTS + // The process may exit before we attempt to enable events. In that case EnableRaisingEvents + // will throw an exception like this: + // System.InvalidOperationException : Cannot process request because the process (42) has exited. + // In this case we catch the InvalidOperationException. If the process has exited, our work + // is done and we return. If for any reason (now or in the future) enabling events fails + // and the process has not exited, bubble the exception up to the user. + // + // + // CASE 3: USER ALREADY ENABLED EVENTS + // In this case the user has already enabled raising events. Re-enabling events is a no-op + // as the value hasn't changed. However, no-op also means that if the process has already + // exited, EnableRaisingEvents won't throw an exception. + // + // CASE 3.1: PROCESS EXITS OR IS CANCELED AFTER REGISTERING HANDLER + // (See CASE 1.1) + // + // CASE 3.2: PROCESS EXITS BEFORE REGISTERING HANDLER + // (See CASE 1.2) + + if (!Associated) + { + throw new InvalidOperationException(SR.NoAssociatedProcess); + } + + if (!HasExited) + { + // Early out for cancellation before doing more expensive work + cancellationToken.ThrowIfCancellationRequested(); + } + + try + { + // CASE 1: We enable events + // CASE 2: Process exits before enabling events (and throws an exception) + // CASE 3: User already enabled events (no-op) + EnableRaisingEvents = true; + } + catch (InvalidOperationException) + { + // CASE 2: If the process has exited, our work is done, otherwise bubble the + // exception up to the user + if (HasExited) + { + return; + } + + throw; + } + + var tcs = new TaskCompletionSourceWithCancellation(); + + EventHandler handler = (s, e) => tcs.TrySetResult(true); + Exited += handler; + + try + { + if (HasExited) + { + // CASE 1.2 & CASE 3.2: Handle race where the process exits before registering the handler + return; + } + + // CASE 1.1 & CASE 3.1: Process exits or is canceled here + await tcs.WaitWithCancellationAsync(cancellationToken).ConfigureAwait(false); + } + finally + { + Exited -= handler; + } + } + /// /// /// Instructs the component to start diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs index bd40aea2593fb9..e2c166ad73cc3b 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs @@ -125,7 +125,7 @@ public static ProcessModuleCollection GetModules(int processId) private static bool IsRemoteMachineCore(string machineName) { - ReadOnlySpan baseName = machineName.AsSpan(machineName.StartsWith("\\", StringComparison.Ordinal) ? 2 : 0); + ReadOnlySpan baseName = machineName.AsSpan(machineName.StartsWith('\\') ? 2 : 0); return !baseName.Equals(".", StringComparison.Ordinal) && !baseName.Equals(Interop.Kernel32.GetComputerName(), StringComparison.OrdinalIgnoreCase); @@ -360,7 +360,7 @@ private static ProcessInfo[] GetProcessInfos(PerformanceCounterLib library) { try { - byte[] dataPtr = library.GetPerformanceData(PerfCounterQueryString); + byte[]? dataPtr = library.GetPerformanceData(PerfCounterQueryString); processInfos = GetProcessInfos(library, ProcessPerfCounterId, ThreadPerfCounterId, dataPtr); } catch (Exception e) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Win32.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Win32.cs index 98fce7c8c4c5d5..8b94d4315b3bc8 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Win32.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Win32.cs @@ -18,7 +18,7 @@ public string[] Verbs if (string.IsNullOrEmpty(extension)) return Array.Empty(); - using (RegistryKey key = Registry.ClassesRoot.OpenSubKey(extension)) + using (RegistryKey? key = Registry.ClassesRoot.OpenSubKey(extension)) { if (key == null) return Array.Empty(); @@ -27,7 +27,7 @@ public string[] Verbs if (string.IsNullOrEmpty(value)) return Array.Empty(); - using (RegistryKey subKey = Registry.ClassesRoot.OpenSubKey(value + "\\shell")) + using (RegistryKey? subKey = Registry.ClassesRoot.OpenSubKey(value + "\\shell")) { if (subKey == null) return Array.Empty(); diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs index b22193f0887972..730bcf3121303e 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs @@ -350,7 +350,7 @@ public void TestWorkingDirectoryPropertyInChildProcess() }, workingDirectory, new RemoteInvokeOptions { StartInfo = psi }).Dispose(); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/12696")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/18978")] [Fact, PlatformSpecific(TestPlatforms.Windows), OuterLoop] // Uses P/Invokes, Requires admin privileges public void TestUserCredentialsPropertiesOnWindows() { @@ -956,13 +956,13 @@ public void StartInfo_NotepadWithContent(bool useShellExecute) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer), // Nano does not support UseShellExecute - nameof(PlatformDetection.IsNotWindows8x))] // https://github.com/dotnet/corefx/issues/20388 + nameof(PlatformDetection.IsNotWindows8x))] // https://github.com/dotnet/runtime/issues/22007 [OuterLoop("Launches notepad")] [PlatformSpecific(TestPlatforms.Windows)] public void StartInfo_TextFile_ShellExecute() { if (Thread.CurrentThread.CurrentCulture.ToString() != "en-US") - return; // [ActiveIssue(https://github.com/dotnet/corefx/issues/28953)] + return; // [ActiveIssue(https://github.com/dotnet/runtime/issues/25823)] string tempFile = GetTestFilePath() + ".txt"; File.WriteAllText(tempFile, $"StartInfo_TextFile_ShellExecute"); @@ -1068,7 +1068,7 @@ public static TheoryData UseShellExecute { TheoryData data = new TheoryData { false }; - if ( !PlatformDetection.IsInAppContainer // https://github.com/dotnet/corefx/issues/20204 + if ( !PlatformDetection.IsInAppContainer // https://github.com/dotnet/runtime/issues/21919 && !PlatformDetection.IsWindowsNanoServer // By design && !PlatformDetection.IsWindowsIoTCore) data.Add(true); @@ -1111,7 +1111,7 @@ public void StartInfo_BadExe(bool useShellExecute) int expected = ERROR_BAD_EXE_FORMAT; - // Windows Nano bug see https://github.com/dotnet/corefx/issues/10290 + // Windows Nano bug see https://github.com/dotnet/runtime/issues/17919 if (PlatformDetection.IsWindowsNanoServer) expected = ERROR_SUCCESS; diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessStreamReadTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessStreamReadTests.cs index 17dd601f7ec7ba..c49ca708b93b90 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessStreamReadTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessStreamReadTests.cs @@ -331,7 +331,7 @@ public void TestSyncStreams() [Fact] public void TestEOFReceivedWhenStdInClosed() { - // This is the test for the fix of https://github.com/dotnet/corefx/issues/13447. + // This is the test for the fix of https://github.com/dotnet/runtime/issues/19277. // // Summary of the issue: // When an application starts more than one child processes with their standard inputs redirected on Unix, diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTestBase.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTestBase.cs index 9b15ab99324e00..9933c3e91a3330 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTestBase.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTestBase.cs @@ -60,6 +60,18 @@ protected Process CreateProcess(Func method = null) return p; } + protected Process CreateProcess(Func> method) + { + Process p = null; + using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(method, new RemoteInvokeOptions { Start = false })) + { + p = handle.Process; + handle.Process = null; + } + AddProcessForDispose(p); + return p; + } + protected Process CreateProcess(Func method, string arg, bool autoDispose = true) { Process p = null; diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs index c062be3843227e..c0ff2deda8e44c 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs @@ -145,7 +145,7 @@ public void ProcessStart_UseShellExecute_OnUnix_SuccessWhenProgramInstalled(bool using (var px = Process.Start(new ProcessStartInfo { UseShellExecute = true, FileName = fileToOpen })) { Assert.NotNull(px); - if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) // on OSX, process name is dotnet for some reason. Refer to https://github.com/dotnet/corefx/issues/23972 + if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) // on OSX, process name is dotnet for some reason. Refer to https://github.com/dotnet/runtime/issues/23525 { Assert.Equal(programToOpen, px.ProcessName); } @@ -355,7 +355,7 @@ public void ProcessStart_OpenFileOnOsx_UsesSpecifiedProgram(string programToOpen File.WriteAllText(fileToOpen, $"{nameof(ProcessStart_OpenFileOnOsx_UsesSpecifiedProgram)}"); using (var px = Process.Start(programToOpenWith, fileToOpen)) { - // Assert.Equal(programToOpenWith, px.ProcessName); // on OSX, process name is dotnet for some reason. Refer to https://github.com/dotnet/corefx/issues/23972 + // Assert.Equal(programToOpenWith, px.ProcessName); // on OSX, process name is dotnet for some reason. Refer to https://github.com/dotnet/runtime/issues/23525 Console.WriteLine($"in OSX, {nameof(programToOpenWith)} is {programToOpenWith}, while {nameof(px.ProcessName)} is {px.ProcessName}."); px.Kill(); px.WaitForExit(); @@ -456,7 +456,7 @@ public void TestBasePriorityOnUnix() ProcessPriorityClass originalPriority = _process.PriorityClass; Assert.Equal(ProcessPriorityClass.Normal, originalPriority); - // https://github.com/dotnet/corefx/issues/25861 -- returns "-19" and not "19" + // https://github.com/dotnet/runtime/issues/24426 -- returns "-19" and not "19" if (!PlatformDetection.IsWindowsSubsystemForLinux) { SetAndCheckBasePriority(ProcessPriorityClass.Idle, 19); @@ -465,7 +465,7 @@ public void TestBasePriorityOnUnix() try { SetAndCheckBasePriority(ProcessPriorityClass.Normal, 0); - // https://github.com/dotnet/corefx/issues/25861 -- returns "11" and not "-11" + // https://github.com/dotnet/runtime/issues/24426 -- returns "11" and not "-11" if (!PlatformDetection.IsWindowsSubsystemForLinux) { SetAndCheckBasePriority(ProcessPriorityClass.High, -11); @@ -549,7 +549,7 @@ private static int CheckUserAndGroupIds(string userId, string groupId, string gr } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/35933", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/28922", TestPlatforms.AnyUnix)] public unsafe void TestCheckChildProcessUserAndGroupIds() { string userName = GetCurrentRealUserName(); @@ -578,7 +578,7 @@ public unsafe void TestCheckChildProcessUserAndGroupIds() [Trait(XunitConstants.Category, XunitConstants.RequiresElevation)] [InlineData(true)] [InlineData(false)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/38833", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30003", TestPlatforms.AnyUnix)] public unsafe void TestCheckChildProcessUserAndGroupIdsElevated(bool useRootGroups) { Func runsAsRoot = (string username, string useRootGroupsArg) => diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs index dd3aa9a0177a66..4573c160d182b6 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs @@ -1090,7 +1090,7 @@ public void GetProcesses_RemoteMachinePath_ReturnsExpected() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/corefx/issues/32780 + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/runtime/issues/27615 public void GetProcessesByName_ProcessName_ReturnsExpected() { // Get the current process using its name @@ -1111,7 +1111,7 @@ public void GetProcessesByName_ProcessName_ReturnsExpected() Assert.All(processes, process => Assert.Equal(".", process.MachineName)); return; - // Outputs a list of active processes in case of failure: https://github.com/dotnet/corefx/issues/35783 + // Outputs a list of active processes in case of failure: https://github.com/dotnet/runtime/issues/28874 string PrintProcesses(Process currentProcess) { StringBuilder builder = new StringBuilder(); @@ -1244,7 +1244,7 @@ public void StartInfo_SetOnRunningProcess_ThrowsInvalidOperationException() // .NET Core fixes a bug where Process.StartInfo for a unrelated process would // return information about the current process, not the unrelated process. - // See https://github.com/dotnet/corefx/issues/1100. + // See https://github.com/dotnet/runtime/issues/14329. Assert.Throws(() => process.StartInfo = new ProcessStartInfo()); process.Kill(); @@ -1272,7 +1272,7 @@ public void StartInfo_GetOnRunningProcess_ThrowsInvalidOperationException() // .NET Core fixes a bug where Process.StartInfo for an unrelated process would // return information about the current process, not the unrelated process. - // See https://github.com/dotnet/corefx/issues/1100. + // See https://github.com/dotnet/runtime/issues/14329. Assert.Throws(() => process.StartInfo); } @@ -1316,8 +1316,7 @@ public void StandardInput_GetNotRedirected_ThrowsInvalidOperationException() Assert.Throws(() => process.StandardInput); } - [Fact] - [SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "GC has different behavior on Mono")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void CanBeFinalized() { FinalizingProcess.CreateAndRelease(); @@ -1845,7 +1844,7 @@ public void TestLongProcessIsWorking() } [PlatformSpecific(TestPlatforms.AnyUnix)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/37054", TestPlatforms.OSX)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/29330", TestPlatforms.OSX)] [Fact] public void LongProcessNamesAreSupported() { diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessWaitingTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessWaitingTests.cs index f57a5cee30ed99..f48abd474f5cfa 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessWaitingTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessWaitingTests.cs @@ -24,6 +24,24 @@ public void MultipleProcesses_StartAllKillAllWaitAll() foreach (Process p in processes) Assert.True(p.WaitForExit(WaitInMS)); } + [Fact] + public async Task MultipleProcesses_StartAllKillAllWaitAllAsync() + { + const int Iters = 10; + Process[] processes = Enumerable.Range(0, Iters).Select(_ => CreateProcessLong()).ToArray(); + + foreach (Process p in processes) p.Start(); + foreach (Process p in processes) p.Kill(); + foreach (Process p in processes) + { + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await p.WaitForExitAsync(cts.Token); + Assert.True(p.HasExited); + } + } + } + [Fact] public void MultipleProcesses_SerialStartKillWait() { @@ -33,7 +51,24 @@ public void MultipleProcesses_SerialStartKillWait() Process p = CreateProcessLong(); p.Start(); p.Kill(); - p.WaitForExit(WaitInMS); + Assert.True(p.WaitForExit(WaitInMS)); + } + } + + [Fact] + public async Task MultipleProcesses_SerialStartKillWaitAsync() + { + const int Iters = 10; + for (int i = 0; i < Iters; i++) + { + Process p = CreateProcessLong(); + p.Start(); + p.Kill(); + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await p.WaitForExitAsync(cts.Token); + Assert.True(p.HasExited); + } } } @@ -54,6 +89,28 @@ public void MultipleProcesses_ParallelStartKillWait() Task.WaitAll(Enumerable.Range(0, Tasks).Select(_ => Task.Run(work)).ToArray()); } + [Fact] + public async Task MultipleProcesses_ParallelStartKillWaitAsync() + { + const int Tasks = 4, ItersPerTask = 10; + Func work = async () => + { + for (int i = 0; i < ItersPerTask; i++) + { + Process p = CreateProcessLong(); + p.Start(); + p.Kill(); + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await p.WaitForExitAsync(cts.Token); + Assert.True(p.HasExited); + } + } + }; + + await Task.WhenAll(Enumerable.Range(0, Tasks).Select(_ => Task.Run(work)).ToArray()); + } + [Theory] [InlineData(0)] // poll [InlineData(10)] // real timeout @@ -62,6 +119,21 @@ public void CurrentProcess_WaitNeverCompletes(int milliseconds) Assert.False(Process.GetCurrentProcess().WaitForExit(milliseconds)); } + [Theory] + [InlineData(0)] // poll + [InlineData(10)] // real timeout + public async Task CurrentProcess_WaitAsyncNeverCompletes(int milliseconds) + { + using (var cts = new CancellationTokenSource(milliseconds)) + { + CancellationToken token = cts.Token; + Process process = Process.GetCurrentProcess(); + OperationCanceledException ex = await Assert.ThrowsAnyAsync(() => process.WaitForExitAsync(token)); + Assert.Equal(token, ex.CancellationToken); + Assert.False(process.HasExited); + } + } + [Fact] public void SingleProcess_TryWaitMultipleTimesBeforeCompleting() { @@ -82,6 +154,60 @@ public void SingleProcess_TryWaitMultipleTimesBeforeCompleting() Assert.True(p.WaitForExit(0)); } + [Fact] + public async Task SingleProcess_TryWaitAsyncMultipleTimesBeforeCompleting() + { + Process p = CreateProcessLong(); + p.Start(); + + // Verify we can try to wait for the process to exit multiple times + + // First test with an already canceled token. Because the token is already canceled, + // WaitForExitAsync should complete synchronously + for (int i = 0; i < 2; i++) + { + var token = new CancellationToken(canceled: true); + Task t = p.WaitForExitAsync(token); + + Assert.Equal(TaskStatus.Canceled, t.Status); + + OperationCanceledException ex = await Assert.ThrowsAnyAsync(() => t); + Assert.Equal(token, ex.CancellationToken); + Assert.False(p.HasExited); + } + + // Next, test with a token that is canceled after the task is created to + // exercise event hookup and async cancellation + using (var cts = new CancellationTokenSource()) + { + CancellationToken token = cts.Token; + Task t = p.WaitForExitAsync(token); + cts.Cancel(); + + OperationCanceledException ex = await Assert.ThrowsAnyAsync(() => t); + Assert.Equal(token, ex.CancellationToken); + Assert.False(p.HasExited); + } + + // Then wait until it exits and concurrently kill it. + // There's a race condition here, in that we really want to test + // killing it while we're waiting, but we could end up killing it + // before hand, in which case we're simply not testing exactly + // what we wanted to test, but everything should still work. + _ = Task.Delay(10).ContinueWith(_ => p.Kill()); + + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await p.WaitForExitAsync(cts.Token); + Assert.True(p.HasExited); + } + + // Waiting on an already exited process should complete synchronously + Assert.True(p.HasExited); + Task task = p.WaitForExitAsync(); + Assert.Equal(TaskStatus.RanToCompletion, task.Status); + } + [Theory] [InlineData(false)] [InlineData(true)] @@ -107,6 +233,38 @@ public async Task SingleProcess_WaitAfterExited(bool addHandlerBeforeStart) Assert.True(p.WaitForExit(0)); } + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task SingleProcess_WaitAsyncAfterExited(bool addHandlerBeforeStart) + { + Process p = CreateProcessLong(); + p.EnableRaisingEvents = true; + + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + if (addHandlerBeforeStart) + { + p.Exited += delegate + { tcs.SetResult(true); }; + } + p.Start(); + if (!addHandlerBeforeStart) + { + p.Exited += delegate + { tcs.SetResult(true); }; + } + + p.Kill(); + Assert.True(await tcs.Task); + + var token = new CancellationToken(canceled: true); + await p.WaitForExitAsync(token); + Assert.True(p.HasExited); + + await p.WaitForExitAsync(); + Assert.True(p.HasExited); + } + [Theory] [InlineData(0)] [InlineData(1)] @@ -143,6 +301,40 @@ public void SingleProcess_CopiesShareExitInformation() } } + [Fact] + public async Task SingleProcess_CopiesShareExitAsyncInformation() + { + using Process p = CreateProcessLong(); + p.Start(); + + Process[] copies = Enumerable.Range(0, 3).Select(_ => Process.GetProcessById(p.Id)).ToArray(); + + using (var cts = new CancellationTokenSource(millisecondsDelay: 0)) + { + CancellationToken token = cts.Token; + OperationCanceledException ex = await Assert.ThrowsAnyAsync(() => p.WaitForExitAsync(token)); + Assert.Equal(token, ex.CancellationToken); + Assert.False(p.HasExited); + } + p.Kill(); + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await p.WaitForExitAsync(cts.Token); + Assert.True(p.HasExited); + } + + using (var cts = new CancellationTokenSource(millisecondsDelay: 0)) + { + foreach (Process copy in copies) + { + // Since the process has already exited, waiting again does not throw (even if the token is canceled) because + // there's no work to do. + await copy.WaitForExitAsync(cts.Token); + Assert.True(copy.HasExited); + } + } + } + [Fact] public void WaitForPeerProcess() { @@ -169,11 +361,49 @@ public void WaitForPeerProcess() Assert.Equal(RemoteExecutor.SuccessExitCode, child2.ExitCode); } + [Fact] + public async Task WaitAsyncForPeerProcess() + { + using Process child1 = CreateProcessLong(); + child1.Start(); + + using Process child2 = CreateProcess(async peerId => + { + Process peer = Process.GetProcessById(int.Parse(peerId)); + Console.WriteLine("Signal"); + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await peer.WaitForExitAsync(cts.Token); + Assert.True(peer.HasExited); + } + return RemoteExecutor.SuccessExitCode; + }, child1.Id.ToString()); + child2.StartInfo.RedirectStandardOutput = true; + child2.Start(); + char[] output = new char[6]; + child2.StandardOutput.Read(output, 0, output.Length); + Assert.Equal("Signal", new string(output)); // wait for the signal before killing the peer + + child1.Kill(); + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await child1.WaitForExitAsync(cts.Token); + Assert.True(child1.HasExited); + } + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await child2.WaitForExitAsync(cts.Token); + Assert.True(child2.HasExited); + } + + Assert.Equal(RemoteExecutor.SuccessExitCode, child2.ExitCode); + } + [Fact] public void WaitForSignal() { - const string expectedSignal = "Signal"; - const string successResponse = "Success"; + const string ExpectedSignal = "Signal"; + const string SuccessResponse = "Success"; const int timeout = 30 * 1000; // 30 seconds, to allow for very slow machines Process p = CreateProcessPortable(RemotelyInvokable.WriteLineReadLine); @@ -188,7 +418,7 @@ public void WaitForSignal() { linesReceived++; - if (e.Data == expectedSignal) + if (e.Data == ExpectedSignal) { mre.Set(); } @@ -207,13 +437,62 @@ public void WaitForSignal() using (StreamWriter writer = p.StandardInput) { - writer.WriteLine(successResponse); + writer.WriteLine(SuccessResponse); } Assert.True(p.WaitForExit(timeout), "Process has not exited"); Assert.Equal(RemotelyInvokable.SuccessExitCode, p.ExitCode); } + [Fact] + public async Task WaitAsyncForSignal() + { + const string expectedSignal = "Signal"; + const string successResponse = "Success"; + const int timeout = 5 * 1000; + + using Process p = CreateProcessPortable(RemotelyInvokable.WriteLineReadLine); + p.StartInfo.RedirectStandardInput = true; + p.StartInfo.RedirectStandardOutput = true; + using var mre = new ManualResetEventSlim(false); + + int linesReceived = 0; + p.OutputDataReceived += (s, e) => + { + if (e.Data != null) + { + linesReceived++; + + if (e.Data == expectedSignal) + { + mre.Set(); + } + } + }; + + p.Start(); + p.BeginOutputReadLine(); + + Assert.True(mre.Wait(timeout)); + Assert.Equal(1, linesReceived); + + // Wait a little bit to make sure process didn't exit on itself + Thread.Sleep(1); + Assert.False(p.HasExited, "Process has prematurely exited"); + + using (StreamWriter writer = p.StandardInput) + { + writer.WriteLine(successResponse); + } + + using (var cts = new CancellationTokenSource(timeout)) + { + await p.WaitForExitAsync(cts.Token); + Assert.True(p.HasExited, "Process has not exited"); + } + Assert.Equal(RemotelyInvokable.SuccessExitCode, p.ExitCode); + } + [Fact] public void WaitChain() { @@ -241,6 +520,52 @@ public void WaitChain() Assert.Equal(RemoteExecutor.SuccessExitCode, root.ExitCode); } + [Fact] + public async Task WaitAsyncChain() + { + Process root = CreateProcess(async () => + { + Process child1 = CreateProcess(async () => + { + Process child2 = CreateProcess(async () => + { + Process child3 = CreateProcess(() => RemoteExecutor.SuccessExitCode); + child3.Start(); + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await child3.WaitForExitAsync(cts.Token); + Assert.True(child3.HasExited); + } + + return child3.ExitCode; + }); + child2.Start(); + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await child2.WaitForExitAsync(cts.Token); + Assert.True(child2.HasExited); + } + + return child2.ExitCode; + }); + child1.Start(); + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await child1.WaitForExitAsync(cts.Token); + Assert.True(child1.HasExited); + } + + return child1.ExitCode; + }); + root.Start(); + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await root.WaitForExitAsync(cts.Token); + Assert.True(root.HasExited); + } + Assert.Equal(RemoteExecutor.SuccessExitCode, root.ExitCode); + } + [Fact] public void WaitForSelfTerminatingChild() { @@ -250,6 +575,33 @@ public void WaitForSelfTerminatingChild() Assert.NotEqual(RemoteExecutor.SuccessExitCode, child.ExitCode); } + [Fact] + public async Task WaitAsyncForSelfTerminatingChild() + { + Process child = CreateProcessPortable(RemotelyInvokable.SelfTerminate); + child.Start(); + using (var cts = new CancellationTokenSource(WaitInMS)) + { + await child.WaitForExitAsync(cts.Token); + Assert.True(child.HasExited); + } + Assert.NotEqual(RemoteExecutor.SuccessExitCode, child.ExitCode); + } + + [Fact] + public async Task WaitAsyncForProcess() + { + Process p = CreateSleepProcess(WaitInMS); + p.Start(); + + Task processTask = p.WaitForExitAsync(); + Task delayTask = Task.Delay(WaitInMS * 2); + + Task result = await Task.WhenAny(processTask, delayTask); + Assert.Equal(processTask, result); + Assert.True(p.HasExited); + } + [Fact] public void WaitForInputIdle_NotDirected_ThrowsInvalidOperationException() { @@ -263,5 +615,12 @@ public void WaitForExit_NotDirected_ThrowsInvalidOperationException() var process = new Process(); Assert.Throws(() => process.WaitForExit()); } + + [Fact] + public async Task WaitForExitAsync_NotDirected_ThrowsInvalidOperationException() + { + var process = new Process(); + await Assert.ThrowsAsync(() => process.WaitForExitAsync()); + } } } diff --git a/src/libraries/System.Diagnostics.StackTrace/ref/System.Diagnostics.StackTrace.cs b/src/libraries/System.Diagnostics.StackTrace/ref/System.Diagnostics.StackTrace.cs index bd3ab1f5d24055..b517071ac128c9 100644 --- a/src/libraries/System.Diagnostics.StackTrace/ref/System.Diagnostics.StackTrace.cs +++ b/src/libraries/System.Diagnostics.StackTrace/ref/System.Diagnostics.StackTrace.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Diagnostics diff --git a/src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.cs b/src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.cs index b31faef3b0278a..b87eb6e67fa281 100644 --- a/src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.cs +++ b/src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.cs @@ -163,7 +163,7 @@ internal void GetSourceLineInfo(Assembly assembly, string assemblyPath, IntPtr l private static unsafe PEReader? TryGetPEReader(string assemblyPath, IntPtr loadedPeAddress, int loadedPeSize) { - // TODO: https://github.com/dotnet/corefx/issues/11406 + // TODO: https://github.com/dotnet/runtime/issues/18423 //if (loadedPeAddress != IntPtr.Zero && loadedPeSize > 0) //{ // return new PEReader((byte*)loadedPeAddress, loadedPeSize, isLoadedImage: true); diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs index 2fb5fe982632f2..849b3bb5a9d810 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs @@ -34,6 +34,7 @@ public void Ctor_FNeedFileInfo(bool fNeedFileInfo) } [Theory] + [ActiveIssue("https://github.com/mono/mono/issues/15183", TestRuntimes.Mono)] [InlineData(StackFrame.OFFSET_UNKNOWN)] [InlineData(0)] [InlineData(1)] @@ -44,6 +45,7 @@ public void Ctor_SkipFrames(int skipFrames) } [Theory] + [ActiveIssue("https://github.com/mono/mono/issues/15187", TestRuntimes.Mono)] [InlineData(StackFrame.OFFSET_UNKNOWN, true)] [InlineData(0, true)] [InlineData(1, true)] @@ -91,6 +93,7 @@ public void Ctor_Filename_LineNumber(string fileName, int lineNumber) } [Theory] + [ActiveIssue("https://github.com/mono/mono/issues/15184", TestRuntimes.Mono)] [InlineData(null, StackFrame.OFFSET_UNKNOWN, 0)] [InlineData("", 0, StackFrame.OFFSET_UNKNOWN)] [InlineData("FileName", 1, 2)] @@ -115,6 +118,7 @@ public static IEnumerable ToString_TestData() } [Theory] + [ActiveIssue("https://github.com/mono/mono/issues/15186", TestRuntimes.Mono)] [MemberData(nameof(ToString_TestData))] public void ToString_Invoke_ReturnsExpected(StackFrame stackFrame, string expectedToString) { diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs index 27c3b54e60a52d..0915dd25377668 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs @@ -143,6 +143,7 @@ public void Ctor_EmptyException_FNeedFileInfo(bool fNeedFileInfo) } [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/31796", TestRuntimes.Mono)] [InlineData(0)] [InlineData(1)] public void Ctor_Exception_SkipFrames(int skipFrames) @@ -181,6 +182,7 @@ public void Ctor_EmptyException_SkipFrames() } [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/31796", TestRuntimes.Mono)] [InlineData(0, true)] [InlineData(1, true)] [InlineData(0, false)] @@ -272,6 +274,7 @@ public void GetFrame_InvalidIndex_ReturnsNull() } [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/31797", TestRuntimes.Mono)] [MemberData(nameof(ToString_TestData))] public void ToString_Invoke_ReturnsExpected(StackTrace stackTrace, string expectedToString) { diff --git a/src/libraries/System.Diagnostics.TextWriterTraceListener/ref/System.Diagnostics.TextWriterTraceListener.cs b/src/libraries/System.Diagnostics.TextWriterTraceListener/ref/System.Diagnostics.TextWriterTraceListener.cs index 8c9b80f890260a..3e516deef81a4d 100644 --- a/src/libraries/System.Diagnostics.TextWriterTraceListener/ref/System.Diagnostics.TextWriterTraceListener.cs +++ b/src/libraries/System.Diagnostics.TextWriterTraceListener/ref/System.Diagnostics.TextWriterTraceListener.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Diagnostics diff --git a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/FxCopBaseline.cs b/src/libraries/System.Diagnostics.TextWriterTraceListener/src/FxCopBaseline.cs deleted file mode 100644 index d7c7e4f0a47181..00000000000000 --- a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/FxCopBaseline.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.DelimitedListTraceListener.#set_Delimiter(System.String)")] diff --git a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System.Diagnostics.TextWriterTraceListener.csproj b/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System.Diagnostics.TextWriterTraceListener.csproj index 5747595d38323f..f326d869012406 100644 --- a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System.Diagnostics.TextWriterTraceListener.csproj +++ b/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System.Diagnostics.TextWriterTraceListener.csproj @@ -4,9 +4,6 @@ System.Diagnostics.TextWriterTraceListener $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix - - - diff --git a/src/libraries/System.Diagnostics.Tools/ref/System.Diagnostics.Tools.Forwards.cs b/src/libraries/System.Diagnostics.Tools/ref/System.Diagnostics.Tools.Forwards.cs index 6460ed50b97de7..3ab0ab42569ee1 100644 --- a/src/libraries/System.Diagnostics.Tools/ref/System.Diagnostics.Tools.Forwards.cs +++ b/src/libraries/System.Diagnostics.Tools/ref/System.Diagnostics.Tools.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.CodeDom.Compiler.GeneratedCodeAttribute))] diff --git a/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs b/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs index 2432c9c77546d3..ca04d6509e8bf6 100644 --- a/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs +++ b/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Diagnostics diff --git a/src/libraries/System.Diagnostics.TraceSource/src/FxCopBaseline.cs b/src/libraries/System.Diagnostics.TraceSource/src/FxCopBaseline.cs deleted file mode 100644 index 89cdfb87de27dc..00000000000000 --- a/src/libraries/System.Diagnostics.TraceSource/src/FxCopBaseline.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Flush()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Fail(System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Fail(System.String,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32,System.String,System.Object[])")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.String,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.Object)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.Object,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.String,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.Object)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.Object,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#Flush()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32,System.String,System.Object[])")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceData(System.Diagnostics.TraceEventType,System.Int32,System.Object)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceData(System.Diagnostics.TraceEventType,System.Int32,System.Object[])")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceTransfer(System.Int32,System.String,System.Guid)")] diff --git a/src/libraries/System.Diagnostics.TraceSource/src/System.Diagnostics.TraceSource.csproj b/src/libraries/System.Diagnostics.TraceSource/src/System.Diagnostics.TraceSource.csproj index 3df76afc2d5ff1..65fa3210771717 100644 --- a/src/libraries/System.Diagnostics.TraceSource/src/System.Diagnostics.TraceSource.csproj +++ b/src/libraries/System.Diagnostics.TraceSource/src/System.Diagnostics.TraceSource.csproj @@ -3,11 +3,8 @@ System.Diagnostics.TraceSource System.Diagnostics.TraceSource $(DefineConstants);TRACE - $(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX - - - diff --git a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs index 2b77b373412e32..4d1e26134ae4e5 100644 --- a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs +++ b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs @@ -34,7 +34,6 @@ public abstract class Switch private object InitializedLock { - [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "Reviewed for thread-safety")] get { if (_initializedLock == null) @@ -140,7 +139,6 @@ public StringDictionary Attributes /// protected int SwitchSetting { - [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "reviewed for thread-safety")] get { if (!_initialized) @@ -150,7 +148,6 @@ protected int SwitchSetting } return _switchSetting; } - [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "reviewed for thread-safety")] set { bool didUpdate = false; diff --git a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceListener.cs b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceListener.cs index 238fd127ad1abb..aadda6917602ce 100644 --- a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceListener.cs +++ b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceListener.cs @@ -201,11 +201,11 @@ public virtual void Fail(string message, string detailMessage) { StringBuilder failMessage = new StringBuilder(); failMessage.Append(SR.TraceListenerFail); - failMessage.Append(" "); + failMessage.Append(' '); failMessage.Append(message); if (detailMessage != null) { - failMessage.Append(" "); + failMessage.Append(' '); failMessage.Append(detailMessage); } diff --git a/src/libraries/System.Diagnostics.Tracing/documentation/EventCounterTutorial.md b/src/libraries/System.Diagnostics.Tracing/documentation/EventCounterTutorial.md index 36711a5b015c4b..f37f206219ee15 100644 --- a/src/libraries/System.Diagnostics.Tracing/documentation/EventCounterTutorial.md +++ b/src/libraries/System.Diagnostics.Tracing/documentation/EventCounterTutorial.md @@ -6,7 +6,7 @@ For events that happen very frequently (for example, if it happens every few mil When dealing with large number of events, knowing the measure per event is not very useful either. Most of the time all we need is just some statistics out of it. So we could crank the statistics within the process itself and then write an event once in a while to report the statistics, that's what `EventCounter` will do for us. Let's take a look at an example how to do this in `Microsoft.Diagnostics.Tracing.EventSource`. -In the sequel, we assume you are familiar with the basic `EventSource` usage, if you don't, please refer to [Vance's excellent blog](http://blogs.msdn.com/b/vancem/archive/2012/07/09/logging-your-own-etw-events-in-c-system-diagnostics-tracing-eventsource.aspx) on that. +In the sequel, we assume you are familiar with the basic `EventSource` usage, if you don't, please refer to [Vance's excellent blog](https://docs.microsoft.com/en-us/archive/blogs/vancem/introduction-tutorial-logging-etw-events-in-c-system-diagnostics-tracing-eventsource) on that. Without further ado, here is an example on how to use the `EventCounter` diff --git a/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs b/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs index 6831291c1b14ba..5dace110bd7039 100644 --- a/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs +++ b/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Diagnostics.Tracing diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/FuzzyTests.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/FuzzyTests.cs index 3458a8a77619dd..3ed963ec8eca37 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/FuzzyTests.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/FuzzyTests.cs @@ -22,7 +22,7 @@ public partial class FuzzyTests /// Tests the EventSource.Write[T] method (can only use the self-describing mechanism). /// /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/corefx/issues/29754 + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/runtime/issues/26197 public void Test_Write_Fuzzy() { using (var logger = new EventSource("EventSourceName")) diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.Etw.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.Etw.cs index 571cd96cd3b898..8fbf5e750e7580 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.Etw.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.Etw.cs @@ -14,7 +14,7 @@ public partial class TestEventCounter private static bool IsProcessElevated => s_isElevated.Value; [ConditionalFact(nameof(IsProcessElevated))] - [ActiveIssue("https://github.com/dotnet/corefx/issues/27106")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/25035")] public void Test_Write_Metric_ETW() { using (var listener = new EtwListener()) diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs index 3e7b3c53c2710a..18d72d8616ae16 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs @@ -40,9 +40,9 @@ public void Error() [Fact] #if !USE_MDT_EVENTSOURCE - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, reason: "https://github.com/dotnet/corefx/issues/23661")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, reason: "https://github.com/dotnet/runtime/issues/23380")] #endif - [ActiveIssue("https://github.com/dotnet/corefx/issues/25029")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24036")] public void Test_Write_Metric_EventListener() { using (var listener = new EventListenerListener()) diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.cs index 00d27d12f116fd..ab898dc351d73f 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.cs @@ -28,7 +28,7 @@ public partial class TestsManifestGeneration /// EventSource would fail when an EventSource was named "EventSource". /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/18808", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21297", TargetFrameworkMonikers.NetFramework)] public void Test_EventSource_NamedEventSource() { using (var es = new SdtEventSources.DontPollute.EventSource()) diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs index 4a1f2fe7c19de8..00236045d91c53 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs @@ -59,7 +59,7 @@ private static string GetResourceStringFromReflection(string key) /// For NuGet EventSources we validate both "runtime" and "validation" behavior /// [Fact] - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "https://github.com/dotnet/corefx/issues/19091")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "https://github.com/dotnet/runtime/issues/21421")] public void Test_GenerateManifest_InvalidEventSources() { TestUtilities.CheckNoEventSourcesRunning("Start"); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.Etw.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.Etw.cs index f34ce6ad8f4b41..34ae3b89bc71fd 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.Etw.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.Etw.cs @@ -17,7 +17,7 @@ public partial class TestsUserErrors /// /// Test the /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/corefx/issues/29754 + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/runtime/issues/26197 public void Test_BadEventSource_MismatchedIds_WithEtwListener() { // We expect only one session to be on when running the test but if a ETW session was left diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs index 27333abe7d99f0..ead8b156b60930 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs @@ -64,7 +64,7 @@ private void Test_BadTypes_Manifest(EventSource source) /// /// Test the /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/corefx/issues/29754 + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // ActiveIssue: https://github.com/dotnet/runtime/issues/26197 public void Test_BadEventSource_MismatchedIds() { TestUtilities.CheckNoEventSourcesRunning("Start"); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.Etw.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.Etw.cs index cb35bbfd1f1aa8..67d9e7f057a6f9 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.Etw.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.Etw.cs @@ -15,7 +15,7 @@ public partial class TestsWrite private static readonly Lazy s_isElevated = new Lazy(AdminHelpers.IsProcessElevated); private static bool IsProcessElevated => s_isElevated.Value; private static bool IsProcessElevatedAndNotWindowsNanoServer => - IsProcessElevated && PlatformDetection.IsNotWindowsNanoServer; // ActiveIssue: https://github.com/dotnet/corefx/issues/29754 + IsProcessElevated && PlatformDetection.IsNotWindowsNanoServer; // ActiveIssue: https://github.com/dotnet/runtime/issues/26197 /// /// Tests the EventSource.Write[T] method (can only use the self-describing mechanism). @@ -30,8 +30,8 @@ public void Test_Write_T_ETW() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/18806", TargetFrameworkMonikers.NetFramework)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/27106")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21295", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/25035")] [ConditionalFact(nameof(IsProcessElevated))] public void Test_Write_T_In_Manifest_Serialization_WithEtwListener() { diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs index 4f3226d6831b1f..3669410a8ba706 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs @@ -37,7 +37,7 @@ private struct PartB_UserInfo /// Tests the EventListener code path /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/19455", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21564", TargetFrameworkMonikers.NetFramework)] public void Test_Write_T_EventListener() { using (var listener = new EventListenerListener()) @@ -51,7 +51,7 @@ public void Test_Write_T_EventListener() /// Tests the EventListener code path using events instead of virtual callbacks. /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/19455", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21564", TargetFrameworkMonikers.NetFramework)] public void Test_Write_T_EventListener_UseEvents() { Test_Write_T(new EventListenerListener(true)); @@ -459,8 +459,8 @@ private void Test_Write_T(Listener listener) static partial void Test_Write_T_AddEtwTests(Listener listener, List tests, EventSource logger); [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/18806", TargetFrameworkMonikers.NetFramework)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/27106")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21295", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/25035")] public void Test_Write_T_In_Manifest_Serialization() { using (var eventListener = new EventListenerListener()) diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.Etw.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.Etw.cs index baf63ad07e5ce1..0643a9ee7e1393 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.Etw.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.Etw.cs @@ -15,7 +15,7 @@ partial class TestsWriteEvent private static readonly Lazy s_isElevated = new Lazy(AdminHelpers.IsProcessElevated); private static bool IsProcessElevated => s_isElevated.Value; private static bool IsProcessElevatedAndNotWindowsNanoServer => - IsProcessElevated && PlatformDetection.IsNotWindowsNanoServer; // ActiveIssue: https://github.com/dotnet/corefx/issues/29754 + IsProcessElevated && PlatformDetection.IsNotWindowsNanoServer; // ActiveIssue: https://github.com/dotnet/runtime/issues/26197 /// /// Tests WriteEvent using the manifest based mechanism. diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.cs index e98448c5daa019..da3108cb50b520 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.cs @@ -23,7 +23,7 @@ public partial class TestsWriteEvent /// Tests bTraceListener path. /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/18806", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21295", TargetFrameworkMonikers.NetFramework)] public void Test_WriteEvent_Manifest_EventListener() { using (var listener = new EventListenerListener()) @@ -37,7 +37,7 @@ public void Test_WriteEvent_Manifest_EventListener() /// Tests bTraceListener path using events instead of virtual callbacks. /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/18806", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21295", TargetFrameworkMonikers.NetFramework)] public void Test_WriteEvent_Manifest_EventListener_UseEvents() { Listener listener = new EventListenerListener(true); @@ -49,7 +49,7 @@ public void Test_WriteEvent_Manifest_EventListener_UseEvents() /// Tests both the ETW and TraceListener paths. /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/18806", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21295", TargetFrameworkMonikers.NetFramework)] public void Test_WriteEvent_SelfDescribing_EventListener() { using (var listener = new EventListenerListener()) @@ -64,7 +64,7 @@ public void Test_WriteEvent_SelfDescribing_EventListener() /// instead of virtual callbacks. /// [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/18806", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21295", TargetFrameworkMonikers.NetFramework)] public void Test_WriteEvent_SelfDescribing_EventListener_UseEvents() { Listener listener = new EventListenerListener(true); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs index 97fd85eaec090a..9630e9eefbc9aa 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs @@ -18,7 +18,7 @@ namespace BasicEventSourceTests public partial class TestsWriteEventToListener { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/19462", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21569", TargetFrameworkMonikers.NetFramework)] public void Test_WriteEvent_ArgsBasicTypes() { TestUtilities.CheckNoEventSourcesRunning("Start"); @@ -172,7 +172,7 @@ public void Test_WriteEvent_ArgsBasicTypes() static partial void Test_WriteEvent_ArgsBasicTypes_Etw_Validate_DateTime(EventSourceTest log); [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/19462", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21569", TargetFrameworkMonikers.NetFramework)] public void Test_WriteEvent_ArgsCornerCases() { TestUtilities.CheckNoEventSourcesRunning("Start"); @@ -241,7 +241,7 @@ public void Test_WriteEvent_ToChannel_Coverage() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/19462", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/21569", TargetFrameworkMonikers.NetFramework)] public void Test_WriteEvent_ZeroKwds() { TestUtilities.CheckNoEventSourcesRunning("Start"); diff --git a/src/libraries/System.DirectoryServices.AccountManagement/ref/System.DirectoryServices.AccountManagement.cs b/src/libraries/System.DirectoryServices.AccountManagement/ref/System.DirectoryServices.AccountManagement.cs index d1cee0d4d1fc5c..8ef925a1d447f8 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/ref/System.DirectoryServices.AccountManagement.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/ref/System.DirectoryServices.AccountManagement.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.DirectoryServices.AccountManagement diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj b/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj index 5c7ce59bd4a1d7..daf24a4408f6e3 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj @@ -6,8 +6,8 @@ $(NoWarn);8073;CA1810 true SR.DirectoryServicesAccountManagement_PlatformNotSupported - netstandard2.0;netcoreapp2.0-Windows_NT;$(NetCoreAppCurrent)-Windows_NT;_$(NetFrameworkCurrent) - true + $(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netcoreapp2.0-Windows_NT;_$(NetFrameworkCurrent) + true diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADAMStoreCtx.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADAMStoreCtx.cs index 1dd959683538aa..b55190968ba63a 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADAMStoreCtx.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADAMStoreCtx.cs @@ -333,7 +333,7 @@ protected override string GetObjectClassPortion(Type principalType) { filter.Append("(objectClass="); filter.Append(objectClass); - filter.Append(")"); + filter.Append(')'); } _cachedBindableObjectFilter = filter.ToString(); diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx.cs index e53adaf24c9914..1871147c94185f 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx.cs @@ -172,7 +172,7 @@ protected static void LoadPropertyMappingTable(int mappingIndex, object[,] rawPr // It's probably a property that requires custom handling, such as IdentityClaim. if (fromLdap != null) { - string ldapAttributeLower = ldapAttribute.ToLower(CultureInfo.InvariantCulture); + string ldapAttributeLower = ldapAttribute.ToLowerInvariant(); if (mappingTableByLDAP[ldapAttributeLower] == null) mappingTableByLDAP[ldapAttributeLower] = new ArrayList(); @@ -1049,22 +1049,22 @@ private ResultSet FindByDate(Type subtype, string[] ldapAttributes, MatchType ma foreach (string ldapAttribute in ldapAttributes) { - ldapFilter.Append("("); + ldapFilter.Append('('); switch (matchType) { case MatchType.Equals: ldapFilter.Append(ldapAttribute); - ldapFilter.Append("="); + ldapFilter.Append('='); ldapFilter.Append(ldapValue); break; case MatchType.NotEquals: ldapFilter.Append("!("); ldapFilter.Append(ldapAttribute); - ldapFilter.Append("="); + ldapFilter.Append('='); ldapFilter.Append(ldapValue); - ldapFilter.Append(")"); + ldapFilter.Append(')'); break; case MatchType.GreaterThanOrEquals: @@ -1080,24 +1080,24 @@ private ResultSet FindByDate(Type subtype, string[] ldapAttributes, MatchType ma break; case MatchType.GreaterThan: - ldapFilter.Append("&"); + ldapFilter.Append('&'); // Greater-than-or-equals (or less-than-or-equals)) - ldapFilter.Append("("); + ldapFilter.Append('('); ldapFilter.Append(ldapAttribute); ldapFilter.Append(matchType == MatchType.GreaterThan ? ">=" : "<="); ldapFilter.Append(ldapValue); - ldapFilter.Append(")"); + ldapFilter.Append(')'); // And not-equal ldapFilter.Append("(!("); ldapFilter.Append(ldapAttribute); - ldapFilter.Append("="); + ldapFilter.Append('='); ldapFilter.Append(ldapValue); ldapFilter.Append("))"); // And exists (need to include because of tristate LDAP logic) - ldapFilter.Append("("); + ldapFilter.Append('('); ldapFilter.Append(ldapAttribute); ldapFilter.Append("=*)"); break; @@ -1110,7 +1110,7 @@ private ResultSet FindByDate(Type subtype, string[] ldapAttributes, MatchType ma break; } - ldapFilter.Append(")"); + ldapFilter.Append(')'); } ldapFilter.Append("))"); diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_LoadStore.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_LoadStore.cs index 9aa632d4340741..c0e4c99e7fa7d4 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_LoadStore.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_LoadStore.cs @@ -628,13 +628,13 @@ private Principal FindPrincipalByIdentRefHelper( innerLdapFilter.Append(filterVal); } - innerLdapFilter.Append(")"); + innerLdapFilter.Append(')'); ldapFilter.Append(innerLdapFilter.ToString()); } // Wrap off the filter - ldapFilter.Append(")"); + ldapFilter.Append(')'); ds.Filter = ldapFilter.ToString(); GlobalDebug.WriteLineIf(GlobalDebug.Info, "ADStoreCtx", "FindPrincipalByIdentRefHelper: using LDAP filter {0}", ds.Filter); @@ -1244,7 +1244,7 @@ protected static void CommaStringToLdapConverter(Principal p, string propertyNam // Preexisting values that have not been removed. // This also includes inserted values. sb.Append(value); - sb.Append(","); + sb.Append(','); } // We have an extra comma at the end (assuming we added any values to the string). Remove it. diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs index ca62b944c42c46..93f395a4d6f79c 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs @@ -172,7 +172,7 @@ internal override object PushFilterToNativeSearcher(PrincipalSearcher ps) // // Wrap off the filter // - ldapFilter.Append(")"); + ldapFilter.Append(')'); } // We don't need any attributes returned, since we're just going to get a DirectoryEntry @@ -211,7 +211,7 @@ protected virtual string GetObjectClassPortion(Type principalType) StringBuilder SB = new StringBuilder(); SB.Append("(&(objectClass="); SB.Append(objClass); - SB.Append(")"); + SB.Append(')'); ldapFilter = SB.ToString(); } @@ -330,12 +330,12 @@ protected static string StringConverter(FilterBase filter, string suggestedAdPro if (filter.Value != null) { - sb.Append("("); + sb.Append('('); sb.Append(suggestedAdProperty); - sb.Append("="); + sb.Append('='); sb.Append(ADUtils.PAPIQueryToLdapQueryString((string)filter.Value)); - sb.Append(")"); + sb.Append(')'); } else { @@ -355,11 +355,11 @@ protected static string AcctDisabledConverter(FilterBase filter, string suggeste if (filter.Value != null) { - sb.Append("("); + sb.Append('('); sb.Append(suggestedAdProperty); - sb.Append("="); + sb.Append('='); sb.Append(!(bool)filter.Value ? "TRUE" : "FALSE"); - sb.Append(")"); + sb.Append(')'); } else { @@ -390,17 +390,17 @@ protected static string DefaultValueBoolConverter(FilterBase filter, string sugg sb.Append(suggestedAdProperty); sb.Append("=*)("); sb.Append(suggestedAdProperty); - sb.Append("="); + sb.Append('='); sb.Append((bool)filter.Value ? "TRUE" : "FALSE"); sb.Append(")))"); } else { - sb.Append("("); + sb.Append('('); sb.Append(suggestedAdProperty); - sb.Append("="); + sb.Append('='); sb.Append((bool)filter.Value ? "TRUE" : "FALSE"); - sb.Append(")"); + sb.Append(')'); } } else @@ -419,11 +419,11 @@ protected static string BoolConverter(FilterBase filter, string suggestedAdPrope if (filter.Value != null) { - sb.Append("("); + sb.Append('('); sb.Append(suggestedAdProperty); - sb.Append("="); + sb.Append('='); sb.Append( (bool)filter.Value ? "TRUE" : "FALSE" ); - sb.Append(")"); + sb.Append(')'); } else { @@ -441,12 +441,12 @@ protected static string CommaStringConverter(FilterBase filter, string suggested if (filter.Value != null) { - sb.Append("("); + sb.Append('('); sb.Append(suggestedAdProperty); sb.Append("=*"); sb.Append(ADUtils.PAPIQueryToLdapQueryString((string)filter.Value)); - sb.Append("*"); - sb.Append(")"); + sb.Append('*'); + sb.Append(')'); } else { @@ -510,13 +510,13 @@ protected static bool IdentityClaimToFilter(string identity, string identityForm sb.Append(ldapHexGuid); - sb.Append(")"); + sb.Append(')'); break; case UrnScheme.DistinguishedNameScheme: sb.Append("(distinguishedName="); sb.Append(ADUtils.EscapeRFC2254SpecialChars(identity)); - sb.Append(")"); + sb.Append(')'); break; case UrnScheme.SidScheme: @@ -543,19 +543,19 @@ protected static bool IdentityClaimToFilter(string identity, string identityForm sb.Append("(samAccountName="); sb.Append(ADUtils.EscapeRFC2254SpecialChars(samAccountName)); - sb.Append(")"); + sb.Append(')'); break; case UrnScheme.NameScheme: sb.Append("(name="); sb.Append(ADUtils.EscapeRFC2254SpecialChars(identity)); - sb.Append(")"); + sb.Append(')'); break; case UrnScheme.UpnScheme: sb.Append("(userPrincipalName="); sb.Append(ADUtils.EscapeRFC2254SpecialChars(identity)); - sb.Append(")"); + sb.Append(')'); break; default: @@ -646,7 +646,7 @@ protected static bool SecurityIdentityClaimConverterHelper(string urnValue, bool { filter.Append("(objectSid="); filter.Append(ldapHexSid); - filter.Append(")"); + filter.Append(')'); } return true; @@ -663,7 +663,7 @@ protected static string CertificateConverter(FilterBase filter, string suggested sb.Append("(userCertificate="); sb.Append(ADUtils.EscapeBinaryValue(rawCertificate)); - sb.Append(")"); + sb.Append(')'); return sb.ToString(); } @@ -759,9 +759,9 @@ protected static string BinaryConverter(FilterBase filter, string suggestedAdPro if (filter.Value != null) { - sb.Append("("); + sb.Append('('); sb.Append(suggestedAdProperty); - sb.Append("="); + sb.Append('='); sb.Append(ADUtils.EscapeBinaryValue((byte[])filter.Value)); } else @@ -771,7 +771,7 @@ protected static string BinaryConverter(FilterBase filter, string suggestedAdPro sb.Append("=*))"); } - sb.Append(")"); + sb.Append(')'); return sb.ToString(); } @@ -793,7 +793,7 @@ protected static string ExpirationDateConverter(FilterBase filter, string sugges { sb.Append("(accountExpires="); sb.Append(ADUtils.DateTimeToADString(date.Value)); - sb.Append(")"); + sb.Append(')'); } return sb.ToString(); @@ -824,7 +824,7 @@ protected static string GuidConverter(FilterBase filter, string suggestedAdPrope sb.Append(ldapHexGuid); - sb.Append(")"); + sb.Append(')'); } return sb.ToString(); @@ -874,7 +874,7 @@ protected static string LastLogonConverter(FilterBase filter, string suggestedAd sb.Append("(|"); sb.Append(DateTimeFilterBuilder("lastLogon", (DateTime)qmt.Value, LdapConstants.defaultUtcTime, false, qmt.Match)); sb.Append(DateTimeFilterBuilder("lastLogonTimestamp", (DateTime)qmt.Value, LdapConstants.defaultUtcTime, true, qmt.Match)); - sb.Append(")"); + sb.Append(')'); return (sb.ToString()); } @@ -952,16 +952,16 @@ public static string DateTimeFilterBuilder(string attributeName, DateTime search { case MatchType.Equals: ldapFilter.Append(attributeName); - ldapFilter.Append("="); + ldapFilter.Append('='); ldapFilter.Append(ldapSearchValue); break; case MatchType.NotEquals: ldapFilter.Append("!("); ldapFilter.Append(attributeName); - ldapFilter.Append("="); + ldapFilter.Append('='); ldapFilter.Append(ldapSearchValue); - ldapFilter.Append(")"); + ldapFilter.Append(')'); break; case MatchType.GreaterThanOrEquals: @@ -977,24 +977,24 @@ public static string DateTimeFilterBuilder(string attributeName, DateTime search break; case MatchType.GreaterThan: - ldapFilter.Append("&"); + ldapFilter.Append('&'); // Greater-than-or-equals (or less-than-or-equals)) - ldapFilter.Append("("); + ldapFilter.Append('('); ldapFilter.Append(attributeName); ldapFilter.Append(mt == MatchType.GreaterThan ? ">=" : "<="); ldapFilter.Append(ldapSearchValue); - ldapFilter.Append(")"); + ldapFilter.Append(')'); // And not-equal ldapFilter.Append("(!("); ldapFilter.Append(attributeName); - ldapFilter.Append("="); + ldapFilter.Append('='); ldapFilter.Append(ldapSearchValue); ldapFilter.Append("))"); // And exists (need to include because of tristate LDAP logic) - ldapFilter.Append("("); + ldapFilter.Append('('); ldapFilter.Append(attributeName); ldapFilter.Append("=*)"); break; @@ -1003,29 +1003,29 @@ public static string DateTimeFilterBuilder(string attributeName, DateTime search goto case MatchType.GreaterThan; } - ldapFilter.Append(")"); + ldapFilter.Append(')'); bool closeFilter = false; if (defaultNeeded) { ldapFilter.Append("(!"); ldapFilter.Append(attributeName); - ldapFilter.Append("="); + ldapFilter.Append('='); ldapFilter.Append(ldapDefaultValue); - ldapFilter.Append(")"); + ldapFilter.Append(')'); closeFilter = true; } if (mt == MatchType.NotEquals && requirePresence) { - ldapFilter.Append("("); + ldapFilter.Append('('); ldapFilter.Append(attributeName); ldapFilter.Append("=*)"); closeFilter = true; } if (closeFilter) - ldapFilter.Append(")"); + ldapFilter.Append(')'); return (ldapFilter.ToString()); } @@ -1065,16 +1065,16 @@ public static string ExtensionTypeConverter(string attributeName, Type type, obj { case MatchType.Equals: ldapFilter.Append(attributeName); - ldapFilter.Append("="); + ldapFilter.Append('='); ldapFilter.Append(ldapValue); break; case MatchType.NotEquals: ldapFilter.Append("!("); ldapFilter.Append(attributeName); - ldapFilter.Append("="); + ldapFilter.Append('='); ldapFilter.Append(ldapValue); - ldapFilter.Append(")"); + ldapFilter.Append(')'); break; case MatchType.GreaterThanOrEquals: @@ -1090,24 +1090,24 @@ public static string ExtensionTypeConverter(string attributeName, Type type, obj break; case MatchType.GreaterThan: - ldapFilter.Append("&"); + ldapFilter.Append('&'); // Greater-than-or-equals (or less-than-or-equals)) - ldapFilter.Append("("); + ldapFilter.Append('('); ldapFilter.Append(attributeName); ldapFilter.Append(mt == MatchType.GreaterThan ? ">=" : "<="); ldapFilter.Append(ldapValue); - ldapFilter.Append(")"); + ldapFilter.Append(')'); // And not-equal ldapFilter.Append("(!("); ldapFilter.Append(attributeName); - ldapFilter.Append("="); + ldapFilter.Append('='); ldapFilter.Append(ldapValue); ldapFilter.Append("))"); // And exists (need to include because of tristate LDAP logic) - ldapFilter.Append("("); + ldapFilter.Append('('); ldapFilter.Append(attributeName); ldapFilter.Append("=*)"); break; @@ -1116,7 +1116,7 @@ public static string ExtensionTypeConverter(string attributeName, Type type, obj goto case MatchType.GreaterThan; } - ldapFilter.Append(")"); + ldapFilter.Append(')'); return ldapFilter.ToString(); } diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADUtils.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADUtils.cs index bc30f8a2814def..2da46d1f5f762a 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADUtils.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADUtils.cs @@ -79,7 +79,7 @@ internal static string EscapeDNComponent(string dnComponent) int startingIndex = 0; if (dnComponent[0] == ' ' || dnComponent[0] == '#') { - sb.Append(@"\"); + sb.Append('\\'); sb.Append(dnComponent[0]); startingIndex++; } @@ -284,7 +284,7 @@ internal static string EscapeBinaryValue(byte[] bytes) foreach (byte b in bytes) { - sb.Append(@"\"); + sb.Append('\\'); sb.Append(b.ToString("x2", CultureInfo.InvariantCulture)); } @@ -343,7 +343,7 @@ internal static string HexStringToLdapHexString(string s) if (((firstChar >= '0' && firstChar <= '9') || (firstChar >= 'A' && firstChar <= 'F') || (firstChar >= 'a' && firstChar <= 'f')) && ((secondChar >= '0' && secondChar <= '9') || (secondChar >= 'A' && secondChar <= 'F') || (secondChar >= 'a' && secondChar <= 'f'))) { - sb.Append(@"\"); + sb.Append('\\'); sb.Append(firstChar); sb.Append(secondChar); } diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/TokenGroupsSet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/TokenGroupsSet.cs index e5bdd98e0b27ee..6a2c73515ceee8 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/TokenGroupsSet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/TokenGroupsSet.cs @@ -56,7 +56,7 @@ internal override object CurrentAsPrincipal SidBindingString.Append(""); + SidBindingString.Append('>'); DirectoryEntry currentDE = SDSUtils.BuildDirectoryEntry( BuildPathFromDN(SidBindingString.ToString()), diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Context.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Context.cs index b0094561b1c89e..0a63cb11da418b 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Context.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Context.cs @@ -104,7 +104,7 @@ private bool BindSam(string target, string userName, string password) // if they just passed user then append the machine name here. if (null != userName) { - int index = userName.IndexOf("\\", StringComparison.Ordinal); + int index = userName.IndexOf('\\'); if (index == -1) { userName = _serverName + "\\" + userName; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMMembersSet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMMembersSet.cs index ff8f8f6ee1a83a..b8f97db9126e19 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMMembersSet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMMembersSet.cs @@ -154,7 +154,7 @@ private bool MoveNextLocal() // Build the "WinNT://machineName/" portion of the new path adsPath.Append(_storeCtx.MachineUserSuppliedName); - adsPath.Append("/"); + adsPath.Append('/'); // Build the "WinNT://machineName/foo" portion of the new path int cElements = pathName.GetNumElements(); @@ -166,7 +166,7 @@ private bool MoveNextLocal() for (int i = cElements - 2; i >= 0; i--) { adsPath.Append(pathName.GetElement(i)); - adsPath.Append("/"); + adsPath.Append('/'); } adsPath.Remove(adsPath.Length - 1, 1); // remove the trailing "/" diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx.cs index 45227a8f675c16..de8746cc1e2269 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx.cs @@ -147,7 +147,7 @@ static SAMStoreCtx() // It's probably a property that requires custom handling, such as an IdentityClaim. if (fromWinNT != null) { - string winNTAttributeLower = winNTAttribute.ToLower(CultureInfo.InvariantCulture); + string winNTAttributeLower = winNTAttribute.ToLowerInvariant(); foreach (Hashtable propertyMappingTableByWinNT in byWinNTTables) { diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_LoadStore.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_LoadStore.cs index 940e66fd721295..92bf5b8cc52e2b 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_LoadStore.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_LoadStore.cs @@ -308,7 +308,7 @@ internal override void Load(Principal p) // Map each SAM attribute into the Principal in turn foreach (string samAttribute in samAttributes) { - ArrayList entries = (ArrayList)propertyMappingTableByWinNT[samAttribute.ToLower(CultureInfo.InvariantCulture)]; + ArrayList entries = (ArrayList)propertyMappingTableByWinNT[samAttribute.ToLowerInvariant()]; // If it's not in the table, it's not an SAM attribute we care about if (entries == null) diff --git a/src/libraries/System.DirectoryServices.AccountManagement/tests/PrincipalContextTests.cs b/src/libraries/System.DirectoryServices.AccountManagement/tests/PrincipalContextTests.cs index 2c7f031455e805..34e0eac0c111d5 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/tests/PrincipalContextTests.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/tests/PrincipalContextTests.cs @@ -101,7 +101,7 @@ public void Ctor_ContextType_Name_Container_Options(ContextType contextType, str } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23800")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23448")] [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] [OuterLoop("Takes too long on domain joined machines")] [InlineData(ContextType.Machine, null, "userName", "password")] @@ -127,7 +127,7 @@ public void Ctor_ContextType_Name_UserName_Password(ContextType contextType, str } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23800")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23448")] [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] [OuterLoop("Takes too long on domain joined machines")] [InlineData(ContextType.Machine, null, null, "userName", "password")] @@ -298,7 +298,7 @@ public void ValidateCredentials_Invoke_ReturnsExpected(string userName, string p Assert.Equal(expected, context.ValidateCredentials(userName, password, ContextOptions.Negotiate)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23800")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23448")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] [OuterLoop("Takes too long on domain joined machines")] public void ValidateCredentials_InvalidUserName_ThrowsException() @@ -307,7 +307,7 @@ public void ValidateCredentials_InvalidUserName_ThrowsException() Assert.Throws(() => context.ValidateCredentials("\0", "password")); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23800")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23448")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] [OuterLoop("Takes too long on domain joined machines")] public void ValidateCredentials_IncorrectUserNamePassword_ThrowsException() diff --git a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs index d2547363c254a5..47241ed15f3fa4 100644 --- a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs +++ b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.DirectoryServices.Protocols diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj b/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj index 6cdece64a96f2a..6ad5f867b6e9db 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj +++ b/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj @@ -5,8 +5,8 @@ $(NoWarn);0649;CA1810 true SR.DirectoryServicesProtocols_PlatformNotSupported - netstandard2.0;netcoreapp2.0-Windows_NT;$(NetCoreAppCurrent)-Windows_NT;_$(NetFrameworkCurrent) - true + $(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netcoreapp2.0-Windows_NT;_$(NetFrameworkCurrent) + true diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryAttribute.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryAttribute.cs index 1953e634b15b49..5a9d65408f14cd 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryAttribute.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryAttribute.cs @@ -276,7 +276,7 @@ public DirectoryAttribute this[string attributeName] throw new ArgumentNullException(nameof(attributeName)); } - object objectName = attributeName.ToLower(CultureInfo.InvariantCulture); + object objectName = attributeName.ToLowerInvariant(); return (DirectoryAttribute)InnerHashtable[objectName]; } } @@ -287,7 +287,7 @@ public DirectoryAttribute this[string attributeName] internal void Add(string name, DirectoryAttribute value) { - Dictionary.Add(name.ToLower(CultureInfo.InvariantCulture), value); + Dictionary.Add(name.ToLowerInvariant(), value); } public bool Contains(string attributeName) @@ -297,7 +297,7 @@ public bool Contains(string attributeName) throw new ArgumentNullException(nameof(attributeName)); } - object objectName = attributeName.ToLower(CultureInfo.InvariantCulture); + object objectName = attributeName.ToLowerInvariant(); return Dictionary.Contains(objectName); } diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryControl.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryControl.cs index 05456b93eb829a..8a9efa373315df 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryControl.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/DirectoryControl.cs @@ -950,9 +950,9 @@ public override byte[] GetValue() // encode Target if it is not null if (Target.Length != 0) { - seq.Append("t"); + seq.Append('t'); objList.Add(0x80 | 0x1); - seq.Append("o"); + seq.Append('o'); objList.Add(Target); } else @@ -962,17 +962,17 @@ public override byte[] GetValue() seq.Append("ii"); objList.Add(Offset); objList.Add(EstimateCount); - seq.Append("}"); + seq.Append('}'); } // encode the contextID if present if (ContextId.Length != 0) { - seq.Append("o"); + seq.Append('o'); objList.Add(ContextId); } - seq.Append("}"); + seq.Append('}'); object[] values = new object[objList.Count]; for (int i = 0; i < objList.Count; i++) { diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapConnection.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapConnection.cs index 9c17861d4366dc..79ed875dd6c44b 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapConnection.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapConnection.cs @@ -205,7 +205,7 @@ internal void Init() temp.Append(servers[i]); if (i < servers.Length - 1) { - temp.Append(" "); + temp.Append(' '); } } } diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs index 614f5d08efc8d0..2ff8d02bc4eb22 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs @@ -889,7 +889,7 @@ private int ProcessQueryConnection(IntPtr PrimaryConnection, IntPtr ReferralFrom var target = new StringBuilder(); target.Append(HostName); - target.Append(":"); + target.Append(':'); target.Append(PortNumber); var identifier = new LdapDirectoryIdentifier(target.ToString()); @@ -956,7 +956,7 @@ private bool ProcessNotifyConnection(IntPtr primaryConnection, IntPtr referralFr var target = new StringBuilder(); target.Append(hostName); - target.Append(":"); + target.Append(':'); target.Append(portNumber); var identifier = new LdapDirectoryIdentifier(target.ToString()); diff --git a/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.cs b/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.cs index f2a06dcaf758cb..c1b7f51e01d0b6 100644 --- a/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.cs +++ b/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.DirectoryServices diff --git a/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.manual.cs b/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.manual.cs index 2284aced0163ee..167d1445a76ea7 100644 --- a/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.manual.cs +++ b/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.manual.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.DirectoryServices diff --git a/src/libraries/System.DirectoryServices/src/Interop/AdsValueHelper2.cs b/src/libraries/System.DirectoryServices/src/Interop/AdsValueHelper2.cs index 020fdadd496165..9bf258bf70e272 100644 --- a/src/libraries/System.DirectoryServices/src/Interop/AdsValueHelper2.cs +++ b/src/libraries/System.DirectoryServices/src/Interop/AdsValueHelper2.cs @@ -144,7 +144,7 @@ public object GetValue() string s = bytes[i].ToString("X", CultureInfo.InvariantCulture); if (s.Length == 1) { - binaryPart.Append("0"); + binaryPart.Append('0'); } binaryPart.Append(s); @@ -152,9 +152,9 @@ public object GetValue() strb.Append("B:"); strb.Append(binaryPart.Length); - strb.Append(":"); + strb.Append(':'); strb.Append(binaryPart.ToString()); - strb.Append(":"); + strb.Append(':'); strb.Append(Marshal.PtrToStringUni(dnb.pszDNString)); return strb.ToString(); @@ -169,9 +169,9 @@ public object GetValue() var strb = new StringBuilder(); strb.Append("S:"); strb.Append(strValue.Length); - strb.Append(":"); + strb.Append(':'); strb.Append(strValue); - strb.Append(":"); + strb.Append(':'); strb.Append(Marshal.PtrToStringUni(dns.pszDNString)); return strb.ToString(); diff --git a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj index b88141f17831d9..6b2e2ad96e4810 100644 --- a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj +++ b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj @@ -4,8 +4,8 @@ true $(NoWarn);0649 SR.DirectoryServices_PlatformNotSupported - netstandard2.0;netcoreapp2.0-Windows_NT;$(NetCoreAppCurrent)-Windows_NT;_$(NetFrameworkCurrent) - true + $(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netcoreapp2.0-Windows_NT;_$(NetFrameworkCurrent) + true diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectoryReplicationMetaData.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectoryReplicationMetaData.cs index 7ab7cccf23bc35..6aa2c3c8158f36 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectoryReplicationMetaData.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectoryReplicationMetaData.cs @@ -24,7 +24,7 @@ public AttributeMetadata this[string name] { get { - string tempName = name.ToLower(CultureInfo.InvariantCulture); + string tempName = name.ToLowerInvariant(); if (Contains(tempName)) { return (AttributeMetadata)InnerHashtable[tempName]; @@ -40,7 +40,7 @@ public AttributeMetadata this[string name] public bool Contains(string attributeName) { - string tempName = attributeName.ToLower(CultureInfo.InvariantCulture); + string tempName = attributeName.ToLowerInvariant(); return Dictionary.Contains(tempName); } @@ -51,7 +51,7 @@ public void CopyTo(AttributeMetadata[] array, int index) private void Add(string name, AttributeMetadata value) { - Dictionary.Add(name.ToLower(CultureInfo.InvariantCulture), value); + Dictionary.Add(name.ToLowerInvariant(), value); AttributeNames.Add(name); Values.Add(value); diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchema.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchema.cs index cc555146364525..ea10e68612d137 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchema.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchema.cs @@ -358,21 +358,21 @@ public ReadOnlyActiveDirectorySchemaPropertyCollection FindAllProperties(Propert if (((int)type & (int)PropertyTypes.Indexed) != 0) { - str.Append("("); + str.Append('('); str.Append(PropertyManager.SearchFlags); str.Append(":1.2.840.113556.1.4.804:="); str.Append((int)SearchFlags.IsIndexed); - str.Append(")"); + str.Append(')'); } if (((int)type & (int)PropertyTypes.InGlobalCatalog) != 0) { - str.Append("("); + str.Append('('); str.Append(PropertyManager.IsMemberOfPartialAttributeSet); str.Append("=TRUE)"); } - str.Append(")"); // end filter + str.Append(')'); // end filter return GetAllProperties(context, _schemaEntry, str.ToString()); } diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchemaClass.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchemaClass.cs index f4e0761267c10c..71b87ab9d2225e 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchemaClass.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchemaClass.cs @@ -1091,7 +1091,7 @@ private object GetValueFromCache(string propertyName, bool mustExist) InitializePropertiesFromSchemaContainer(); Debug.Assert(_propertyValuesFromServer != null); - ArrayList values = (ArrayList)_propertyValuesFromServer[propertyName.ToLower(CultureInfo.InvariantCulture)]; + ArrayList values = (ArrayList)_propertyValuesFromServer[propertyName.ToLowerInvariant()]; Debug.Assert(values != null); if (values.Count < 1 && mustExist) @@ -1116,7 +1116,7 @@ private ICollection GetValuesFromCache(string propertyName) InitializePropertiesFromSchemaContainer(); Debug.Assert(_propertyValuesFromServer != null); - ArrayList values = (ArrayList)_propertyValuesFromServer[propertyName.ToLower(CultureInfo.InvariantCulture)]; + ArrayList values = (ArrayList)_propertyValuesFromServer[propertyName.ToLowerInvariant()]; Debug.Assert(values != null); return values; @@ -1178,7 +1178,7 @@ internal static Hashtable GetPropertiesFromSchemaContainer(DirectoryContext cont str.Append("(&("); str.Append(PropertyManager.ObjectCategory); str.Append("=classSchema)"); - str.Append("("); + str.Append('('); if (!isDefunctOnServer) { str.Append(PropertyManager.LdapDisplayName); @@ -1187,16 +1187,16 @@ internal static Hashtable GetPropertiesFromSchemaContainer(DirectoryContext cont { str.Append(PropertyManager.Cn); } - str.Append("="); + str.Append('='); str.Append(Utils.GetEscapedFilterValue(name)); - str.Append(")"); + str.Append(')'); if (!isDefunctOnServer) { str.Append("(!("); } else { - str.Append("("); + str.Append('('); } str.Append(PropertyManager.IsDefunct); if (!isDefunctOnServer) @@ -1325,15 +1325,15 @@ private ArrayList GetClasses(ICollection ldapDisplayNames) } foreach (string ldapDisplayName in ldapDisplayNames) { - str.Append("("); + str.Append('('); str.Append(PropertyManager.LdapDisplayName); - str.Append("="); + str.Append('='); str.Append(Utils.GetEscapedFilterValue(ldapDisplayName)); - str.Append(")"); + str.Append(')'); } if (ldapDisplayNames.Count > 1) { - str.Append(")"); + str.Append(')'); } string filter = "(&(" + PropertyManager.ObjectCategory + "=classSchema)" + str.ToString() + "(!(" + PropertyManager.IsDefunct + "=TRUE)))"; @@ -1403,15 +1403,15 @@ private ArrayList GetProperties(ICollection ldapDisplayNames) } foreach (string ldapDisplayName in ldapDisplayNames) { - str.Append("("); + str.Append('('); str.Append(PropertyManager.LdapDisplayName); - str.Append("="); + str.Append('='); str.Append(Utils.GetEscapedFilterValue(ldapDisplayName)); - str.Append(")"); + str.Append(')'); } if (ldapDisplayNames.Count > 1) { - str.Append(")"); + str.Append(')'); } string filter = "(&(" + PropertyManager.ObjectCategory + "=attributeSchema)" + str.ToString() + "(!(" + PropertyManager.IsDefunct + "=TRUE)))"; diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchemaProperty.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchemaProperty.cs index 9c27aaee0baac7..62ac720c966e17 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchemaProperty.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchemaProperty.cs @@ -1217,7 +1217,7 @@ internal static SearchResult GetPropertiesFromSchemaContainer(DirectoryContext c str.Append("(&("); str.Append(PropertyManager.ObjectCategory); str.Append("=attributeSchema)"); - str.Append("("); + str.Append('('); if (!isDefunctOnServer) { str.Append(PropertyManager.LdapDisplayName); @@ -1226,16 +1226,16 @@ internal static SearchResult GetPropertiesFromSchemaContainer(DirectoryContext c { str.Append(PropertyManager.Cn); } - str.Append("="); + str.Append('='); str.Append(Utils.GetEscapedFilterValue(name)); - str.Append(")"); + str.Append(')'); if (!isDefunctOnServer) { str.Append("(!("); } else { - str.Append("("); + str.Append('('); } str.Append(PropertyManager.IsDefunct); if (!isDefunctOnServer) diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySite.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySite.cs index 7bcf6a234c4d03..b4f5125772444a 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySite.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySite.cs @@ -987,10 +987,10 @@ private ReadOnlyDirectoryServerCollection GetBridgeheadServers() str.Append("(fromServer="); str.Append("CN=NTDS Settings,"); str.Append(Utils.GetEscapedFilterValue((string)val.Key)); - str.Append(")"); + str.Append(')'); } if (nonBridgHeadTable.Count > 1) - str.Append(")"); + str.Append(')'); ADSearcher adSearcher = new ADSearcher(serverEntry, "(&(objectClass=nTDSConnection)(objectCategory=NTDSConnection)" + str.ToString() + ")", new string[] { "fromServer", "distinguishedName" }, diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySiteLink.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySiteLink.cs index 2671fb234fd58f..e35ece7285cfe1 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySiteLink.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySiteLink.cs @@ -704,7 +704,7 @@ private void GetSites() propertyList.Add(propertyName); Hashtable values = Utils.GetValuesWithRangeRetrieval(cachedEntry, "(objectClass=*)", propertyList, SearchScope.Base); - ArrayList siteLists = (ArrayList)values[propertyName.ToLower(CultureInfo.InvariantCulture)]; + ArrayList siteLists = (ArrayList)values[propertyName.ToLowerInvariant()]; // somehow no site list if (siteLists == null) diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySiteLinkBridge.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySiteLinkBridge.cs index e4cf6b58a753f6..286cd8489d0174 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySiteLinkBridge.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySiteLinkBridge.cs @@ -360,7 +360,7 @@ private void GetLinks() propertyList.Add(propertyName); Hashtable values = Utils.GetValuesWithRangeRetrieval(cachedEntry, "(objectClass=*)", propertyList, SearchScope.Base); - ArrayList siteLinkLists = (ArrayList)values[propertyName.ToLower(CultureInfo.InvariantCulture)]; + ArrayList siteLinkLists = (ArrayList)values[propertyName.ToLowerInvariant()]; // somehow no site link list if (siteLinkLists == null) diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ApplicationPartition.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ApplicationPartition.cs index 0974c3948a1802..970561cb0f95f1 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ApplicationPartition.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ApplicationPartition.cs @@ -225,7 +225,7 @@ public static ApplicationPartition FindByName(DirectoryContext context, string d str.Append((int)SystemFlag.SystemFlagNtdsDomain); str.Append("))("); str.Append(PropertyManager.NCName); - str.Append("="); + str.Append('='); str.Append(Utils.GetEscapedFilterValue(distinguishedName)); str.Append("))"); diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ConfigSet.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ConfigSet.cs index 841cd627eacd32..bcd36bfefa45c6 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ConfigSet.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ConfigSet.cs @@ -447,11 +447,11 @@ internal static AdamInstance FindAnyAdamInstance(DirectoryContext context) str.Append("(&("); str.Append(PropertyManager.ObjectCategory); str.Append("=serviceConnectionPoint)"); - str.Append("("); + str.Append('('); str.Append(PropertyManager.Keywords); str.Append("=1.2.840.113556.1.4.1851)("); str.Append(PropertyManager.Keywords); - str.Append("="); + str.Append('='); str.Append(Utils.GetEscapedFilterValue(context.Name)); // target = config set name str.Append("))"); diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/DirectoryServer.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/DirectoryServer.cs index 6e3d8bc3dd1afd..2d9f940a292ad3 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/DirectoryServer.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/DirectoryServer.cs @@ -260,7 +260,7 @@ internal ArrayList GetPartitions() throw ExceptionHelper.GetExceptionFromCOMException(context, e); } - ArrayList readOnlyPartitions = (ArrayList)values[PropertyManager.HasPartialReplicaNCs.ToLower(CultureInfo.InvariantCulture)]; + ArrayList readOnlyPartitions = (ArrayList)values[PropertyManager.HasPartialReplicaNCs.ToLowerInvariant()]; Debug.Assert(readOnlyPartitions != null); foreach (string readOnlyPartition in readOnlyPartitions) diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Domain.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Domain.cs index 1828a6111aee6c..102c829d539cc4 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Domain.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Domain.cs @@ -1146,7 +1146,7 @@ private void LoadCrossRefAttributes() str.Append((int)SystemFlag.SystemFlagNtdsDomain); str.Append(")("); str.Append(PropertyManager.DnsRoot); - str.Append("="); + str.Append('='); str.Append(Utils.GetEscapedFilterValue(partitionName)); str.Append("))"); @@ -1241,7 +1241,7 @@ private ArrayList GetChildDomains() str.Append((int)SystemFlag.SystemFlagNtdsDomain); str.Append(")("); str.Append(PropertyManager.TrustParent); - str.Append("="); + str.Append('='); str.Append(Utils.GetEscapedFilterValue(_crossRefDN)); str.Append("))"); diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Locator.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Locator.cs index d4b406a603d55e..f372b72fe4d270 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Locator.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Locator.cs @@ -159,7 +159,7 @@ private static Hashtable DnsGetDcWrapper(string domainName, string siteName, lon try { dcDnsHostName = Marshal.PtrToStringUni(dcDnsHostNamePtr); - string key = dcDnsHostName.ToLower(CultureInfo.InvariantCulture); + string key = dcDnsHostName.ToLowerInvariant(); if (!domainControllers.Contains(key)) { @@ -254,7 +254,7 @@ private static Hashtable DnsQueryWrapper(string domainName, string siteName, lon DnsRecord dnsRecord = new DnsRecord(); Marshal.PtrToStructure(currentDnsRecord, dnsRecord); string targetName = dnsRecord.data.targetName; - string key = targetName.ToLower(CultureInfo.InvariantCulture); + string key = targetName.ToLowerInvariant(); if (!domainControllers.Contains(key)) { diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Utils.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Utils.cs index 62ef80c1f65933..af0a279dc5e179 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Utils.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Utils.cs @@ -754,7 +754,7 @@ internal static DirectoryEntry GetCrossRefEntry(DirectoryContext context, Direct str.Append((int)SystemFlag.SystemFlagNtdsDomain); str.Append("))("); str.Append(PropertyManager.NCName); - str.Append("="); + str.Append('='); str.Append(Utils.GetEscapedFilterValue(partitionName)); str.Append("))"); @@ -1107,7 +1107,7 @@ internal static Hashtable GetValuesWithRangeRetrieval(DirectoryEntry searchRootE foreach (string propertyName in propertiesWithoutRangeRetrieval) { // need to convert to lower case since S.DS returns property names in all lower case - string lowerCasePropertyName = propertyName.ToLower(CultureInfo.InvariantCulture); + string lowerCasePropertyName = propertyName.ToLowerInvariant(); propertyNamesWithoutRangeInfo.Add(lowerCasePropertyName); results.Add(lowerCasePropertyName, new ArrayList()); // add to the seachers's propertiesToLoad @@ -1119,7 +1119,7 @@ internal static Hashtable GetValuesWithRangeRetrieval(DirectoryEntry searchRootE foreach (string propertyName in propertiesWithRangeRetrieval) { // need to convert to lower case since S.DS returns property names in all lower case - string lowerCasePropertyName = propertyName.ToLower(CultureInfo.InvariantCulture); + string lowerCasePropertyName = propertyName.ToLowerInvariant(); propertiesStillToLoad.Add(lowerCasePropertyName); results.Add(lowerCasePropertyName, new ArrayList()); } @@ -1131,7 +1131,7 @@ internal static Hashtable GetValuesWithRangeRetrieval(DirectoryEntry searchRootE string propertyToLoad = propertyName + ";range=" + rangeStart + "-*"; searcher.PropertiesToLoad.Add(propertyToLoad); // need to convert to lower case since S.DS returns property names in all lower case - propertyNamesWithRangeInfo.Add(propertyName.ToLower(CultureInfo.InvariantCulture), propertyToLoad); + propertyNamesWithRangeInfo.Add(propertyName.ToLowerInvariant(), propertyToLoad); } //clear for the nezxt round @@ -1294,8 +1294,8 @@ internal static ArrayList GetReplicaList(DirectoryContext context, string partit } // extract the property values - ArrayList replicaLocations = (ArrayList)values[PropertyManager.MsDSNCReplicaLocations.ToLower(CultureInfo.InvariantCulture)]; - ArrayList roReplicaLocations = (ArrayList)values[PropertyManager.MsDSNCROReplicaLocations.ToLower(CultureInfo.InvariantCulture)]; + ArrayList replicaLocations = (ArrayList)values[PropertyManager.MsDSNCReplicaLocations.ToLowerInvariant()]; + ArrayList roReplicaLocations = (ArrayList)values[PropertyManager.MsDSNCROReplicaLocations.ToLowerInvariant()]; Debug.Assert(replicaLocations != null); if (replicaLocations.Count == 0) @@ -1306,32 +1306,32 @@ internal static ArrayList GetReplicaList(DirectoryContext context, string partit foreach (string replicaLocation in replicaLocations) { - ntdsaFilter.Append("("); + ntdsaFilter.Append('('); ntdsaFilter.Append(PropertyManager.DistinguishedName); - ntdsaFilter.Append("="); + ntdsaFilter.Append('='); ntdsaFilter.Append(Utils.GetEscapedFilterValue(replicaLocation)); - ntdsaFilter.Append(")"); + ntdsaFilter.Append(')'); - serverFilter.Append("("); + serverFilter.Append('('); serverFilter.Append(PropertyManager.DistinguishedName); - serverFilter.Append("="); + serverFilter.Append('='); serverFilter.Append(Utils.GetEscapedFilterValue(Utils.GetPartialDN(replicaLocation, 1))); - serverFilter.Append(")"); + serverFilter.Append(')'); } foreach (string roReplicaLocation in roReplicaLocations) { - roNtdsaFilter.Append("("); + roNtdsaFilter.Append('('); roNtdsaFilter.Append(PropertyManager.DistinguishedName); - roNtdsaFilter.Append("="); + roNtdsaFilter.Append('='); roNtdsaFilter.Append(Utils.GetEscapedFilterValue(roReplicaLocation)); - roNtdsaFilter.Append(")"); + roNtdsaFilter.Append(')'); - roServerFilter.Append("("); + roServerFilter.Append('('); roServerFilter.Append(PropertyManager.DistinguishedName); - roServerFilter.Append("="); + roServerFilter.Append('='); roServerFilter.Append(Utils.GetEscapedFilterValue(Utils.GetPartialDN(roReplicaLocation, 1))); - roServerFilter.Append(")"); + roServerFilter.Append(')'); } } catch (COMException e) @@ -1608,16 +1608,16 @@ internal static ArrayList GetReplicaList(DirectoryContext context, string partit foreach (string name in ntdsaNamesForRangeRetrieval) { - str.Append("("); + str.Append('('); str.Append(PropertyManager.NCName); - str.Append("="); + str.Append('='); str.Append(Utils.GetEscapedFilterValue(name)); - str.Append(")"); + str.Append(')'); } if (ntdsaNamesForRangeRetrieval.Count > 1) { - str.Append(")"); + str.Append(')'); } // Clear it for the next round of range retrieval @@ -1935,10 +1935,10 @@ internal static string SplitServerNameAndPortNumber(string serverName, out strin } //extract IPv6 port number if any - bool isBrace = serverName.StartsWith("["); + bool isBrace = serverName.StartsWith("[", StringComparison.Ordinal); if (isBrace == true) { - if (serverName.EndsWith("]")) + if (serverName.EndsWith("]", StringComparison.Ordinal)) { //[IPv6] serverName = serverName.Substring(1, serverName.Length - 2); //2 for [] diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryEntry.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryEntry.cs index af515111e827d0..7f093c6f94ffaa 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryEntry.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryEntry.cs @@ -999,7 +999,7 @@ public void RefreshCache(string[] propertyNames) { if (propertyNames[i] != null) { - string name = propertyNames[i].ToLower(CultureInfo.InvariantCulture); + string name = propertyNames[i].ToLowerInvariant(); _propertyCollection.valueTable.Remove(name); // also need to consider the range retrieval case diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/PropertyCollection.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/PropertyCollection.cs index 8990b5b492cc7d..5855d93d7bf37f 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/PropertyCollection.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/PropertyCollection.cs @@ -34,7 +34,7 @@ public PropertyValueCollection this[string propertyName] if (propertyName == null) throw new ArgumentNullException(nameof(propertyName)); - string name = propertyName.ToLower(CultureInfo.InvariantCulture); + string name = propertyName.ToLowerInvariant(); if (valueTable.Contains(name)) return (PropertyValueCollection)valueTable[name]; else diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ResultPropertyCollection.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ResultPropertyCollection.cs index 7ed4132e113745..a2ec31720a5166 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ResultPropertyCollection.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ResultPropertyCollection.cs @@ -23,7 +23,7 @@ public ResultPropertyValueCollection this[string name] { get { - object objectName = name.ToLower(CultureInfo.InvariantCulture); + object objectName = name.ToLowerInvariant(); if (Contains((string)objectName)) { return (ResultPropertyValueCollection)InnerHashtable[objectName]; @@ -41,12 +41,12 @@ public ResultPropertyValueCollection this[string name] internal void Add(string name, ResultPropertyValueCollection value) { - Dictionary.Add(name.ToLower(CultureInfo.InvariantCulture), value); + Dictionary.Add(name.ToLowerInvariant(), value); } public bool Contains(string propertyName) { - object objectName = propertyName.ToLower(CultureInfo.InvariantCulture); + object objectName = propertyName.ToLowerInvariant(); return Dictionary.Contains(objectName); } diff --git a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs index 21a6388dfabe54..35b22779a5f19e 100644 --- a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs +++ b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Drawing diff --git a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj index ac98d1041598b7..85eed370af7fad 100644 --- a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj +++ b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj @@ -1,7 +1,7 @@ netcoreapp3.0;$(NetCoreAppCurrent) - true + true diff --git a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj index 7d387d12c4d5c0..51401ba88a68ed 100644 --- a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj +++ b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj @@ -6,7 +6,7 @@ $(DefineConstants);FEATURE_WINDOWS_SYSTEM_COLORS;FEATURE_SYSTEM_EVENTS true netcoreapp3.0-Windows_NT;netcoreapp3.0-Unix;$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix - true + true diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/ColorConverter.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/ColorConverter.cs index feda73cc49259d..b6b654e12879b6 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/ColorConverter.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/ColorConverter.cs @@ -167,7 +167,7 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c // Nope. Parse the RGBA from the text. // if (obj == null) { - string[] tokens = text.Split(new char[] {sep}); + string[] tokens = text.Split(sep); int[] values = new int[tokens.Length]; for (int i = 0; i < values.Length; i++) { values[i] = unchecked((int)intConverter.ConvertFromString(context, culture, tokens[i])); diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/PointConverter.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/PointConverter.cs index 0c84114e1b15da..cbe20d133e3271 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/PointConverter.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/PointConverter.cs @@ -71,7 +71,7 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c culture = CultureInfo.CurrentCulture; } char sep = culture.TextInfo.ListSeparator[0]; - string[] tokens = text.Split(new char[] {sep}); + string[] tokens = text.Split(sep); int[] values = new int[tokens.Length]; TypeConverter intConverter = TypeDescriptor.GetConverter(typeof(int)); for (int i = 0; i < values.Length; i++) { diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs index 21ee9ab7696cf4..98d87f549b92c8 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs @@ -411,7 +411,7 @@ private static PrinterResolution ParseResolution(string resolution) if (string.IsNullOrEmpty(resolution)) return null; - int dpiIndex = resolution.IndexOf("dpi"); + int dpiIndex = resolution.IndexOf("dpi", StringComparison.Ordinal); if (dpiIndex == -1) { // Resolution is "Unknown" or unparsable diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/RectangleConverter.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/RectangleConverter.cs index f161d0a1347627..8a92db4fe0ed80 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/RectangleConverter.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/RectangleConverter.cs @@ -71,7 +71,7 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c culture = CultureInfo.CurrentCulture; } char sep = culture.TextInfo.ListSeparator[0]; - string[] tokens = text.Split(new char[] {sep}); + string[] tokens = text.Split(sep); int[] values = new int[tokens.Length]; TypeConverter intConverter = TypeDescriptor.GetConverter(typeof(int)); for (int i = 0; i < values.Length; i++) { diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/SizeConverter.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/SizeConverter.cs index 41c10457d03c9e..9404d912e7d11a 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/SizeConverter.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/SizeConverter.cs @@ -71,7 +71,7 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c culture = CultureInfo.CurrentCulture; } char sep = culture.TextInfo.ListSeparator[0]; - string[] tokens = text.Split(new char[] {sep}); + string[] tokens = text.Split(sep); int[] values = new int[tokens.Length]; TypeConverter intConverter = TypeDescriptor.GetConverter(typeof(int)); for (int i = 0; i < values.Length; i++) { diff --git a/src/libraries/System.Drawing.Common/tests/BitmapTests.cs b/src/libraries/System.Drawing.Common/tests/BitmapTests.cs index c0e2cd221ee601..c1be4b4701a029 100644 --- a/src/libraries/System.Drawing.Common/tests/BitmapTests.cs +++ b/src/libraries/System.Drawing.Common/tests/BitmapTests.cs @@ -71,16 +71,14 @@ public void Ctor_FilePath_UseIcm(string filename, int width, int height, PixelFo } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void Ctor_NullFilePath_ThrowsArgumentNullException() { AssertExtensions.Throws("path", () => new Bitmap((string)null)); AssertExtensions.Throws("path", () => new Bitmap((string)null, false)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData("", "path")] [InlineData("\0", "path")] [InlineData("NoSuchPath", null)] @@ -109,7 +107,7 @@ public void Ctor_NullType_ThrowsNullReferenceException() Assert.Throws(() => new Bitmap(null, "name")); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(typeof(Bitmap), null)] [InlineData(typeof(Bitmap), "")] @@ -159,8 +157,7 @@ public void Ctor_NullStream_ThrowsArgumentNullException() AssertExtensions.Throws("stream", null, () => new Bitmap((Stream)null, false)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void Ctor_InvalidBytesInStream_ThrowsArgumentException() { using (var stream = new MemoryStream(new byte[0])) @@ -185,7 +182,7 @@ public void Ctor_Width_Height(int width, int height) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(10, 10, PixelFormat.Format1bppIndexed)] [InlineData(10, 10, PixelFormat.Format8bppIndexed)] @@ -220,7 +217,7 @@ public static IEnumerable Ctor_Width_Height_Stride_PixelFormat_Scan0_T yield return new object[] { 1, 1, 1, PixelFormat.Format1bppIndexed, IntPtr.Zero }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_Width_Height_Stride_PixelFormat_Scan0_TestData))] public void Ctor_Width_Height_Stride_PixelFormat_Scan0(int width, int height, int stride, PixelFormat pixelFormat, IntPtr scan0) @@ -234,7 +231,7 @@ public void Ctor_Width_Height_Stride_PixelFormat_Scan0(int width, int height, in } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(-1)] [InlineData(0)] @@ -250,7 +247,7 @@ public void Ctor_InvalidWidth_ThrowsArgumentException(int width) AssertExtensions.Throws(null, () => new Bitmap(width, 1, 0, PixelFormat.Format16bppArgb1555, IntPtr.Zero)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(-1)] [InlineData(0)] @@ -266,8 +263,7 @@ public void Ctor_InvalidHeight_ThrowsArgumentException(int height) AssertExtensions.Throws(null, () => new Bitmap(1, height, 0, PixelFormat.Format16bppArgb1555, IntPtr.Zero)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(PixelFormat.Undefined - 1)] [InlineData(PixelFormat.Undefined)] [InlineData(PixelFormat.Gdi - 1)] @@ -284,7 +280,7 @@ public void Ctor_InvalidPixelFormat_ThrowsArgumentException(PixelFormat format) AssertExtensions.Throws(null, () => new Bitmap(1, 1, 0, format, IntPtr.Zero)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_InvalidScan0_ThrowsArgumentException() { @@ -306,7 +302,7 @@ public static IEnumerable Image_TestData() yield return new object[] { new Bitmap(Helpers.GetTestBitmapPath("16x16_nonindexed_24bit.png")), 32, 48 }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Image_TestData))] public void Ctor_Width_Height_Graphics(Bitmap image, int width, int height) @@ -346,7 +342,7 @@ public void Ctor_NullImageWithoutSize_ThrowsNullReferenceException() Assert.Throws(() => new Bitmap((Image)null)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Image_TestData))] public void Ctor_Image_Width_Height(Image image, int width, int height) @@ -360,7 +356,7 @@ public void Ctor_Image_Width_Height(Image image, int width, int height) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Image_TestData))] public void Ctor_Size(Image image, int width, int height) @@ -400,7 +396,7 @@ public static IEnumerable Clone_TestData() yield return new object[] { new Bitmap(3, 3, PixelFormat.Format64bppPArgb), new Rectangle(1, 1, 1, 1), PixelFormat.Format16bppRgb565 }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Clone_TestData))] public void Clone_Rectangle_ReturnsExpected(Bitmap bitmap, Rectangle rectangle, PixelFormat targetFormat) @@ -439,7 +435,7 @@ public void Clone_Rectangle_ReturnsExpected(Bitmap bitmap, Rectangle rectangle, } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Clone_TestData))] public void Clone_RectangleF_ReturnsExpected(Bitmap bitmap, Rectangle rectangle, PixelFormat format) @@ -461,7 +457,7 @@ public void Clone_RectangleF_ReturnsExpected(Bitmap bitmap, Rectangle rectangle, } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(0, 1)] [InlineData(1, 0)] @@ -474,7 +470,7 @@ public void Clone_ZeroWidthOrHeightRect_ThrowsArgumentException(int width, int h } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(0, 0, 4, 1)] [InlineData(0, 0, 1, 4)] @@ -491,7 +487,7 @@ public void Clone_InvalidRect_ThrowsOutOfMemoryException(int x, int y, int width } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(PixelFormat.Max)] [InlineData(PixelFormat.Indexed)] @@ -510,7 +506,7 @@ public void Clone_InvalidPixelFormat_ThrowsOutOfMemoryException(PixelFormat form } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Clone_GrayscaleFormat_ThrowsOutOfMemoryException() { @@ -544,7 +540,7 @@ public void Clone_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => bitmap.Clone(new RectangleF(0, 0, 1, 1), PixelFormat.Format32bppArgb)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetFrameCount_NewBitmap_ReturnsZero() { @@ -566,7 +562,7 @@ public void GetFrameCount_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => bitmap.GetFrameCount(FrameDimension.Page)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(-1)] [InlineData(0)] @@ -614,8 +610,7 @@ public void GetPixel_ValidPixelFormat_Success(Bitmap bitmap, int x, int y, Color } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(-1)] [InlineData(1)] public void GetPixel_InvalidX_ThrowsArgumentOutOfRangeException(int x) @@ -626,8 +621,7 @@ public void GetPixel_InvalidX_ThrowsArgumentOutOfRangeException(int x) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(-1)] [InlineData(1)] public void GetPixel_InvalidY_ThrowsArgumentOutOfRangeException(int y) @@ -638,7 +632,7 @@ public void GetPixel_InvalidY_ThrowsArgumentOutOfRangeException(int y) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetPixel_GrayScalePixelFormat_ThrowsArgumentException() { @@ -664,7 +658,7 @@ public static IEnumerable GetHbitmap_TestData() yield return new object[] { new Bitmap(512, 512, PixelFormat.Format16bppRgb555), 512, 512 }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(GetHbitmap_TestData))] public void GetHbitmap_FromHbitmap_ReturnsExpected(Bitmap bitmap, int width, int height) @@ -706,7 +700,7 @@ public void GetHbitmap_FromHbitmap_ReturnsExpected(Bitmap bitmap, int width, int } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(1, 1)] [InlineData(short.MaxValue, 1)] @@ -728,7 +722,7 @@ public void GetHbitmap_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => bitmap.GetHbitmap()); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHbitmap_InvalidHandle_ThrowsExternalException() { @@ -772,7 +766,7 @@ public static IEnumerable FromHicon_TestData() yield return new object[] { new Bitmap(512, 512, PixelFormat.Format16bppRgb555).GetHicon(), 512, 512 }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FromHicon_TestData))] public Bitmap GetHicon_FromHicon_ReturnsExpected(IntPtr handle, int width, int height) @@ -790,7 +784,7 @@ public Bitmap GetHicon_FromHicon_ReturnsExpected(IntPtr handle, int width, int h return result; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHicon_Grayscale_ThrowsArgumentException() { @@ -809,7 +803,8 @@ public void GetHicon_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => bitmap.GetHicon()); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + // This test causes an AV on Linux + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHicon_InvalidHandle_ThrowsArgumentException() { @@ -817,7 +812,7 @@ public void FromHicon_InvalidHandle_ThrowsArgumentException() AssertExtensions.Throws(null, () => Bitmap.FromHicon((IntPtr)10)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHicon_1bppIcon_ThrowsArgumentException() { @@ -827,7 +822,7 @@ public void FromHicon_1bppIcon_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromResource_InvalidHandle_ThrowsArgumentException() { @@ -835,7 +830,7 @@ public void FromResource_InvalidHandle_ThrowsArgumentException() AssertExtensions.Throws(null, () => Bitmap.FromResource((IntPtr)10, "Name")); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromResource_InvalidBitmapName_ThrowsArgumentException() { @@ -843,7 +838,7 @@ public void FromResource_InvalidBitmapName_ThrowsArgumentException() AssertExtensions.Throws(null, () => Bitmap.FromResource((IntPtr)10, "Name")); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void MakeTransparent_NoColorWithMatches_SetsMatchingPixelsToTransparent() { @@ -882,7 +877,7 @@ public void MakeTransparent_NoColorWithMatches_SetsMatchingPixelsToTransparent() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void MakeTransparent_CustomColorExists_SetsMatchingPixelsToTransparent() { @@ -955,9 +950,9 @@ public void MakeTransparent_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => bitmap.MakeTransparent(Color.Red)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/21886", TargetFrameworkMonikers.NetFramework)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/29858", TestPlatforms.Windows)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22629", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26247", TestPlatforms.Windows)] [ConditionalFact(Helpers.IsDrawingSupported)] public void MakeTransparent_GrayscalePixelFormat_ThrowsArgumentException() { @@ -968,8 +963,7 @@ public void MakeTransparent_GrayscalePixelFormat_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void MakeTransparent_Icon_ThrowsInvalidOperationException() { using (var bitmap = new Bitmap(Helpers.GetTestBitmapPath("16x16_one_entry_4bit.ico"))) @@ -1004,8 +998,7 @@ public void SetPixel_IndexedPixelFormat_ThrowsInvalidOperationException(PixelFor } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(-1)] [InlineData(1)] public void SetPixel_InvalidX_ThrowsArgumentOutOfRangeException(int x) @@ -1016,8 +1009,7 @@ public void SetPixel_InvalidX_ThrowsArgumentOutOfRangeException(int x) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(-1)] [InlineData(1)] public void SetPixel_InvalidY_ThrowsArgumentOutOfRangeException(int y) @@ -1028,7 +1020,7 @@ public void SetPixel_InvalidY_ThrowsArgumentOutOfRangeException(int y) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetPixel_GrayScalePixelFormat_ThrowsArgumentException() { @@ -1072,7 +1064,7 @@ public void SetResolution_InvalidXDpi_ThrowsArgumentException(float xDpi) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(-1)] [InlineData(0)] @@ -1149,15 +1141,16 @@ public static IEnumerable LockBits_TestData() yield return new object[] { new Bitmap(184, 184, PixelFormat.Format1bppIndexed), new Rectangle(0, 0, 184, 184), ImageLockMode.WriteOnly, PixelFormat.Format1bppIndexed, 24, 2 }; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/40224", TestPlatforms.Windows)] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30565", TestPlatforms.Windows)] [MemberData(nameof(LockBits_TestData))] public void LockBits_Invoke_Success(Bitmap bitmap, Rectangle rectangle, ImageLockMode lockMode, PixelFormat pixelFormat, int expectedStride, int expectedReserved) { Do_LockBits_Invoke_Success(bitmap, rectangle, lockMode, pixelFormat, expectedStride, expectedReserved); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + // This test causes an AV on Unix + [ActiveIssue("https://github.com/dotnet/runtime/issues/30565", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(LockBits_NotUnix_TestData))] public void LockBits_Invoke_Success_NotUnix(Bitmap bitmap, Rectangle rectangle, ImageLockMode lockMode, PixelFormat pixelFormat, int expectedStride, int expectedReserved) @@ -1207,8 +1200,7 @@ public void LockBits_NullBitmapData_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(-1, 0, 1, 1)] [InlineData(2, 0, 1, 1)] [InlineData(0, -1, 1, 1)] @@ -1232,8 +1224,7 @@ public void LockBits_InvalidRect_ThrowsArgumentException(int x, int y, int width } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(PixelFormat.DontCare)] [InlineData(PixelFormat.Max)] [InlineData(PixelFormat.Indexed)] @@ -1257,7 +1248,7 @@ public void LockBits_InvalidPixelFormat_ThrowsArgumentException(PixelFormat form } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void LockBits_ReadOnlyGrayscale_ThrowsArgumentException() { @@ -1274,7 +1265,7 @@ public void LockBits_ReadOnlyGrayscale_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData((ImageLockMode)(-1))] [InlineData(ImageLockMode.UserInputBuffer + 1)] @@ -1318,7 +1309,7 @@ public void LockBits_AlreadyLocked_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(0, -1)] [InlineData(0, 2)] @@ -1347,8 +1338,7 @@ public void UnlockBits_Scan0Zero_Nop() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(PixelFormat.Indexed)] [InlineData(PixelFormat.Gdi)] public void UnlockBits_InvalidPixelFormat_Nop(PixelFormat format) @@ -1371,8 +1361,7 @@ public void UnlockBits_NullBitmapData_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void UnlockBits_NotLocked_ThrowsExternalException() { using (var bitmap = new Bitmap(1, 1)) @@ -1381,8 +1370,7 @@ public void UnlockBits_NotLocked_ThrowsExternalException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void UnlockBits_AlreadyUnlocked_ThrowsExternalException() { using (var bitmap = new Bitmap(1, 1)) @@ -1414,7 +1402,7 @@ public void Size_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => bitmap.Size); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(PixelFormat.Format16bppArgb1555)] [InlineData(PixelFormat.Format16bppRgb555)] @@ -1583,7 +1571,7 @@ public void Palette_Get_ReturnsExpected(PixelFormat pixelFormat, int[] expectedE } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Palette_SetNull_ThrowsNullReferenceException() { @@ -1605,7 +1593,7 @@ public void Palette_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => bitmap.Size); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void LockBits_Marshalling_Success() { Color red = Color.FromArgb(Color.Red.ToArgb()); diff --git a/src/libraries/System.Drawing.Common/tests/BrushTests.cs b/src/libraries/System.Drawing.Common/tests/BrushTests.cs index fdb8071f4546c4..45a198d9600155 100644 --- a/src/libraries/System.Drawing.Common/tests/BrushTests.cs +++ b/src/libraries/System.Drawing.Common/tests/BrushTests.cs @@ -20,7 +20,7 @@ public void SetNativeBrush_Brush_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/39232")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30157")] [ConditionalFact(Helpers.IsDrawingSupported)] public void Dispose_NoSuchEntryPoint_SilentyCatchesException() { diff --git a/src/libraries/System.Drawing.Common/tests/BufferedGraphicsContextTests.cs b/src/libraries/System.Drawing.Common/tests/BufferedGraphicsContextTests.cs index 5c79e7342b8e5a..4ecded7db01e88 100644 --- a/src/libraries/System.Drawing.Common/tests/BufferedGraphicsContextTests.cs +++ b/src/libraries/System.Drawing.Common/tests/BufferedGraphicsContextTests.cs @@ -18,7 +18,7 @@ public void Ctor_Default() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Allocate_ValidTargetGraphics_Success() { @@ -61,7 +61,7 @@ public void Allocate_LargeRectWithTargetGraphics_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Allocate_ValidTargetHdc_Success() { @@ -134,7 +134,7 @@ public void Allocate_LargeRectWithTargetHdc_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [Fact] public void Allocate_InvalidHdc_ThrowsArgumentException() { @@ -144,7 +144,7 @@ public void Allocate_InvalidHdc_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Allocate_NullGraphicsZeroSize_Success() { @@ -155,7 +155,7 @@ public void Allocate_NullGraphicsZeroSize_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Allocate_NullGraphicsNonZeroSize_ThrowsArgumentNullException() { @@ -166,7 +166,7 @@ public void Allocate_NullGraphicsNonZeroSize_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Allocate_DisposedGraphics_ThrowsArgumentException() { @@ -182,7 +182,7 @@ public void Allocate_DisposedGraphics_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Allocate_BusyGraphics_ThrowsInvalidOperationException() { @@ -264,7 +264,7 @@ public void Finalize_Invoke_Success() GC.WaitForPendingFinalizers(); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Dispose_BusyAndValidated_ThrowsInvalidOperationException() { @@ -279,7 +279,7 @@ public void Dispose_BusyAndValidated_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Dispose_BusyAndInvalidated_ThrowsInvalidOperationException() { diff --git a/src/libraries/System.Drawing.Common/tests/BufferedGraphicsTests.cs b/src/libraries/System.Drawing.Common/tests/BufferedGraphicsTests.cs index 7f55d2dab0cef8..6339fa93de0676 100644 --- a/src/libraries/System.Drawing.Common/tests/BufferedGraphicsTests.cs +++ b/src/libraries/System.Drawing.Common/tests/BufferedGraphicsTests.cs @@ -42,7 +42,7 @@ public void Dispose_ActualMultipleTimes_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Render_ParameterlessWithTargetGraphics_Success() { @@ -69,7 +69,7 @@ public void Render_ParameterlessWithTargetGraphics_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Render_ParameterlessWithNullTargetGraphics_Success() { @@ -97,7 +97,7 @@ public void Render_ParameterlessWithNullTargetGraphics_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Render_TargetGraphics_Success() { @@ -138,7 +138,7 @@ public void Render_NullGraphics_Nop() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Render_InvalidTargetDC_Nop() { diff --git a/src/libraries/System.Drawing.Common/tests/Drawing2D/AdjustableArrowCapTests.cs b/src/libraries/System.Drawing.Common/tests/Drawing2D/AdjustableArrowCapTests.cs index d3e4f16e67b3ae..0c216766caa87c 100644 --- a/src/libraries/System.Drawing.Common/tests/Drawing2D/AdjustableArrowCapTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Drawing2D/AdjustableArrowCapTests.cs @@ -128,8 +128,7 @@ public void Clone_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void BaseCap_ReturnsTriangle() { using (AdjustableArrowCap arrowCap = new AdjustableArrowCap(1, 1)) diff --git a/src/libraries/System.Drawing.Common/tests/Drawing2D/CustomLineCapTests.cs b/src/libraries/System.Drawing.Common/tests/Drawing2D/CustomLineCapTests.cs index 80dbb9b3cefbd8..ad79d8176c65ea 100644 --- a/src/libraries/System.Drawing.Common/tests/Drawing2D/CustomLineCapTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Drawing2D/CustomLineCapTests.cs @@ -41,8 +41,7 @@ public static IEnumerable Ctor_Path_Path_LineCap_Float_TestData() yield return new object[] { fillPath, null, LineCap.Flat, 0f, LineCap.Flat }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [MemberData(nameof(Ctor_Path_Path_LineCap_Float_TestData))] public void Ctor_Path_Path_LineCap_Float(GraphicsPath fillPath, GraphicsPath strokePath, LineCap baseCap, float baseInset, LineCap expectedCap) { @@ -57,8 +56,7 @@ public void Ctor_Path_Path_LineCap_Float(GraphicsPath fillPath, GraphicsPath str } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] // These values are outside the valid range of the LineCap enum. [InlineData(LineCap.Flat - 1)] [InlineData(LineCap.Custom + 1)] @@ -72,7 +70,7 @@ public void Ctor_InvalidLineCap_ReturnsFlat(LineCap baseCap) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_FillPath_Incomplete_ThrowsArgumentException() { @@ -83,7 +81,7 @@ public void Ctor_FillPath_Incomplete_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_FillPath_DoesNotCrossYAxis_ThrowsNotImplementedException() { @@ -114,8 +112,7 @@ public void SetThenGetStrokeCaps_Success(LineCap startCap, LineCap endCap) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(LineCap.SquareAnchor, LineCap.SquareAnchor)] [InlineData(LineCap.Custom, LineCap.Custom)] [InlineData(LineCap.Square, LineCap.Custom)] @@ -169,7 +166,7 @@ public void BaseCap_SetThenGet_Success(LineCap baseCap) } } - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(LineCap.NoAnchor)] [InlineData(LineCap.SquareAnchor)] [InlineData(LineCap.RoundAnchor)] @@ -177,7 +174,6 @@ public void BaseCap_SetThenGet_Success(LineCap baseCap) [InlineData(LineCap.Custom)] [InlineData(LineCap.Flat - 1)] [InlineData(LineCap.Custom + 1)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884")] public void BaseCap_Set_InvalidLineCap_ThrowsArgumentException(LineCap baseCap) { using (GraphicsPath strokePath = new GraphicsPath()) diff --git a/src/libraries/System.Drawing.Common/tests/Drawing2D/GraphicsPathIteratorTests.cs b/src/libraries/System.Drawing.Common/tests/Drawing2D/GraphicsPathIteratorTests.cs index 6b3516a6a0d9d1..56d6eedec73fb7 100644 --- a/src/libraries/System.Drawing.Common/tests/Drawing2D/GraphicsPathIteratorTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Drawing2D/GraphicsPathIteratorTests.cs @@ -63,7 +63,7 @@ public void Ctor_NullPath_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void NextSubpath_PathFigureNotClosed_ReturnsExpeced() { @@ -87,7 +87,7 @@ public void NextSubpath_PathFigureClosed_ReturnsExpeced() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void NextSubpath_NullPath_ReturnsExpected() { @@ -98,9 +98,9 @@ public void NextSubpath_NullPath_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] - public void NextSubpath_FigureNotClosed_ReturnsExpeced() + public void NextSubpath_FigureNotClosed_ReturnsExpected() { using (GraphicsPath gp = new GraphicsPath()) using (GraphicsPathIterator gpi = new GraphicsPathIterator(gp)) @@ -239,7 +239,7 @@ public void HasCurve_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Rewind_Success() { diff --git a/src/libraries/System.Drawing.Common/tests/Drawing2D/GraphicsPathTests.cs b/src/libraries/System.Drawing.Common/tests/Drawing2D/GraphicsPathTests.cs index e79f13aad5bedc..50f0e071da5b1f 100644 --- a/src/libraries/System.Drawing.Common/tests/Drawing2D/GraphicsPathTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Drawing2D/GraphicsPathTests.cs @@ -142,8 +142,7 @@ public void GraphicsPath_FillModeChange() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(FillMode.Alternate - 1)] [InlineData(FillMode.Winding + 1)] public void GraphicsPath_InvalidFillMode_ThrowsInvalidEnumArgumentException(FillMode fillMode) @@ -375,7 +374,7 @@ public void AddLines_ZeroPoints_ThrowsArgumentException() AssertExtensions.Throws(null, () => new GraphicsPath().AddLines(new PointF[0])); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddArc_Values_Success() { @@ -398,7 +397,7 @@ public void AddArc_Values_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddArc_Rectangle_Success() { @@ -419,8 +418,7 @@ public void AddArc_Rectangle_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(0, 0)] [InlineData(1, 0)] [InlineData(0, 1)] @@ -529,7 +527,7 @@ public void AddBeziers_InvalidFloatPointsLength_ThrowsArgumentException(PointF[] } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddCurve_TwoPoints_Success() { @@ -548,7 +546,7 @@ public void AddCurve_TwoPoints_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddCurve_TwoPointsWithTension_Success() { @@ -725,7 +723,7 @@ public void AddCurve_OffsetTooLarge_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddClosedCurve_Points_Success() { @@ -765,7 +763,7 @@ public void AddClosedCurve_SamePoints_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddClosedCurve_Tension_Success() { @@ -1000,7 +998,7 @@ public void AddEllipse_ZeroWidthHeight_Success(int width, int height) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddPie_Rectangle_Success() { @@ -1013,7 +1011,7 @@ public void AddPie_Rectangle_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddPie_Values_Success() { @@ -1028,8 +1026,7 @@ public void AddPie_Values_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(0, 0)] [InlineData(2, 0)] [InlineData(0, 2)] @@ -1043,7 +1040,7 @@ public void AddPie_ZeroWidthHeight_ThrowsArgumentException(int width, int height } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddPolygon_Points_Success() { @@ -1059,7 +1056,7 @@ public void AddPolygon_Points_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddPolygon_SamePoints_Success() { @@ -1165,8 +1162,7 @@ public void AddPath_PathNull_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void AddString_Point_Success() { using (GraphicsPath gpi = new GraphicsPath()) @@ -1180,8 +1176,7 @@ public void AddString_Point_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void AddString_Rectangle_Success() { using (GraphicsPath gpi = new GraphicsPath()) @@ -1195,8 +1190,7 @@ public void AddString_Rectangle_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void AddString_NegativeSize_Success() { using (GraphicsPath gpi = new GraphicsPath()) @@ -1218,7 +1212,7 @@ public void AddString_NegativeSize_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddString_StringFormat_Success() { @@ -1237,8 +1231,7 @@ public void AddString_StringFormat_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void AddString_EmptyString_Success() { using (GraphicsPath gpi = new GraphicsPath()) @@ -1252,8 +1245,7 @@ public void AddString_EmptyString_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void AddString_StringNull_ThrowsNullReferenceException() { using (GraphicsPath gp = new GraphicsPath()) @@ -1550,7 +1542,7 @@ public void Warp_WarpModeInvalid_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Warp_RectangleEmpty_Success() { @@ -1918,7 +1910,7 @@ public void StartClose_AddRectangles() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void StartClose_AddString() { @@ -1937,7 +1929,7 @@ public void StartClose_AddString() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Widen_Pen_Success() { @@ -1986,7 +1978,7 @@ public void Widen_PenNull_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Widen_MatrixNull_Success() { @@ -2000,7 +1992,7 @@ public void Widen_MatrixNull_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Widen_MatrixEmpty_Success() { @@ -2024,7 +2016,7 @@ public static IEnumerable Widen_PenSmallWidth_TestData() yield return new object[] { new Rectangle(1, 1, 2, 2), 1.1f, new RectangleF(0.45f, 0.45f, 3.10f, 3.10f) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Widen_PenSmallWidth_TestData))] public void Widen_Pen_SmallWidth_Succes( @@ -2120,14 +2112,14 @@ public void IsOutlineVisible_RectangleWithoutGraphics_ReturnsExpected() AssertIsOutlineVisibleRectangle(null); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void IsVisible_RectangleWithoutGraphics_ReturnsExpected() { AssertIsVisibleRectangle(null); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void IsVisible_RectangleWithGraphics_ReturnsExpected() { @@ -2293,7 +2285,7 @@ public void Reverse_Rectangles_Succes() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Reverse_Pie_Succes() { @@ -2331,7 +2323,7 @@ public void Reverse_EllipseRectangle_Succes() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Reverse_String_Succes() { diff --git a/src/libraries/System.Drawing.Common/tests/Drawing2D/LinearGradientBrushTests.cs b/src/libraries/System.Drawing.Common/tests/Drawing2D/LinearGradientBrushTests.cs index 51f2de317aa9c3..bcc33b61b72d5e 100644 --- a/src/libraries/System.Drawing.Common/tests/Drawing2D/LinearGradientBrushTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Drawing2D/LinearGradientBrushTests.cs @@ -24,8 +24,7 @@ public static IEnumerable Ctor_Point_TestData() yield return new object[] { new Point(4, 6), new Point(1, 2), Color.Black, Color.Wheat, new RectangleF(1, 2, 3, 4) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/32706", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [MemberData(nameof(Ctor_Point_TestData))] public void Ctor_PointF_PointF_Color_Color(Point point1, Point point2, Color color1, Color color2, RectangleF expectedRectangle) { @@ -44,7 +43,7 @@ public void Ctor_PointF_PointF_Color_Color(Point point1, Point point2, Color col } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_PointF_PointF_Color_Color_FloatRanges() { @@ -57,8 +56,7 @@ public void Ctor_PointF_PointF_Color_Color_FloatRanges() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/32706", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [MemberData(nameof(Ctor_Point_TestData))] public void Ctor_Point_Point_Color_Color(Point point1, Point point2, Color color1, Color color2, RectangleF expectedRectangle) { @@ -77,8 +75,7 @@ public void Ctor_Point_Point_Color_Color(Point point1, Point point2, Color color } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(0, 0)] [InlineData(1, 1)] public void Ctor_EqualPoints_ThrowsOutOfMemoryException(int x, int y) @@ -282,8 +279,7 @@ public void Clone_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => brush.Clone()); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void Blend_GetWithInterpolationColorsSet_ReturnsNull() { using (var brush = new LinearGradientBrush(new Rectangle(1, 2, 3, 4), Color.Plum, Color.Red, 45, true)) @@ -299,8 +295,7 @@ public void Blend_GetWithInterpolationColorsSet_ReturnsNull() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(new float[] { 1 }, new float[] { 1 })] [InlineData(new float[] { 0 }, new float[] { 0 })] [InlineData(new float[] { float.MaxValue }, new float[] { float.MaxValue })] @@ -567,8 +562,7 @@ public void InterpolationColors_SetBlendTriangularShape_ThrowsArgumentException( } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void InterpolationColors_SetBlend_ThrowsArgumentException() { using (var brush = new LinearGradientBrush(new Rectangle(1, 2, 3, 4), Color.Plum, Color.Red, 45, true) @@ -631,8 +625,7 @@ public void LinearColors_GetSetDisposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => brush.LinearColors = new Color[] { Color.Red, Color.Wheat }); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void Rectangle_GetDisposed_ThrowsArgumentException() { var brush = new LinearGradientBrush(new Rectangle(1, 2, 3, 4), Color.Plum, Color.Red, 45, true); @@ -748,8 +741,7 @@ public void MultiplyTransform_NoOrder_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(MatrixOrder.Prepend)] [InlineData(MatrixOrder.Append)] [InlineData(MatrixOrder.Prepend - 1)] diff --git a/src/libraries/System.Drawing.Common/tests/Drawing2D/MatrixTests.cs b/src/libraries/System.Drawing.Common/tests/Drawing2D/MatrixTests.cs index 2337e2fab98076..70da317a78e160 100644 --- a/src/libraries/System.Drawing.Common/tests/Drawing2D/MatrixTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Drawing2D/MatrixTests.cs @@ -52,8 +52,7 @@ public void Ctor_Default() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(float.NaN)] [InlineData(float.NegativeInfinity)] [InlineData(float.PositiveInfinity)] @@ -254,8 +253,7 @@ public void Invert_Matrix_Success(Matrix matrix, float[] expectedElements) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(float.NaN)] [InlineData(float.PositiveInfinity)] [InlineData(float.NegativeInfinity)] @@ -322,8 +320,7 @@ public static IEnumerable Multiply_TestData() yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), new Matrix(float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue), MatrixOrder.Append, new float[] { float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue } }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [MemberData(nameof(Multiply_TestData))] public void Multiply_Matrix_Success(Matrix matrix, Matrix multiple, MatrixOrder order, float[] expected) { @@ -465,7 +462,7 @@ public static IEnumerable Rotate_TestData() yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), float.NegativeInfinity, PointF.Empty, MatrixOrder.Append, new float[] { float.NaN, float.NaN, float.NaN, float.NaN, float.NaN, float.NaN }, null, false }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Rotate_TestData))] public void Rotate_Matrix_Success(Matrix matrix, float angle, PointF point, MatrixOrder order, float[] expectedElements, float[] expectedElementsRotateAt, bool isIdentity) @@ -578,8 +575,7 @@ public static IEnumerable Scale_TestData() yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), float.MaxValue, float.MaxValue, MatrixOrder.Append, new float[] { float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue } }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [MemberData(nameof(Scale_TestData))] public void Scale_Matrix_Succss(Matrix matrix, float scaleX, float scaleY, MatrixOrder order, float[] expectedElements) { @@ -655,8 +651,7 @@ public static IEnumerable Shear_TestData() yield return new object[] { new Matrix(10, 20, 30, 40, 50, 60), float.MaxValue, float.MaxValue, MatrixOrder.Append, new float[] { float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue, float.MaxValue } }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [MemberData(nameof(Shear_TestData))] public void Shear_Matrix_Succss(Matrix matrix, float shearX, float shearY, MatrixOrder order, float[] expectedElements) { @@ -724,8 +719,7 @@ public static IEnumerable Translate_TestData() yield return new object[] { new Matrix(1, 2, 3, 4, 5, 6), float.MaxValue, float.MaxValue, MatrixOrder.Append, new float[] { 1, 2, 3, 4, float.MaxValue, float.MaxValue } }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [MemberData(nameof(Translate_TestData))] public void Translate_Matrix_Success(Matrix matrix, float offsetX, float offsetY, MatrixOrder order, float[] expectedElements) { diff --git a/src/libraries/System.Drawing.Common/tests/Drawing2D/PathGradientBrushTests.cs b/src/libraries/System.Drawing.Common/tests/Drawing2D/PathGradientBrushTests.cs index 79250c685d15ee..3046c016418469 100644 --- a/src/libraries/System.Drawing.Common/tests/Drawing2D/PathGradientBrushTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Drawing2D/PathGradientBrushTests.cs @@ -36,8 +36,7 @@ public class PathGradientBrushTests private readonly PointF[] _defaultFloatPoints = new PointF[2] { new PointF(1, 2), new PointF(20, 30) }; private readonly RectangleF _defaultRectangle = new RectangleF(1, 2, 19, 28); - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void Ctor_Points_ReturnsExpected() { using (PathGradientBrush bi = new PathGradientBrush(_defaultIntPoints)) @@ -59,8 +58,7 @@ public static IEnumerable WrapMode_TestData() yield return new object[] { WrapMode.TileFlipY }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [MemberData(nameof(WrapMode_TestData))] public void Ctor_PointsWrapMode_ReturnsExpected(WrapMode wrapMode) { @@ -102,8 +100,7 @@ public void Ctor_InvalidWrapMode_ThrowsInvalidEnumArgumentException() new PathGradientBrush(_defaultFloatPoints, (WrapMode)int.MaxValue)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void Ctor_Path_ReturnsExpected() { using (GraphicsPath path = new GraphicsPath(_defaultFloatPoints, new byte[] { 0, 1 })) @@ -131,8 +128,7 @@ public void Ctor_PathWithLessThenTwoPoints_ThrowsOutOfMemoryException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void Clone_ReturnsExpected() { using (GraphicsPath path = new GraphicsPath(_defaultFloatPoints, new byte[] { 0, 1 })) @@ -175,8 +171,7 @@ public void CenterColor_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => brush.CenterColor = Color.Blue); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void SurroundColors_ReturnsExpected() { Color[] expectedColors = new Color[2] { Color.FromArgb(255, 0, 0, 255), Color.FromArgb(255, 255, 0, 0) }; @@ -280,8 +275,7 @@ public static IEnumerable Blend_FactorsPositions_TestData() yield return new object[] { new float[1] { 1 }, new float[3] { 0, 3, 1 } }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [MemberData(nameof(Blend_FactorsPositions_TestData))] public void Blend_ReturnsExpected(float[] factors, float[] positions) { @@ -603,8 +597,7 @@ public void InterpolationColors_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void InterpolationColors_CannotChange() { Color[] colors = new Color[2] { Color.FromArgb(255, 0, 0, 255), Color.FromArgb(255, 255, 0, 0) }; diff --git a/src/libraries/System.Drawing.Common/tests/FontFamilyTests.cs b/src/libraries/System.Drawing.Common/tests/FontFamilyTests.cs index 175e6ac4969690..d4748e45c6cdd7 100644 --- a/src/libraries/System.Drawing.Common/tests/FontFamilyTests.cs +++ b/src/libraries/System.Drawing.Common/tests/FontFamilyTests.cs @@ -9,7 +9,7 @@ namespace System.Drawing.Tests { public class FontFamilyTests { - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(GenericFontFamilies.Serif - 1, "Courier New")] // Value is outside the enum range. [InlineData(GenericFontFamilies.Monospace + 1, "Courier New")] // Value is outside the enum range. @@ -24,7 +24,7 @@ public void Ctor_GenericFamily(GenericFontFamilies genericFamily, string expecte } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData("Courier New", "Courier New")] [InlineData("Microsoft Sans Serif", "Microsoft Sans Serif")] @@ -38,7 +38,7 @@ public void Ctor_Name(string name, string expectedName) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_Name_FontCollection() { @@ -53,7 +53,7 @@ public void Ctor_Name_FontCollection() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(null)] [InlineData("NoSuchFont")] @@ -84,7 +84,7 @@ public static IEnumerable Equals_TestData() yield return new object[] { FontFamily.GenericSansSerif, null, false }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Equals_TestData))] public void Equals_Object_ReturnsExpected(FontFamily fontFamily, object other, bool expected) @@ -130,7 +130,7 @@ public void Families_Get_ReturnsExpected() #pragma warning restore 0618 } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GenericMonospace_Get_ReturnsExpected() { @@ -144,7 +144,7 @@ public void GenericMonospace_Get_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GenericSansSerif_Get_ReturnsExpected() { @@ -158,7 +158,7 @@ public void GenericSansSerif_Get_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GenericSerif_Get_ReturnsExpected() { @@ -180,7 +180,7 @@ public void GetFamilies_NullGraphics_ThrowsArgumentNullException() #pragma warning restore 0618 } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHashCode_Invoke_ReturnsNameHashCode() { @@ -201,7 +201,7 @@ public static IEnumerable FontStyle_TestData() yield return new object[] { FontStyle.Strikeout + 1 }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FontStyle_TestData))] public void FontFamilyProperties_CustomFont_ReturnsExpected(FontStyle style) @@ -221,7 +221,7 @@ public void FontFamilyProperties_CustomFont_ReturnsExpected(FontStyle style) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void IsStyleAvailable_Disposed_ThrowsArgumentException() { @@ -231,7 +231,7 @@ public void IsStyleAvailable_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => fontFamily.IsStyleAvailable(FontStyle.Italic)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetEmHeight_Disposed_ThrowsArgumentException() { @@ -243,7 +243,7 @@ public void GetEmHeight_Disposed_ThrowsArgumentException() private const int FrenchLCID = 1036; - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(-1, "Code New Roman")] [InlineData(0, "Code New Roman")] @@ -263,7 +263,7 @@ public void GetName_LanguageCode_ReturnsExpected(int languageCode, string expect } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetName_Disposed_ThrowsArgumentException() { @@ -273,7 +273,7 @@ public void GetName_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => fontFamily.GetName(0)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetCellAscent_Disposed_ThrowsArgumentException() { @@ -283,7 +283,7 @@ public void GetCellAscent_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => fontFamily.GetCellAscent(FontStyle.Italic)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetCellDescent_Disposed_ThrowsArgumentException() { @@ -293,7 +293,7 @@ public void GetCellDescent_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => fontFamily.GetCellDescent(FontStyle.Italic)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetLineSpacing_Disposed_ThrowsArgumentException() { @@ -303,7 +303,7 @@ public void GetLineSpacing_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => fontFamily.GetLineSpacing(FontStyle.Italic)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Dispose_MultipleTimes_Nop() { diff --git a/src/libraries/System.Drawing.Common/tests/FontTests.cs b/src/libraries/System.Drawing.Common/tests/FontTests.cs index f981b1f5934f79..183358d218eaf4 100644 --- a/src/libraries/System.Drawing.Common/tests/FontTests.cs +++ b/src/libraries/System.Drawing.Common/tests/FontTests.cs @@ -323,7 +323,7 @@ public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamil } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_FamilyNamePrefixedWithAtSign_StripsSign() { @@ -341,8 +341,7 @@ public void Ctor_NullFont_ThrowsNullReferenceException() Assert.Throws(() => new Font(null, FontStyle.Regular)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void Ctor_DisposedFont_Success() { using (FontFamily family = FontFamily.GenericSerif) @@ -383,7 +382,7 @@ public void Ctor_DisposedFamily_ThrowsArgumentException() AssertExtensions.Throws(null, () => new Font(family, 10, FontStyle.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(-1)] [InlineData(0)] @@ -409,8 +408,7 @@ public void Ctor_InvalidEmSize_ThrowsArgumentException(float emSize) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(GraphicsUnit.Display)] [InlineData(GraphicsUnit.World - 1)] [InlineData(GraphicsUnit.Millimeter + 1)] @@ -429,8 +427,7 @@ public void Ctor_InvalidUnit_ThrowsArgumentException(GraphicsUnit unit) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void Clone_Invoke_ReturnsExpected() { using (FontFamily family = FontFamily.GenericSansSerif) @@ -448,7 +445,7 @@ public void Clone_Invoke_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Clone_DisposedFont_ThrowsArgumentException() { @@ -467,7 +464,7 @@ public static IEnumerable Equals_TestData() var font = new Font(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); yield return new object[] { font, font, true }; - // [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + // [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] if (PlatformDetection.IsWindows) { yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true), false }; @@ -506,14 +503,14 @@ public void Equals_Other_ReturnsExpected(Font font, object other, bool expected) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHdc_ZeroHdc_ThrowsArgumentException() { AssertExtensions.Throws(null, () => Font.FromHdc(IntPtr.Zero)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHdc_GraphicsHdc_ThrowsArgumentException() { @@ -532,15 +529,14 @@ public void FromHdc_GraphicsHdc_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHfont_Zero_ThrowsArgumentException() { AssertExtensions.Throws(null, () => Font.FromHfont(IntPtr.Zero)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void GetHeight_Parameterless_ReturnsExpected() { using (FontFamily family = FontFamily.GenericSansSerif) @@ -553,8 +549,7 @@ public void GetHeight_Parameterless_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void GetHeight_Graphics_ReturnsExpected() { using (FontFamily family = FontFamily.GenericSansSerif) @@ -566,7 +561,7 @@ public void GetHeight_Graphics_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(0, 0)] [InlineData(-1, -0.1571995)] @@ -624,7 +619,7 @@ public void GetHeight_Disposed_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(FontStyle.Bold, int.MinValue, 0)] [InlineData(FontStyle.Bold, -2147483099, 0)] @@ -662,7 +657,7 @@ public void FromLogFont_ValidLogFont_ReturnsExpected(FontStyle fontStyle, int we } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromLogFont_NullLogFont_ThrowsArgumentNullException() { @@ -690,7 +685,7 @@ public void FromLogFont_NullLogFont_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromLogFont_InvalidLogFont_ThrowsArgumentException() { @@ -711,7 +706,7 @@ public void FromLogFont_InvalidLogFont_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromLogFont_UnblittableStruct() { @@ -785,8 +780,7 @@ public void SizeInPoints_Get_ReturnsExpected(GraphicsUnit unit) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [InlineData(FontStyle.Strikeout | FontStyle.Bold | FontStyle.Italic, 255, true, "@", 700)] [InlineData(FontStyle.Regular, 0, false, "", 400)] [InlineData(FontStyle.Regular, 10, false, "", 400)] @@ -815,7 +809,7 @@ public void ToLogFont_Invoke_ReturnsExpected(FontStyle fontStyle, byte gdiCharSe } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(TextRenderingHint.SystemDefault)] [InlineData(TextRenderingHint.AntiAlias)] @@ -852,8 +846,7 @@ public void ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRende } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "AV Exception is wrapped in a TargetInvocationException in the .NET Framework.")] public void ToLogFont_NullLogFont_ThrowsArgumentNullException() { @@ -867,8 +860,7 @@ public void ToLogFont_NullLogFont_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void ToLogFont_NullGraphics_ThrowsArgumentNullException() { using (FontFamily family = FontFamily.GenericMonospace) @@ -912,7 +904,7 @@ public class LOGFONT public string lfFaceName; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ToHfont_SimpleFont_Roundtrips() { @@ -928,7 +920,7 @@ public void ToHfont_SimpleFont_Roundtrips() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ToHfont_ComplicatedFont_DoesNotRoundtrip() { @@ -944,8 +936,7 @@ public void ToHfont_ComplicatedFont_DoesNotRoundtrip() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void ToHfont_Disposed_ThrowsArgumentException() { using (FontFamily family = FontFamily.GenericSansSerif) @@ -959,8 +950,7 @@ public void ToHfont_Disposed_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void ToString_Invoke_ReturnsExpected() { using (FontFamily family = FontFamily.GenericSansSerif) diff --git a/src/libraries/System.Drawing.Common/tests/GdiplusTests.cs b/src/libraries/System.Drawing.Common/tests/GdiplusTests.cs new file mode 100644 index 00000000000000..69a9a84afb2b16 --- /dev/null +++ b/src/libraries/System.Drawing.Common/tests/GdiplusTests.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing.Text; +using Xunit; + +namespace System.Drawing.Tests +{ + public class GdiplusTests + { + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsOSX))] + public void IsAtLeastLibgdiplus6() + { + Assert.True(Helpers.GetIsWindowsOrAtLeastLibgdiplus6()); + } + } +} diff --git a/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs b/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs index b415a0dc0d74cc..9305efae97a883 100644 --- a/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs +++ b/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs @@ -12,7 +12,7 @@ namespace System.Drawing.Tests { public class GraphicsTests { - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHdc_FromHdc_Roundtrips() { @@ -36,7 +36,7 @@ public void GetHdc_FromHdc_Roundtrips() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHdc_SameImage_ReturnsSame() { @@ -56,7 +56,7 @@ public void GetHdc_SameImage_ReturnsSame() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHdc_NotReleased_ThrowsInvalidOperationException() { @@ -75,7 +75,7 @@ public void GetHdc_NotReleased_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHdc_Disposed_ThrowsObjectDisposedException() { @@ -97,7 +97,7 @@ public static IEnumerable FromHdc_TestData() yield return new object[] { Helpers.GetDC(foregroundWindow) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FromHdc_TestData))] public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc) @@ -109,7 +109,7 @@ public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FromHdc_TestData))] public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc) @@ -121,7 +121,7 @@ public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FromHdc_TestData))] public void FromHdcInternal_GetDC_ReturnsExpected(IntPtr hdc) @@ -133,28 +133,28 @@ public void FromHdcInternal_GetDC_ReturnsExpected(IntPtr hdc) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHdc_ZeroHdc_ThrowsArgumentNullException() { AssertExtensions.Throws("hdc", () => Graphics.FromHdc(IntPtr.Zero)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHdcInternal_ZeroHdc_ThrowsOutOfMemoryException() { Assert.Throws(() => Graphics.FromHdcInternal(IntPtr.Zero)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHdc_ZeroHdc_ThrowsOutOfMemoryException() { Assert.Throws(() => Graphics.FromHdc(IntPtr.Zero, (IntPtr)10)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHdc_InvalidHdc_ThrowsOutOfMemoryException() { @@ -162,7 +162,7 @@ public void FromHdc_InvalidHdc_ThrowsOutOfMemoryException() Assert.Throws(() => Graphics.FromHwndInternal((IntPtr)10)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ReleaseHdc_ValidHdc_ResetsHdc() { @@ -186,7 +186,7 @@ public void ReleaseHdc_ValidHdc_ResetsHdc() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ReleaseHdc_NoSuchHdc_ResetsHdc() { @@ -203,7 +203,7 @@ public void ReleaseHdc_NoSuchHdc_ResetsHdc() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ReleaseHdc_OtherGraphicsHdc_Success() { @@ -236,7 +236,7 @@ public void ReleaseHdc_NoHdc_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ReleaseHdc_Disposed_ThrowsObjectDisposedException() { @@ -257,7 +257,7 @@ public static IEnumerable Hwnd_TestData() yield return new object[] { Helpers.GetForegroundWindow() }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Hwnd_TestData))] public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd) @@ -269,7 +269,7 @@ public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Hwnd_TestData))] public void FromHwndInternal_ValidHwnd_ReturnsExpected(IntPtr hWnd) @@ -281,7 +281,7 @@ public void FromHwndInternal_ValidHwnd_ReturnsExpected(IntPtr hWnd) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromHwnd_InvalidHwnd_ThrowsOutOfMemoryException() { @@ -289,7 +289,7 @@ public void FromHwnd_InvalidHwnd_ThrowsOutOfMemoryException() Assert.Throws(() => Graphics.FromHdcInternal((IntPtr)10)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(PixelFormat.Format16bppRgb555)] [InlineData(PixelFormat.Format16bppRgb565)] @@ -309,7 +309,7 @@ public void FromImage_Bitmap_Success(PixelFormat format) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void FromImage_NullImage_ThrowsArgumentNullException() { @@ -348,7 +348,7 @@ public void FromImage_Metafile_ThrowsOutOfMemoryException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(PixelFormat.Format16bppArgb1555)] [InlineData(PixelFormat.Format16bppGrayScale)] @@ -366,7 +366,7 @@ public static IEnumerable CompositingMode_TestData() yield return new object[] { CompositingMode.SourceOver, Color.FromArgb(220, 185, 185, 185) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(CompositingMode_TestData))] public void CompositingMode_Set_GetReturnsExpected(CompositingMode mode, Color expectedOverlap) @@ -409,7 +409,7 @@ public void CompositingMode_SetInvalid_ThrowsInvalidEnumArgumentException(Compos } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void CompositingMode_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -468,7 +468,7 @@ public static IEnumerable CompositingQuality_TestData() yield return new object[] { CompositingQuality.HighQuality, gammaCorrectedColors }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(CompositingQuality_TestData))] public void CompositingQuality_Set_GetReturnsExpected(CompositingQuality quality, Color[][] expectedIntersectionColor) @@ -503,7 +503,7 @@ public void CompositingQuality_SetInvalid_ThrowsInvalidEnumArgumentException(Com } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void CompositingQuality_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -566,7 +566,7 @@ public void Dispose_MultipleTimesWithHdc_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DpiX_GetWhenBusy_ThrowsInvalidOperationException() { @@ -597,7 +597,7 @@ public void DpiX_GetWhenDisposed_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DpiY_GetWhenBusy_ThrowsInvalidOperationException() { @@ -649,7 +649,7 @@ public void Flush_MultipleTimes_Success(FlushIntention intention) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Flush_Busy_ThrowsInvalidOperationException() { @@ -723,7 +723,7 @@ public void InterpolationMode_SetToInvalid_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void InterpolationMode_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -785,7 +785,7 @@ public void PageScale_SetInvalid_ThrowsArgumentException(float pageScale) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void PageScale_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -857,7 +857,7 @@ public void PageUnit_SetWorld_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void PageUnit_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -928,7 +928,7 @@ public void PixelOffsetMode_SetToInvalid_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void PixelOffsetMode_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -999,7 +999,7 @@ public static IEnumerable RenderingOrigin_TestData() yield return new object[] { new Point(3, 3), allEmpty }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(RenderingOrigin_TestData))] public void RenderingOrigin_SetToCustom_RendersExpected(Point renderingOrigin, Color[][] expectedRendering) @@ -1019,7 +1019,7 @@ public void RenderingOrigin_SetToCustom_RendersExpected(Point renderingOrigin, C } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void RenderingOrigin_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -1090,7 +1090,7 @@ public void SmoothingMode_SetToInvalid_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SmoothingMode_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -1149,7 +1149,7 @@ public void TextContrast_SetInvalid_ThrowsArgumentException(int textContrast) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void TextContrast_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -1211,7 +1211,7 @@ public void TextRenderingHint_SetInvalid_ThrowsInvalidEnumArgumentException(Text } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void TextRenderingHint_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -1244,7 +1244,7 @@ public void TextRenderingHint_GetSetWhenDisposed_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Transform_SetValid_GetReturnsExpected() { @@ -1307,7 +1307,7 @@ public void Transform_SetNonInvertibleMatrix_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Transform_GetSetWhenBusy_ThrowsInvalidOperationException() { @@ -1357,7 +1357,7 @@ public void ResetTransform_Invoke_SetsTransformToIdentity() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ResetTransform_Busy_ThrowsInvalidOperationException() { @@ -1475,7 +1475,7 @@ public void MultiplyTransform_InvalidOrder_ThrowsArgumentException(MatrixOrder o } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void MultiplyTransform_Busy_ThrowsInvalidOperationException() { @@ -1563,7 +1563,7 @@ public void TranslateTransform_InvalidOrder_ThrowsArgumentException(MatrixOrder } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void TranslateTransform_Busy_ThrowsInvalidOperationException() { @@ -1657,7 +1657,7 @@ public void ScaleTransform_InvalidOrder_ThrowsArgumentException(MatrixOrder orde } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ScaleTransform_Busy_ThrowsInvalidOperationException() { @@ -1744,7 +1744,7 @@ public void RotateTransform_InvalidOrder_ThrowsArgumentException(MatrixOrder ord } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void RotateTransform_Busy_ThrowsInvalidOperationException() { @@ -1788,8 +1788,8 @@ public static IEnumerable CopyFromScreen_TestData() yield return new object[] { 0, 0, 0, 0, new Size(-1, -1) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23650")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23375")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(CopyFromScreen_TestData))] public void CopyFromScreen_OutOfRange_DoesNotAffectGraphics(int sourceX, int sourceY, int destinationX, int destinationY, Size size) @@ -1806,8 +1806,8 @@ public void CopyFromScreen_OutOfRange_DoesNotAffectGraphics(int sourceX, int sou } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23650")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23375")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(0, 0, 0, 0, 10, 10)] [InlineData(0, 0, 0, 0, int.MaxValue, int.MaxValue)] @@ -1866,8 +1866,8 @@ public static IEnumerable CopyPixelOperation_TestData() yield return new object[] { CopyPixelOperation.CaptureBlt }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23650")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23375")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(CopyPixelOperation_TestData))] public void CopyFromScreen_IntsAndValidCopyPixelOperation_Success(CopyPixelOperation copyPixelOperation) @@ -1881,8 +1881,8 @@ public void CopyFromScreen_IntsAndValidCopyPixelOperation_Success(CopyPixelOpera } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23650")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23375")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(CopyPixelOperation_TestData))] public void CopyFromScreen_PointsAndValidCopyPixelOperation_Success(CopyPixelOperation copyPixelOperation) @@ -1896,8 +1896,8 @@ public void CopyFromScreen_PointsAndValidCopyPixelOperation_Success(CopyPixelOpe } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23650")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23375")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(CopyPixelOperation.NoMirrorBitmap + 1)] [InlineData(CopyPixelOperation.Blackness - 1)] @@ -1926,8 +1926,8 @@ public void CopyFromScreen_InvalidCopyPixelOperation_ThrowsInvalidEnumArgumentEx } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23650")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23375")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void CopyFromScreen_Busy_ThrowsInvalidOperationException() { @@ -1949,8 +1949,8 @@ public void CopyFromScreen_Busy_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/23650")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23375")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void CopyFromScreen_Disposed_ThrowsArgumentException() { @@ -2017,7 +2017,7 @@ public static IEnumerable TransformPoints_TestData() }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(TransformPoints_TestData))] public void TransformPoints_Points_Success(CoordinateSpace destSpace, CoordinateSpace srcSpace, Point[] points, Point[] expected) @@ -2085,7 +2085,7 @@ public static IEnumerable TransformPointFs_TestData() }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(TransformPointFs_TestData))] public void TransformPoints_PointFs_Success(CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF[] points, PointF[] expected) @@ -2102,7 +2102,7 @@ public void TransformPoints_PointFs_Success(CoordinateSpace destSpace, Coordinat } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(CoordinateSpace.Device)] [InlineData(CoordinateSpace.World)] @@ -2121,7 +2121,7 @@ public void TransformPoints_PointsAndSameCoordinateSpace_DoesNothing(CoordinateS } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(CoordinateSpace.Device)] [InlineData(CoordinateSpace.World)] @@ -2140,7 +2140,7 @@ public void TransformPoints_PointFsAndSameCoordinateSpace_DoesNothing(Coordinate } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(CoordinateSpace.World - 1)] [InlineData(CoordinateSpace.Device + 1)] @@ -2154,7 +2154,7 @@ public void TransformPoints_InvalidDestSpace_ThrowsArgumentException(CoordinateS } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(CoordinateSpace.World - 1)] [InlineData(CoordinateSpace.Device + 1)] @@ -2179,7 +2179,7 @@ public void TransformPoints_NullPoints_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void TransformPoints_EmptyPoints_ThrowsArgumentException() { @@ -2191,7 +2191,7 @@ public void TransformPoints_EmptyPoints_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void TransformPoints_Busy_ThrowsInvalidOperationException() { @@ -2211,7 +2211,7 @@ public void TransformPoints_Busy_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void TransformPoints_Disposed_ThrowsArgumentException() { @@ -2231,7 +2231,7 @@ public static IEnumerable GetNearestColor_TestData() yield return new object[] { PixelFormat.Format16bppRgb555, Color.Red, Color.FromArgb(255, 248, 0, 0) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(GetNearestColor_TestData))] public void GetNearestColor_Color_ReturnsExpected(PixelFormat pixelFormat, Color color, Color expected) @@ -2243,7 +2243,7 @@ public void GetNearestColor_Color_ReturnsExpected(PixelFormat pixelFormat, Color } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetNearestColor_Busy_ThrowsInvalidOperationException() { @@ -2262,7 +2262,7 @@ public void GetNearestColor_Busy_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetNearestColor_Disposed_ThrowsArgumentException() { @@ -2275,7 +2275,7 @@ public void GetNearestColor_Disposed_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawArc_NullPen_ThrowsArgumentNullException() { @@ -2289,7 +2289,7 @@ public void DrawArc_NullPen_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawArc_DisposedPen_ThrowsArgumentException() { @@ -2306,7 +2306,7 @@ public void DrawArc_DisposedPen_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawArc_ZeroWidth_ThrowsArgumentException() { @@ -2321,7 +2321,7 @@ public void DrawArc_ZeroWidth_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawArc_ZeroHeight_ThrowsArgumentException() { @@ -2336,7 +2336,7 @@ public void DrawArc_ZeroHeight_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawArc_Busy_ThrowsInvalidOperationException() { @@ -2359,7 +2359,7 @@ public void DrawArc_Busy_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawArc_Disposed_ThrowsArgumentException() { @@ -2404,7 +2404,7 @@ public void DrawRectangle_DisposedPen_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawRectangle_Busy_ThrowsInvalidOperationException() { @@ -2490,7 +2490,7 @@ public void DrawRectangles_EmptyRectangles_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawRectangles_Busy_ThrowsInvalidOperationException() { @@ -2555,7 +2555,7 @@ public void DrawEllipse_DisposedPen_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawEllipse_Busy_ThrowsInvalidOperationException() { @@ -2623,7 +2623,7 @@ public void DrawPie_DisposedPen_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawPie_ZeroWidth_ThrowsArgumentException() { @@ -2638,7 +2638,7 @@ public void DrawPie_ZeroWidth_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawPie_ZeroHeight_ThrowsArgumentException() { @@ -2653,7 +2653,7 @@ public void DrawPie_ZeroHeight_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawPie_Busy_ThrowsInvalidOperationException() { @@ -2743,7 +2743,7 @@ public void DrawPolygon_InvalidPointsLength_ThrowsArgumentException(int length) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawPolygon_Busy_ThrowsInvalidOperationException() { @@ -2828,7 +2828,7 @@ public void DrawPath_DisposedPath_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawPath_Busy_ThrowsInvalidOperationException() { @@ -2934,7 +2934,7 @@ public void DrawCurve_InvalidPointsLength_ThrowsArgumentException(int length) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(4, -1, 4)] [InlineData(4, 0, -1)] @@ -2953,7 +2953,7 @@ public void DrawCurve_InvalidOffsetCount_ThrowsArgumentException(int length, int } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawCurve_Busy_ThrowsInvalidOperationException() { @@ -3058,7 +3058,7 @@ public void DrawClosedCurve_InvalidPointsLength_ThrowsArgumentException(int leng } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawClosedCurve_Busy_ThrowsInvalidOperationException() { @@ -3117,7 +3117,7 @@ public void Clear_Color_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Clear_Busy_ThrowsInvalidOperationException() { @@ -3150,7 +3150,7 @@ public void Clear_Disposed_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawString_DefaultFont_Succeeds() { @@ -3162,7 +3162,7 @@ public void DrawString_DefaultFont_Succeeds() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawString_CompositingModeSourceCopy_ThrowsArgumentException() { diff --git a/src/libraries/System.Drawing.Common/tests/Graphics_DrawBezierTests.cs b/src/libraries/System.Drawing.Common/tests/Graphics_DrawBezierTests.cs index f9acd89244cef5..89b5d6e0c7f70c 100644 --- a/src/libraries/System.Drawing.Common/tests/Graphics_DrawBezierTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Graphics_DrawBezierTests.cs @@ -22,7 +22,7 @@ public void DrawBezier_Point() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/30683", TargetFrameworkMonikers.Netcoreapp)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26624", TargetFrameworkMonikers.Netcoreapp)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawBezier_Points() { @@ -44,7 +44,7 @@ public void DrawBezier_Points() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/30683", TargetFrameworkMonikers.Netcoreapp)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26624", TargetFrameworkMonikers.Netcoreapp)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawBezier_PointFs() { @@ -93,8 +93,7 @@ public void DrawBezier_DisposedPen_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void DrawBezier_Busy_ThrowsInvalidOperationException() { using (var image = new Bitmap(10, 10)) @@ -115,8 +114,7 @@ public void DrawBezier_Busy_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void DrawBezier_Disposed_ThrowsArgumentException() { using (var image = new Bitmap(10, 10)) @@ -143,7 +141,7 @@ public void DrawBeziers_NullPen_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawBeziers_DisposedPen_ThrowsArgumentException() { @@ -170,7 +168,7 @@ public void DrawBeziers_NullPoints_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawBeziers_EmptyPoints_ThrowsArgumentException() { @@ -183,7 +181,7 @@ public void DrawBeziers_EmptyPoints_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawBeziers_Busy_ThrowsInvalidOperationException() { @@ -204,7 +202,7 @@ public void DrawBeziers_Busy_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawBeziers_Disposed_ThrowsArgumentException() { diff --git a/src/libraries/System.Drawing.Common/tests/Graphics_DrawLineTests.cs b/src/libraries/System.Drawing.Common/tests/Graphics_DrawLineTests.cs index a6fc4eb79b72a0..fc6f574bad6dbf 100644 --- a/src/libraries/System.Drawing.Common/tests/Graphics_DrawLineTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Graphics_DrawLineTests.cs @@ -7,7 +7,7 @@ namespace System.Drawing.Tests { public class Graphics_DrawLineTests : DrawingTest { - [ActiveIssue("https://github.com/dotnet/corefx/issues/30683", TargetFrameworkMonikers.Netcoreapp)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26624", TargetFrameworkMonikers.Netcoreapp)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawLines_Points() { @@ -23,7 +23,7 @@ public void DrawLines_Points() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/30683", TargetFrameworkMonikers.Netcoreapp)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26624", TargetFrameworkMonikers.Netcoreapp)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawLines_PointFs() { @@ -68,7 +68,7 @@ public void DrawLine_DisposedPen_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawLine_Busy_ThrowsInvalidOperationException() { @@ -158,7 +158,7 @@ public void DrawLines_InvalidPointsLength_ThrowsArgumentException(int length) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawLines_Busy_ThrowsInvalidOperationException() { diff --git a/src/libraries/System.Drawing.Common/tests/IconTests.cs b/src/libraries/System.Drawing.Common/tests/IconTests.cs index 33c97f38fe2fca..175a6c5e5bf365 100644 --- a/src/libraries/System.Drawing.Common/tests/IconTests.cs +++ b/src/libraries/System.Drawing.Common/tests/IconTests.cs @@ -76,7 +76,7 @@ public static IEnumerable Size_TestData() yield return new object[] { "256x256_one_entry_32bit.ico", new Size(int.MaxValue, int.MaxValue), new Size(256, 256) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Size_TestData))] public void Ctor_FilePath_Width_Height(string fileName, Size size, Size expectedSize) @@ -89,7 +89,7 @@ public void Ctor_FilePath_Width_Height(string fileName, Size size, Size expected } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Size_TestData))] public void Ctor_FilePath_Size(string fileName, Size size, Size expectedSize) @@ -122,7 +122,7 @@ public void Ctor_Stream() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Size_TestData))] public void Ctor_Stream_Width_Height(string fileName, Size size, Size expectedSize) @@ -136,7 +136,7 @@ public void Ctor_Stream_Width_Height(string fileName, Size size, Size expectedSi } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Size_TestData))] public void Ctor_Stream_Size(string fileName, Size size, Size expectedSize) @@ -215,7 +215,7 @@ public static IEnumerable Ctor_InvalidBytesInStream_TestData() yield return new object[] { new byte[] { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, typeof(Win32Exception) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_InvalidBytesInStream_TestData))] public void Ctor_InvalidBytesInStream_ThrowsException(byte[] bytes, Type exceptionType) @@ -229,7 +229,7 @@ public void Ctor_InvalidBytesInStream_ThrowsException(byte[] bytes, Type excepti } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Size_TestData))] public void Ctor_Icon_Width_Height(string fileName, Size size, Size expectedSize) @@ -244,7 +244,7 @@ public void Ctor_Icon_Width_Height(string fileName, Size size, Size expectedSize } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Size_TestData))] public void Ctor_Icon_Size(string fileName, Size size, Size expectedSize) @@ -349,7 +349,7 @@ public void Dispose_IconData_DestroysHandle() Assert.Throws(() => icon.Handle); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Dispose_OwnsHandle_DestroysHandle() { @@ -401,7 +401,7 @@ public void ExtractAssociatedIcon_FilePath_Success() } [PlatformSpecific(TestPlatforms.Windows)] // UNC - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Fix for https://github.com/dotnet/corefx/issues/34122")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Fix for https://github.com/dotnet/runtime/issues/28220")] [ConditionalFact(Helpers.IsDrawingSupported)] public void ExtractAssociatedIcon_UNCFilePath_Success() { @@ -434,7 +434,7 @@ private void ExtractAssociatedIcon_FilePath_Success(string filePath) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ExtractAssociatedIcon_NonFilePath_ThrowsFileNotFound() { @@ -514,7 +514,7 @@ public void Save_NullOutputStreamIconData_ThrowsNullReferenceException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Save_NullOutputStreamNoIconData_ThrowsArgumentNullException() { @@ -527,7 +527,7 @@ public void Save_NullOutputStreamNoIconData_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Save_ClosedOutputStreamIconData_ThrowsException() { @@ -540,7 +540,7 @@ public void Save_ClosedOutputStreamIconData_ThrowsException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Save_ClosedOutputStreamNoIconData_DoesNothing() { @@ -554,7 +554,7 @@ public void Save_ClosedOutputStreamNoIconData_DoesNothing() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Save_NoIconDataOwnsHandleAndDisposed_ThrowsObjectDisposedException() { @@ -614,7 +614,7 @@ public void ToBitmap_BitmapIconFromHandle_ReturnsExpected() private const string DontSupportPngFramesInIcons = "Switch.System.Drawing.DontSupportPngFramesInIcons"; - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ToBitmap_PngIconSupportedInSwitches_Success() { @@ -651,7 +651,7 @@ void VerifyPng() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ToBitmap_PngIconNotSupportedInSwitches_ThrowsArgumentOutOfRangeException() { diff --git a/src/libraries/System.Drawing.Common/tests/ImageTests.cs b/src/libraries/System.Drawing.Common/tests/ImageTests.cs index bde2a5bad55b0f..c9147dc81b216c 100644 --- a/src/libraries/System.Drawing.Common/tests/ImageTests.cs +++ b/src/libraries/System.Drawing.Common/tests/ImageTests.cs @@ -22,7 +22,7 @@ public static IEnumerable InvalidBytes_TestData() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(InvalidBytes_TestData))] public void FromFile_InvalidBytes_ThrowsOutOfMemoryException(byte[] bytes) @@ -77,7 +77,7 @@ public void FromFile_NoSuchFile_ThrowsFileNotFoundException() Assert.Throws(() => Image.FromFile("NoSuchFile", useEmbeddedColorManagement: true)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(InvalidBytes_TestData))] public void FromStream_InvalidBytes_ThrowsArgumentException(byte[] bytes) @@ -159,7 +159,7 @@ public static IEnumerable GetEncoderParameterList_ReturnsExpected_Test }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(GetEncoderParameterList_ReturnsExpected_TestData))] public void GetEncoderParameterList_ReturnsExpected(ImageFormat format, Guid[] expectedParameters) diff --git a/src/libraries/System.Drawing.Common/tests/Imaging/ImageAttributesTests.cs b/src/libraries/System.Drawing.Common/tests/Imaging/ImageAttributesTests.cs index 1e45c9d89a7dc0..caa9994a9b5887 100644 --- a/src/libraries/System.Drawing.Common/tests/Imaging/ImageAttributesTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Imaging/ImageAttributesTests.cs @@ -67,7 +67,7 @@ public void Ctor_Default_Success() imageAttr.Dispose(); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] // Causes a crash on libgdiplus. + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] // Causes a crash on libgdiplus. [ConditionalFact(Helpers.IsDrawingSupported)] public void Clone_Success() { @@ -282,6 +282,7 @@ public static IEnumerable ColorMatrixFlag_InvalidFlags_TestData() [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_InvalidTypes_TestData))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/2337", TestRuntimes.Mono)] public void SetColorMatrix_InvalidFlags_ThrowsArgumentException(ColorMatrixFlag flag) { using (var imageAttr = new ImageAttributes()) @@ -520,7 +521,7 @@ public void SetColorMatrices_InvalidFlags_ThrowsArgumentException(ColorMatrixFla } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetThreshold_Threshold_Success() { @@ -535,7 +536,7 @@ public void SetThreshold_Threshold_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_TestData))] public void SetThreshold_ThresholdType_Success(ColorAdjustType type) @@ -552,7 +553,7 @@ public void SetThreshold_ThresholdType_Success(ColorAdjustType type) } [ConditionalTheory(Helpers.IsDrawingSupported)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [MemberData(nameof(ColorAdjustTypeI_TestData))] public void SetThreshold_ThresholdTypeI_Success(ColorAdjustType type) { @@ -567,7 +568,7 @@ public void SetThreshold_ThresholdTypeI_Success(ColorAdjustType type) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetThreshold_Disposed_ThrowsArgumentException() { @@ -577,7 +578,7 @@ public void SetThreshold_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => imageAttr.SetThreshold(0.5f)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_InvalidTypes_TestData))] public void SetThreshold_InvalidType_ThrowsArgumentException(ColorAdjustType type) @@ -588,7 +589,7 @@ public void SetThreshold_InvalidType_ThrowsArgumentException(ColorAdjustType typ } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ClearThreshold_Success() { @@ -604,7 +605,7 @@ public void ClearThreshold_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_AllTypesAllowed_TestData))] public void ClearThreshold_ThresholdTypeI_Success(ColorAdjustType type) @@ -621,7 +622,7 @@ public void ClearThreshold_ThresholdTypeI_Success(ColorAdjustType type) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ClearThreshold_Disposed_ThrowsArgumentException() { @@ -631,7 +632,7 @@ public void ClearThreshold_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => imageAttr.ClearThreshold(ColorAdjustType.Default)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_InvalidTypes_TestData))] public void ClearThreshold_InvalidTypes_ThrowsArgumentException(ColorAdjustType type) @@ -642,7 +643,7 @@ public void ClearThreshold_InvalidTypes_ThrowsArgumentException(ColorAdjustType } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetGamma_Gamma_Success() { @@ -657,7 +658,7 @@ public void SetGamma_Gamma_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_TestData))] public void SetGamma_GammaType_Success(ColorAdjustType type) @@ -673,7 +674,7 @@ public void SetGamma_GammaType_Success(ColorAdjustType type) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustTypeI_TestData))] public void SetGamma_GammaTypeI_Success(ColorAdjustType type) @@ -745,7 +746,7 @@ public void ClearGamma_InvalidTypes_ThrowsArgumentException(ColorAdjustType type } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetNoOp_Success() { @@ -762,7 +763,7 @@ public void SetNoOp_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_AllTypesAllowed_TestData))] public void SetNoOp_Type_Success(ColorAdjustType type) @@ -819,7 +820,7 @@ public void ClearNoOp_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_TestData))] public void ClearNoOp_Type_Success(ColorAdjustType type) @@ -858,7 +859,7 @@ public void ClearNoOp_TypeI_Success(ColorAdjustType type) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ClearNoOp_Disposed_ThrowsArgumentException() { @@ -879,7 +880,7 @@ public void ClearNoOp_InvalidTypes_ThrowsArgumentException(ColorAdjustType type) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/22309")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22784")] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetColorKey_Success() { @@ -895,7 +896,7 @@ public void SetColorKey_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/22309")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22784")] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_TestData))] public void SetColorKey_Type_Success(ColorAdjustType type) @@ -1011,7 +1012,7 @@ public static IEnumerable SetOutputChannel_ColorChannelFlag_TestData() yield return new object[] { ColorChannelFlag.ColorChannelY, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 207, 207, 207) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(SetOutputChannel_ColorChannelFlag_TestData))] public void SetOutputChannel_Flag_Success(ColorChannelFlag flag, Color actualColor, Color expectedColor) @@ -1040,7 +1041,7 @@ public static IEnumerable SetOutputChannel_ColorChannelFlagType_TestDa yield return new object[] { ColorChannelFlag.ColorChannelY, ColorAdjustType.Bitmap, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 207, 207, 207) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(SetOutputChannel_ColorChannelFlagType_TestData))] public void SetOutputChannel_FlagType_Success(ColorChannelFlag flag, ColorAdjustType type, Color actualColor, Color expectedColor) @@ -1073,7 +1074,7 @@ public static IEnumerable SetOutputChannel_ColorChannelFlagTypeI_TestD yield return new object[] { ColorChannelFlag.ColorChannelY, ColorAdjustType.Text, Color.FromArgb(255, 100, 100, 100) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(SetOutputChannel_ColorChannelFlagTypeI_TestData))] public void SetOutputChannel_FlagTypeI_Success(ColorChannelFlag flag, ColorAdjustType type, Color color) @@ -1090,7 +1091,7 @@ public void SetOutputChannel_FlagTypeI_Success(ColorChannelFlag flag, ColorAdjus } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetOutputChannel_Disposed_ThrowsArgumentException() { @@ -1101,7 +1102,7 @@ public void SetOutputChannel_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => imageAttr.SetOutputChannel(ColorChannelFlag.ColorChannelY, ColorAdjustType.Default)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_InvalidTypes_TestData))] public void SetOutputChannel_InvalidTypes_ThrowsArgumentException(ColorAdjustType type) @@ -1121,7 +1122,7 @@ public static IEnumerable SetOutputChannel_InvalidColorChannelFlags_Te yield return new object[] { (ColorChannelFlag)int.MaxValue }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(SetOutputChannel_InvalidColorChannelFlags_TestData))] public void SetOutputChannel_InvalidFlags_ThrowsArgumentException(ColorChannelFlag flag) @@ -1133,7 +1134,7 @@ public void SetOutputChannel_InvalidFlags_ThrowsArgumentException(ColorChannelFl } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ClearOutputChannel_Success() { @@ -1150,7 +1151,7 @@ public void ClearOutputChannel_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_AllTypesAllowed_TestData))] public void ClearOutputChannel_Type_Success(ColorAdjustType type) @@ -1168,7 +1169,7 @@ public void ClearOutputChannel_Type_Success(ColorAdjustType type) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ClearOutputChannel_Disposed_ThrowsArgumentException() { @@ -1179,7 +1180,7 @@ public void ClearOutputChannel_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => imageAttr.ClearOutputChannel(ColorAdjustType.Default)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_InvalidTypes_TestData))] public void ClearOutputChannel_InvalidTypes_ThrowsArgumentException(ColorAdjustType type) @@ -1190,7 +1191,7 @@ public void ClearOutputChannel_InvalidTypes_ThrowsArgumentException(ColorAdjustT } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetOutputChannelColorProfile_Name_Success() { @@ -1206,7 +1207,7 @@ public void SetOutputChannelColorProfile_Name_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetOutputChannelColorProfile_Disposed_ThrowsArgumentException() { @@ -1229,7 +1230,7 @@ public void SetOutputChannelColorProfile_Null_ThrowsArgumentNullException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/22309")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22784")] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetOutputChannelColorProfile_InvalidPath_ThrowsArgumentException() { @@ -1240,7 +1241,7 @@ public void SetOutputChannelColorProfile_InvalidPath_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetOutputChannelColorProfile_InvalidPath_ThrowsOutOfMemoryException() { @@ -1251,7 +1252,7 @@ public void SetOutputChannelColorProfile_InvalidPath_ThrowsOutOfMemoryException( } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetOutputChannelColorProfile_InvalidPath_ThrowsPathTooLongException() { @@ -1263,7 +1264,7 @@ public void SetOutputChannelColorProfile_InvalidPath_ThrowsPathTooLongException( } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_InvalidTypes_TestData))] public void SetOutputChannelColorProfile_InvalidTypes_ThrowsArgumentException(ColorAdjustType type) @@ -1274,7 +1275,7 @@ public void SetOutputChannelColorProfile_InvalidTypes_ThrowsArgumentException(Co } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ClearOutputChannelColorProfile_Success() { @@ -1292,7 +1293,7 @@ public void ClearOutputChannelColorProfile_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_AllTypesAllowed_TestData))] public void ClearOutputChannelColorProfile_Type_Success(ColorAdjustType type) @@ -1311,7 +1312,7 @@ public void ClearOutputChannelColorProfile_Type_Success(ColorAdjustType type) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ClearOutputChannelColorProfile_Disposed_ThrowsArgumentException() { @@ -1322,7 +1323,7 @@ public void ClearOutputChannelColorProfile_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => imageAttr.ClearOutputChannelColorProfile(ColorAdjustType.Default)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_InvalidTypes_TestData))] public void ClearOutputChannelColorProfile_InvalidTypes_ThrowsArgumentException(ColorAdjustType type) @@ -1415,7 +1416,7 @@ public void SetRemapTable_NullMapMeber_ThrowsNullReferenceException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetRemapTable_EmptyMap_ThrowsArgumentException() { @@ -1425,7 +1426,7 @@ public void SetRemapTable_EmptyMap_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ClearRemapTable_Success() { @@ -1441,7 +1442,7 @@ public void ClearRemapTable_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_AllTypesAllowed_TestData))] public void ClearRemapTable_Type_Success(ColorAdjustType type) @@ -1489,7 +1490,7 @@ public void SetWrapMode_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => imageAttr.SetWrapMode(WrapMode.Clamp, Color.Black, true)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetAdjustedPalette_Disposed_ThrowsArgumentException() { @@ -1511,7 +1512,7 @@ public void GetAdjustedPalette_NullPallete_ThrowsNullReferenceException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ColorAdjustType_InvalidTypes_TestData))] public void GetAdjustedPalette_InvalidTypes_ThrowsArgumentException(ColorAdjustType type) diff --git a/src/libraries/System.Drawing.Common/tests/Imaging/ImageFormatTests.cs b/src/libraries/System.Drawing.Common/tests/Imaging/ImageFormatTests.cs index 8bf64da405ee53..ea52bfeba7b998 100644 --- a/src/libraries/System.Drawing.Common/tests/Imaging/ImageFormatTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Imaging/ImageFormatTests.cs @@ -94,7 +94,7 @@ public void ToString_ReturnsExpected(string expected, ImageFormat imageFormat) Assert.Equal(expected, imageFormat.ToString()); } - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Bug fix not in NETFX, https://github.com/dotnet/corefx/issues/16463")] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Bug fix not in NETFX, https://github.com/dotnet/runtime/issues/20332")] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(ImageFromFileToStringTestData))] public void Image_RawFormat_ToString(string path, string expected) diff --git a/src/libraries/System.Drawing.Common/tests/Imaging/MetafileTests.cs b/src/libraries/System.Drawing.Common/tests/Imaging/MetafileTests.cs index 4a112bbdd357d0..02247905a6dcaa 100644 --- a/src/libraries/System.Drawing.Common/tests/Imaging/MetafileTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Imaging/MetafileTests.cs @@ -43,7 +43,7 @@ public void Ctor_IntPtrZero_ThrowsArgumentException() AssertExtensions.Throws(null, () => new Metafile(IntPtr.Zero, false)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_IntPtrToWmf_ThrowsExternalException() { @@ -111,7 +111,7 @@ public void Ctor_NullStream_ThrowsArgumentException() AssertExtensions.Throws("stream", null, () => new Metafile((Stream)null)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_EmptyStream_ThrowsExternalException() { @@ -190,7 +190,7 @@ public void Ctor_IntPtrEmfTypeString_Success(string description) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(InvalidPath_TestData))] public void Ctor_ZeroPointerEmfTypeInvalidString_ThrowsArgumentException(string description) @@ -955,7 +955,7 @@ public void Static_GetMetafileHeader_NullStream_ThrowsNullReferenceException() Assert.Throws(() => Metafile.GetMetafileHeader((Stream)null)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Static_GetMetafileHeader_EmptyStream_ArgumentException() { @@ -995,7 +995,7 @@ public void GetHenhmetafile_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHenhmetafile_Disposed_ThrowsArgumentException() { diff --git a/src/libraries/System.Drawing.Common/tests/Imaging/PropertyItemTests.cs b/src/libraries/System.Drawing.Common/tests/Imaging/PropertyItemTests.cs index 2884a446828850..104ba4263f1a4b 100644 --- a/src/libraries/System.Drawing.Common/tests/Imaging/PropertyItemTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Imaging/PropertyItemTests.cs @@ -39,7 +39,7 @@ public static IEnumerable Properties_TestData() yield return new object[] { 0, 0, 0, new byte[0] }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Properties_TestData))] public void Properties_SetValues_ReturnsExpected(int id, int len, short type, byte[] value) diff --git a/src/libraries/System.Drawing.Common/tests/Printing/PageSettingsTests.cs b/src/libraries/System.Drawing.Common/tests/Printing/PageSettingsTests.cs index 0da2d5534ae095..257292f00e0923 100644 --- a/src/libraries/System.Drawing.Common/tests/Printing/PageSettingsTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Printing/PageSettingsTests.cs @@ -34,8 +34,8 @@ namespace System.Drawing.Printing.Tests public class PageSettingsTests { - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void Clone_Success() { PageSettings ps = new PageSettings(); diff --git a/src/libraries/System.Drawing.Common/tests/Printing/PrintDocumentTests.cs b/src/libraries/System.Drawing.Common/tests/Printing/PrintDocumentTests.cs index c4b18104898b3e..9b952a830b89c7 100644 --- a/src/libraries/System.Drawing.Common/tests/Printing/PrintDocumentTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Printing/PrintDocumentTests.cs @@ -37,8 +37,8 @@ public class PrintDocumentTests } }; - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void Ctor_Default_Success() { using (var document = new PrintDocument()) @@ -49,8 +49,8 @@ public void Ctor_Default_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void DefaultPageSettings_SetValue_ReturnsExpected() { using (var document = new PrintDocument()) @@ -64,8 +64,8 @@ public void DefaultPageSettings_SetValue_ReturnsExpected() } [ConditionalFact(Helpers.IsDrawingSupported)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/39381")] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30221")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] public void DefaultPageSettings_Null_ReturnsExpected() { using (var document = new PrintDocument()) @@ -87,7 +87,7 @@ public void DocumentName_SetValue_ReturnsExpected(string documentName) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DocumentName_Null_ReturnsExpected() { @@ -110,7 +110,7 @@ public void OriginAtMargins_SetValue_ReturnsExpected(bool originAtMargins) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void PrintController_SetValue_ReturnsExpected() { @@ -125,8 +125,8 @@ public void PrintController_SetValue_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void PrinterSettings_SetValue_ReturnsExpected() { using (var document = new PrintDocument()) @@ -149,8 +149,8 @@ public void PrinterSettings_SetValue_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void BeginPrint_SetValue_ReturnsExpected() { bool flag = false; @@ -170,8 +170,8 @@ public void BeginPrint_SetValue_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/30223")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26428")] [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported)] public void EndPrint_SetValue_ReturnsExpected() { @@ -192,8 +192,8 @@ public void EndPrint_SetValue_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/30223")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/26428")] [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported)] public void PrintPage_SetValue_ReturnsExpected() { @@ -214,8 +214,8 @@ public void PrintPage_SetValue_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void QueryPageSettings_SetValue_ReturnsExpected() { bool flag = false; diff --git a/src/libraries/System.Drawing.Common/tests/Printing/PrinterSettingsTests.cs b/src/libraries/System.Drawing.Common/tests/Printing/PrinterSettingsTests.cs index c0ff8a91bf2a4b..096ad2001e8d07 100644 --- a/src/libraries/System.Drawing.Common/tests/Printing/PrinterSettingsTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Printing/PrinterSettingsTests.cs @@ -43,7 +43,7 @@ public void Ctor_Default_Success() Assert.NotNull(printerSettings.DefaultPageSettings); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported)] public void CanDuplex_ReturnsExpected() { @@ -119,7 +119,7 @@ public void Duplex_SetValue_ReturnsExpected(Duplex duplex) Assert.Equal(duplex, printerSettings.Duplex); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(Duplex.Default - 1)] [InlineData(Duplex.Horizontal + 1)] @@ -174,7 +174,7 @@ public void IsDefaultPrinter_ReturnsExpected() Assert.True(printerSettings.IsDefaultPrinter); } - [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void IsPlotter_ReturnsExpected() { var printerSettings = new PrinterSettings(); @@ -182,7 +182,7 @@ public void IsPlotter_ReturnsExpected() } [ConditionalFact(Helpers.IsDrawingSupported)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] public void IsValid_ReturnsExpected() { var printerSettings = new PrinterSettings() @@ -279,7 +279,7 @@ public void PrintFileName_SetValue_ReturnsExpected() Assert.Equal(printFileName, printerSettings.PrintFileName); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [Fact] public void PrintFileName_Null_ThrowsArgumentNullException() { @@ -287,7 +287,7 @@ public void PrintFileName_Null_ThrowsArgumentNullException() AssertExtensions.Throws(null, () => printerSettings.PrintFileName = null); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [Fact] public void PrintFileName_Empty_ThrowsArgumentNullException() { @@ -295,7 +295,7 @@ public void PrintFileName_Empty_ThrowsArgumentNullException() AssertExtensions.Throws(string.Empty, () => printerSettings.PrintFileName = string.Empty); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported)] public void PaperSizes_ReturnsExpected() { @@ -303,7 +303,7 @@ public void PaperSizes_ReturnsExpected() Assert.NotNull(printerSettings.PaperSizes); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported)] public void PaperSources_ReturnsExpected() { @@ -311,7 +311,7 @@ public void PaperSources_ReturnsExpected() Assert.NotNull(printerSettings.PaperSources); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [Theory] [InlineData(PrintRange.AllPages)] [InlineData(PrintRange.CurrentPage)] @@ -350,7 +350,7 @@ public void PrintToFile_SetValue_ReturnsExpected() Assert.Equal(printToFile, printerSettings.PrintToFile); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [Theory] [InlineData("")] [InlineData("My printer")] @@ -364,7 +364,7 @@ public void PrinterName_SetValue_ReturnsExpected(string printerName) Assert.Equal(printerName, printerSettings.PrinterName); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported)] public void PrinterName_Null_ReturnsExpected() { @@ -376,7 +376,7 @@ public void PrinterName_Null_ReturnsExpected() Assert.NotNull(printerSettings.PrinterName); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported)] public void PrinterResolutions_ReturnsExpected() { @@ -390,7 +390,7 @@ public static IEnumerable IsDirectPrintingSupported_ImageFormatSupport yield return new object[] { ImageFormat.Png }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported)] [MemberData(nameof(IsDirectPrintingSupported_ImageFormatSupported_TestData))] public void IsDirectPrintingSupported_ImageFormatSupported_ReturnsExpected(ImageFormat imageFormat) @@ -411,7 +411,7 @@ public static IEnumerable IsDirectPrintingSupported_ImageFormatNotSupp yield return new object[] { ImageFormat.Bmp }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [Theory] [MemberData(nameof(IsDirectPrintingSupported_ImageFormatNotSupported_TestData))] public void IsDirectPrintingSupported_ImageFormatNotSupported_ReturnsExpected(ImageFormat imageFormat) @@ -420,7 +420,7 @@ public void IsDirectPrintingSupported_ImageFormatNotSupported_ReturnsExpected(Im Assert.False(printerSettings.IsDirectPrintingSupported(imageFormat)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void IsDirectPrintingSupported_ImageNotSupported_ReturnsExpected() { @@ -431,7 +431,7 @@ public void IsDirectPrintingSupported_ImageNotSupported_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported)] public void SupportsColor_ReturnsExpected() { @@ -461,7 +461,7 @@ public void ToPage_Invalid_ThrowsArgumentException(int toPage) AssertExtensions.Throws(null, () => printerSettings.ToPage = toPage); } - [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void Clone_Success() { var printerSettings = new PrinterSettings(); @@ -469,8 +469,8 @@ public void Clone_Success() Assert.False(ReferenceEquals(clone, printerSettings)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void CreateMeasurementGraphics_Default_ReturnsExpected() { var printerSettings = new PrinterSettings(); @@ -484,8 +484,8 @@ public void CreateMeasurementGraphics_Default_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void CreateMeasurementGraphics_Bool_ReturnsExpected() { var printerSettings = new PrinterSettings(); @@ -497,8 +497,8 @@ public void CreateMeasurementGraphics_Bool_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void CreateMeasurementGraphics_PageSettings_ReturnsExpected() { var printerSettings = new PrinterSettings(); @@ -513,8 +513,8 @@ public void CreateMeasurementGraphics_PageSettings_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.AnyInstalledPrinters, Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void CreateMeasurementGraphics_PageSettingsBool_ReturnsExpected() { var printerSettings = new PrinterSettings(); @@ -527,8 +527,8 @@ public void CreateMeasurementGraphics_PageSettingsBool_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/corefx/issues/29858 + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ConditionalFact(Helpers.IsDrawingSupported, Helpers.WindowsRS3OrEarlier)] // RS4 failures: https://github.com/dotnet/runtime/issues/26247 public void CreateMeasurementGraphics_Null_ThrowsNullReferenceException() { var printerSettings = new PrinterSettings(); @@ -536,7 +536,7 @@ public void CreateMeasurementGraphics_Null_ThrowsNullReferenceException() Assert.Throws(() => printerSettings.CreateMeasurementGraphics(null, true)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHdevmode_ReturnsExpected() { @@ -547,7 +547,7 @@ public void GetHdevmode_ReturnsExpected() Assert.NotEqual(IntPtr.Zero, handle); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHdevmode_PageSettings_ReturnsExpected() { @@ -559,7 +559,7 @@ public void GetHdevmode_PageSettings_ReturnsExpected() Assert.NotEqual(IntPtr.Zero, handle); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHdevmode_Null_ThrowsNullReferenceException() { @@ -567,7 +567,7 @@ public void GetHdevmode_Null_ThrowsNullReferenceException() Assert.Throws(() => printerSettings.GetHdevmode(null)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHdevnames_ReturnsExpected() { @@ -578,7 +578,7 @@ public void GetHdevnames_ReturnsExpected() Assert.NotEqual(IntPtr.Zero, handle); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(typeof(PrinterSettingsTests), nameof(CanTestSetHdevmode_IntPtr_Success))] public void SetHdevmode_IntPtr_Success() { @@ -615,7 +615,7 @@ private static string GetNameOfTestPrinterSuitableForDevModeTesting() "Microsoft XPS Document Writer", // Backup for older Windows }; - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHdevmode_Zero_ThrowsArgumentException() { @@ -623,7 +623,7 @@ public void GetHdevmode_Zero_ThrowsArgumentException() AssertExtensions.Throws(null, () => printerSettings.SetHdevmode(IntPtr.Zero)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void SetHdevnames_IntPtr_Success() { @@ -634,7 +634,7 @@ public void SetHdevnames_IntPtr_Success() Assert.Equal(newPrinterSettings.PrinterName, printerSettings.PrinterName); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void ToString_ReturnsExpected() { diff --git a/src/libraries/System.Drawing.Common/tests/RegionTests.cs b/src/libraries/System.Drawing.Common/tests/RegionTests.cs index fa73eb86e8d2ee..13ee7161efc810 100644 --- a/src/libraries/System.Drawing.Common/tests/RegionTests.cs +++ b/src/libraries/System.Drawing.Common/tests/RegionTests.cs @@ -51,7 +51,7 @@ public void Ctor_Default() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(-1, -2, -3, -4, true)] [InlineData(0, 0, 0, 0, true)] @@ -68,7 +68,7 @@ public void Ctor_Rectangle(int x, int y, int width, int height, bool isEmpty) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(1, 2, 3, float.NegativeInfinity, true)] [InlineData(-1, -2, -3, -4, true)] @@ -139,7 +139,7 @@ public void Ctor_NullRegionData_ThrowsArgumentNullException() AssertExtensions.Throws("rgnData", () => new Region((RegionData)null)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(0)] [InlineData(1)] @@ -155,7 +155,7 @@ public void Ctor_InvalidRegionData_ThrowsExternalException(int dataLength) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_EmptyGraphicsPath_ThrowsExternalException() { @@ -178,7 +178,7 @@ public void Ctor_NullDataInRegionData_ThrowsNullReferenceException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_GraphicsPath() { @@ -242,7 +242,7 @@ public static IEnumerable Ctor_InfiniteGraphicsPath_TestData() yield return new object[] { path6, true }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_InfiniteGraphicsPath_TestData))] public void Ctor_InfiniteGraphicsPath_IsInfinite(GraphicsPath path, bool isInfinite) @@ -454,7 +454,7 @@ public void Complement_DisposedRegion_ThrowsArgumentException() AssertExtensions.Throws(null, () => new Region().Complement(CreateDisposedRegion())); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Complement_SameRegion_ThrowsInvalidOperationException() { @@ -522,7 +522,7 @@ public void Complement_GraphicsPath_Success(Region region, RectangleF[] rectangl } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/24525", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23784", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Complement_GraphicsPathWithMultipleRectangles_Success() { @@ -636,7 +636,7 @@ static Region Empty() yield return new object[] { new Region(graphics1), new Region(graphics6), false }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Equals_TestData))] public void Equals_Valid_ReturnsExpected(Region region, Region other, bool expected) @@ -898,7 +898,7 @@ public void Exclude_DisposedRegion_ThrowsArgumentException() AssertExtensions.Throws(null, () => new Region().Exclude(CreateDisposedRegion())); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Exclude_SameRegion_ThrowsInvalidOperationException() { @@ -908,7 +908,7 @@ public void Exclude_SameRegion_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Exclude_TestData))] public void Exclude_Rectangle_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) @@ -927,7 +927,7 @@ public void Exclude_Rectangle_Success(Region region, RectangleF[] rectangles, Re } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Exclude_TestData))] public void Exclude_RectangleF_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) @@ -946,7 +946,7 @@ public void Exclude_RectangleF_Success(Region region, RectangleF[] rectangles, R } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Exclude_TestData))] public void Exclude_GraphicsPath_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) @@ -1059,7 +1059,7 @@ public void GetHrgn_Empty_ReturnsNonZero() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHrgn_NullGraphics_ThrowsArgumentNullException() { @@ -1117,7 +1117,7 @@ public void GetRegionData_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => CreateDisposedRegion().GetRegionData()); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetRegionScans_CustomMatrix_TransformsRegionScans() { @@ -1151,7 +1151,7 @@ public void GetRegionScans_Disposed_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetRegionScans_DisposedMatrix_ThrowsArgumentException() { @@ -1237,7 +1237,7 @@ public static IEnumerable Intersect_TestData() }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Intersect_TestData))] public void Intersect_Region_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) @@ -1287,7 +1287,7 @@ public void Intersect_DisposedRegion_ThrowsArgumentException() AssertExtensions.Throws(null, () => new Region().Intersect(CreateDisposedRegion())); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Intersect_SameRegion_ThrowsInvalidOperationException() { @@ -1361,7 +1361,7 @@ public void Intersect_InfiniteRegionWithSmallerRectangleF_Success() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Intersect_TestData))] public void Intersect_GraphicsPath_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) @@ -1836,7 +1836,7 @@ public static IEnumerable Union_TestData() }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Union_TestData))] public void Union_Region_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) @@ -1858,7 +1858,7 @@ public void Union_Region_Success(Region region, RectangleF[] rectangles, Rectang } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Union_InfiniteRegion_Success() { @@ -1890,7 +1890,7 @@ public void Union_DisposedRegion_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Union_SameRegion_ThrowsInvalidOperationException() { @@ -2158,7 +2158,7 @@ public void Translate_Infinity_Nop() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(float.MaxValue)] [InlineData(float.MinValue)] @@ -2244,7 +2244,7 @@ public static IEnumerable Xor_TestData() }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Xor_TestData))] public void Xor_Region_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) @@ -2303,7 +2303,7 @@ public void Xor_DisposedRegion_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Xor_SameRegion_ThrowsInvalidOperationException() { @@ -2313,7 +2313,7 @@ public void Xor_SameRegion_ThrowsInvalidOperationException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Xor_TestData))] public void Xor_Rectangle_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) @@ -2332,7 +2332,7 @@ public void Xor_Rectangle_Success(Region region, RectangleF[] rectangles, Rectan } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Xor_TestData))] public void Xor_RectangleF_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) @@ -2351,7 +2351,7 @@ public void Xor_RectangleF_Success(Region region, RectangleF[] rectangles, Recta } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Xor_TestData))] public void Xor_GraphicsPath_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) diff --git a/src/libraries/System.Drawing.Common/tests/SolidBrushTests.cs b/src/libraries/System.Drawing.Common/tests/SolidBrushTests.cs index ea95da552a6f53..d37196055bacd8 100644 --- a/src/libraries/System.Drawing.Common/tests/SolidBrushTests.cs +++ b/src/libraries/System.Drawing.Common/tests/SolidBrushTests.cs @@ -14,8 +14,7 @@ public static IEnumerable Colors_TestData() yield return new object[] { Color.PapayaWhip, Color.PapayaWhip }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(Helpers.IsWindowsOrAtLeastLibgdiplus6)] [MemberData(nameof(Colors_TestData))] public void Ctor_Color(Color color, Color expectedColor) { @@ -60,8 +59,7 @@ public void Clone_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => brush.Clone()); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] - [ConditionalFact(Helpers.IsDrawingSupported)] + [ConditionalFact(Helpers.IsWindowsOrAtLeastLibgdiplus6)] public void Color_EmptyAndGetDisposed_ThrowsArgumentException() { var brush = new SolidBrush(new Color()); diff --git a/src/libraries/System.Drawing.Common/tests/StringFormatTests.cs b/src/libraries/System.Drawing.Common/tests/StringFormatTests.cs index 1346ea4012a59a..ad5f8907f6ed08 100644 --- a/src/libraries/System.Drawing.Common/tests/StringFormatTests.cs +++ b/src/libraries/System.Drawing.Common/tests/StringFormatTests.cs @@ -136,7 +136,7 @@ public void Clone_Disposed_ThrowsArgumentException() AssertExtensions.Throws(null, () => format.Clone()); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(0, StringDigitSubstitute.None, 0)] [InlineData(EnglishLanguageCode, StringDigitSubstitute.Traditional, EnglishLanguageCode)] diff --git a/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj b/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj index 015d6d293bac3e..a30bfd2bf5f351 100644 --- a/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj +++ b/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj @@ -21,6 +21,7 @@ + diff --git a/src/libraries/System.Drawing.Common/tests/SystemFontsTests.cs b/src/libraries/System.Drawing.Common/tests/SystemFontsTests.cs index 436276646a29d5..8576301a194f14 100644 --- a/src/libraries/System.Drawing.Common/tests/SystemFontsTests.cs +++ b/src/libraries/System.Drawing.Common/tests/SystemFontsTests.cs @@ -139,7 +139,7 @@ public void GetFontByName_NoSuchName_ReturnsNull(string systemFontName) public static extern int GetUserDefaultLCID(); // Do not test DefaultFont and DialogFont, as we can't reliably determine from LCID - // https://github.com/dotnet/corefx/issues/35664#issuecomment-473556522 + // https://github.com/dotnet/runtime/issues/28830#issuecomment-473556522 class SystemFontList { public SystemFontList(string c_it_m_mb_scFonts) diff --git a/src/libraries/System.Drawing.Common/tests/Text/PrivateFontCollectionTests.cs b/src/libraries/System.Drawing.Common/tests/Text/PrivateFontCollectionTests.cs index 38637b06e159d3..af934a15f458a6 100644 --- a/src/libraries/System.Drawing.Common/tests/Text/PrivateFontCollectionTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Text/PrivateFontCollectionTests.cs @@ -77,7 +77,7 @@ public void AddFontFile_SamePathMultipleTimes_FamiliesContainsOnlyOneFont() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddFontFile_SameNameMultipleTimes_FamiliesContainsFirstFontOnly() { @@ -101,7 +101,7 @@ public void AddFontFile_SameNameMultipleTimes_FamiliesContainsFirstFontOnly() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddFontFile_NullFileName_ThrowsArgumentNullException() { @@ -130,7 +130,7 @@ public void AddFontFile_NoSuchFilePath_ThrowsFileNotFoundException() } [ConditionalFact(Helpers.IsDrawingSupported)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/8655")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/17328")] public void AddFontFile_LongFilePath_ThrowsException() { using (var fontCollection = new PrivateFontCollection()) @@ -158,7 +158,7 @@ public void AddFontFile_Directory_ThrowsFileNotFoundException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddFontFile_Disposed_ThrowsArgumentException() { @@ -200,7 +200,7 @@ public void AddMemoryFont_ZeroMemory_ThrowsArgumentException() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(0)] [InlineData(-1)] @@ -229,7 +229,7 @@ public void AddMemoryFont_InvalidLength_ThrowsArgumentException(int length) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void AddMemoryFont_Disposed_ThrowsArgumentException() { diff --git a/src/libraries/System.Drawing.Common/tests/TextureBrushTests.cs b/src/libraries/System.Drawing.Common/tests/TextureBrushTests.cs index 84ded72601cfc7..533ab00e007e4a 100644 --- a/src/libraries/System.Drawing.Common/tests/TextureBrushTests.cs +++ b/src/libraries/System.Drawing.Common/tests/TextureBrushTests.cs @@ -17,7 +17,7 @@ public static IEnumerable Ctor_Bitmap_TestData() yield return new object[] { new Metafile(Helpers.GetTestBitmapPath("telescope_01.wmf")), PixelFormat.Format32bppArgb, new Size(490, 654) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_Bitmap_TestData))] public void Ctor_Bitmap(Image bitmap, PixelFormat expectedPixelFormat, Size expectedSize) @@ -41,7 +41,7 @@ public void Ctor_Bitmap(Image bitmap, PixelFormat expectedPixelFormat, Size expe } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Ctor_BitmapFromIconHandle_Success() { @@ -64,7 +64,7 @@ public static IEnumerable Ctor_Image_WrapMode_TestData() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_Image_WrapMode_TestData))] public void Ctor_Image_WrapMode(Image image, WrapMode wrapMode, PixelFormat expectedPixelFormat, Size expectedSize) @@ -94,7 +94,7 @@ public static IEnumerable Ctor_Image_Rectangle_TestData() yield return new object[] { new Bitmap(10, 10), new Rectangle(5, 5, 5, 5) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_Image_Rectangle_TestData))] public void Ctor_Image_Rectangle(Image image, Rectangle rectangle) @@ -118,7 +118,7 @@ public void Ctor_Image_Rectangle(Image image, Rectangle rectangle) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_Image_Rectangle_TestData))] public void Ctor_Image_RectangleF(Image image, Rectangle rectangle) @@ -154,7 +154,7 @@ public static IEnumerable Ctor_Image_WrapMode_Rectangle_TestData() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_Image_WrapMode_Rectangle_TestData))] public void Ctor_Image_WrapMode_Rectangle(Image image, WrapMode wrapMode, Rectangle rectangle) @@ -178,7 +178,7 @@ public void Ctor_Image_WrapMode_Rectangle(Image image, WrapMode wrapMode, Rectan } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_Image_WrapMode_Rectangle_TestData))] public void Ctor_Image_WrapMode_RectangleF(Image image, WrapMode wrapMode, Rectangle rectangle) @@ -215,7 +215,7 @@ public static IEnumerable Ctor_Image_Rectangle_ImageAttributes_TestDat } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_Image_Rectangle_ImageAttributes_TestData))] public void Ctor_Image_Rectangle_ImageAttributes(Image image, Rectangle rectangle, ImageAttributes attributes, WrapMode expectedWrapMode) @@ -240,7 +240,7 @@ public void Ctor_Image_Rectangle_ImageAttributes(Image image, Rectangle rectangl } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_Image_Rectangle_ImageAttributes_TestData))] public void Ctor_Image_RectangleF_ImageAttributes(Image image, Rectangle rectangle, ImageAttributes attributes, WrapMode expectedWrapMode) @@ -449,7 +449,7 @@ public void MultiplyTransform_DisposedMatrix_Nop() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(MatrixOrder.Prepend - 1)] [InlineData(MatrixOrder.Append + 1)] @@ -841,7 +841,7 @@ public void WrapMode_Tile_ReturnsExpected() }); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void WrapMode_TileFlipX_ReturnsExpected() { @@ -858,7 +858,7 @@ public void WrapMode_TileFlipX_ReturnsExpected() }); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void WrapMode_TileFlipY_ReturnsExpected() { @@ -875,7 +875,7 @@ public void WrapMode_TileFlipY_ReturnsExpected() }); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void WrapMode_TileFlipXY_ReturnsExpected() { diff --git a/src/libraries/System.Drawing.Common/tests/ToolboxBitmapAttributeTests.cs b/src/libraries/System.Drawing.Common/tests/ToolboxBitmapAttributeTests.cs index c92e23f2cd3815..119d902317e76c 100644 --- a/src/libraries/System.Drawing.Common/tests/ToolboxBitmapAttributeTests.cs +++ b/src/libraries/System.Drawing.Common/tests/ToolboxBitmapAttributeTests.cs @@ -26,7 +26,7 @@ private void AssertDefaultSize(Image image) { // On .NET Framework sometimes the size might be default or it might // be disposed in which case Size property throws an ArgumentException - // so allow both cases see https://github.com/dotnet/corefx/issues/27361. + // so allow both cases see https://github.com/dotnet/runtime/issues/25144. if (PlatformDetection.IsNetFramework && ex is ArgumentException) { return; @@ -43,7 +43,7 @@ public static IEnumerable Ctor_FileName_TestData() yield return new object[] { Helpers.GetTestBitmapPath("invalid.ico"), new Size(0, 0) }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Ctor_FileName_TestData))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] @@ -64,7 +64,7 @@ public void Ctor_FileName(string fileName, Size size) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(null, -1, -1)] [InlineData(typeof(ClassWithNoNamespace), -1, -1)] @@ -86,7 +86,7 @@ public void Ctor_Type(Type type, int width, int height) } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [InlineData(null, null, -1, -1)] [InlineData(null, "invalid.ico", -1, -1)] @@ -133,7 +133,7 @@ public void GetImage_TypeFileNameBool_ReturnsExpected(string fileName, int width } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetImage_NullComponent_ReturnsNull() { @@ -158,7 +158,7 @@ public void GetImage_Component_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void GetImage_Default_ReturnsExpected() { @@ -175,7 +175,7 @@ public void GetImage_Default_ReturnsExpected() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Logical name with no extension is not supported in .NET Framework")] [InlineData(typeof(Icon_toolboxBitmapAttributeTest), 256, 256)] @@ -204,7 +204,7 @@ public static IEnumerable Equals_TestData() yield return new object[] { ToolboxBitmapAttribute.Default, null, false }; } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Equals_TestData))] public void Equals_Other_ReturnsExpected(ToolboxBitmapAttribute attribute, object other, bool expected) diff --git a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/BmpCodecTests.cs b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/BmpCodecTests.cs index a418e7f9c62212..1444f2d04df8c7 100644 --- a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/BmpCodecTests.cs +++ b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/BmpCodecTests.cs @@ -4,7 +4,7 @@ // BMPCodec class testing unit // // Authors: -// Jordi Mas i Hernàndez (jordi@ximian.com) +// Jordi Mas i Hern?ndez (jordi@ximian.com) // Sebastien Pouliot // // (C) 2004 Ximian, Inc. http://www.ximian.com @@ -249,7 +249,7 @@ public void Bitmap24bitPixels() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void Bitmap24bitData() { string sInFile = Helpers.GetTestBitmapPath("almogaver24bits.bmp"); diff --git a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/GifCodecTests.cs b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/GifCodecTests.cs index da509217872227..4de572d99ab21d 100644 --- a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/GifCodecTests.cs +++ b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/GifCodecTests.cs @@ -4,7 +4,7 @@ // GIF Codec class testing unit // // Authors: -// Jordi Mas i Hernàndez (jordi@ximian.com) +// Jordi Mas i Hern?ndez (jordi@ximian.com) // Sebastien Pouliot // // Copyright (C) 2006, 2007 Novell, Inc (http://www.novell.com) @@ -109,7 +109,7 @@ public void Bitmap8bitsPixels_Gif87() Bitmap8bitsPixels(Helpers.GetTestBitmapPath("nature24bits87.gif")); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void Bitmap8bitsData() { string sInFile = Helpers.GetTestBitmapPath("nature24bits.gif"); diff --git a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/IconCodecTests.cs b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/IconCodecTests.cs index 98b9be194c8a0f..f082e760eea95b 100644 --- a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/IconCodecTests.cs +++ b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/IconCodecTests.cs @@ -4,7 +4,7 @@ // ICO Codec class testing unit // // Authors: -// Jordi Mas i Hernàndez (jordi@ximian.com) +// Jordi Mas i Hern?ndez (jordi@ximian.com) // Sebastien Pouliot // // Copyright (C) 2006-2007 Novell, Inc (http://www.novell.com) @@ -186,7 +186,7 @@ public void Bitmap16Pixels() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void Bitmap16Data() { string sInFile = Helpers.GetTestBitmapPath("48x48_multiple_entries_4bit.ico"); @@ -421,7 +421,7 @@ public void Bitmap32Pixels() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void Bitmap32Data() { string sInFile = Helpers.GetTestBitmapPath("VisualPng.ico"); @@ -663,7 +663,7 @@ public void Bitmap48Pixels() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void Bitmap48Data() { string sInFile = Helpers.GetTestBitmapPath("48x48_one_entry_1bit.ico"); @@ -889,7 +889,7 @@ public void Bitmap64Pixels() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void Bitmap64Data() { string sInFile = Helpers.GetTestBitmapPath("64x64_one_entry_8bit.ico"); @@ -1686,7 +1686,7 @@ public void Bitmap96Pixels() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void Bitmap96Data() { string sInFile = Helpers.GetTestBitmapPath("96x96_one_entry_8bit.ico"); diff --git a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/JpegCodecTests.cs b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/JpegCodecTests.cs index f33d495c092e71..dfbe6c3c12b258 100644 --- a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/JpegCodecTests.cs +++ b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/JpegCodecTests.cs @@ -4,7 +4,7 @@ // JpegCodec class testing unit // // Authors: -// Jordi Mas i Hernàndez (jordi@ximian.com) +// Jordi Mas i Hern?ndez (jordi@ximian.com) // Sebastien Pouliot // // (C) 2004 Ximian, Inc. http://www.ximian.com @@ -112,7 +112,7 @@ public void Bitmap8bbpIndexedGreyscalePixels() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotWindows7), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotWindows7), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void Bitmap8bbpIndexedGreyscaleData() { string sInFile = Helpers.GetTestBitmapPath("nature-greyscale.jpg"); @@ -233,7 +233,7 @@ public void Bitmap24bitPixels() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void Bitmap24bitData() { string sInFile = Helpers.GetTestBitmapPath("almogaver24bits.bmp"); diff --git a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/PngCodecTesst.cs b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/PngCodecTesst.cs index e77d33c839e697..4ca26e5905d2a4 100644 --- a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/PngCodecTesst.cs +++ b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/PngCodecTesst.cs @@ -4,7 +4,7 @@ // PNG Codec class testing unit // // Authors: -// Jordi Mas i Hernàndez (jordi@ximian.com) +// Jordi Mas i Hern?ndez (jordi@ximian.com) // Sebastien Pouliot // // Copyright (C) 2006, 2007 Novell, Inc (http://www.novell.com) @@ -37,7 +37,7 @@ namespace MonoTests.System.Drawing.Imaging { - [ActiveIssue("https://github.com/dotnet/corefx/issues/24354", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23691", TestPlatforms.AnyUnix)] public class PngCodecTest { private bool IsArm64Process() diff --git a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/TiffCodecTests.cs b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/TiffCodecTests.cs index 3306d08d68da77..93e408c31914e3 100644 --- a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/TiffCodecTests.cs +++ b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/TiffCodecTests.cs @@ -4,7 +4,7 @@ // TIFF Codec class testing unit // // Authors: -// Jordi Mas i Hernàndez (jordi@ximian.com) +// Jordi Mas i Hern?ndez (jordi@ximian.com) // Sebastien Pouliot // // Copyright (C) 2006, 2007 Novell, Inc (http://www.novell.com) @@ -65,7 +65,7 @@ public void Bitmap32bitsFeatures() /* Checks bitmap features on a known 32bbp bitmap */ [ConditionalFact(Helpers.IsDrawingSupported)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] public void Bitmap32bitsPixelFormat() { string sInFile = Helpers.GetTestBitmapPath("almogaver32bits.tif"); @@ -122,7 +122,7 @@ public void Bitmap32bitsPixels() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void Bitmap32bitsData() { string sInFile = Helpers.GetTestBitmapPath("almogaver32bits.tif"); diff --git a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing/BitmapTests.cs b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing/BitmapTests.cs index bc3ab080642531..4f32a7d623651c 100644 --- a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing/BitmapTests.cs +++ b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing/BitmapTests.cs @@ -4,7 +4,7 @@ // Bitmap class testing unit // // Authors: -// Jordi Mas i Hernàndez (jmas@softcatala.org> +// Jordi Mas i Hern?ndez (jmas@softcatala.org> // Jonathan Gilbert // Sebastien Pouliot // @@ -65,7 +65,7 @@ public void TestPixels() } [ConditionalFact(Helpers.IsDrawingSupported)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221")] public void LockBits_IndexedWrite_NonIndexed() { using (Bitmap bmp = new Bitmap(100, 100, PixelFormat.Format8bppIndexed)) @@ -76,7 +76,7 @@ public void LockBits_IndexedWrite_NonIndexed() } [ConditionalFact(Helpers.IsDrawingSupported)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221")] public void LockBits_NonIndexedWrite_ToIndexed() { using (Bitmap bmp = new Bitmap(100, 100, PixelFormat.Format32bppRgb)) @@ -90,7 +90,7 @@ public void LockBits_NonIndexedWrite_ToIndexed() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void LockBits_ImageLockMode_Invalid() { using (Bitmap bmp = new Bitmap(10, 10, PixelFormat.Format24bppRgb)) @@ -298,7 +298,7 @@ public void Format32bppArgb() } [ConditionalFact(Helpers.IsDrawingSupported)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221")] public void Format32bppRgb() { FormatTest(PixelFormat.Format32bppRgb); @@ -507,7 +507,7 @@ public void Rotate() // Rotate 1- and 4-bit bitmaps in different ways and check the // resulting pixels using MD5 - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] [InlineData("1bit.png", RotateFlipType.Rotate180FlipNone, "64AE60858A02228F7B1B18C7812FB6")] [InlineData("1bit.png", RotateFlipType.Rotate180FlipX, "353E937CFF31B1BF6C3DD0A031ACB5")] [InlineData("1bit.png", RotateFlipType.Rotate180FlipXY, "A4DAF507C92BDE10626BC7B34FEFE5")] @@ -630,7 +630,7 @@ private byte[] HashLock(Bitmap bmp, int width, int height, PixelFormat fmt, Imag private static byte[] DefaultBitmapHash = new byte[] { 0xD8, 0xD3, 0x68, 0x9C, 0x86, 0x7F, 0xB6, 0xA0, 0x76, 0xD6, 0x00, 0xEF, 0xFF, 0xE5, 0x8E, 0x1B }; private static byte[] FinalWholeBitmapHash = new byte[] { 0x5F, 0x52, 0x98, 0x37, 0xE3, 0x94, 0xE1, 0xA6, 0x06, 0x6C, 0x5B, 0xF1, 0xA9, 0xC2, 0xA9, 0x43 }; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void LockBitmap_Format32bppArgb_Format32bppArgb_ReadWrite_Whole() { using (Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb)) @@ -643,7 +643,7 @@ public void LockBitmap_Format32bppArgb_Format32bppArgb_ReadWrite_Whole() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void LockBitmap_Format32bppArgb_Format32bppPArgb_ReadWrite_Whole() { using (Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb)) @@ -657,7 +657,7 @@ public void LockBitmap_Format32bppArgb_Format32bppPArgb_ReadWrite_Whole() } [ConditionalFact(Helpers.IsDrawingSupported)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221")] public void LockBitmap_Format32bppArgb_Format32bppRgb_ReadWrite_Whole() { using (Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb)) @@ -670,7 +670,7 @@ public void LockBitmap_Format32bppArgb_Format32bppRgb_ReadWrite_Whole() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void LockBitmap_Format32bppArgb_Format24bppRgb_ReadWrite_Whole() { using (Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb)) @@ -685,7 +685,7 @@ public void LockBitmap_Format32bppArgb_Format24bppRgb_ReadWrite_Whole() private static byte[] FinalPartialBitmapHash = new byte[] { 0xED, 0xD8, 0xDC, 0x9B, 0x44, 0x00, 0x22, 0x9B, 0x07, 0x06, 0x4A, 0x21, 0x70, 0xA7, 0x31, 0x1D }; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void LockBitmap_Format32bppArgb_Format32bppArgb_ReadWrite_Partial() { using (Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb)) @@ -698,7 +698,7 @@ public void LockBitmap_Format32bppArgb_Format32bppArgb_ReadWrite_Partial() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void LockBitmap_Format32bppArgb_Format32bppPArgb_ReadWrite_Partial() { using (Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb)) @@ -712,7 +712,7 @@ public void LockBitmap_Format32bppArgb_Format32bppPArgb_ReadWrite_Partial() } [ConditionalFact(Helpers.IsDrawingSupported)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221")] public void LockBitmap_Format32bppArgb_Format32bppRgb_ReadWrite_Partial() { using (Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb)) @@ -725,7 +725,7 @@ public void LockBitmap_Format32bppArgb_Format32bppRgb_ReadWrite_Partial() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void LockBitmap_Format32bppArgb_Format24bppRgb_ReadWrite_Partial() { using (Bitmap bmp = CreateBitmap(100, 100, PixelFormat.Format32bppArgb)) @@ -740,7 +740,7 @@ public void LockBitmap_Format32bppArgb_Format24bppRgb_ReadWrite_Partial() // Tests the LockBitmap and UnlockBitmap functions, specifically the copying // of bitmap data in the directions indicated by the ImageLockMode. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDrawingSupported), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] public void LockUnlockBitmap() { BitmapData data; diff --git a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing/GraphicsTests.cs b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing/GraphicsTests.cs index 228b7ada0cb6c1..ef19f2d0e9e5b0 100644 --- a/src/libraries/System.Drawing.Common/tests/mono/System.Drawing/GraphicsTests.cs +++ b/src/libraries/System.Drawing.Common/tests/mono/System.Drawing/GraphicsTests.cs @@ -2307,7 +2307,7 @@ public void VisibleClipBound() { if (PlatformDetection.IsArmOrArm64Process) { - // [ActiveIssue("https://github.com/dotnet/corefx/issues/35744")] + // [ActiveIssue("https://github.com/dotnet/runtime/issues/28859")] throw new SkipTestException("Precision on float numbers"); } @@ -3162,7 +3162,7 @@ public void FillPath_Arcs() } } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20884", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void TransformPoints() { diff --git a/src/libraries/System.Drawing.Primitives/ref/System.Drawing.Primitives.cs b/src/libraries/System.Drawing.Primitives/ref/System.Drawing.Primitives.cs index 9b1ab0770a9702..1ad21cceba63a1 100644 --- a/src/libraries/System.Drawing.Primitives/ref/System.Drawing.Primitives.cs +++ b/src/libraries/System.Drawing.Primitives/ref/System.Drawing.Primitives.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.Drawing diff --git a/src/libraries/System.Drawing.Primitives/tests/PointFTests.cs b/src/libraries/System.Drawing.Primitives/tests/PointFTests.cs index 29621c6ef9e6a5..5da17cf78c1e9e 100644 --- a/src/libraries/System.Drawing.Primitives/tests/PointFTests.cs +++ b/src/libraries/System.Drawing.Primitives/tests/PointFTests.cs @@ -135,7 +135,7 @@ public static void EqualityTest_NotPointF() // If PointF implements IEquatable (e.g. in .NET Core), then classes that are implicitly // convertible to PointF can potentially be equal. - // See https://github.com/dotnet/corefx/issues/5255. + // See https://github.com/dotnet/runtime/issues/16050. bool expectsImplicitCastToPointF = typeof(IEquatable).IsAssignableFrom(point.GetType()); Assert.Equal(expectsImplicitCastToPointF, point.Equals(new Point(0, 0))); diff --git a/src/libraries/System.Drawing.Primitives/tests/RectangleFTests.cs b/src/libraries/System.Drawing.Primitives/tests/RectangleFTests.cs index a496eb67a4abf9..4a94a0c04d1e32 100644 --- a/src/libraries/System.Drawing.Primitives/tests/RectangleFTests.cs +++ b/src/libraries/System.Drawing.Primitives/tests/RectangleFTests.cs @@ -129,7 +129,7 @@ public static void EqualityTest_NotRectangleF() // If RectangleF implements IEquatable (e.g. in .NET Core), then classes that are implicitly // convertible to RectangleF can potentially be equal. - // See https://github.com/dotnet/corefx/issues/5255. + // See https://github.com/dotnet/runtime/issues/16050. bool expectsImplicitCastToRectangleF = typeof(IEquatable).IsAssignableFrom(rectangle.GetType()); Assert.Equal(expectsImplicitCastToRectangleF, rectangle.Equals(new Rectangle(0, 0, 0, 0))); diff --git a/src/libraries/System.Drawing.Primitives/tests/SizeFTests.cs b/src/libraries/System.Drawing.Primitives/tests/SizeFTests.cs index e3d4e6869b04de..e7924d2f84133c 100644 --- a/src/libraries/System.Drawing.Primitives/tests/SizeFTests.cs +++ b/src/libraries/System.Drawing.Primitives/tests/SizeFTests.cs @@ -111,7 +111,7 @@ public static void EqualityTest_NotSizeF() // If SizeF implements IEquatable (e.g in .NET Core), then classes that are implicitly // convertible to SizeF can potentially be equal. - // See https://github.com/dotnet/corefx/issues/5255. + // See https://github.com/dotnet/runtime/issues/16050. bool expectsImplicitCastToSizeF = typeof(IEquatable).IsAssignableFrom(size.GetType()); Assert.Equal(expectsImplicitCastToSizeF, size.Equals(new Size(0, 0))); diff --git a/src/libraries/System.Dynamic.Runtime/ref/System.Dynamic.Runtime.Forwards.cs b/src/libraries/System.Dynamic.Runtime/ref/System.Dynamic.Runtime.Forwards.cs index 9217dd48b5d121..90ac70cd4954d7 100644 --- a/src/libraries/System.Dynamic.Runtime/ref/System.Dynamic.Runtime.Forwards.cs +++ b/src/libraries/System.Dynamic.Runtime/ref/System.Dynamic.Runtime.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallSiteBinder))] diff --git a/src/libraries/System.Dynamic.Runtime/ref/System.Dynamic.Runtime.cs b/src/libraries/System.Dynamic.Runtime/ref/System.Dynamic.Runtime.cs index fc0f2b93ff65b2..0a321b5f377c7a 100644 --- a/src/libraries/System.Dynamic.Runtime/ref/System.Dynamic.Runtime.cs +++ b/src/libraries/System.Dynamic.Runtime/ref/System.Dynamic.Runtime.cs @@ -2,5 +2,5 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ diff --git a/src/libraries/System.Dynamic.Runtime/tests/Dynamic.OverloadResolution/Conformance.dynamic.overloadResolution.Methods.1class2methods.cs b/src/libraries/System.Dynamic.Runtime/tests/Dynamic.OverloadResolution/Conformance.dynamic.overloadResolution.Methods.1class2methods.cs index 870d9a20a45905..7c1ae18d39fe27 100644 --- a/src/libraries/System.Dynamic.Runtime/tests/Dynamic.OverloadResolution/Conformance.dynamic.overloadResolution.Methods.1class2methods.cs +++ b/src/libraries/System.Dynamic.Runtime/tests/Dynamic.OverloadResolution/Conformance.dynamic.overloadResolution.Methods.1class2methods.cs @@ -3995,6 +3995,7 @@ public void Method(int f, ref object x) public class Test { [Fact] + [ActiveIssue("https://github.com/mono/mono/issues/14906", TestRuntimes.Mono)] public static void DynamicCSharpRunTest() { Assert.Equal(0, MainMethod(null)); diff --git a/src/libraries/System.Globalization.Calendars/ref/System.Globalization.Calendars.Forwards.cs b/src/libraries/System.Globalization.Calendars/ref/System.Globalization.Calendars.Forwards.cs index 5d38c30b19495e..c01f44c85397f7 100644 --- a/src/libraries/System.Globalization.Calendars/ref/System.Globalization.Calendars.Forwards.cs +++ b/src/libraries/System.Globalization.Calendars/ref/System.Globalization.Calendars.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Globalization.ChineseLunisolarCalendar))] diff --git a/src/libraries/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj b/src/libraries/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj index 950aa06228a97f..2a140980934ff6 100644 --- a/src/libraries/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj +++ b/src/libraries/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj @@ -6,7 +6,7 @@ System.Globalization.Extensions true true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingGetAsciiTests.cs b/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingGetAsciiTests.cs index 46e8348b1219a4..ddd5fc9b62a13e 100644 --- a/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingGetAsciiTests.cs +++ b/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingGetAsciiTests.cs @@ -22,7 +22,7 @@ public static IEnumerable GetAscii_TestData() continue; } string ascii = c.ToString(); - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // expected platform differences, see https://github.com/dotnet/corefx/issues/8242 + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // expected platform differences, see https://github.com/dotnet/runtime/issues/17190 { if ((c >= 'A' && c <= 'Z')) { @@ -133,7 +133,7 @@ public static IEnumerable GetAscii_Invalid_TestData() yield return new object[] { "\u0061\u0062\u0063.\u305D\u306E\u30B9\u30D4\u30FC\u30C9\u3067.\u30D1\u30D5\u30A3\u30FC\u0064\u0065\u30EB\u30F3\u30D0", 3, 9, typeof(ArgumentException) }; yield return new object[] { "\u0061\u0062\u0063.\u305D\u306E\u30B9\u30D4\u30FC\u30C9\u3067.\u30D1\u30D5\u30A3\u30FC\u0064\u0065\u30EB\u30F3\u30D0", 11, 10, typeof(ArgumentException) }; - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // expected platform differences, see https://github.com/dotnet/corefx/issues/8242 + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // expected platform differences, see https://github.com/dotnet/runtime/issues/17190 { if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { diff --git a/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingGetUnicodeTests.cs b/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingGetUnicodeTests.cs index 0853309820b3df..3d3b5685fad05a 100644 --- a/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingGetUnicodeTests.cs +++ b/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingGetUnicodeTests.cs @@ -96,7 +96,7 @@ public static IEnumerable GetUnicode_Invalid_TestData() yield return new object[] { "abc" + (char)0x7F + "def", 0, 7, typeof(ArgumentException) }; - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // expected platform differences, see https://github.com/dotnet/corefx/issues/8242 + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // expected platform differences, see https://github.com/dotnet/runtime/issues/17190 { yield return new object[] { "xn--\u1234", 0, 5, typeof(ArgumentException) }; yield return new object[] { "xn--\u1234pck", 0, 8, typeof(ArgumentException) }; diff --git a/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingIdnaConformanceTests.cs b/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingIdnaConformanceTests.cs index e555273333bfa3..650e8b53e50029 100644 --- a/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingIdnaConformanceTests.cs +++ b/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingIdnaConformanceTests.cs @@ -80,7 +80,7 @@ public void GetUnicode_Success() /// from the 6.0\IdnaTest.txt. To find them, search for "GETASCII DOES NOT FAIL ON WINDOWS 8.1" /// Same applies to Windows 10 >= 10.0.15063 in the IdnaTest_9.txt file /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // https://github.com/dotnet/corefx/issues/21332 + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // https://github.com/dotnet/runtime/issues/22409 public void GetAscii_Invalid() { Assert.All(Factory.GetDataset().Where(entry => !entry.ASCIIResult.Success), entry => diff --git a/src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.LastIndexOf.cs b/src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.LastIndexOf.cs index 9026f8881fd9fd..459f0b74d9f050 100644 --- a/src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.LastIndexOf.cs +++ b/src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.LastIndexOf.cs @@ -166,7 +166,7 @@ public void LastIndexOf_String(CompareInfo compareInfo, string source, string va // Use int MemoryExtensions.LastIndexOf(this ReadOnlySpan, ReadOnlySpan, StringComparison) // Filter differences betweeen string-based and Span-based LastIndexOf - // - Empty value handling - https://github.com/dotnet/coreclr/issues/26608 + // - Empty value handling - https://github.com/dotnet/runtime/issues/13382 // - Negative count if (value.Length == 0 || count < 0) return; diff --git a/src/libraries/System.Globalization/tests/Invariant/InvariantMode.cs b/src/libraries/System.Globalization/tests/Invariant/InvariantMode.cs index 2089e849062757..5291add4c7d402 100644 --- a/src/libraries/System.Globalization/tests/Invariant/InvariantMode.cs +++ b/src/libraries/System.Globalization/tests/Invariant/InvariantMode.cs @@ -702,7 +702,7 @@ public void TestLastIndexOf(string source, string value, int startIndex, int cou Assert.Equal(result, source.LastIndexOf(value, startIndex, count, GetStringComparison(options))); // Filter differences betweeen string-based and Span-based LastIndexOf - // - Empty value handling - https://github.com/dotnet/coreclr/issues/26608 + // - Empty value handling - https://github.com/dotnet/runtime/issues/13382 // - Negative count if (value.Length == 0 || count < 0) continue; diff --git a/src/libraries/System.Globalization/tests/System/Globalization/RegionInfoTests.cs b/src/libraries/System.Globalization/tests/System/Globalization/RegionInfoTests.cs index 9cabbb8812bb89..204365e4da4346 100644 --- a/src/libraries/System.Globalization/tests/System/Globalization/RegionInfoTests.cs +++ b/src/libraries/System.Globalization/tests/System/Globalization/RegionInfoTests.cs @@ -65,7 +65,7 @@ public void CurrentRegion() [Theory] [InlineData("en-US", "United States")] - [OuterLoop("May fail on machines with multiple language packs installed")] // see https://github.com/dotnet/corefx/issues/39177 + [OuterLoop("May fail on machines with multiple language packs installed")] // see https://github.com/dotnet/runtime/issues/30132 public void DisplayName(string name, string expected) { using (new ThreadCultureChange(null, new CultureInfo(name))) diff --git a/src/libraries/System.IO.Compression.Brotli/ref/System.IO.Compression.Brotli.cs b/src/libraries/System.IO.Compression.Brotli/ref/System.IO.Compression.Brotli.cs index 8ff7be3d4cc594..9fce293a2a44d5 100644 --- a/src/libraries/System.IO.Compression.Brotli/ref/System.IO.Compression.Brotli.cs +++ b/src/libraries/System.IO.Compression.Brotli/ref/System.IO.Compression.Brotli.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO.Compression diff --git a/src/libraries/System.IO.Compression.Brotli/src/System.IO.Compression.Brotli.csproj b/src/libraries/System.IO.Compression.Brotli/src/System.IO.Compression.Brotli.csproj index 5c70d39ff6cc85..626ab0f48a792b 100644 --- a/src/libraries/System.IO.Compression.Brotli/src/System.IO.Compression.Brotli.csproj +++ b/src/libraries/System.IO.Compression.Brotli/src/System.IO.Compression.Brotli.csproj @@ -4,7 +4,7 @@ Library true enable - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj b/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj index b1943d26b22987..6cd5df420f23f9 100644 --- a/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj +++ b/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj @@ -1,7 +1,6 @@ - $(DefineConstants);STREAM_MEMORY_OVERLOADS_AVAILABLE - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.IO.Compression.ZipFile/ref/System.IO.Compression.ZipFile.cs b/src/libraries/System.IO.Compression.ZipFile/ref/System.IO.Compression.ZipFile.cs index 795c4156b97623..f5ff1c854acc36 100644 --- a/src/libraries/System.IO.Compression.ZipFile/ref/System.IO.Compression.ZipFile.cs +++ b/src/libraries/System.IO.Compression.ZipFile/ref/System.IO.Compression.ZipFile.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO.Compression diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs index 9a238043730a63..e46c9b8574ae72 100644 --- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs +++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs @@ -68,7 +68,6 @@ public static partial class ZipFile /// If the file exists and is not a Zip file, a ZipArchiveException will be thrown. /// If the file exists and is empty or does not exist, a new Zip file will be created. /// Note that creating a Zip file with the ZipArchiveMode.Create mode is more efficient when creating a new Zip file. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] // See comment in the body. public static ZipArchive Open(string archiveFileName, ZipArchiveMode mode) => Open(archiveFileName, mode, entryNameEncoding: null); /// @@ -145,7 +144,6 @@ public static partial class ZipFile /// Note that Unicode encodings other than UTF-8 may not be currently used for the entryNameEncoding, /// otherwise an is thrown. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] // See comment in the body. public static ZipArchive Open(string archiveFileName, ZipArchiveMode mode, Encoding? entryNameEncoding) { // Relies on FileStream's ctor for checking of archiveFileName diff --git a/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Extract.cs b/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Extract.cs index 4755e57648f692..e01d2e71632d94 100644 --- a/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Extract.cs +++ b/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Extract.cs @@ -66,7 +66,7 @@ public void ExtractOutOfRoot(string entryName) /// This test ensures that a zipfile with path names that are invalid to this OS will throw errors /// when an attempt is made to extract them. /// - [ActiveIssue("https://github.com/dotnet/corefx/issues/25665")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24327")] [Theory] [InlineData("NullCharFileName_FromWindows")] [InlineData("NullCharFileName_FromUnix")] @@ -96,7 +96,7 @@ public void Unix_ZipWithOSSpecificFileNames(string zipName, string fileName) /// when an attempt is made to extract them. /// [Theory] - [ActiveIssue("https://github.com/dotnet/corefx/issues/27269")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/25099")] [InlineData("WindowsInvalid_FromUnix", null)] [InlineData("WindowsInvalid_FromWindows", null)] [InlineData("NullCharFileName_FromWindows", "path")] diff --git a/src/libraries/System.IO.Compression/ref/System.IO.Compression.cs b/src/libraries/System.IO.Compression/ref/System.IO.Compression.cs index fbea7ccd916a70..c2444c3e874a41 100644 --- a/src/libraries/System.IO.Compression/ref/System.IO.Compression.cs +++ b/src/libraries/System.IO.Compression/ref/System.IO.Compression.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO.Compression diff --git a/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj b/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj index e5fcafd683bebc..5efabca1ba8c2a 100644 --- a/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj +++ b/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj @@ -3,7 +3,7 @@ System.IO.Compression Library true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix enable diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/PositionPreservingWriteOnlyStreamWrapper.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/PositionPreservingWriteOnlyStreamWrapper.cs index 0d40b542541716..a275be1cfab3d6 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/PositionPreservingWriteOnlyStreamWrapper.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/PositionPreservingWriteOnlyStreamWrapper.cs @@ -42,7 +42,7 @@ public override void Write(ReadOnlySpan buffer) _stream.Write(buffer); } - public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object? state) + public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state) { _position += count; return _stream.BeginWrite(buffer, offset, count, callback, state); diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs index 063fc39d6a0088..e48c9e731ef4dd 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs @@ -10,7 +10,6 @@ namespace System.IO.Compression { // The disposable fields that this class owns get disposed when the ZipArchive it belongs to gets disposed - [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] public partial class ZipArchiveEntry { // The maximum index of our buffers, from the maximum index of a byte array diff --git a/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj b/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj index 8c5f4c3e3ce1de..20bb882a1b9626 100644 --- a/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj +++ b/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj @@ -1,8 +1,6 @@ - - $(DefineConstants);STREAM_MEMORY_OVERLOADS_AVAILABLE - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.IO.Compression/tests/ZipArchive/zip_CreateTests.cs b/src/libraries/System.IO.Compression/tests/ZipArchive/zip_CreateTests.cs index 714edef7f7bb26..b69891858ddfd0 100644 --- a/src/libraries/System.IO.Compression/tests/ZipArchive/zip_CreateTests.cs +++ b/src/libraries/System.IO.Compression/tests/ZipArchive/zip_CreateTests.cs @@ -89,7 +89,6 @@ public static async Task CreateNormal_Unseekable(string folder) } [Fact] - [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Jenkins fails with unicode characters [JENKINS-12610] public static async Task CreateNormal_Unicode_Seekable() { using (var s = new MemoryStream()) @@ -102,7 +101,6 @@ public static async Task CreateNormal_Unicode_Seekable() } [Fact] - [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Jenkins fails with unicode characters [JENKINS-12610] public static async Task CreateNormal_Unicode_Unseekable() { using (var s = new MemoryStream()) diff --git a/src/libraries/System.IO.FileSystem.AccessControl/ref/System.IO.FileSystem.AccessControl.cs b/src/libraries/System.IO.FileSystem.AccessControl/ref/System.IO.FileSystem.AccessControl.cs index ee9ec7559c181b..9fe32ae8e4da95 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/ref/System.IO.FileSystem.AccessControl.cs +++ b/src/libraries/System.IO.FileSystem.AccessControl/ref/System.IO.FileSystem.AccessControl.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO diff --git a/src/libraries/System.IO.FileSystem.AccessControl/ref/System.IO.FileSystem.AccessControl.csproj b/src/libraries/System.IO.FileSystem.AccessControl/ref/System.IO.FileSystem.AccessControl.csproj index cf85135ff1bfe0..aab3abf65abaf6 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/ref/System.IO.FileSystem.AccessControl.csproj +++ b/src/libraries/System.IO.FileSystem.AccessControl/ref/System.IO.FileSystem.AccessControl.csproj @@ -2,7 +2,8 @@ true netstandard2.0;$(NetFrameworkCurrent);net461 - true + true + enable diff --git a/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj b/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj index aebcf7f5604860..890edd52f323f2 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj +++ b/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj @@ -1,12 +1,12 @@ - + true true SR.PlatformNotSupported_AccessControl - netstandard2.0;netstandard2.0-Windows_NT;net461-Windows_NT;$(NetCoreAppCurrent)-Windows_NT;$(NetFrameworkCurrent)-Windows_NT - true - true - annotations + $(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netstandard2.0-Windows_NT;net461-Windows_NT;$(NetFrameworkCurrent)-Windows_NT + true + true + enable diff --git a/src/libraries/System.IO.FileSystem.AccessControl/src/System/IO/FileSystemAclExtensions.cs b/src/libraries/System.IO.FileSystem.AccessControl/src/System/IO/FileSystemAclExtensions.cs index e660091c41712f..80d3dd72a4ac66 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/src/System/IO/FileSystemAclExtensions.cs +++ b/src/libraries/System.IO.FileSystem.AccessControl/src/System/IO/FileSystemAclExtensions.cs @@ -322,7 +322,7 @@ private static void ValidateFileHandle(SafeFileHandle handle, string fullPath) // probably be consistent w/ every other directory. int errorCode = Marshal.GetLastWin32Error(); - if (errorCode == Interop.Errors.ERROR_PATH_NOT_FOUND && fullPath.Length == Path.GetPathRoot(fullPath).Length) + if (errorCode == Interop.Errors.ERROR_PATH_NOT_FOUND && fullPath.Length == Path.GetPathRoot(fullPath)!.Length) { errorCode = Interop.Errors.ERROR_ACCESS_DENIED; } diff --git a/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/DirectoryObjectSecurity.cs b/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/DirectoryObjectSecurity.cs index 7bfd44f1b85f8b..6ec2ff89ffa2de 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/DirectoryObjectSecurity.cs +++ b/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/DirectoryObjectSecurity.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Diagnostics; using System.Security.Principal; namespace System.Security.AccessControl @@ -58,7 +59,7 @@ private AuthorizationRuleCollection GetRules(bool access, bool includeExplicit, throw new ArgumentException(SR.Arg_MustBeIdentityReferenceType, nameof(targetType)); } - CommonAcl acl = null; + CommonAcl? acl = null; if (access) { @@ -83,7 +84,7 @@ private AuthorizationRuleCollection GetRules(bool access, bool includeExplicit, return result; } - IdentityReferenceCollection irTarget = null; + IdentityReferenceCollection? irTarget = null; if (targetType != typeof(SecurityIdentifier)) { @@ -100,7 +101,7 @@ private AuthorizationRuleCollection GetRules(bool access, bool includeExplicit, // A better way would be to have an internal method that would canonicalize the ACL // and call it once, then use the RawAcl. // - QualifiedAce ace = acl[i] as QualifiedAce; + QualifiedAce? ace = acl[i] as QualifiedAce; if (ace == null) { @@ -150,7 +151,7 @@ private AuthorizationRuleCollection GetRules(bool access, bool includeExplicit, // A better way would be to have an internal method that would canonicalize the ACL // and call it once, then use the RawAcl. // - QualifiedAce ace = acl[i] as CommonAce; + QualifiedAce? ace = acl[i] as CommonAce; if (ace == null) { @@ -189,7 +190,7 @@ private AuthorizationRuleCollection GetRules(bool access, bool includeExplicit, if ((includeExplicit && ((ace.AceFlags & AceFlags.Inherited) == 0)) || (includeInherited && ((ace.AceFlags & AceFlags.Inherited) != 0))) { - IdentityReference iref = (targetType == typeof(SecurityIdentifier)) ? ace.SecurityIdentifier : irTarget[i]; + IdentityReference iref = (targetType == typeof(SecurityIdentifier)) ? ace.SecurityIdentifier : irTarget![i]; if (access) { @@ -204,15 +205,13 @@ private AuthorizationRuleCollection GetRules(bool access, bool includeExplicit, type = AccessControlType.Deny; } - if (ace is ObjectAce) + if (ace is ObjectAce objectAce) { - ObjectAce objectAce = ace as ObjectAce; - result.AddRule(AccessRuleFactory(iref, objectAce.AccessMask, objectAce.IsInherited, objectAce.InheritanceFlags, objectAce.PropagationFlags, type, objectAce.ObjectAceType, objectAce.InheritedObjectAceType)); } else { - CommonAce commonAce = ace as CommonAce; + CommonAce? commonAce = ace as CommonAce; if (commonAce == null) { @@ -224,15 +223,13 @@ private AuthorizationRuleCollection GetRules(bool access, bool includeExplicit, } else { - if (ace is ObjectAce) + if (ace is ObjectAce objectAce) { - ObjectAce objectAce = ace as ObjectAce; - result.AddRule(AuditRuleFactory(iref, objectAce.AccessMask, objectAce.IsInherited, objectAce.InheritanceFlags, objectAce.PropagationFlags, objectAce.AuditFlags, objectAce.ObjectAceType, objectAce.InheritedObjectAceType)); } else { - CommonAce commonAce = ace as CommonAce; + CommonAce? commonAce = ace as CommonAce; if (commonAce == null) { @@ -291,8 +288,9 @@ private bool ModifyAccess(AccessControlModification modification, ObjectAccessRu } } - SecurityIdentifier sid = rule.IdentityReference.Translate(typeof(SecurityIdentifier)) as SecurityIdentifier; + SecurityIdentifier sid = (SecurityIdentifier)rule.IdentityReference.Translate(typeof(SecurityIdentifier)); + Debug.Assert(SecurityDescriptor.DiscretionaryAcl != null); if (rule.AccessControlType == AccessControlType.Allow) { switch (modification) @@ -431,8 +429,9 @@ private bool ModifyAudit(AccessControlModification modification, ObjectAuditRule } } - SecurityIdentifier sid = rule.IdentityReference.Translate(typeof(SecurityIdentifier)) as SecurityIdentifier; + SecurityIdentifier sid = (SecurityIdentifier)rule.IdentityReference.Translate(typeof(SecurityIdentifier)); + Debug.Assert(SecurityDescriptor.SystemAcl != null); switch (modification) { case AccessControlModification.Add: @@ -504,7 +503,7 @@ protected override bool ModifyAccess(AccessControlModification modification, Acc // SR.AccessControl_InvalidAccessRuleType, // "rule"); //} - return ModifyAccess(modification, rule as ObjectAccessRule, out modified); + return ModifyAccess(modification, (ObjectAccessRule)rule, out modified); } protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified) @@ -516,7 +515,7 @@ protected override bool ModifyAudit(AccessControlModification modification, Audi // SR.AccessControl_InvalidAuditRuleType, // "rule"); //} - return ModifyAudit(modification, rule as ObjectAuditRule, out modified); + return ModifyAudit(modification, (ObjectAuditRule)rule, out modified); } #endregion diff --git a/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/FileSecurity.cs b/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/FileSecurity.cs index ac531a937d5e1e..8a4a089f1fd4ba 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/FileSecurity.cs +++ b/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/FileSecurity.cs @@ -19,7 +19,7 @@ public FileSecurity(string fileName, AccessControlSections includeSections) { } - internal FileSecurity(SafeFileHandle handle, AccessControlSections includeSections) + internal FileSecurity(SafeFileHandle? handle, AccessControlSections includeSections) : base(false, handle, includeSections, false) { } diff --git a/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/FileSystemSecurity.cs b/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/FileSystemSecurity.cs index e17cbf542322fe..311ded95de0a71 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/FileSystemSecurity.cs +++ b/src/libraries/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/FileSystemSecurity.cs @@ -23,14 +23,14 @@ internal FileSystemSecurity(bool isContainer, string name, AccessControlSections { } - internal FileSystemSecurity(bool isContainer, SafeFileHandle handle, AccessControlSections includeSections, bool isDirectory) + internal FileSystemSecurity(bool isContainer, SafeFileHandle? handle, AccessControlSections includeSections, bool isDirectory) : base(isContainer, s_ResourceType, handle, includeSections, _HandleErrorCode, isDirectory) { } - private static Exception _HandleErrorCode(int errorCode, string name, SafeHandle handle, object context) + private static Exception? _HandleErrorCode(int errorCode, string? name, SafeHandle? handle, object? context) { - Exception exception = null; + Exception? exception = null; switch (errorCode) { @@ -176,9 +176,7 @@ public bool RemoveAccessRule(FileSystemAccessRule rule) for (int i = 0; i < rules.Count; i++) { - FileSystemAccessRule fsrule = rules[i] as FileSystemAccessRule; - - if ((fsrule != null) && (fsrule.FileSystemRights == rule.FileSystemRights) + if ((rules[i] is FileSystemAccessRule fsrule) && (fsrule.FileSystemRights == rule.FileSystemRights) && (fsrule.IdentityReference == rule.IdentityReference) && (fsrule.AccessControlType == rule.AccessControlType)) { @@ -222,9 +220,7 @@ public void RemoveAccessRuleSpecific(FileSystemAccessRule rule) for (int i = 0; i < rules.Count; i++) { - FileSystemAccessRule fsrule = rules[i] as FileSystemAccessRule; - - if ((fsrule != null) && (fsrule.FileSystemRights == rule.FileSystemRights) + if ((rules[i] is FileSystemAccessRule fsrule) && (fsrule.FileSystemRights == rule.FileSystemRights) && (fsrule.IdentityReference == rule.IdentityReference) && (fsrule.AccessControlType == rule.AccessControlType)) { diff --git a/src/libraries/System.IO.FileSystem.AccessControl/tests/DirectoryObjectSecurityTests.cs b/src/libraries/System.IO.FileSystem.AccessControl/tests/DirectoryObjectSecurityTests.cs index 99ac0b446498eb..a190dfc00927d4 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/tests/DirectoryObjectSecurityTests.cs +++ b/src/libraries/System.IO.FileSystem.AccessControl/tests/DirectoryObjectSecurityTests.cs @@ -25,7 +25,7 @@ public void SetCustomDescriptor_Success() // We didn't allow setting the security descriptor in core due to assembly refactoring. // GetAccessRules() would throw a null ref after setting the descriptor. We now expose // the descriptor as a protected property (instead of internal). - // https://github.com/dotnet/corefx/issues/34151 + // https://github.com/dotnet/runtime/issues/28233 var customObjectSecurity = new CustomDirectoryObjectSecurity(); @@ -68,7 +68,7 @@ public void ObjectInitialization_InvalidSecurityDescriptor() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/24903", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/23972", TargetFrameworkMonikers.NetFramework)] public void GetAccessRules_InvalidTargetType() { var activeDirectorySecurity = new ActiveDirectorySecurity(); diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/ref/System.IO.FileSystem.DriveInfo.cs b/src/libraries/System.IO.FileSystem.DriveInfo/ref/System.IO.FileSystem.DriveInfo.cs index f76bd6cc7f89b6..e335ab26bbccfd 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/ref/System.IO.FileSystem.DriveInfo.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/ref/System.IO.FileSystem.DriveInfo.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj b/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj index c73065728f8c18..716da85edb8037 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj +++ b/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj @@ -3,7 +3,7 @@ System.IO.FileSystem.DriveInfo System.IO.FileSystem.DriveInfo true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix enable diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs index 65b155e6799106..ab2add6d750ef9 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs @@ -60,7 +60,7 @@ public void PropertiesOfInvalidDrive() Assert.Equal(invalidDriveName, invalidDrive.VolumeLabel); // VolumeLabel is equivalent to Name on Unix } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/11570 + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/runtime/issues/18487 [PlatformSpecific(TestPlatforms.AnyUnix)] public void PropertiesOfValidDrive() { diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/tests/System.IO.FileSystem.DriveInfo.Tests.csproj b/src/libraries/System.IO.FileSystem.DriveInfo/tests/System.IO.FileSystem.DriveInfo.Tests.csproj index b8d990c88bccee..54b3f750ff9e03 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/tests/System.IO.FileSystem.DriveInfo.Tests.csproj +++ b/src/libraries/System.IO.FileSystem.DriveInfo/tests/System.IO.FileSystem.DriveInfo.Tests.csproj @@ -1,6 +1,6 @@ - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.IO.FileSystem.Primitives/ref/System.IO.FileSystem.Primitives.Forwards.cs b/src/libraries/System.IO.FileSystem.Primitives/ref/System.IO.FileSystem.Primitives.Forwards.cs index cac771b9c7ba57..c9230481319d5d 100644 --- a/src/libraries/System.IO.FileSystem.Primitives/ref/System.IO.FileSystem.Primitives.Forwards.cs +++ b/src/libraries/System.IO.FileSystem.Primitives/ref/System.IO.FileSystem.Primitives.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.SafeFileHandle))] diff --git a/src/libraries/System.IO.FileSystem.Primitives/ref/System.IO.FileSystem.Primitives.cs b/src/libraries/System.IO.FileSystem.Primitives/ref/System.IO.FileSystem.Primitives.cs index fc0f2b93ff65b2..0a321b5f377c7a 100644 --- a/src/libraries/System.IO.FileSystem.Primitives/ref/System.IO.FileSystem.Primitives.cs +++ b/src/libraries/System.IO.FileSystem.Primitives/ref/System.IO.FileSystem.Primitives.cs @@ -2,5 +2,5 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ diff --git a/src/libraries/System.IO.FileSystem.Watcher/ref/System.IO.FileSystem.Watcher.cs b/src/libraries/System.IO.FileSystem.Watcher/ref/System.IO.FileSystem.Watcher.cs index 86a892b0482924..c4c1f927fecb4f 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/ref/System.IO.FileSystem.Watcher.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/ref/System.IO.FileSystem.Watcher.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO diff --git a/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj b/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj index 65ad72fc73cbf4..a005804e5df54c 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj +++ b/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj @@ -1,7 +1,7 @@ true - $(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD enable diff --git a/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs b/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs index 79e3c5e11a9c01..9a69d22219df01 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs @@ -472,7 +472,6 @@ private void NotifyFileSystemEventArgs(WatcherChangeTypes changeType, string nam /// /// Raises the event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] protected void OnChanged(FileSystemEventArgs e) { InvokeOn(e, _onChangedHandler); @@ -481,7 +480,6 @@ protected void OnChanged(FileSystemEventArgs e) /// /// Raises the event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] protected void OnCreated(FileSystemEventArgs e) { InvokeOn(e, _onCreatedHandler); @@ -490,7 +488,6 @@ protected void OnCreated(FileSystemEventArgs e) /// /// Raises the event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] protected void OnDeleted(FileSystemEventArgs e) { InvokeOn(e, _onDeletedHandler); @@ -511,7 +508,6 @@ private void InvokeOn(FileSystemEventArgs e, FileSystemEventHandler? handler) /// /// Raises the event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] protected void OnError(ErrorEventArgs e) { ErrorEventHandler? handler = _onErrorHandler; @@ -528,7 +524,6 @@ protected void OnError(ErrorEventArgs e) /// /// Raises the event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] protected void OnRenamed(RenamedEventArgs e) { RenamedEventHandler? handler = _onRenamedHandler; diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs index 6347d5695bf374..dae3a1ab2cdd18 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs @@ -86,7 +86,7 @@ public void Linux_File_Move_To_Different_Watched_Directory() [Fact] public void File_Move_From_Unwatched_To_Watched() { - // TODO remove OS version check after https://github.com/dotnet/corefx/issues/40034 fixed + // TODO remove OS version check after https://github.com/dotnet/runtime/issues/30491 fixed if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || Environment.OSVersion.Version.Major < 19) { FileMove_FromUnwatchedToWatched(WatcherChangeTypes.Created); diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Unix.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Unix.cs index 615706d692f7aa..9d9ed743e0f723 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Unix.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Unix.cs @@ -10,6 +10,7 @@ using System.Runtime.InteropServices; using System.Threading; using Microsoft.DotNet.XUnitExtensions; +using Microsoft.DotNet.RemoteExecutor; using Xunit; using Xunit.Abstractions; @@ -23,34 +24,43 @@ public void FileSystemWatcher_Unix_DoesNotLeak() { Interop.Sys.GetRLimit(Interop.Sys.RlimitResources.RLIMIT_NOFILE, out Interop.Sys.RLimit limits); _output.WriteLine("File descriptor limit is {0}", limits.CurrentLimit); + _output.WriteLine($"Starting 100/200 test on {TestDirectory}"); - if (limits.CurrentLimit > 50_000) + RemoteInvokeOptions options = new RemoteInvokeOptions { TimeOut = 600_000 }; + RemoteExecutor.Invoke(testDirectory => { - throw new SkipTestException($"File descriptor limit is too high {limits.CurrentLimit}."); - } + ulong maxFd = 200; + int count = 100; + Interop.Sys.RLimit limits = new Interop.Sys.RLimit { CurrentLimit = maxFd, MaximumLimit = maxFd}; - try { - for (int i = 0; i < (int)limits.CurrentLimit; i++) + // Set open file limit to given value. + Assert.Equal(0, Interop.Sys.SetRLimit(Interop.Sys.RlimitResources.RLIMIT_NOFILE, ref limits)); + Assert.Equal(0, Interop.Sys.GetRLimit(Interop.Sys.RlimitResources.RLIMIT_NOFILE, out limits)); + Assert.Equal(maxFd, limits.CurrentLimit); + + try { - using (var watcher = new FileSystemWatcher(TestDirectory)) + for (int i = 0; i < count; i++) { - watcher.Created += (s, e) => { } ; - watcher.EnableRaisingEvents = true; + using (var watcher = new FileSystemWatcher(testDirectory)) + { + watcher.Created += (s, e) => { } ; + watcher.EnableRaisingEvents = true; + } } - - // On some OSes system resource is released in finalizer. - GC.Collect(); - GC.WaitForPendingFinalizers(); } - } - catch (Exception e) - { - // If we use all handles we may not have luck writing out errors. - // Try our best here. - Console.WriteLine(e.Message); - _output.WriteLine(e.Message); - throw; - } + catch (Exception e) + { + // If we use all handles we may not have luck writing out errors. + // Try our best here. _output is not available within RemoteExec(). + // When we run out of fd, exception may be weird from OutOfMem to "unable load type". + Console.WriteLine($"Test failed for count={count}, limit={maxFd} and path='{testDirectory}'."); + Console.WriteLine(e.Message); + return 1; + } + + return RemoteExecutor.SuccessExitCode; + }, TestDirectory, options).Dispose(); } } } diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj index b55a59a5b13a7b..7256fce6cb1c40 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj @@ -1,6 +1,7 @@ - $(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Windows_NT + true + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD @@ -41,4 +42,4 @@ Common\Interop\Unix\System.Native\Interop.ResourceLimits.cs - \ No newline at end of file + diff --git a/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.Forwards.cs b/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.Forwards.cs index d6952a936b193c..6fb7abf9d14883 100644 --- a/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.Forwards.cs +++ b/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.SafeFileHandle))] diff --git a/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs b/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs index 74770914a9a217..2da652f866f430 100644 --- a/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs +++ b/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO diff --git a/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj b/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj index f16c2105d97d27..3dfbc1ba581460 100644 --- a/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj +++ b/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj @@ -4,7 +4,7 @@ true $(NoWarn);CS1573 true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix enable diff --git a/src/libraries/System.IO.FileSystem/src/System/IO/FileInfo.cs b/src/libraries/System.IO.FileSystem/src/System/IO/FileInfo.cs index e4aac5966e2096..6a69fcbcc7ec14 100644 --- a/src/libraries/System.IO.FileSystem/src/System/IO/FileInfo.cs +++ b/src/libraries/System.IO.FileSystem/src/System/IO/FileInfo.cs @@ -139,7 +139,7 @@ public void MoveTo(string destFileName, bool overwrite) // These checks are in place to ensure Unix error throwing happens the same way // as it does on Windows.These checks can be removed if a solution to - // https://github.com/dotnet/corefx/issues/2460 is found that doesn't require + // https://github.com/dotnet/runtime/issues/14885 is found that doesn't require // validity checks before making an API call. if (!new DirectoryInfo(Path.GetDirectoryName(FullName)!).Exists) throw new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, FullName)); diff --git a/src/libraries/System.IO.FileSystem/src/System/IO/FileSystem.Windows.cs b/src/libraries/System.IO.FileSystem/src/System/IO/FileSystem.Windows.cs index 50ad117c301ae0..2e34e67884828a 100644 --- a/src/libraries/System.IO.FileSystem/src/System/IO/FileSystem.Windows.cs +++ b/src/libraries/System.IO.FileSystem/src/System/IO/FileSystem.Windows.cs @@ -223,7 +223,7 @@ private static bool IsNameSurrogateReparsePoint(ref Interop.Kernel32.WIN32_FIND_ // into them. Surrogates should just be detached. // // See - // https://github.com/dotnet/corefx/issues/24250 + // https://github.com/dotnet/runtime/issues/23646 // https://msdn.microsoft.com/en-us/library/windows/desktop/aa365511.aspx // https://msdn.microsoft.com/en-us/library/windows/desktop/aa365197.aspx diff --git a/src/libraries/System.IO.FileSystem/tests/Base/InfoGetSetTimes.cs b/src/libraries/System.IO.FileSystem/tests/Base/InfoGetSetTimes.cs index 8810809d1ba400..0e61c82cd5187d 100644 --- a/src/libraries/System.IO.FileSystem/tests/Base/InfoGetSetTimes.cs +++ b/src/libraries/System.IO.FileSystem/tests/Base/InfoGetSetTimes.cs @@ -13,7 +13,7 @@ public abstract class InfoGetSetTimes : BaseGetSetTimes where T : FileSyst protected abstract void InvokeCreate(T item); [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/39108")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30108")] public void DoesntExistThenCreate_ReturnsDefaultValues() { T item = GetMissingItem(); diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs index a7b9c5c8e0e67b..cf453204b16385 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs @@ -508,7 +508,7 @@ public void SubdirectoryOnNonExistentDriveAsPath_ThrowsDirectoryNotFoundExceptio } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/1221")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/14378")] [PlatformSpecific(TestPlatforms.Windows)] // testing drive labels public void NotReadyDriveAsPath_ThrowsDirectoryNotFoundException() { // Behavior is suspect, should really have thrown IOException similar to the SubDirectory case @@ -527,7 +527,7 @@ public void NotReadyDriveAsPath_ThrowsDirectoryNotFoundException() [Fact] [PlatformSpecific(TestPlatforms.Windows)] // testing drive labels - [ActiveIssue("https://github.com/dotnet/corefx/issues/1221")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/14378")] public void SubdirectoryOnNotReadyDriveAsPath_ThrowsIOException() { var drive = IOServices.GetNotReadyDrive(); diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Delete_MountVolume.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Delete_MountVolume.cs index fbd9a739f13bfd..ccdc8e3dbb9bbe 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Delete_MountVolume.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Delete_MountVolume.cs @@ -22,7 +22,7 @@ public class Directory_Delete_MountVolume private static bool s_pass = true; [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/1221")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/14378")] [PlatformSpecific(TestPlatforms.Windows)] // testing volumes / mounts / drive letters public static void RunTest() { diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/EnumerableTests.cs b/src/libraries/System.IO.FileSystem/tests/Directory/EnumerableTests.cs index f70feca19afa49..29a2aaa5c192a5 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/EnumerableTests.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/EnumerableTests.cs @@ -12,7 +12,7 @@ namespace System.IO.Tests public class EnumerableTests : FileSystemTest { [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/25613", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/24295", TestPlatforms.AnyUnix)] public void FileEnumeratorIsThreadSafe() { string directory = Directory.CreateDirectory(GetTestFilePath()).FullName; diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs index 52b71ecd0208f3..e338abfea7e676 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs @@ -329,7 +329,7 @@ public void DirectoryWithComponentLongerThanMaxComponentAsPath_ReturnsFalse(stri } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/1221")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/14378")] [PlatformSpecific(TestPlatforms.Windows)] // drive labels public void NotReadyDriveAsPath_ReturnsFalse() { @@ -346,7 +346,7 @@ public void NotReadyDriveAsPath_ReturnsFalse() } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/1221")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/14378")] [PlatformSpecific(TestPlatforms.Windows)] // drive labels public void SubdirectoryOnNotReadyDriveAsPath_ReturnsFalse() { diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs b/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs index c962caa014ad65..d5d32ecfa1ce14 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs @@ -218,7 +218,7 @@ public void PatternTests_UnixPatterns(string pattern, string[] sourceFiles, stri ValidatePatternMatch(expected, GetEntries(testDir, pattern)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20779", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22168", TestPlatforms.AnyUnix)] [Theory, // Question marks collapse (right) to periods InlineData( @@ -243,8 +243,8 @@ public void PatternTests_DosQM(string pattern, string[] sourceFiles, string[] ex ValidatePatternMatch(expected, GetEntries(testDir, pattern)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20779", TestPlatforms.AnyUnix)] - [ActiveIssue("https://github.com/dotnet/corefx/issues/20780", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22168", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22169", TestPlatforms.AnyUnix)] [Theory, // Periods are optional if left of ? and end of match InlineData( @@ -284,7 +284,7 @@ public void PatternTests_DosDotQm(string pattern, string[] sourceFiles, string[] ValidatePatternMatch(expected, GetEntries(testDir, pattern)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20780", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22169", TestPlatforms.AnyUnix)] [Theory, // Periods are optional if left of * and end of match InlineData( @@ -304,7 +304,7 @@ public void PatternTests_DosDot(string pattern, string[] sourceFiles, string[] e ValidatePatternMatch(expected, GetEntries(testDir, pattern)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20780", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22169", TestPlatforms.AnyUnix)] // Can't do these without extended path support on Windows, UsingNewNormalization filters appropriately [ConditionalTheory(nameof(UsingNewNormalization)), // Periods are optional if left of * or ? and end of match @@ -349,7 +349,7 @@ public void PatternTests_DosDotTrailingDot(string pattern, string[] sourceFiles, ValidatePatternMatch(expected, GetEntries(testDir, pattern)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20781", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22170", TestPlatforms.AnyUnix)] [Theory, InlineData( "foo*.", @@ -363,7 +363,7 @@ public void PatternTests_DosStar(string pattern, string[] sourceFiles, string[] ValidatePatternMatch(expected, GetEntries(testDir, pattern)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20781", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22170", TestPlatforms.AnyUnix)] // Can't do these without extended path support on Windows, UsingNewNormalization filters appropriately [ConditionalTheory(nameof(UsingNewNormalization)), InlineData( @@ -409,7 +409,7 @@ public void PatternTests_DosStarSpace(string pattern, string[] sourceFiles, stri ValidatePatternMatch(expected, GetEntries(testDir, pattern)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/20781", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/22170", TestPlatforms.AnyUnix)] [OuterLoop("These are pretty corner, don't need to run all the time.")] [Theory, // "foo*." actually becomes "foo<" when passed to NT. It matches all characters up to, and including, the final period. diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Move.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Move.cs index e4c2bd64e13285..889d20d637fdf8 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Move.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Move.cs @@ -59,7 +59,7 @@ public void MoveOntoExistingDirectory() [Fact] public void MoveFile() { - // Regression https://github.com/dotnet/corefx/issues/19710 + // Regression https://github.com/dotnet/runtime/issues/21673 string source = GetTestFilePath(); string destination = GetTestFilePath(); File.Create(source).Dispose(); @@ -71,7 +71,7 @@ public void MoveFile() [Fact] public void MoveFile_TrailingDestinationSlash() { - // Regression https://github.com/dotnet/corefx/issues/19710 + // Regression https://github.com/dotnet/runtime/issues/21673 string source = GetTestFilePath(); string destination = GetTestFilePath(); File.Create(source).Dispose(); @@ -84,7 +84,7 @@ public void MoveFile_TrailingDestinationSlash() [PlatformSpecific(TestPlatforms.Windows)] public void MoveFile_TrailingDestinationAltSlash_Windows() { - // Regression https://github.com/dotnet/corefx/issues/19710 + // Regression https://github.com/dotnet/runtime/issues/21673 string source = GetTestFilePath(); string destination = GetTestFilePath(); File.Create(source).Dispose(); diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/ReparsePoints_MountVolume.cs b/src/libraries/System.IO.FileSystem/tests/Directory/ReparsePoints_MountVolume.cs index b7a67808a1e7d5..50e5d553440be2 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/ReparsePoints_MountVolume.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/ReparsePoints_MountVolume.cs @@ -19,7 +19,7 @@ public class Directory_ReparsePoints_MountVolume private static bool s_pass = true; [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/1221")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/14378")] [PlatformSpecific(TestPlatforms.Windows)] // testing mounting volumes and reparse points public static void runTest() { diff --git a/src/libraries/System.IO.FileSystem/tests/FileInfo/Length.cs b/src/libraries/System.IO.FileSystem/tests/FileInfo/Length.cs index 2b09ad576de7c5..7b8ad50a8daa01 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileInfo/Length.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileInfo/Length.cs @@ -47,7 +47,7 @@ public void Length_Of_Directory_Throws_FileNotFoundException() // DirectoryNotFound exceptions, but in this particular case we ignored the actual // result and always gave FileNotFound. // - // https://github.com/dotnet/corefx/issues/19850 + // https://github.com/dotnet/runtime/issues/21745 [Theory, MemberData(nameof(TrailingCharacters))] public void Length_MissingFile_ThrowsFileNotFound(char trailingChar) diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/LockUnlock.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/LockUnlock.cs index 3232b58c474671..bcfdaa58a5a557 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileStream/LockUnlock.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileStream/LockUnlock.cs @@ -154,7 +154,7 @@ public void OverlappingRegionsFromSameProcess_AllowedOnUnix(long fileLength, lon } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/34397 + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/runtime/issues/28330 [InlineData(10, 0, 10, 1, 2)] [InlineData(10, 3, 5, 3, 5)] [InlineData(10, 3, 5, 3, 4)] diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/Pipes.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/Pipes.cs index b168f55db03aef..28d19959bf13da 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileStream/Pipes.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileStream/Pipes.cs @@ -42,7 +42,7 @@ public async Task AnonymousPipeWriteViaFileStream(bool asyncWrites) } [Fact] - [ActiveIssue("https://github.com/dotnet/corefx/issues/39230")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/30155")] [PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invokes public async Task FifoReadWriteViaFileStream() { diff --git a/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj b/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj index c798d897911adf..c36d099b980f2a 100644 --- a/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj +++ b/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj @@ -2,7 +2,7 @@ true true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.IO.IsolatedStorage/ref/System.IO.IsolatedStorage.cs b/src/libraries/System.IO.IsolatedStorage/ref/System.IO.IsolatedStorage.cs index 74ac06600851aa..2a70468d100ea3 100644 --- a/src/libraries/System.IO.IsolatedStorage/ref/System.IO.IsolatedStorage.cs +++ b/src/libraries/System.IO.IsolatedStorage/ref/System.IO.IsolatedStorage.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO.IsolatedStorage @@ -31,15 +31,15 @@ protected IsolatedStorage() { } public virtual long UsedSize { get { throw null; } } public virtual bool IncreaseQuotaTo(long newQuotaSize) { throw null; } protected void InitStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, System.Type appEvidenceType) { } - protected void InitStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, System.Type domainEvidenceType, System.Type assemblyEvidenceType) { } + protected void InitStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, System.Type? domainEvidenceType, System.Type? assemblyEvidenceType) { } public abstract void Remove(); } public partial class IsolatedStorageException : System.Exception { public IsolatedStorageException() { } protected IsolatedStorageException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } - public IsolatedStorageException(string message) { } - public IsolatedStorageException(string message, System.Exception inner) { } + public IsolatedStorageException(string? message) { } + public IsolatedStorageException(string? message, System.Exception? inner) { } } public sealed partial class IsolatedStorageFile : System.IO.IsolatedStorage.IsolatedStorage, System.IDisposable { @@ -76,10 +76,10 @@ public void Dispose() { } public static System.IO.IsolatedStorage.IsolatedStorageFile GetMachineStoreForApplication() { throw null; } public static System.IO.IsolatedStorage.IsolatedStorageFile GetMachineStoreForAssembly() { throw null; } public static System.IO.IsolatedStorage.IsolatedStorageFile GetMachineStoreForDomain() { throw null; } - public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, object applicationIdentity) { throw null; } - public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, object domainIdentity, object assemblyIdentity) { throw null; } - public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, System.Type applicationEvidenceType) { throw null; } - public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, System.Type domainEvidenceType, System.Type assemblyEvidenceType) { throw null; } + public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, object? applicationIdentity) { throw null; } + public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, object? domainIdentity, object? assemblyIdentity) { throw null; } + public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, System.Type? applicationEvidenceType) { throw null; } + public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore(System.IO.IsolatedStorage.IsolatedStorageScope scope, System.Type? domainEvidenceType, System.Type? assemblyEvidenceType) { throw null; } public static System.IO.IsolatedStorage.IsolatedStorageFile GetUserStoreForApplication() { throw null; } public static System.IO.IsolatedStorage.IsolatedStorageFile GetUserStoreForAssembly() { throw null; } public static System.IO.IsolatedStorage.IsolatedStorageFile GetUserStoreForDomain() { throw null; } @@ -99,10 +99,10 @@ public partial class IsolatedStorageFileStream : System.IO.FileStream public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } - public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, System.IO.IsolatedStorage.IsolatedStorageFile isf) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } - public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.IO.IsolatedStorage.IsolatedStorageFile isf) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } - public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.IsolatedStorage.IsolatedStorageFile isf) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } - public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.IsolatedStorage.IsolatedStorageFile isf) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } + public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, System.IO.IsolatedStorage.IsolatedStorageFile? isf) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } + public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.IO.IsolatedStorage.IsolatedStorageFile? isf) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } + public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.IsolatedStorage.IsolatedStorageFile? isf) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } + public IsolatedStorageFileStream(string path, System.IO.FileMode mode, System.IO.IsolatedStorage.IsolatedStorageFile? isf) : base (default(Microsoft.Win32.SafeHandles.SafeFileHandle), default(System.IO.FileAccess)) { } public override bool CanRead { get { throw null; } } public override bool CanSeek { get { throw null; } } public override bool CanWrite { get { throw null; } } @@ -112,8 +112,8 @@ public partial class IsolatedStorageFileStream : System.IO.FileStream public override long Length { get { throw null; } } public override long Position { get { throw null; } set { } } public override Microsoft.Win32.SafeHandles.SafeFileHandle SafeFileHandle { get { throw null; } } - public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int numBytes, System.AsyncCallback userCallback, object stateObject) { throw null; } - public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int numBytes, System.AsyncCallback userCallback, object stateObject) { throw null; } + public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int numBytes, System.AsyncCallback? userCallback, object? stateObject) { throw null; } + public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int numBytes, System.AsyncCallback? userCallback, object? stateObject) { throw null; } protected override void Dispose(bool disposing) { } public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; } public override int EndRead(System.IAsyncResult asyncResult) { throw null; } diff --git a/src/libraries/System.IO.IsolatedStorage/ref/System.IO.IsolatedStorage.csproj b/src/libraries/System.IO.IsolatedStorage/ref/System.IO.IsolatedStorage.csproj index 62e8a6aa20a12e..ab19b0d2d547c8 100644 --- a/src/libraries/System.IO.IsolatedStorage/ref/System.IO.IsolatedStorage.csproj +++ b/src/libraries/System.IO.IsolatedStorage/ref/System.IO.IsolatedStorage.csproj @@ -1,6 +1,7 @@ $(NetCoreAppCurrent) + enable diff --git a/src/libraries/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj b/src/libraries/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj index 7b4cbf337c0834..710b00e4b4c83b 100644 --- a/src/libraries/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj +++ b/src/libraries/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj @@ -1,6 +1,7 @@ $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix + enable diff --git a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.Win32Unix.cs b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.Win32Unix.cs index 15e0e913a96f8c..9ba74ef366dc4a 100644 --- a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.Win32Unix.cs +++ b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.Win32Unix.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System.Reflection; using System.Security; using System.Threading; @@ -48,15 +49,15 @@ internal static void GetDefaultIdentityAndHash(out object identity, out string h // to pull from we'd have to dig into the use case to try and find a reasonable solution should we // run into this in the wild. - Assembly assembly = Assembly.GetEntryAssembly(); + Assembly? assembly = Assembly.GetEntryAssembly(); if (assembly == null) throw new IsolatedStorageException(SR.IsolatedStorage_Init); AssemblyName assemblyName = assembly.GetName(); - Uri codeBase = new Uri(assembly.CodeBase); + Uri codeBase = new Uri(assembly.CodeBase!); - hash = IdentityHelper.GetNormalizedStrongNameHash(assemblyName); + hash = IdentityHelper.GetNormalizedStrongNameHash(assemblyName)!; if (hash != null) { hash = "StrongName" + separator + hash; @@ -71,7 +72,7 @@ internal static void GetDefaultIdentityAndHash(out object identity, out string h internal static string GetRandomDirectory(string rootDirectory, IsolatedStorageScope scope) { - string randomDirectory = GetExistingRandomDirectory(rootDirectory); + string? randomDirectory = GetExistingRandomDirectory(rootDirectory); if (string.IsNullOrEmpty(randomDirectory)) { using (Mutex m = CreateMutexNotOwned(rootDirectory)) @@ -101,7 +102,7 @@ internal static string GetRandomDirectory(string rootDirectory, IsolatedStorageS return randomDirectory; } - internal static string GetExistingRandomDirectory(string rootDirectory) + internal static string? GetExistingRandomDirectory(string rootDirectory) { // Look for an existing random directory at the given root // (a set of nested directories that were created via Path.GetRandomFileName()) diff --git a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.cs b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.cs index f48cd480c963bd..1c0b1b5bb02a5c 100644 --- a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.cs +++ b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.cs @@ -2,15 +2,16 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable namespace System.IO.IsolatedStorage { internal static partial class Helper { private const string IsolatedStorageDirectoryName = "IsolatedStorage"; - private static string s_machineRootDirectory; - private static string s_roamingUserRootDirectory; - private static string s_userRootDirectory; + private static string? s_machineRootDirectory; + private static string? s_roamingUserRootDirectory; + private static string? s_userRootDirectory; /// /// The full root directory is the relevant special folder from Environment.GetFolderPath() plus "IsolatedStorage" diff --git a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorage.cs b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorage.cs index 968035fa3903b2..ab4448110e3842 100644 --- a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorage.cs +++ b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorage.cs @@ -11,9 +11,9 @@ public abstract class IsolatedStorage : MarshalByRefObject private ulong _quota; private bool _validQuota; - private object _applicationIdentity; - private object _assemblyIdentity; - private object _domainIdentity; + private object? _applicationIdentity; + private object? _assemblyIdentity; + private object? _domainIdentity; protected IsolatedStorage() { } @@ -22,7 +22,7 @@ public object ApplicationIdentity get { if (Helper.IsApplication(Scope)) - return _applicationIdentity; + return _applicationIdentity!; throw new InvalidOperationException(SR.IsolatedStorage_ApplicationUndefined); } @@ -33,7 +33,7 @@ public object AssemblyIdentity get { if (Helper.IsAssembly(Scope)) - return _assemblyIdentity; + return _assemblyIdentity!; throw new InvalidOperationException(SR.IsolatedStorage_AssemblyUndefined); } @@ -44,7 +44,7 @@ public object DomainIdentity get { if (Helper.IsDomain(Scope)) - return _domainIdentity; + return _domainIdentity!; throw new InvalidOperationException(SR.IsolatedStorage_AssemblyUndefined); } @@ -128,7 +128,7 @@ public virtual bool IncreaseQuotaTo(long newQuotaSize) public abstract void Remove(); - internal string IdentityHash + internal string? IdentityHash { get; private set; } @@ -138,14 +138,12 @@ protected void InitStore(IsolatedStorageScope scope, Type appEvidenceType) InitStore(scope, null, appEvidenceType); } - protected void InitStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType) + protected void InitStore(IsolatedStorageScope scope, Type? domainEvidenceType, Type? assemblyEvidenceType) { VerifyScope(scope); Scope = scope; - object identity; - string hash; - Helper.GetDefaultIdentityAndHash(out identity, out hash, SeparatorInternal); + Helper.GetDefaultIdentityAndHash(out object identity, out string hash, SeparatorInternal); if (Helper.IsApplication(scope)) { diff --git a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageException.cs b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageException.cs index fbf2908da16899..1af42caa6961b6 100644 --- a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageException.cs +++ b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageException.cs @@ -15,7 +15,7 @@ public class IsolatedStorageException : Exception, ISerializable // All the exceptions from IsolatedStorage are wrapped as IsolatedStorageException, // this field is used to provide the underlying exception under debugger. - internal Exception _underlyingException; + internal Exception? _underlyingException; public IsolatedStorageException() : base(SR.IsolatedStorage_Exception) @@ -23,13 +23,13 @@ public IsolatedStorageException() HResult = COR_E_ISOSTORE; } - public IsolatedStorageException(string message) + public IsolatedStorageException(string? message) : base(message) { HResult = COR_E_ISOSTORE; } - public IsolatedStorageException(string message, Exception inner) + public IsolatedStorageException(string? message, Exception? inner) : base(message, inner) { HResult = COR_E_ISOSTORE; diff --git a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFile.cs b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFile.cs index 3bef2d8824bdac..d7d09f9bf3ff6e 100644 --- a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFile.cs +++ b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFile.cs @@ -14,7 +14,7 @@ public sealed partial class IsolatedStorageFile : IsolatedStorage, IDisposable internal const string s_files = "Files"; internal const string s_assemFiles = "AssemFiles"; internal const string s_appFiles = "AppFiles"; - private string _rootDirectory; + private string _rootDirectory = null!; // Initialized in helper private bool _disposed; private bool _closed; @@ -223,7 +223,7 @@ public string[] GetDirectoryNames(string searchPattern) { // FileSystem APIs return the complete path of the matching directories however Iso store only provided the directory name // and hid the IsoStore root. Hence we find all the matching directories from the fileSystem and simply return their names. - return Directory.EnumerateDirectories(RootDirectory, searchPattern).Select(m => m.Substring(Path.GetDirectoryName(m).Length + 1)).ToArray(); + return Directory.EnumerateDirectories(RootDirectory, searchPattern).Select(m => m.Substring(Path.GetDirectoryName(m)!.Length + 1)).ToArray(); } catch (UnauthorizedAccessException e) { @@ -469,7 +469,7 @@ public void MoveDirectory(string sourceDirectoryName, string destinationDirector public static IEnumerator GetEnumerator(IsolatedStorageScope scope) { - // Not currently supported: https://github.com/dotnet/corefx/issues/10936 + // Not currently supported: https://github.com/dotnet/runtime/issues/18209 // Implementing this would require serializing/deserializing identity objects which is particularly // complicated given the normal identity objects used by .NET Framework aren't available on .NET Core. @@ -609,31 +609,31 @@ private static IsolatedStorageFile GetStore(IsolatedStorageScope scope) // // "Known" types are Publisher, StrongName, Url, Site, and Zone. - public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Type applicationEvidenceType) + public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Type? applicationEvidenceType) { // Scope MUST be Application - return (applicationEvidenceType == null) ? GetStore(scope) : throw new PlatformNotSupportedException(SR.PlatformNotSupported_CAS); // https://github.com/dotnet/corefx/issues/10935 + return (applicationEvidenceType == null) ? GetStore(scope) : throw new PlatformNotSupportedException(SR.PlatformNotSupported_CAS); // https://github.com/dotnet/runtime/issues/18208 } - public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, object applicationIdentity) + public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, object? applicationIdentity) { // Scope MUST be Application - return (applicationIdentity == null) ? GetStore(scope) : throw new PlatformNotSupportedException(SR.PlatformNotSupported_CAS); // https://github.com/dotnet/corefx/issues/10935 + return (applicationIdentity == null) ? GetStore(scope) : throw new PlatformNotSupportedException(SR.PlatformNotSupported_CAS); // https://github.com/dotnet/runtime/issues/18208 } - public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType) + public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Type? domainEvidenceType, Type? assemblyEvidenceType) { // Scope MUST NOT be Application (assembly is assumed otherwise) - return (domainEvidenceType == null && assemblyEvidenceType == null) ? GetStore(scope) : throw new PlatformNotSupportedException(SR.PlatformNotSupported_CAS); // https://github.com/dotnet/corefx/issues/10935 + return (domainEvidenceType == null && assemblyEvidenceType == null) ? GetStore(scope) : throw new PlatformNotSupportedException(SR.PlatformNotSupported_CAS); // https://github.com/dotnet/runtime/issues/18208 } - public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, object domainIdentity, object assemblyIdentity) + public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, object? domainIdentity, object? assemblyIdentity) { // Scope MUST NOT be Application (assembly is assumed otherwise) - return (domainIdentity == null && assemblyIdentity == null) ? GetStore(scope) : throw new PlatformNotSupportedException(SR.PlatformNotSupported_CAS); // https://github.com/dotnet/corefx/issues/10935 + return (domainIdentity == null && assemblyIdentity == null) ? GetStore(scope) : throw new PlatformNotSupportedException(SR.PlatformNotSupported_CAS); // https://github.com/dotnet/runtime/issues/18208 } - // https://github.com/dotnet/corefx/issues/10935 + // https://github.com/dotnet/runtime/issues/18208 // Evidence isn't currently available // public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Evidence domainEvidence, Type domainEvidenceType, Evidence assemblyEvidence, Type assemblyEvidenceType) { return default(IsolatedStorageFile); } @@ -734,7 +734,8 @@ public override void Remove() Close(); - string parentDirectory = Path.GetDirectoryName(RootDirectory.TrimEnd(Path.DirectorySeparatorChar)); + string? parentDirectory = Path.GetDirectoryName(RootDirectory.TrimEnd(Path.DirectorySeparatorChar)); + Debug.Assert(parentDirectory != null); if (ContainsUnknownFiles(parentDirectory)) return; @@ -753,6 +754,7 @@ public override void Remove() if (Helper.IsDomain(Scope)) { parentDirectory = Path.GetDirectoryName(parentDirectory); + Debug.Assert(parentDirectory != null); if (ContainsUnknownFiles(parentDirectory)) return; diff --git a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFileStream.cs b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFileStream.cs index 829c32d9bde1a4..d05bfeb0c4896f 100644 --- a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFileStream.cs +++ b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFileStream.cs @@ -23,7 +23,7 @@ public IsolatedStorageFileStream(string path, FileMode mode) { } - public IsolatedStorageFileStream(string path, FileMode mode, IsolatedStorageFile isf) + public IsolatedStorageFileStream(string path, FileMode mode, IsolatedStorageFile? isf) : this(path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), FileShare.None, isf) { } @@ -33,7 +33,7 @@ public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access) { } - public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, IsolatedStorageFile isf) + public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, IsolatedStorageFile? isf) : this(path, mode, access, access == FileAccess.Read ? FileShare.Read : FileShare.None, DefaultBufferSize, isf) { } @@ -43,7 +43,7 @@ public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, { } - public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, FileShare share, IsolatedStorageFile isf) + public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, FileShare share, IsolatedStorageFile? isf) : this(path, mode, access, share, DefaultBufferSize, isf) { } @@ -53,7 +53,7 @@ public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, { } - public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, IsolatedStorageFile isf) + public IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, IsolatedStorageFile? isf) : this(path, mode, access, share, bufferSize, InitializeFileStream(path, mode, access, share, bufferSize, isf)) { } @@ -81,7 +81,7 @@ private struct InitialiationData } // If IsolatedStorageFile is null, then we default to using a file that is scoped by user, appdomain, and assembly. - private static InitialiationData InitializeFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, IsolatedStorageFile isf) + private static InitialiationData InitializeFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, IsolatedStorageFile? isf) { if (path == null) throw new ArgumentNullException(nameof(path)); @@ -302,12 +302,12 @@ public override void WriteByte(byte value) _fs.WriteByte(value); } - public override IAsyncResult BeginRead(byte[] array, int offset, int numBytes, AsyncCallback userCallback, object stateObject) + public override IAsyncResult BeginRead(byte[] array, int offset, int numBytes, AsyncCallback? userCallback, object? stateObject) { return _fs.BeginRead(array, offset, numBytes, userCallback, stateObject); } - public override IAsyncResult BeginWrite(byte[] array, int offset, int numBytes, AsyncCallback userCallback, object stateObject) + public override IAsyncResult BeginWrite(byte[] array, int offset, int numBytes, AsyncCallback? userCallback, object? stateObject) { return _fs.BeginWrite(array, offset, numBytes, userCallback, stateObject); } diff --git a/src/libraries/System.IO.IsolatedStorage/tests/System.IO.IsolatedStorage.Tests.csproj b/src/libraries/System.IO.IsolatedStorage/tests/System.IO.IsolatedStorage.Tests.csproj index aba99e2ae1215e..0aaf3693233c22 100644 --- a/src/libraries/System.IO.IsolatedStorage/tests/System.IO.IsolatedStorage.Tests.csproj +++ b/src/libraries/System.IO.IsolatedStorage/tests/System.IO.IsolatedStorage.Tests.csproj @@ -1,6 +1,6 @@ - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/HelperTests.cs b/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/HelperTests.cs index 9fc57a6e05f8bb..581c9bf6d79da5 100644 --- a/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/HelperTests.cs +++ b/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/HelperTests.cs @@ -41,7 +41,7 @@ public void GetDefaultIdentityAndHash() public void GetDataDirectory(IsolatedStorageScope scope) { // Machine scope is behind a policy that isn't enabled by default - // https://github.com/dotnet/corefx/issues/19839 + // https://github.com/dotnet/runtime/issues/21742 if (scope == IsolatedStorageScope.Machine && PlatformDetection.IsInAppContainer) return; diff --git a/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/IdentityTests.cs b/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/IdentityTests.cs index 725ebf568a73c4..bb8d473783a868 100644 --- a/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/IdentityTests.cs +++ b/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/IdentityTests.cs @@ -39,7 +39,7 @@ public void IdentityThrowsInvalidOperation() [Theory, InlineData(IsolatedStorageScope.Application | IsolatedStorageScope.User), InlineData(IsolatedStorageScope.Application | IsolatedStorageScope.User | IsolatedStorageScope.Roaming) - // https://github.com/dotnet/corefx/issues/12628 + // https://github.com/dotnet/runtime/issues/2092 // InlineData(IsolatedStorageScope.Application | IsolatedStorageScope.Machine) ] public void ApplicationIdentityIsSet(IsolatedStorageScope scope) @@ -53,7 +53,7 @@ public void ApplicationIdentityIsSet(IsolatedStorageScope scope) [Theory, InlineData(IsolatedStorageScope.Assembly | IsolatedStorageScope.User), InlineData(IsolatedStorageScope.Assembly | IsolatedStorageScope.User | IsolatedStorageScope.Roaming) - // https://github.com/dotnet/corefx/issues/12628 + // https://github.com/dotnet/runtime/issues/2092 // InlineData(IsolatedStorageScope.Assembly | IsolatedStorageScope.Machine) ] public void AssemblyIdentityIsSet(IsolatedStorageScope scope) @@ -67,7 +67,7 @@ public void AssemblyIdentityIsSet(IsolatedStorageScope scope) [Theory, InlineData(IsolatedStorageScope.Assembly | IsolatedStorageScope.User | IsolatedStorageScope.Domain), InlineData(IsolatedStorageScope.Assembly | IsolatedStorageScope.User | IsolatedStorageScope.Roaming | IsolatedStorageScope.Domain) - // https://github.com/dotnet/corefx/issues/12628 + // https://github.com/dotnet/runtime/issues/2092 // InlineData(IsolatedStorageScope.Assembly | IsolatedStorageScope.Machine | IsolatedStorageScope.Domain) ] public void DomainIdentityIsSet(IsolatedStorageScope scope) diff --git a/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/IsoStorageTest.cs b/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/IsoStorageTest.cs index 579750378cf2ae..a313ead4015ec0 100644 --- a/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/IsoStorageTest.cs +++ b/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/IsoStorageTest.cs @@ -78,7 +78,7 @@ public static IEnumerable ValidStores PresetScopes.UserStoreForDomain, }; - // https://github.com/dotnet/corefx/issues/12628 + // https://github.com/dotnet/runtime/issues/2092 if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !PlatformDetection.IsInAppContainer) { diff --git a/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/TestHelper.cs b/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/TestHelper.cs index 78ac0acdf9e4a3..64202c277766df 100644 --- a/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/TestHelper.cs +++ b/src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/TestHelper.cs @@ -32,8 +32,8 @@ static TestHelper() // Application scope doesn't go under a random dir s_roots.Add(Path.Combine(userRoot, hash)); - // https://github.com/dotnet/corefx/issues/12628 - // https://github.com/dotnet/corefx/issues/19839 + // https://github.com/dotnet/runtime/issues/2092 + // https://github.com/dotnet/runtime/issues/21742 if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !PlatformDetection.IsInAppContainer) { diff --git a/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs b/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs index d6aef9ae8ba75d..55e7bc26f7fb7a 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace Microsoft.Win32.SafeHandles diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj b/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj index 9a60c30ad1121b..c2dc86df1632e0 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj @@ -3,7 +3,7 @@ System.IO.MemoryMappedFiles true enable - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj b/src/libraries/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj index a6b3512c172c58..830a1c5f73d846 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj @@ -2,7 +2,7 @@ true true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.PackUriScheme.cs b/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.PackUriScheme.cs index 5acfd967a768a5..2b3b220464fdba 100644 --- a/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.PackUriScheme.cs +++ b/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.PackUriScheme.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO.Packaging diff --git a/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.Serialization.cs b/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.Serialization.cs index cf8e70a50a2276..766964af44ac6c 100644 --- a/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.Serialization.cs +++ b/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.Serialization.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO diff --git a/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.cs b/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.cs index 39cd711b352826..9c97e45a7215d1 100644 --- a/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.cs +++ b/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO diff --git a/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.csproj b/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.csproj index bf900cb44888c7..b6f8f5ac2d04b7 100644 --- a/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.csproj +++ b/src/libraries/System.IO.Packaging/ref/System.IO.Packaging.csproj @@ -2,8 +2,8 @@ true $(DefineConstants);netcoreapp - netstandard1.3;net46;netstandard2.0;$(NetFrameworkCurrent) - true + netstandard2.0;netstandard1.3;net46;$(NetFrameworkCurrent) + true diff --git a/src/libraries/System.IO.Packaging/src/System.IO.Packaging.csproj b/src/libraries/System.IO.Packaging/src/System.IO.Packaging.csproj index 2508e16a3446f4..d08a0d0f2c0c81 100644 --- a/src/libraries/System.IO.Packaging/src/System.IO.Packaging.csproj +++ b/src/libraries/System.IO.Packaging/src/System.IO.Packaging.csproj @@ -4,7 +4,7 @@ true $(DefineConstants);FEATURE_SERIALIZATION net46;netstandard1.3;netstandard2.0;$(NetFrameworkCurrent)-Windows_NT - true + true diff --git a/src/libraries/System.IO.Pipelines/ref/System.IO.Pipelines.cs b/src/libraries/System.IO.Pipelines/ref/System.IO.Pipelines.cs index 2cc01c3771925f..041fa8751925d2 100644 --- a/src/libraries/System.IO.Pipelines/ref/System.IO.Pipelines.cs +++ b/src/libraries/System.IO.Pipelines/ref/System.IO.Pipelines.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO.Pipelines diff --git a/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj b/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj index fc605627cb4868..c15a68ff5a26ca 100644 --- a/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj +++ b/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netcoreapp3.0;$(NetCoreAppCurrent) - true + $(NetCoreAppCurrent);netstandard2.0;netcoreapp3.0 + true enable diff --git a/src/libraries/System.IO.Pipes.AccessControl/ref/System.IO.Pipes.AccessControl.cs b/src/libraries/System.IO.Pipes.AccessControl/ref/System.IO.Pipes.AccessControl.cs index 6f299796cc104b..8d5cb49f0b19d1 100644 --- a/src/libraries/System.IO.Pipes.AccessControl/ref/System.IO.Pipes.AccessControl.cs +++ b/src/libraries/System.IO.Pipes.AccessControl/ref/System.IO.Pipes.AccessControl.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO.Pipes @@ -69,11 +69,11 @@ public void SetAuditRule(System.IO.Pipes.PipeAuditRule rule) { } public static class AnonymousPipeServerStreamAcl { - public static System.IO.Pipes.AnonymousPipeServerStream Create(System.IO.Pipes.PipeDirection direction, System.IO.HandleInheritability inheritability, int bufferSize, System.IO.Pipes.PipeSecurity pipeSecurity) { throw null; } + public static System.IO.Pipes.AnonymousPipeServerStream Create(System.IO.Pipes.PipeDirection direction, System.IO.HandleInheritability inheritability, int bufferSize, System.IO.Pipes.PipeSecurity? pipeSecurity) { throw null; } } public static class NamedPipeServerStreamAcl { - public static System.IO.Pipes.NamedPipeServerStream Create(string pipeName, System.IO.Pipes.PipeDirection direction, int maxNumberOfServerInstances, System.IO.Pipes.PipeTransmissionMode transmissionMode, System.IO.Pipes.PipeOptions options, int inBufferSize, int outBufferSize, System.IO.Pipes.PipeSecurity pipeSecurity, System.IO.HandleInheritability inheritability = System.IO.HandleInheritability.None, System.IO.Pipes.PipeAccessRights additionalAccessRights = default) { throw null; } + public static System.IO.Pipes.NamedPipeServerStream Create(string pipeName, System.IO.Pipes.PipeDirection direction, int maxNumberOfServerInstances, System.IO.Pipes.PipeTransmissionMode transmissionMode, System.IO.Pipes.PipeOptions options, int inBufferSize, int outBufferSize, System.IO.Pipes.PipeSecurity? pipeSecurity, System.IO.HandleInheritability inheritability = System.IO.HandleInheritability.None, System.IO.Pipes.PipeAccessRights additionalAccessRights = default) { throw null; } } } diff --git a/src/libraries/System.IO.Pipes.AccessControl/ref/System.IO.Pipes.AccessControl.csproj b/src/libraries/System.IO.Pipes.AccessControl/ref/System.IO.Pipes.AccessControl.csproj index 5a8effe08ba4ae..86347043377876 100644 --- a/src/libraries/System.IO.Pipes.AccessControl/ref/System.IO.Pipes.AccessControl.csproj +++ b/src/libraries/System.IO.Pipes.AccessControl/ref/System.IO.Pipes.AccessControl.csproj @@ -4,6 +4,7 @@ The reference assembly version needs to be frozen so that our desktop compat facades point to the version from the package. --> 4.0.3.0 netstandard2.0 + enable diff --git a/src/libraries/System.IO.Pipes.AccessControl/src/System.IO.Pipes.AccessControl.csproj b/src/libraries/System.IO.Pipes.AccessControl/src/System.IO.Pipes.AccessControl.csproj index 584ebbb0db00c7..d30ca97f80e7f9 100644 --- a/src/libraries/System.IO.Pipes.AccessControl/src/System.IO.Pipes.AccessControl.csproj +++ b/src/libraries/System.IO.Pipes.AccessControl/src/System.IO.Pipes.AccessControl.csproj @@ -6,6 +6,7 @@ true SR.PlatformNotSupported_AccessControl $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix + enable diff --git a/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.cs b/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.cs index e0d7ef00220cdc..0e0987f59a1533 100644 --- a/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.cs +++ b/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace Microsoft.Win32.SafeHandles @@ -111,8 +111,8 @@ protected PipeStream(System.IO.Pipes.PipeDirection direction, System.IO.Pipes.Pi public virtual System.IO.Pipes.PipeTransmissionMode ReadMode { get { throw null; } set { } } public Microsoft.Win32.SafeHandles.SafePipeHandle SafePipeHandle { get { throw null; } } public virtual System.IO.Pipes.PipeTransmissionMode TransmissionMode { get { throw null; } } - public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback callback, object state) { throw null; } - public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback callback, object state) { throw null; } + public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; } + public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; } protected internal virtual void CheckPipePropertyOperations() { } protected internal void CheckReadOperations() { } protected internal void CheckWriteOperations() { } @@ -120,7 +120,8 @@ protected override void Dispose(bool disposing) { } public override int EndRead(System.IAsyncResult asyncResult) { throw null; } public override void EndWrite(System.IAsyncResult asyncResult) { } public override void Flush() { } - protected void InitializeHandle(Microsoft.Win32.SafeHandles.SafePipeHandle handle, bool isExposed, bool isAsync) { } + public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; } + protected void InitializeHandle(Microsoft.Win32.SafeHandles.SafePipeHandle? handle, bool isExposed, bool isAsync) { } public override int Read(byte[] buffer, int offset, int count) { throw null; } public override int Read(System.Span buffer) { throw null; } public override System.Threading.Tasks.Task ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } diff --git a/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.csproj b/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.csproj index 37fc71824515af..4ddc4f2a783f0d 100644 --- a/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.csproj +++ b/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.csproj @@ -1,6 +1,7 @@ $(NetCoreAppCurrent) + enable diff --git a/src/libraries/System.IO.Pipes/src/Microsoft/Win32/SafeHandles/SafePipeHandle.Unix.cs b/src/libraries/System.IO.Pipes/src/Microsoft/Win32/SafeHandles/SafePipeHandle.Unix.cs index a9810794373e94..406e1599a89086 100644 --- a/src/libraries/System.IO.Pipes/src/Microsoft/Win32/SafeHandles/SafePipeHandle.Unix.cs +++ b/src/libraries/System.IO.Pipes/src/Microsoft/Win32/SafeHandles/SafePipeHandle.Unix.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Diagnostics; using System.Net.Sockets; @@ -22,8 +23,8 @@ public sealed partial class SafePipeHandle : SafeHandleZeroOrMinusOneIsInvalid // and operations that should go through the Socket to be done via _namedPipeSocket. We keep the // Socket's SafeHandle alive as long as this SafeHandle is alive. - private Socket _namedPipeSocket; - private SafeHandle _namedPipeSocketHandle; + private Socket? _namedPipeSocket; + private SafeHandle? _namedPipeSocketHandle; internal SafePipeHandle(Socket namedPipeSocket) : base(ownsHandle: true) { @@ -37,8 +38,8 @@ internal SafePipeHandle(Socket namedPipeSocket) : base(ownsHandle: true) SetHandle(_namedPipeSocketHandle.DangerousGetHandle()); } - internal Socket NamedPipeSocket => _namedPipeSocket; - internal SafeHandle NamedPipeSocketHandle => _namedPipeSocketHandle; + internal Socket? NamedPipeSocket => _namedPipeSocket; + internal SafeHandle? NamedPipeSocketHandle => _namedPipeSocketHandle; protected override void Dispose(bool disposing) { diff --git a/src/libraries/System.IO.Pipes/src/Microsoft/Win32/SafeHandles/SafePipeHandle.cs b/src/libraries/System.IO.Pipes/src/Microsoft/Win32/SafeHandles/SafePipeHandle.cs index d6b88e5d9561d2..aecdadcab5ee19 100644 --- a/src/libraries/System.IO.Pipes/src/Microsoft/Win32/SafeHandles/SafePipeHandle.cs +++ b/src/libraries/System.IO.Pipes/src/Microsoft/Win32/SafeHandles/SafePipeHandle.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using System; using System.Runtime.InteropServices; using System.Security; diff --git a/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj b/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj index 2f252ce442c46c..8599e10012ec35 100644 --- a/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj +++ b/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj @@ -3,7 +3,8 @@ System.IO.Pipes true true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix + enable diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeClientStream.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeClientStream.cs index 77bd42e4aa6ffe..94057cc6c5d8fe 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeClientStream.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeClientStream.cs @@ -13,13 +13,11 @@ namespace System.IO.Pipes /// public sealed partial class AnonymousPipeClientStream : PipeStream { - [SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "string", Justification = "By design")] public AnonymousPipeClientStream(string pipeHandleAsString) : this(PipeDirection.In, pipeHandleAsString) { } - [SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "string", Justification = "By design")] public AnonymousPipeClientStream(PipeDirection direction, string pipeHandleAsString) : base(direction, 0) { diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.Windows.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.Windows.cs index fc57fdf5972aac..256b3c8d3f1ccf 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.Windows.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.Windows.cs @@ -13,7 +13,7 @@ namespace System.IO.Pipes /// public sealed partial class AnonymousPipeServerStream : PipeStream { - internal AnonymousPipeServerStream(PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity pipeSecurity) + internal AnonymousPipeServerStream(PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity? pipeSecurity) : base(direction, bufferSize) { if (direction == PipeDirection.InOut) @@ -34,7 +34,7 @@ private void Create(PipeDirection direction, HandleInheritability inheritability Create(direction, inheritability, bufferSize, null); } - private void Create(PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity pipeSecurity) + private void Create(PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity? pipeSecurity) { Debug.Assert(direction != PipeDirection.InOut, "Anonymous pipe direction shouldn't be InOut"); Debug.Assert(bufferSize >= 0, "bufferSize is negative"); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.cs index ea0f58f4dacad6..249aa1e5d94f55 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.cs @@ -12,7 +12,7 @@ namespace System.IO.Pipes /// public sealed partial class AnonymousPipeServerStream : PipeStream { - private SafePipeHandle _clientHandle; + private SafePipeHandle _clientHandle = null!; private bool _clientHandleExposed; public AnonymousPipeServerStream() @@ -88,7 +88,6 @@ public AnonymousPipeServerStream(PipeDirection direction, HandleInheritability i // This method should exist until we add a first class way of passing handles between parent and child // processes. For now, people do it via command line arguments. - [SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Runtime.InteropServices.SafeHandle.DangerousGetHandle", Justification = "By design")] public string GetClientHandleAsString() { _clientHandleExposed = true; diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStreamAcl.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStreamAcl.cs index f63da142d5bc1b..75c8010713ea1e 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStreamAcl.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStreamAcl.cs @@ -17,7 +17,7 @@ public static class AnonymousPipeServerStreamAcl /// Setting to is equivalent to calling the `System.IO.Pipes.AnonymousPipeServerStream(System.IO.Pipes.PipeDirection direction, System.IO.HandleInheritability inheritability, int bufferSize)` constructor directly. /// is . /// is not set to a valid enum value. - public static AnonymousPipeServerStream Create(PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity pipeSecurity) + public static AnonymousPipeServerStream Create(PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity? pipeSecurity) { return new AnonymousPipeServerStream(direction, inheritability, bufferSize, pipeSecurity); } diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/ConnectionCompletionSource.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/ConnectionCompletionSource.cs index f5a34ba8bf0415..f0e4f1d5533d0d 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/ConnectionCompletionSource.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/ConnectionCompletionSource.cs @@ -13,7 +13,7 @@ internal sealed class ConnectionCompletionSource : PipeCompletionSource.Empty) + : base(server._threadPoolBinding!, ReadOnlyMemory.Empty) { _serverStream = server; } diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs index 584a69bcdce27d..3025ee6868f44a 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs @@ -25,7 +25,7 @@ private bool TryConnect(int timeout, CancellationToken cancellationToken) // immediately if it isn't. The only delay will be between the time the server // has called Bind and Listen, with the latter immediately following the former. var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); - SafePipeHandle clientHandle = null; + SafePipeHandle? clientHandle = null; try { socket.Connect(new UnixDomainSocketEndPoint(_normalizedPipePath)); @@ -69,7 +69,6 @@ private bool TryConnect(int timeout, CancellationToken cancellationToken) public int NumberOfServerInstances { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs index e1d28d721cd233..2fa4c1575e7659 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs @@ -110,7 +110,6 @@ private bool TryConnect(int timeout, CancellationToken cancellationToken) public unsafe int NumberOfServerInstances { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); @@ -121,7 +120,7 @@ public unsafe int NumberOfServerInstances // access request before calling NTCreateFile, so all NamedPipeClientStreams can read // this if they are created (on WinXP SP2 at least)] uint numInstances; - if (!Interop.Kernel32.GetNamedPipeHandleStateW(InternalHandle, null, &numInstances, null, null, null, 0)) + if (!Interop.Kernel32.GetNamedPipeHandleStateW(InternalHandle!, null, &numInstances, null, null, null, 0)) { throw WinIOError(Marshal.GetLastWin32Error()); } @@ -136,10 +135,10 @@ private void ValidateRemotePipeUser() return; PipeSecurity accessControl = this.GetAccessControl(); - IdentityReference remoteOwnerSid = accessControl.GetOwner(typeof(SecurityIdentifier)); + IdentityReference? remoteOwnerSid = accessControl.GetOwner(typeof(SecurityIdentifier)); using (WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent()) { - SecurityIdentifier currentUserSid = currentIdentity.Owner; + SecurityIdentifier? currentUserSid = currentIdentity.Owner; if (remoteOwnerSid != currentUserSid) { State = PipeState.Closed; diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs index 796c3f9586601e..73bc1332da466f 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs @@ -20,7 +20,7 @@ public sealed partial class NamedPipeClientStream : PipeStream // Maximum interval in milliseconds between which cancellation is checked. // Used by ConnectInternal. 50ms is fairly responsive time but really long time for processor. private const int CancellationCheckInterval = 50; - private readonly string _normalizedPipePath; + private readonly string? _normalizedPipePath; private readonly TokenImpersonationLevel _impersonationLevel; private readonly PipeOptions _pipeOptions; private readonly HandleInheritability _inheritability; diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Unix.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Unix.cs index a47efd6d9c69bb..5b0cbe776bc171 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Unix.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Unix.cs @@ -15,7 +15,7 @@ namespace System.IO.Pipes { public sealed partial class NamedPipeServerStream : PipeStream { - private SharedServer _instance; + private SharedServer? _instance; private PipeDirection _direction; private PipeOptions _options; private int _inBufferSize; @@ -62,7 +62,7 @@ public void WaitForConnection() // Use and block on AcceptAsync() rather than using Accept() in order to provide // behavior more akin to Windows if the Stream is closed while a connection is pending. - Socket accepted = _instance.ListeningSocket.AcceptAsync().GetAwaiter().GetResult(); + Socket accepted = _instance!.ListeningSocket.AcceptAsync().GetAwaiter().GetResult(); HandleAcceptedSocket(accepted); } @@ -79,7 +79,7 @@ public Task WaitForConnectionAsync(CancellationToken cancellationToken) WaitForConnectionAsyncCore(); async Task WaitForConnectionAsyncCore() => - HandleAcceptedSocket(await _instance.ListeningSocket.AcceptAsync().ConfigureAwait(false)); + HandleAcceptedSocket(await _instance!.ListeningSocket.AcceptAsync().ConfigureAwait(false)); } private void HandleAcceptedSocket(Socket acceptedSocket) @@ -124,7 +124,7 @@ public void Disconnect() { CheckDisconnectOperations(); State = PipeState.Disconnected; - InternalHandle.Dispose(); + InternalHandle!.Dispose(); InitializeHandle(null, false, false); } @@ -135,7 +135,7 @@ public string GetImpersonationUserName() { CheckWriteOperations(); - SafeHandle handle = InternalHandle?.NamedPipeSocketHandle; + SafeHandle? handle = InternalHandle?.NamedPipeSocketHandle; if (handle == null) { throw new InvalidOperationException(SR.InvalidOperation_PipeHandleNotSet); @@ -178,7 +178,7 @@ public override int OutBufferSize public void RunAsClient(PipeStreamImpersonationWorker impersonationWorker) { CheckWriteOperations(); - SafeHandle handle = InternalHandle?.NamedPipeSocketHandle; + SafeHandle? handle = InternalHandle?.NamedPipeSocketHandle; if (handle == null) { throw new InvalidOperationException(SR.InvalidOperation_PipeHandleNotSet); @@ -233,7 +233,7 @@ internal static SharedServer Get(string path, int maxCount) lock (s_servers) { - SharedServer server; + SharedServer? server; if (s_servers.TryGetValue(path, out server)) { // On Windows, if a subsequent server stream is created for the same pipe and with a different diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Win32.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Win32.cs index ea30ea28fad79d..410e969a4b4b80 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Win32.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Win32.cs @@ -23,7 +23,7 @@ private unsafe string HandleGetImpersonationUserNameError(int error, uint userNa { Interop.Kernel32.LoadLibraryEx("sspicli.dll", IntPtr.Zero, Interop.Kernel32.LOAD_LIBRARY_SEARCH_SYSTEM32); - if (Interop.Kernel32.GetNamedPipeHandleStateW(InternalHandle, null, null, null, null, userName, userNameMaxLength)) + if (Interop.Kernel32.GetNamedPipeHandleStateW(InternalHandle!, null, null, null, null, userName, userNameMaxLength)) { return new string(userName); } diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs index 7a988f415ff912..79e338d277a680 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs @@ -27,7 +27,7 @@ internal NamedPipeServerStream( PipeOptions options, int inBufferSize, int outBufferSize, - PipeSecurity pipeSecurity, + PipeSecurity? pipeSecurity, HandleInheritability inheritability = HandleInheritability.None, PipeAccessRights additionalAccessRights = default) : base(direction, transmissionMode, outBufferSize) @@ -53,7 +53,7 @@ private void Create(string pipeName, PipeDirection direction, int maxNumberOfSer // This overload is used in Mono to implement public constructors. private void Create(string pipeName, PipeDirection direction, int maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, int inBufferSize, int outBufferSize, - PipeSecurity pipeSecurity, HandleInheritability inheritability, PipeAccessRights additionalAccessRights) + PipeSecurity? pipeSecurity, HandleInheritability inheritability, PipeAccessRights additionalAccessRights) { Debug.Assert(pipeName != null && pipeName.Length != 0, "fullPipeName is null or empty"); Debug.Assert(direction >= PipeDirection.In && direction <= PipeDirection.InOut, "invalid pipe direction"); @@ -76,7 +76,7 @@ private void Create(string pipeName, PipeDirection direction, int maxNumberOfSer using (WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent()) { - SecurityIdentifier identifier = currentIdentity.Owner; + SecurityIdentifier identifier = currentIdentity.Owner!; // Grant full control to the owner so multiple servers can be opened. // Full control is the default per MSDN docs for CreateNamedPipe. @@ -135,7 +135,6 @@ private void Create(string pipeName, PipeDirection direction, int maxNumberOfSer // was called (but not before this server is been created, or, if we were servicing another client, // not before we called Disconnect), in which case, there may be some buffer already in the pipe waiting // for us to read. See NamedPipeClientStream.Connect for more information. - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] public void WaitForConnection() { CheckConnectOperationsServerWithHandle(); @@ -146,7 +145,7 @@ public void WaitForConnection() } else { - if (!Interop.Kernel32.ConnectNamedPipe(InternalHandle, IntPtr.Zero)) + if (!Interop.Kernel32.ConnectNamedPipe(InternalHandle!, IntPtr.Zero)) { int errorCode = Marshal.GetLastWin32Error(); @@ -178,7 +177,7 @@ public Task WaitForConnectionAsync(CancellationToken cancellationToken) if (!IsAsync) { - return Task.Factory.StartNew(s => ((NamedPipeServerStream)s).WaitForConnection(), + return Task.Factory.StartNew(s => ((NamedPipeServerStream)s!).WaitForConnection(), this, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } @@ -190,7 +189,7 @@ public void Disconnect() CheckDisconnectOperations(); // Disconnect the pipe. - if (!Interop.Kernel32.DisconnectNamedPipe(InternalHandle)) + if (!Interop.Kernel32.DisconnectNamedPipe(InternalHandle!)) { throw Win32Marshal.GetExceptionForLastWin32Error(); } @@ -208,7 +207,7 @@ public unsafe string GetImpersonationUserName() const uint UserNameMaxLength = Interop.Kernel32.CREDUI_MAX_USERNAME_LENGTH + 1; char* userName = stackalloc char[(int)UserNameMaxLength]; // ~1K - if (Interop.Kernel32.GetNamedPipeHandleStateW(InternalHandle, null, null, null, null, userName, UserNameMaxLength)) + if (Interop.Kernel32.GetNamedPipeHandleStateW(InternalHandle!, null, null, null, null, userName, UserNameMaxLength)) { return new string(userName); } @@ -245,11 +244,11 @@ public void RunAsClient(PipeStreamImpersonationWorker impersonationWorker) private static readonly RuntimeHelpers.TryCode tryCode = new RuntimeHelpers.TryCode(ImpersonateAndTryCode); private static readonly RuntimeHelpers.CleanupCode cleanupCode = new RuntimeHelpers.CleanupCode(RevertImpersonationOnBackout); - private static void ImpersonateAndTryCode(object helper) + private static void ImpersonateAndTryCode(object? helper) { - ExecuteHelper execHelper = (ExecuteHelper)helper; + ExecuteHelper execHelper = (ExecuteHelper)helper!; - if (Interop.Advapi32.ImpersonateNamedPipeClient(execHelper._handle)) + if (Interop.Advapi32.ImpersonateNamedPipeClient(execHelper._handle!)) { execHelper._mustRevert = true; } @@ -265,9 +264,9 @@ private static void ImpersonateAndTryCode(object helper) } } - private static void RevertImpersonationOnBackout(object helper, bool exceptionThrown) + private static void RevertImpersonationOnBackout(object? helper, bool exceptionThrown) { - ExecuteHelper execHelper = (ExecuteHelper)helper; + ExecuteHelper execHelper = (ExecuteHelper)helper!; if (execHelper._mustRevert) { @@ -281,12 +280,12 @@ private static void RevertImpersonationOnBackout(object helper, bool exceptionTh internal class ExecuteHelper { internal PipeStreamImpersonationWorker _userCode; - internal SafePipeHandle _handle; + internal SafePipeHandle? _handle; internal bool _mustRevert; internal int _impersonateErrorCode; internal int _revertImpersonateErrorCode; - internal ExecuteHelper(PipeStreamImpersonationWorker userCode, SafePipeHandle handle) + internal ExecuteHelper(PipeStreamImpersonationWorker userCode, SafePipeHandle? handle) { _userCode = userCode; _handle = handle; @@ -305,7 +304,7 @@ private unsafe Task WaitForConnectionCoreAsync(CancellationToken cancellationTok var completionSource = new ConnectionCompletionSource(this); - if (!Interop.Kernel32.ConnectNamedPipe(InternalHandle, completionSource.Overlapped)) + if (!Interop.Kernel32.ConnectNamedPipe(InternalHandle!, completionSource.Overlapped)) { int errorCode = Marshal.GetLastWin32Error(); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.cs index d4cae06073fdd2..51e73721f678a0 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.cs @@ -184,7 +184,6 @@ public void EndWaitForConnection(IAsyncResult asyncResult) => TaskToApm.End(asyncResult); // Server can only connect from Disconnected state - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Consistent with security model")] private void CheckConnectOperationsServer() { // we're not checking whether already connected; this allows us to throw IOException diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStreamAcl.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStreamAcl.cs index 53980df96872e9..467b82368f7bf9 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStreamAcl.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStreamAcl.cs @@ -41,7 +41,7 @@ public static NamedPipeServerStream Create( PipeOptions options, int inBufferSize, int outBufferSize, - PipeSecurity pipeSecurity, + PipeSecurity? pipeSecurity, HandleInheritability inheritability = HandleInheritability.None, PipeAccessRights additionalAccessRights = default) { diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeCompletionSource.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeCompletionSource.cs index 31189655eaa02d..484e138d47fe4f 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeCompletionSource.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeCompletionSource.cs @@ -43,7 +43,7 @@ protected PipeCompletionSource(ThreadPoolBoundHandle handle, ReadOnlyMemory { - var completionSource = (PipeCompletionSource)ThreadPoolBoundHandle.GetNativeOverlappedState(pOverlapped); + var completionSource = (PipeCompletionSource)ThreadPoolBoundHandle.GetNativeOverlappedState(pOverlapped)!; Debug.Assert(completionSource.Overlapped == pOverlapped); completionSource.AsyncCallback(errorCode, numBytes); @@ -70,7 +70,7 @@ internal void RegisterForCancellation(CancellationToken cancellationToken) if (state == NoResult) { // Register the cancellation - _cancellationRegistration = cancellationToken.UnsafeRegister(thisRef => ((PipeCompletionSource)thisRef).Cancel(), this); + _cancellationRegistration = cancellationToken.UnsafeRegister(thisRef => ((PipeCompletionSource)thisRef!).Cancel(), this); // Grab the state for case if IO completed while we were setting the registration. state = Interlocked.Exchange(ref _state, NoResult); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeSecurity.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeSecurity.cs index eb26265e05d4ef..7a826e20139940 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeSecurity.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeSecurity.cs @@ -55,7 +55,7 @@ public bool RemoveAccessRule(PipeAccessRule rule) for (int i = 0; i < rules.Count; i++) { - PipeAccessRule fsrule = rules[i] as PipeAccessRule; + PipeAccessRule? fsrule = rules[i] as PipeAccessRule; if ((fsrule != null) && (fsrule.PipeAccessRights == rule.PipeAccessRights) && (fsrule.IdentityReference == rule.IdentityReference) @@ -97,7 +97,7 @@ public void RemoveAccessRuleSpecific(PipeAccessRule rule) for (int i = 0; i < rules.Count; i++) { - PipeAccessRule fsrule = rules[i] as PipeAccessRule; + PipeAccessRule? fsrule = rules[i] as PipeAccessRule; if ((fsrule != null) && (fsrule.PipeAccessRights == rule.PipeAccessRights) && (fsrule.IdentityReference == rule.IdentityReference) diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs index 10556bcf2c56a7..fdd1d920647a3c 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs @@ -109,10 +109,11 @@ internal virtual void DisposeCore(bool disposing) private unsafe int ReadCore(Span buffer) { + Debug.Assert(_handle != null); DebugAssertHandleValid(_handle); // For named pipes, receive on the socket. - Socket socket = _handle.NamedPipeSocket; + Socket? socket = _handle.NamedPipeSocket; if (socket != null) { // For a blocking socket, we could simply use the same Read syscall as is done @@ -140,10 +141,11 @@ private unsafe int ReadCore(Span buffer) private unsafe void WriteCore(ReadOnlySpan buffer) { + Debug.Assert(_handle != null); DebugAssertHandleValid(_handle); // For named pipes, send to the socket. - Socket socket = _handle.NamedPipeSocket; + Socket? socket = _handle.NamedPipeSocket; if (socket != null) { // For a blocking socket, we could simply use the same Write syscall as is done @@ -181,7 +183,7 @@ private async ValueTask ReadAsyncCore(Memory destination, Cancellatio try { - return await InternalHandle.NamedPipeSocket.ReceiveAsync(destination, SocketFlags.None, cancellationToken).ConfigureAwait(false); + return await InternalHandle!.NamedPipeSocket.ReceiveAsync(destination, SocketFlags.None, cancellationToken).ConfigureAwait(false); } catch (SocketException e) { @@ -197,7 +199,7 @@ private async Task WriteAsyncCore(ReadOnlyMemory source, CancellationToken { while (source.Length > 0) { - int bytesWritten = await _handle.NamedPipeSocket.SendAsync(source, SocketFlags.None, cancellationToken).ConfigureAwait(false); + int bytesWritten = await _handle!.NamedPipeSocket.SendAsync(source, SocketFlags.None, cancellationToken).ConfigureAwait(false); Debug.Assert(bytesWritten > 0 && bytesWritten <= source.Length); source = source.Slice(bytesWritten); } @@ -237,7 +239,6 @@ public void WaitForPipeDrain() // override this in cases where only one mode is legal (such as anonymous pipes) public virtual PipeTransmissionMode TransmissionMode { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); @@ -249,7 +250,6 @@ public virtual PipeTransmissionMode TransmissionMode // access. If that passes, call to GetNamedPipeInfo will succeed. public virtual int InBufferSize { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] get { CheckPipePropertyOperations(); @@ -267,7 +267,6 @@ public virtual int InBufferSize // the ctor. public virtual int OutBufferSize { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); @@ -286,7 +285,6 @@ public virtual PipeTransmissionMode ReadMode CheckPipePropertyOperations(); return PipeTransmissionMode.Byte; // Unix pipes are only byte-based, not message-based } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] set { CheckPipePropertyOperations(); @@ -314,7 +312,7 @@ public virtual PipeTransmissionMode ReadMode /// semaphore. Since we don't delegate to the base stream for Read/WriteAsync due /// to having specialized support for cancellation, we do the same serialization here. /// - private SemaphoreSlim _asyncActiveSemaphore; + private SemaphoreSlim? _asyncActiveSemaphore; private SemaphoreSlim EnsureAsyncActiveSemaphoreInitialized() { @@ -420,7 +418,7 @@ internal static void ConfigureSocket( } } - internal static Exception CreateExceptionForLastError(string pipeName = null) + internal static Exception CreateExceptionForLastError(string? pipeName = null) { Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); return error.Error == Interop.Error.ENOTSUP ? diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs index c79bdc7dec73e6..8feb3b60eb65f6 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs @@ -14,7 +14,7 @@ namespace System.IO.Pipes public abstract partial class PipeStream : Stream { internal const bool CheckOperationsRequiresSetHandle = true; - internal ThreadPoolBoundHandle _threadPoolBinding; + internal ThreadPoolBoundHandle? _threadPoolBinding; internal static string GetPipePath(string serverName, string pipeName) { @@ -57,7 +57,7 @@ private void DisposeCore(bool disposing) private unsafe int ReadCore(Span buffer) { int errorCode = 0; - int r = ReadFileNative(_handle, buffer, null, out errorCode); + int r = ReadFileNative(_handle!, buffer, null, out errorCode); if (r == -1) { @@ -89,7 +89,7 @@ private ValueTask ReadAsyncCore(Memory buffer, CancellationToken canc int r; unsafe { - r = ReadFileNative(_handle, buffer.Span, completionSource.Overlapped, out errorCode); + r = ReadFileNative(_handle!, buffer.Span, completionSource.Overlapped, out errorCode); } // ReadFile, the OS version, will return 0 on failure, but this ReadFileNative wrapper @@ -137,7 +137,7 @@ private ValueTask ReadAsyncCore(Memory buffer, CancellationToken canc private unsafe void WriteCore(ReadOnlySpan buffer) { int errorCode = 0; - int r = WriteFileNative(_handle, buffer, null, out errorCode); + int r = WriteFileNative(_handle!, buffer, null, out errorCode); if (r == -1) { @@ -155,7 +155,7 @@ private Task WriteAsyncCore(ReadOnlyMemory buffer, CancellationToken cance int r; unsafe { - r = WriteFileNative(_handle, buffer.Span, completionSource.Overlapped, out errorCode); + r = WriteFileNative(_handle!, buffer.Span, completionSource.Overlapped, out errorCode); } // WriteFile, the OS version, will return 0 on failure, but this WriteFileNative @@ -188,7 +188,7 @@ public void WaitForPipeDrain() } // Block until other end of the pipe has read everything. - if (!Interop.Kernel32.FlushFileBuffers(_handle)) + if (!Interop.Kernel32.FlushFileBuffers(_handle!)) { throw WinIOError(Marshal.GetLastWin32Error()); } @@ -198,7 +198,6 @@ public void WaitForPipeDrain() // override this in cases where only one mode is legal (such as anonymous pipes) public unsafe virtual PipeTransmissionMode TransmissionMode { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); @@ -206,7 +205,7 @@ public unsafe virtual PipeTransmissionMode TransmissionMode if (_isFromExistingHandle) { uint pipeFlags; - if (!Interop.Kernel32.GetNamedPipeInfo(_handle, &pipeFlags, null, null, null)) + if (!Interop.Kernel32.GetNamedPipeInfo(_handle!, &pipeFlags, null, null, null)) { throw WinIOError(Marshal.GetLastWin32Error()); } @@ -230,7 +229,6 @@ public unsafe virtual PipeTransmissionMode TransmissionMode // access. If that passes, call to GetNamedPipeInfo will succeed. public unsafe virtual int InBufferSize { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] get { CheckPipePropertyOperations(); @@ -240,7 +238,7 @@ public unsafe virtual int InBufferSize } uint inBufferSize; - if (!Interop.Kernel32.GetNamedPipeInfo(_handle, null, null, &inBufferSize, null)) + if (!Interop.Kernel32.GetNamedPipeInfo(_handle!, null, null, &inBufferSize, null)) { throw WinIOError(Marshal.GetLastWin32Error()); } @@ -255,7 +253,6 @@ public unsafe virtual int InBufferSize // the ctor. public unsafe virtual int OutBufferSize { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); @@ -271,7 +268,7 @@ public unsafe virtual int OutBufferSize { outBufferSize = _outBufferSize; } - else if (!Interop.Kernel32.GetNamedPipeInfo(_handle, null, &outBufferSize, null, null)) + else if (!Interop.Kernel32.GetNamedPipeInfo(_handle!, null, &outBufferSize, null, null)) { throw WinIOError(Marshal.GetLastWin32Error()); } @@ -293,7 +290,6 @@ public virtual PipeTransmissionMode ReadMode } return _readMode; } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] set { // Nothing fancy here. This is just a wrapper around the Win32 API. Note, that NamedPipeServerStream @@ -308,7 +304,7 @@ public virtual PipeTransmissionMode ReadMode unsafe { int pipeReadType = (int)value << 1; - if (!Interop.Kernel32.SetNamedPipeHandleState(_handle, &pipeReadType, IntPtr.Zero, IntPtr.Zero)) + if (!Interop.Kernel32.SetNamedPipeHandleState(_handle!, &pipeReadType, IntPtr.Zero, IntPtr.Zero)) { throw WinIOError(Marshal.GetLastWin32Error()); } @@ -408,7 +404,7 @@ internal static unsafe Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(HandleIn return secAttrs; } - internal static unsafe Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(HandleInheritability inheritability, PipeSecurity pipeSecurity, ref GCHandle pinningHandle) + internal static unsafe Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(HandleInheritability inheritability, PipeSecurity? pipeSecurity, ref GCHandle pinningHandle) { Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs = GetSecAttrs(inheritability); @@ -470,7 +466,7 @@ internal Exception WinIOError(int errorCode) // For invalid handles, detect the error and mark our handle // as invalid to give slightly better error messages. Also // help ensure we avoid handle recycling bugs. - _handle.SetHandleAsInvalid(); + _handle!.SetHandleAsInvalid(); _state = PipeState.Broken; break; } diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.cs index b8e684df509e3e..142f514ca35523 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.cs @@ -16,7 +16,7 @@ public abstract partial class PipeStream : Stream internal const string AnonymousPipeName = "anonymous"; private static readonly Task s_zeroTask = Task.FromResult(0); - private SafePipeHandle _handle; + private SafePipeHandle? _handle; private bool _canRead; private bool _canWrite; private bool _isAsync; @@ -94,7 +94,7 @@ private void Init(PipeDirection direction, PipeTransmissionMode transmissionMode // Once a PipeStream has a handle ready, it should call this method to set up the PipeStream. If // the pipe is in a connected state already, it should also set the IsConnected (protected) property. // This method may also be called to uninitialize a handle, setting it to null. - protected void InitializeHandle(SafePipeHandle handle, bool isExposed, bool isAsync) + protected void InitializeHandle(SafePipeHandle? handle, bool isExposed, bool isAsync) { if (isAsync && handle != null) { @@ -199,7 +199,7 @@ public override Task ReadAsync(byte[] buffer, int offset, int count, Cancel return ReadAsyncCore(buffer, cancellationToken); } - public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) + public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state) { if (_isAsync) return TaskToApm.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), callback, state); @@ -305,7 +305,7 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati return new ValueTask(WriteAsyncCore(buffer, cancellationToken)); } - public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) + public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state) { if (_isAsync) return TaskToApm.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), callback, state); @@ -424,7 +424,6 @@ public bool IsAsync // message, otherwise it is set to true. public bool IsMessageComplete { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { // omitting pipe broken exception to allow reader to finish getting message @@ -465,7 +464,6 @@ internal void UpdateMessageCompletion(bool completion) public SafePipeHandle SafePipeHandle { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { if (_handle == null) @@ -482,7 +480,7 @@ public SafePipeHandle SafePipeHandle } } - internal SafePipeHandle InternalHandle + internal SafePipeHandle? InternalHandle { get { diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/ReadWriteCompletionSource.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/ReadWriteCompletionSource.cs index b75b872818969f..979fcc19f46428 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/ReadWriteCompletionSource.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/ReadWriteCompletionSource.cs @@ -16,7 +16,7 @@ internal sealed class ReadWriteCompletionSource : PipeCompletionSource private int _numBytes; // number of buffer read OR written internal ReadWriteCompletionSource(PipeStream stream, ReadOnlyMemory bufferToPin, bool isWrite) - : base(stream._threadPoolBinding, bufferToPin) + : base(stream._threadPoolBinding!, bufferToPin) { _pipeStream = stream; _isWrite = isWrite; diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.RunAsClient.Unix.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.RunAsClient.Unix.cs index 3025b04e1bc0f7..e3d5fd9417855d 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.RunAsClient.Unix.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.RunAsClient.Unix.cs @@ -27,7 +27,7 @@ public static bool IsSuperUser() [ConditionalFact(nameof(IsSuperUser))] [PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invokes - [ActiveIssue("https://github.com/dotnet/corefx/issues/0")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/0")] public void RunAsClient_Unix() { string pipeName = Path.GetRandomFileName(); diff --git a/src/libraries/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj b/src/libraries/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj index dbb57e200242f8..4984e9c3d7902c 100644 --- a/src/libraries/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj +++ b/src/libraries/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj @@ -2,7 +2,7 @@ true true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Windows_NT + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix diff --git a/src/libraries/System.IO.Ports/ref/System.IO.Ports.cs b/src/libraries/System.IO.Ports/ref/System.IO.Ports.cs index d833e46a7d4880..e30a44d8c1d43c 100644 --- a/src/libraries/System.IO.Ports/ref/System.IO.Ports.cs +++ b/src/libraries/System.IO.Ports/ref/System.IO.Ports.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System.IO.Ports diff --git a/src/libraries/System.IO.Ports/ref/System.IO.Ports.csproj b/src/libraries/System.IO.Ports/ref/System.IO.Ports.csproj index 1ae35f7a35f228..d48f7a0a1c0667 100644 --- a/src/libraries/System.IO.Ports/ref/System.IO.Ports.csproj +++ b/src/libraries/System.IO.Ports/ref/System.IO.Ports.csproj @@ -2,7 +2,7 @@ true netstandard2.0;net461;$(NetFrameworkCurrent) - true + true diff --git a/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj b/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj index 91dee0b2ef86ba..8b261f91ada340 100644 --- a/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj +++ b/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj @@ -2,15 +2,15 @@ true true - SR.PlatformNotSupported_IOPorts + SR.PlatformNotSupported_IOPorts $(DefineConstants);NOSPAN true annotations netstandard2.0-Windows_NT;netstandard2.0-Linux;netstandard2.0-OSX;netstandard2.0;net461-Windows_NT;netstandard2.0-FreeBSD;$(NetFrameworkCurrent)-Windows_NT - true - true + true + true - + diff --git a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.FreeBSD.cs b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.FreeBSD.cs index c56f59cfd54b1a..47ac11438725e7 100644 --- a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.FreeBSD.cs +++ b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.FreeBSD.cs @@ -17,7 +17,7 @@ public static string[] GetPortNames() foreach (string name in Directory.GetFiles("/dev", "ttyd*")) { - if (!name.EndsWith(".init") && !name.EndsWith(".lock")) + if (!name.EndsWith(".init", StringComparison.Ordinal) && !name.EndsWith(".lock", StringComparison.Ordinal)) { ports.Add(name); } @@ -25,7 +25,7 @@ public static string[] GetPortNames() foreach (string name in Directory.GetFiles("/dev", "cuau*")) { - if (!name.EndsWith(".init") && !name.EndsWith(".lock")) + if (!name.EndsWith(".init", StringComparison.Ordinal) && !name.EndsWith(".lock", StringComparison.Ordinal)) { ports.Add(name); } diff --git a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.Linux.cs b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.Linux.cs index fa9ba5da196eb0..3f2eadfd7373f3 100644 --- a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.Linux.cs +++ b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.Linux.cs @@ -32,8 +32,8 @@ public static string[] GetPortNames() // by checking for presence of device/id or device/of_node // checking for that for non-ttyS entries is incorrect as some uart // devices are incorrectly filtered out - bool isTtyS = entry.Name.StartsWith("ttyS"); - bool isTtyGS = !isTtyS && entry.Name.StartsWith("ttyGS"); + bool isTtyS = entry.Name.StartsWith("ttyS", StringComparison.Ordinal); + bool isTtyGS = !isTtyS && entry.Name.StartsWith("ttyGS", StringComparison.Ordinal); if ((isTtyS && (File.Exists(entry.FullName + "/device/id") || Directory.Exists(entry.FullName + "/device/of_node"))) || @@ -58,11 +58,11 @@ public static string[] GetPortNames() var ports = new List(); foreach (var portName in Directory.EnumerateFiles(devDir, "tty*")) { - if (portName.StartsWith("/dev/ttyS") || - portName.StartsWith("/dev/ttyUSB") || - portName.StartsWith("/dev/ttyACM") || - portName.StartsWith("/dev/ttyAMA") || - portName.StartsWith("/dev/ttymxc")) + if (portName.StartsWith("/dev/ttyS", StringComparison.Ordinal) || + portName.StartsWith("/dev/ttyUSB", StringComparison.Ordinal) || + portName.StartsWith("/dev/ttyACM", StringComparison.Ordinal) || + portName.StartsWith("/dev/ttyAMA", StringComparison.Ordinal) || + portName.StartsWith("/dev/ttymxc", StringComparison.Ordinal)) { ports.Add(portName); } diff --git a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.OSX.cs b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.OSX.cs index dcd2a47eb1c264..be1f9d8796a10d 100644 --- a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.OSX.cs +++ b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.OSX.cs @@ -19,7 +19,7 @@ public static string[] GetPortNames() { // GetFiles can return unexpected results because of 8.3 matching. // Like /dev/tty - if (name.StartsWith("/dev/tty.")) + if (name.StartsWith("/dev/tty.", StringComparison.Ordinal)) { ports.Add(name); } @@ -27,7 +27,7 @@ public static string[] GetPortNames() foreach (string name in Directory.GetFiles("/dev", "cu.*")) { - if (name.StartsWith("/dev/cu.")) + if (name.StartsWith("/dev/cu.", StringComparison.Ordinal)) { ports.Add(name); } diff --git a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs index 56cf3b7661377c..487b8b5d08a96d 100644 --- a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs +++ b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs @@ -1581,7 +1581,6 @@ internal bool ShutdownLoop } // This is the blocking method that waits for an event to occur. It wraps the SDK's WaitCommEvent function. - [SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", Justification = "this is debug-only code")] internal unsafe void WaitForCommEvent() { int unused = 0; diff --git a/src/libraries/System.IO.Ports/tests/SerialPort/AbortOnError.cs b/src/libraries/System.IO.Ports/tests/SerialPort/AbortOnError.cs index 11e9fc56b0a023..fe7b12716f87d7 100644 --- a/src/libraries/System.IO.Ports/tests/SerialPort/AbortOnError.cs +++ b/src/libraries/System.IO.Ports/tests/SerialPort/AbortOnError.cs @@ -14,7 +14,7 @@ namespace System.IO.Ports.Tests public class AbortOnError : PortsTest { /// - /// This is a test for https://github.com/dotnet/corefx/issues/17396, Connect issue 584116 + /// This is a test for https://github.com/dotnet/runtime/issues/20728, Connect issue 584116 /// /// The situation is as follows: /// * Some user of the port causes DCB.fAbortOnError to be set at some point diff --git a/src/libraries/System.IO.Ports/tests/SerialPort/GetPortNames.cs b/src/libraries/System.IO.Ports/tests/SerialPort/GetPortNames.cs index bc958956bbe285..c193892d5a92f1 100644 --- a/src/libraries/System.IO.Ports/tests/SerialPort/GetPortNames.cs +++ b/src/libraries/System.IO.Ports/tests/SerialPort/GetPortNames.cs @@ -45,7 +45,7 @@ public void AllHelperPortsAreInGetPortNames() { if (PlatformDetection.IsWindows && PlatformDetection.IsArmOrArm64Process) { - // [ActiveIssue("https://github.com/dotnet/corefx/issues/35722")] + // [ActiveIssue("https://github.com/dotnet/runtime/issues/28851")] throw new SkipTestException("Port detection broken on Windows IoT"); } @@ -60,7 +60,7 @@ public void AllHelperPortsAreInGetPortNames() /// /// Test that the test helpers have found every port that SerialPort.GetPortNames has found /// This catches regressions in the test helpers, - /// eg https://github.com/dotnet/corefx/issues/18928 / https://github.com/dotnet/corefx/issues/20668 + /// eg https://github.com/dotnet/corefx/pull/18928 / https://github.com/dotnet/corefx/pull/20668 /// [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] public void AllGetPortNamesAreInHelperPorts() diff --git a/src/libraries/System.IO.Ports/tests/SerialPort/OpenDevices.cs b/src/libraries/System.IO.Ports/tests/SerialPort/OpenDevices.cs index 6bc9569b2646fe..b48b474068dd87 100644 --- a/src/libraries/System.IO.Ports/tests/SerialPort/OpenDevices.cs +++ b/src/libraries/System.IO.Ports/tests/SerialPort/OpenDevices.cs @@ -12,7 +12,7 @@ namespace System.IO.Ports.Tests { public class OpenDevices : PortsTest { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // see https://github.com/dotnet/corefx/issues/29756#issuecomment-390338721 + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // see https://github.com/dotnet/runtime/issues/26199#issuecomment-390338721 public void OpenDevices01() { DosDevices dosDevices = new DosDevices(); diff --git a/src/libraries/System.IO.Ports/tests/SerialPort/ReadTimeout.cs b/src/libraries/System.IO.Ports/tests/SerialPort/ReadTimeout.cs index 4bfffbd55cbabe..d0f75f7dee32d3 100644 --- a/src/libraries/System.IO.Ports/tests/SerialPort/ReadTimeout.cs +++ b/src/libraries/System.IO.Ports/tests/SerialPort/ReadTimeout.cs @@ -33,7 +33,7 @@ private enum ThrowAt { Set, Open }; #region Test Cases - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasLoopbackOrNullModem))] public void ReadTimeout_Default_Read_byte_int_int() { @@ -41,7 +41,7 @@ public void ReadTimeout_Default_Read_byte_int_int() VerifyInfiniteTimeout(Read_byte_int_int, false); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasLoopbackOrNullModem))] public void ReadTimeout_Default_Read_char_int_int() { @@ -49,7 +49,7 @@ public void ReadTimeout_Default_Read_char_int_int() VerifyInfiniteTimeout(Read_char_int_int, false); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasLoopbackOrNullModem))] public void ReadTimeout_Default_ReadByte() { @@ -57,7 +57,7 @@ public void ReadTimeout_Default_ReadByte() VerifyInfiniteTimeout(ReadByte, false); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasLoopbackOrNullModem))] public void ReadTimeout_Default_ReadLine() { @@ -65,7 +65,7 @@ public void ReadTimeout_Default_ReadLine() VerifyInfiniteTimeout(ReadLine, false); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasLoopbackOrNullModem))] public void ReadTimeout_Default_ReadTo() { @@ -73,7 +73,7 @@ public void ReadTimeout_Default_ReadTo() VerifyInfiniteTimeout(ReadTo, false); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasLoopbackOrNullModem))] public void ReadTimeout_Infinite_Read_byte_int_int() { @@ -81,7 +81,7 @@ public void ReadTimeout_Infinite_Read_byte_int_int() VerifyInfiniteTimeout(Read_byte_int_int, true); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasLoopbackOrNullModem))] public void ReadTimeout_Infinite_Read_char_int_int() { @@ -89,7 +89,7 @@ public void ReadTimeout_Infinite_Read_char_int_int() VerifyInfiniteTimeout(Read_char_int_int, true); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasLoopbackOrNullModem))] public void ReadTimeout_Infinite_ReadByte() { @@ -97,7 +97,7 @@ public void ReadTimeout_Infinite_ReadByte() VerifyInfiniteTimeout(ReadByte, true); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasLoopbackOrNullModem))] public void ReadTimeout_Infinite_ReadLine() { @@ -105,7 +105,7 @@ public void ReadTimeout_Infinite_ReadLine() VerifyInfiniteTimeout(ReadLine, true); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasLoopbackOrNullModem))] public void ReadTimeout_Infinite_ReadTo() { @@ -113,7 +113,7 @@ public void ReadTimeout_Infinite_ReadTo() VerifyInfiniteTimeout(ReadTo, true); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_0_Read_byte_int_int_BeforeOpen() { @@ -121,7 +121,7 @@ public void ReadTimeout_0_Read_byte_int_int_BeforeOpen() VerifyZeroTimeoutBeforeOpen(Read_byte_int_int); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_0_Read_char_int_int_BeforeOpen() { @@ -129,7 +129,7 @@ public void ReadTimeout_0_Read_char_int_int_BeforeOpen() VerifyZeroTimeoutBeforeOpen(Read_char_int_int); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_0_ReadByte_BeforeOpen() { @@ -137,7 +137,7 @@ public void ReadTimeout_0_ReadByte_BeforeOpen() VerifyZeroTimeoutBeforeOpen(ReadByte); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_0_ReadLine_BeforeOpen() { @@ -145,7 +145,7 @@ public void ReadTimeout_0_ReadLine_BeforeOpen() VerifyZeroTimeoutBeforeOpen(ReadLine); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_0_ReadTo_BeforeOpen() { @@ -153,7 +153,7 @@ public void ReadTimeout_0_ReadTo_BeforeOpen() VerifyZeroTimeoutBeforeOpen(ReadTo); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_0_Read_byte_int_int_AfterOpen() { @@ -161,7 +161,7 @@ public void ReadTimeout_0_Read_byte_int_int_AfterOpen() VerifyZeroTimeoutAfterOpen(Read_byte_int_int); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_0_Read_char_int_int_AfterOpen() { @@ -169,7 +169,7 @@ public void ReadTimeout_0_Read_char_int_int_AfterOpen() VerifyZeroTimeoutAfterOpen(Read_char_int_int); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_0_ReadByte_AfterOpen() { @@ -177,7 +177,7 @@ public void ReadTimeout_0_ReadByte_AfterOpen() VerifyZeroTimeoutAfterOpen(ReadByte); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_0_ReadLine_AfterOpen() { @@ -185,7 +185,7 @@ public void ReadTimeout_0_ReadLine_AfterOpen() VerifyZeroTimeoutAfterOpen(ReadLine); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_0_ReadTo_AfterOpen() { @@ -193,7 +193,7 @@ public void ReadTimeout_0_ReadTo_AfterOpen() VerifyZeroTimeoutAfterOpen(ReadTo); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_Int32MinValue() { @@ -202,7 +202,7 @@ public void ReadTimeout_Int32MinValue() VerifyException(int.MinValue, ThrowAt.Set, typeof(ArgumentOutOfRangeException)); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort))] public void ReadTimeout_NEG2() { diff --git a/src/libraries/System.IO.Ports/tests/SerialPort/WriteTimeout.cs b/src/libraries/System.IO.Ports/tests/SerialPort/WriteTimeout.cs index 413d0d9cf2785d..f0813d9d2f2fa0 100644 --- a/src/libraries/System.IO.Ports/tests/SerialPort/WriteTimeout.cs +++ b/src/libraries/System.IO.Ports/tests/SerialPort/WriteTimeout.cs @@ -73,7 +73,7 @@ public void WriteTimeout_Infinite_Write_byte_int_int() VerifyInfiniteTimeout(Write_byte_int_int, true); } - [ActiveIssue("https://github.com/dotnet/corefx/issues/15961")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/20149")] [ConditionalFact(nameof(HasOneSerialPort), nameof(HasHardwareFlowControl))] public void WriteTimeout_Infinite_Write_char_int_int() { diff --git a/src/libraries/System.IO.Ports/tests/Support/TCSupport.cs b/src/libraries/System.IO.Ports/tests/Support/TCSupport.cs index 8028134e2b0d22..52d1641f9c8d89 100644 --- a/src/libraries/System.IO.Ports/tests/Support/TCSupport.cs +++ b/src/libraries/System.IO.Ports/tests/Support/TCSupport.cs @@ -107,9 +107,9 @@ private static void GenerateSerialInfo() } // See Github issues: - // https://github.com/dotnet/corefx/issues/15961 - // https://github.com/dotnet/corefx/issues/16033 - // https://github.com/dotnet/corefx/issues/20764 + // https://github.com/dotnet/runtime/issues/20149 + // https://github.com/dotnet/runtime/issues/20174 + // https://github.com/dotnet/runtime/issues/22159 // hardware tests are currently insufficiently stable on master CI if (loopbackPortName == null && !nullModemPresent) { diff --git a/src/libraries/System.IO.UnmanagedMemoryStream/ref/System.IO.UnmanagedMemoryStream.Forwards.cs b/src/libraries/System.IO.UnmanagedMemoryStream/ref/System.IO.UnmanagedMemoryStream.Forwards.cs index 0340e6b4c5f7dc..e6102af8656102 100644 --- a/src/libraries/System.IO.UnmanagedMemoryStream/ref/System.IO.UnmanagedMemoryStream.Forwards.cs +++ b/src/libraries/System.IO.UnmanagedMemoryStream/ref/System.IO.UnmanagedMemoryStream.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.UnmanagedMemoryStream))] diff --git a/src/libraries/System.IO/ref/System.IO.Forwards.cs b/src/libraries/System.IO/ref/System.IO.Forwards.cs index d36e5e46d92bcf..732eae34a186eb 100644 --- a/src/libraries/System.IO/ref/System.IO.Forwards.cs +++ b/src/libraries/System.IO/ref/System.IO.Forwards.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. +// Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ diff --git a/src/libraries/System.Json/System.Json.sln b/src/libraries/System.Json/System.Json.sln deleted file mode 100644 index 1dd48f1036ab67..00000000000000 --- a/src/libraries/System.Json/System.Json.sln +++ /dev/null @@ -1,41 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27213.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Json.Tests", "tests\System.Json.Tests.csproj", "{DC683D60-34EC-4D85-B6E0-E97FDB37A583}" - ProjectSection(ProjectDependencies) = postProject - {B11B5B76-F583-44EA-A4B7-3ABD990594F6} = {B11B5B76-F583-44EA-A4B7-3ABD990594F6} - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Json", "src\System.Json.csproj", "{B11B5B76-F583-44EA-A4B7-3ABD990594F6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1A2F9F4A-A032-433E-B914-ADD5992BB178}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DC683D60-34EC-4D85-B6E0-E97FDB37A583}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC683D60-34EC-4D85-B6E0-E97FDB37A583}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC683D60-34EC-4D85-B6E0-E97FDB37A583}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC683D60-34EC-4D85-B6E0-E97FDB37A583}.Release|Any CPU.Build.0 = Release|Any CPU - {B11B5B76-F583-44EA-A4B7-3ABD990594F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B11B5B76-F583-44EA-A4B7-3ABD990594F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B11B5B76-F583-44EA-A4B7-3ABD990594F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B11B5B76-F583-44EA-A4B7-3ABD990594F6}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {DC683D60-34EC-4D85-B6E0-E97FDB37A583} = {1A2F9F4A-A032-433E-B914-ADD5992BB178} - {B11B5B76-F583-44EA-A4B7-3ABD990594F6} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {8592804E-48D0-459C-94AC-3197E1828A1B} - EndGlobalSection -EndGlobal diff --git a/src/libraries/System.Json/pkg/System.Json.pkgproj b/src/libraries/System.Json/pkg/System.Json.pkgproj deleted file mode 100644 index bc51c68512c181..00000000000000 --- a/src/libraries/System.Json/pkg/System.Json.pkgproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - - net45;netcore45;netcoreapp1.0;wp8;wpa81;$(AllXamarinFrameworks) - - - - true - - - true - - - true - - - true - - - true - - - true - - - - \ No newline at end of file diff --git a/src/libraries/System.Json/src/Resources/Strings.resx b/src/libraries/System.Json/src/Resources/Strings.resx deleted file mode 100644 index cab736c51571ce..00000000000000 --- a/src/libraries/System.Json/src/Resources/Strings.resx +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Extra characters in JSON input. - - - Incomplete JSON input. - - - Unexpected character '{0}'. - - - JSON array must end with ']'. - - - Leading zeros are not allowed. - - - Invalid JSON numeric literal; no digit found. - - - Invalid JSON numeric literal; extra dot. - - - Invalid JSON numeric literal; incomplete exponent. - - - Invalid JSON string literal format. - - - JSON string is not closed. - - - Invalid JSON string literal; incomplete escape sequence. - - - Incomplete unicode character escape literal. - - - Invalid JSON string literal; unexpected escape character. - - - Expected '{0}', got '{1}'. - - - Expected '{0}', differed at {1}. - - - {0} At line {1}, column {2}. - - - GetFormattedString from value type {0}. - - \ No newline at end of file diff --git a/src/libraries/System.Json/src/System.Json.csproj b/src/libraries/System.Json/src/System.Json.csproj deleted file mode 100644 index 7f9913752e7fa5..00000000000000 --- a/src/libraries/System.Json/src/System.Json.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - MicrosoftShared - netstandard1.0;netstandard2.0 - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/libraries/System.Json/src/System/Json/JavaScriptReader.cs b/src/libraries/System.Json/src/System/Json/JavaScriptReader.cs deleted file mode 100644 index 14824b75d65005..00000000000000 --- a/src/libraries/System.Json/src/System/Json/JavaScriptReader.cs +++ /dev/null @@ -1,434 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// See the LICENSE file in the project root for more information. - -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; - -namespace System.Runtime.Serialization.Json -{ - internal class JavaScriptReader - { - private readonly TextReader _r; - private int _line = 1, _column = 0; - private int _peek; - private bool _has_peek; - private bool _prev_lf; - - public JavaScriptReader(TextReader reader) - { - Debug.Assert(reader != null); - - _r = reader; - } - - public object Read() - { - object v = ReadCore(); - SkipSpaces(); - if (ReadChar() >= 0) - { - throw JsonError(SR.ArgumentException_ExtraCharacters); - } - return v; - } - - private object ReadCore() - { - SkipSpaces(); - int c = PeekChar(); - if (c < 0) - { - throw JsonError(SR.ArgumentException_IncompleteInput); - } - - switch (c) - { - case '[': - ReadChar(); - var list = new List(); - SkipSpaces(); - if (PeekChar() == ']') - { - ReadChar(); - return list; - } - - while (true) - { - list.Add(ReadCore()); - SkipSpaces(); - c = PeekChar(); - if (c != ',') - break; - ReadChar(); - continue; - } - - if (ReadChar() != ']') - { - throw JsonError(SR.ArgumentException_ArrayMustEndWithBracket); - } - - return list.ToArray(); - - case '{': - ReadChar(); - var obj = new Dictionary(); - SkipSpaces(); - if (PeekChar() == '}') - { - ReadChar(); - return obj; - } - - while (true) - { - SkipSpaces(); - if (PeekChar() == '}') - { - ReadChar(); - break; - } - string name = ReadStringLiteral(); - SkipSpaces(); - Expect(':'); - SkipSpaces(); - obj[name] = ReadCore(); // it does not reject duplicate names. - SkipSpaces(); - c = ReadChar(); - if (c == ',') - { - continue; - } - if (c == '}') - { - break; - } - } - return obj.ToArray(); - - case 't': - Expect("true"); - return true; - - case 'f': - Expect("false"); - return false; - - case 'n': - Expect("null"); - return null; - - case '"': - return ReadStringLiteral(); - - default: - if ('0' <= c && c <= '9' || c == '-') - { - return ReadNumericLiteral(); - } - throw JsonError(SR.Format(SR.ArgumentException_UnexpectedCharacter, (char)c)); - } - } - - private int PeekChar() - { - if (!_has_peek) - { - _peek = _r.Read(); - _has_peek = true; - } - return _peek; - } - - private int ReadChar() - { - int v = _has_peek ? _peek : _r.Read(); - - _has_peek = false; - - if (_prev_lf) - { - _line++; - _column = 0; - _prev_lf = false; - } - - if (v == '\n') - { - _prev_lf = true; - } - - _column++; - - return v; - } - - private void SkipSpaces() - { - while (true) - { - switch (PeekChar()) - { - case ' ': - case '\t': - case '\r': - case '\n': - ReadChar(); - continue; - - default: - return; - } - } - } - - // It could return either int, long, ulong, decimal or double, depending on the parsed value. - private object ReadNumericLiteral() - { - var sb = new StringBuilder(); - - if (PeekChar() == '-') - { - sb.Append((char)ReadChar()); - } - - int c; - int x = 0; - bool zeroStart = PeekChar() == '0'; - for (; ; x++) - { - c = PeekChar(); - if (c < '0' || '9' < c) - { - break; - } - - sb.Append((char)ReadChar()); - if (zeroStart && x == 1) - { - throw JsonError(SR.ArgumentException_LeadingZeros); - } - } - - if (x == 0) // Reached e.g. for "- " - { - throw JsonError(SR.ArgumentException_NoDigitFound); - } - - // fraction - bool hasFrac = false; - int fdigits = 0; - if (PeekChar() == '.') - { - hasFrac = true; - sb.Append((char)ReadChar()); - if (PeekChar() < 0) - { - throw JsonError(SR.ArgumentException_ExtraDot); - } - - while (true) - { - c = PeekChar(); - if (c < '0' || '9' < c) - { - break; - } - - sb.Append((char)ReadChar()); - fdigits++; - } - if (fdigits == 0) - { - throw JsonError(SR.ArgumentException_ExtraDot); - } - } - - c = PeekChar(); - if (c != 'e' && c != 'E') - { - if (!hasFrac) - { - int valueInt; - if (int.TryParse(sb.ToString(), NumberStyles.Float, CultureInfo.InvariantCulture, out valueInt)) - { - return valueInt; - } - - long valueLong; - if (long.TryParse(sb.ToString(), NumberStyles.Float, CultureInfo.InvariantCulture, out valueLong)) - { - return valueLong; - } - - ulong valueUlong; - if (ulong.TryParse(sb.ToString(), NumberStyles.Float, CultureInfo.InvariantCulture, out valueUlong)) - { - return valueUlong; - } - } - - decimal valueDecimal; - if (decimal.TryParse(sb.ToString(), NumberStyles.Float, CultureInfo.InvariantCulture, out valueDecimal) && valueDecimal != 0) - { - return valueDecimal; - } - } - else - { - // exponent - sb.Append((char)ReadChar()); - if (PeekChar() < 0) - { - throw JsonError(SR.ArgumentException_IncompleteExponent); - } - - c = PeekChar(); - if (c == '-') - { - sb.Append((char)ReadChar()); - } - else if (c == '+') - { - sb.Append((char)ReadChar()); - } - - if (PeekChar() < 0) - { - throw JsonError(SR.ArgumentException_IncompleteExponent); - } - - while (true) - { - c = PeekChar(); - if (c < '0' || '9' < c) - { - break; - } - - sb.Append((char)ReadChar()); - } - } - - return double.Parse(sb.ToString(), NumberStyles.Float, CultureInfo.InvariantCulture); - } - - private readonly StringBuilder _vb = new StringBuilder(); - - private string ReadStringLiteral() - { - if (PeekChar() != '"') - { - throw JsonError(SR.ArgumentException_InvalidLiteralFormat); - } - - ReadChar(); - _vb.Length = 0; - while (true) - { - int c = ReadChar(); - if (c < 0) - { - throw JsonError(SR.ArgumentException_StringNotClosed); - } - - if (c == '"') - { - return _vb.ToString(); - } - else if (c != '\\') - { - _vb.Append((char)c); - continue; - } - - // escaped expression - c = ReadChar(); - if (c < 0) - { - throw JsonError(SR.ArgumentException_IncompleteEscapeSequence); - } - switch (c) - { - case '"': - case '\\': - case '/': - _vb.Append((char)c); - break; - case 'b': - _vb.Append('\x8'); - break; - case 'f': - _vb.Append('\f'); - break; - case 'n': - _vb.Append('\n'); - break; - case 'r': - _vb.Append('\r'); - break; - case 't': - _vb.Append('\t'); - break; - case 'u': - ushort cp = 0; - for (int i = 0; i < 4; i++) - { - cp <<= 4; - if ((c = ReadChar()) < 0) - { - throw JsonError(SR.ArgumentException_IncompleteEscapeLiteral); - } - - if ('0' <= c && c <= '9') - { - cp += (ushort)(c - '0'); - } - if ('A' <= c && c <= 'F') - { - cp += (ushort)(c - 'A' + 10); - } - if ('a' <= c && c <= 'f') - { - cp += (ushort)(c - 'a' + 10); - } - } - _vb.Append((char)cp); - break; - default: - throw JsonError(SR.ArgumentException_UnexpectedEscapeCharacter); - } - } - } - - private void Expect(char expected) - { - int c; - if ((c = ReadChar()) != expected) - { - throw JsonError(SR.Format(SR.ArgumentException_ExpectedXButGotY, expected, (char)c)); - } - } - - private void Expect(string expected) - { - for (int i = 0; i < expected.Length; i++) - { - if (ReadChar() != expected[i]) - { - throw JsonError(SR.Format(SR.ArgumentException_ExpectedXDiferedAtY, expected, i)); - } - } - } - - private Exception JsonError(string msg) - { - return new ArgumentException(SR.Format(SR.ArgumentException_MessageAt, msg, _line, _column)); - } - } -} diff --git a/src/libraries/System.Json/src/System/Json/JsonArray.cs b/src/libraries/System.Json/src/System/Json/JsonArray.cs deleted file mode 100644 index 8b4b5026657257..00000000000000 --- a/src/libraries/System.Json/src/System/Json/JsonArray.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// See the LICENSE file in the project root for more information. - -using System.Collections; -using System.Collections.Generic; -using System.IO; - -namespace System.Json -{ - public class JsonArray : JsonValue, IList - { - private readonly List _list; - - public JsonArray(params JsonValue[] items) - { - _list = new List(); - AddRange(items); - } - - public JsonArray(IEnumerable items) - { - if (items == null) - { - throw new ArgumentNullException(nameof(items)); - } - - _list = new List(items); - } - - public override int Count => _list.Count; - - public bool IsReadOnly => false; - - public override sealed JsonValue this[int index] - { - get { return _list[index]; } - set { _list[index] = value; } - } - - public override JsonType JsonType => JsonType.Array; - - public void Add(JsonValue item) - { - _list.Add(item); - } - - public void AddRange(IEnumerable items) - { - if (items == null) - { - throw new ArgumentNullException(nameof(items)); - } - - _list.AddRange(items); - } - - public void AddRange(params JsonValue[] items) - { - if (items != null) - { - _list.AddRange(items); - } - } - - public void Clear() => _list.Clear(); - - public bool Contains(JsonValue item) => _list.Contains(item); - - public void CopyTo(JsonValue[] array, int arrayIndex) => _list.CopyTo(array, arrayIndex); - - public int IndexOf(JsonValue item) => _list.IndexOf(item); - - public void Insert(int index, JsonValue item) => _list.Insert(index, item); - - public bool Remove(JsonValue item) => _list.Remove(item); - - public void RemoveAt(int index) => _list.RemoveAt(index); - - public override void Save(Stream stream) - { - if (stream == null) - { - throw new ArgumentNullException(nameof(stream)); - } - - stream.WriteByte((byte)'['); - - for (int i = 0; i < _list.Count; i++) - { - JsonValue v = _list[i]; - if (v != null) - { - v.Save(stream); - } - else - { - stream.WriteByte((byte)'n'); - stream.WriteByte((byte)'u'); - stream.WriteByte((byte)'l'); - stream.WriteByte((byte)'l'); - } - - if (i < Count - 1) - { - stream.WriteByte((byte)','); - stream.WriteByte((byte)' '); - } - } - - stream.WriteByte((byte)']'); - } - - IEnumerator IEnumerable.GetEnumerator() => _list.GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => _list.GetEnumerator(); - } -} diff --git a/src/libraries/System.Json/src/System/Json/JsonObject.cs b/src/libraries/System.Json/src/System/Json/JsonObject.cs deleted file mode 100644 index d228c7f36627d2..00000000000000 --- a/src/libraries/System.Json/src/System/Json/JsonObject.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// See the LICENSE file in the project root for more information. - -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; - -using JsonPair = System.Collections.Generic.KeyValuePair; -using JsonPairEnumerable = System.Collections.Generic.IEnumerable>; - -namespace System.Json -{ - public class JsonObject : JsonValue, IDictionary, ICollection - { - // Use SortedDictionary to make result of ToString() deterministic - private readonly SortedDictionary _map; - - public JsonObject(params JsonPair[] items) - { - _map = new SortedDictionary(StringComparer.Ordinal); - - if (items != null) - { - AddRange(items); - } - } - - public JsonObject(JsonPairEnumerable items) - { - if (items == null) - { - throw new ArgumentNullException(nameof(items)); - } - - _map = new SortedDictionary(StringComparer.Ordinal); - AddRange(items); - } - - public override int Count => _map.Count; - - public IEnumerator GetEnumerator() => _map.GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => _map.GetEnumerator(); - - public override sealed JsonValue this[string key] - { - get { return _map[key]; } - set { _map[key] = value; } - } - - public override JsonType JsonType => JsonType.Object; - - public ICollection Keys => _map.Keys; - - public ICollection Values => _map.Values; - - public void Add(string key, JsonValue value) - { - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - _map.Add(key, value); - } - - public void Add(JsonPair pair) => Add(pair.Key, pair.Value); - - public void AddRange(JsonPairEnumerable items) - { - if (items == null) - { - throw new ArgumentNullException(nameof(items)); - } - - foreach (var pair in items) - { - _map.Add(pair.Key, pair.Value); - } - } - - public void AddRange(params JsonPair[] items) => AddRange((JsonPairEnumerable)items); - - public void Clear() => _map.Clear(); - - bool ICollection.Contains(JsonPair item) => (_map as ICollection).Contains(item); - - bool ICollection.Remove(JsonPair item) => (_map as ICollection).Remove(item); - - public override bool ContainsKey(string key) - { - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - return _map.ContainsKey(key); - } - - public void CopyTo(JsonPair[] array, int arrayIndex) => (_map as ICollection).CopyTo(array, arrayIndex); - - public bool Remove(string key) - { - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - return _map.Remove(key); - } - - bool ICollection.IsReadOnly => false; - - public override void Save(Stream stream) - { - base.Save(stream); - } - - public bool TryGetValue(string key, out JsonValue value) => _map.TryGetValue(key, out value); - } -} diff --git a/src/libraries/System.Json/src/System/Json/JsonPrimitive.cs b/src/libraries/System.Json/src/System/Json/JsonPrimitive.cs deleted file mode 100644 index 86a74e978815c9..00000000000000 --- a/src/libraries/System.Json/src/System/Json/JsonPrimitive.cs +++ /dev/null @@ -1,173 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// See the LICENSE file in the project root for more information. - -using System.Globalization; -using System.IO; -using System.Text; - -namespace System.Json -{ - public class JsonPrimitive : JsonValue - { - private static readonly byte[] s_trueBytes = Encoding.UTF8.GetBytes("true"); - private static readonly byte[] s_falseBytes = Encoding.UTF8.GetBytes("false"); - private readonly object _value; - - public JsonPrimitive(bool value) - { - _value = value; - } - - public JsonPrimitive(byte value) - { - _value = value; - } - - public JsonPrimitive(char value) - { - _value = value; - } - - public JsonPrimitive(decimal value) - { - _value = value; - } - - public JsonPrimitive(double value) - { - _value = value; - } - - public JsonPrimitive(float value) - { - _value = value; - } - - public JsonPrimitive(int value) - { - _value = value; - } - - public JsonPrimitive(long value) - { - _value = value; - } - - [CLSCompliant(false)] - public JsonPrimitive(sbyte value) - { - _value = value; - } - - public JsonPrimitive(short value) - { - _value = value; - } - - public JsonPrimitive(string value) - { - _value = value; - } - - public JsonPrimitive(DateTime value) - { - _value = value; - } - - [CLSCompliant(false)] - public JsonPrimitive(uint value) - { - _value = value; - } - - [CLSCompliant(false)] - public JsonPrimitive(ulong value) - { - _value = value; - } - - [CLSCompliant(false)] - public JsonPrimitive(ushort value) - { - _value = value; - } - - public JsonPrimitive(DateTimeOffset value) - { - _value = value; - } - - public JsonPrimitive(Guid value) - { - _value = value; - } - - public JsonPrimitive(TimeSpan value) - { - _value = value; - } - - public JsonPrimitive(Uri value) - { - _value = value; - } - - internal object Value => _value; - - public override JsonType JsonType => - _value == null || _value.GetType() == typeof(char) || _value.GetType() == typeof(string) || _value.GetType() == typeof(DateTime) || _value.GetType() == typeof(object) ? JsonType.String : // DateTimeOffset || Guid || TimeSpan || Uri - _value.GetType() == typeof(bool) ? JsonType.Boolean : - JsonType.Number; - - public override void Save(Stream stream) - { - switch (JsonType) - { - case JsonType.Boolean: - byte[] boolBytes = (bool)_value ? s_trueBytes : s_falseBytes; - stream.Write(boolBytes, 0, boolBytes.Length); - break; - - case JsonType.String: - stream.WriteByte((byte)'\"'); - byte[] bytes = Encoding.UTF8.GetBytes(EscapeString(_value.ToString())); - stream.Write(bytes, 0, bytes.Length); - stream.WriteByte((byte)'\"'); - break; - - default: - bytes = Encoding.UTF8.GetBytes(GetFormattedString()); - stream.Write(bytes, 0, bytes.Length); - break; - } - } - - internal string GetFormattedString() - { - switch (JsonType) - { - case JsonType.String: - if (_value is string || _value == null) - { - return (string)_value; - } - if (_value is char) - { - return _value.ToString(); - } - throw new NotImplementedException(SR.Format(SR.NotImplemented_GetFormattedString, _value.GetType())); - - case JsonType.Number: - string s = _value is float || _value is double ? - ((IFormattable)_value).ToString("R", CultureInfo.InvariantCulture) : // Use "round-trip" format - ((IFormattable)_value).ToString("G", CultureInfo.InvariantCulture); - return s == "NaN" || s == "Infinity" || s == "-Infinity" ? - "\"" + s + "\"" : - s; - - default: - throw new InvalidOperationException(); - } - } - } -} diff --git a/src/libraries/System.Json/src/System/Json/JsonType.cs b/src/libraries/System.Json/src/System/Json/JsonType.cs deleted file mode 100644 index dd46600b8f5d92..00000000000000 --- a/src/libraries/System.Json/src/System/Json/JsonType.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// See the LICENSE file in the project root for more information. - -namespace System.Json -{ - public enum JsonType - { - String, - Number, - Object, - Array, - Boolean, - } -} diff --git a/src/libraries/System.Json/src/System/Json/JsonValue.cs b/src/libraries/System.Json/src/System/Json/JsonValue.cs deleted file mode 100644 index 87db42f7de255e..00000000000000 --- a/src/libraries/System.Json/src/System/Json/JsonValue.cs +++ /dev/null @@ -1,534 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// See the LICENSE file in the project root for more information. - -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.Runtime.Serialization.Json; -using System.Text; - -using JsonPair = System.Collections.Generic.KeyValuePair; - -namespace System.Json -{ - public abstract class JsonValue : IEnumerable - { - private static readonly UTF8Encoding s_encoding = new UTF8Encoding(false, true); - - public static JsonValue Load(Stream stream) - { - if (stream == null) - { - throw new ArgumentNullException(nameof(stream)); - } - - return Load(new StreamReader(stream, true)); - } - - public static JsonValue Load(TextReader textReader) - { - if (textReader == null) - { - throw new ArgumentNullException(nameof(textReader)); - } - - return ToJsonValue(new JavaScriptReader(textReader).Read()); - } - - private static IEnumerable> ToJsonPairEnumerable(IEnumerable> kvpc) - { - foreach (KeyValuePair kvp in kvpc) - { - yield return new KeyValuePair(kvp.Key, ToJsonValue(kvp.Value)); - } - } - - private static IEnumerable ToJsonValueEnumerable(IEnumerable arr) - { - foreach (object obj in arr) - { - yield return ToJsonValue(obj); - } - } - - private static JsonValue ToJsonValue(object ret) - { - if (ret == null) - { - return null; - } - - var kvpc = ret as IEnumerable>; - if (kvpc != null) - { - return new JsonObject(ToJsonPairEnumerable(kvpc)); - } - - var arr = ret as IEnumerable; - if (arr != null) - { - return new JsonArray(ToJsonValueEnumerable(arr)); - } - - if (ret is bool) return new JsonPrimitive((bool)ret); - if (ret is decimal) return new JsonPrimitive((decimal)ret); - if (ret is double) return new JsonPrimitive((double)ret); - if (ret is int) return new JsonPrimitive((int)ret); - if (ret is long) return new JsonPrimitive((long)ret); - if (ret is string) return new JsonPrimitive((string)ret); - - Debug.Assert(ret is ulong); - return new JsonPrimitive((ulong)ret); - } - - public static JsonValue Parse(string jsonString) - { - if (jsonString == null) - { - throw new ArgumentNullException(nameof(jsonString)); - } - - return Load(new StringReader(jsonString)); - } - - public virtual int Count - { - get { throw new InvalidOperationException(); } - } - - public abstract JsonType JsonType { get; } - - public virtual JsonValue this[int index] - { - get { throw new InvalidOperationException(); } - set { throw new InvalidOperationException(); } - } - - public virtual JsonValue this[string key] - { - get { throw new InvalidOperationException(); } - set { throw new InvalidOperationException(); } - } - - public virtual bool ContainsKey(string key) - { - throw new InvalidOperationException(); - } - - public virtual void Save(Stream stream) - { - if (stream == null) - { - throw new ArgumentNullException(nameof(stream)); - } - - using (StreamWriter writer = new StreamWriter(stream, s_encoding, 1024, true)) - { - Save(writer); - } - } - - public virtual void Save(TextWriter textWriter) - { - if (textWriter == null) - { - throw new ArgumentNullException(nameof(textWriter)); - } - - SaveInternal(textWriter); - } - - private void SaveInternal(TextWriter w) - { - switch (JsonType) - { - case JsonType.Object: - w.Write('{'); - bool following = false; - foreach (JsonPair pair in ((JsonObject)this)) - { - if (following) - { - w.Write(", "); - } - - w.Write('\"'); - w.Write(EscapeString(pair.Key)); - w.Write("\": "); - if (pair.Value == null) - { - w.Write("null"); - } - else - { - pair.Value.SaveInternal(w); - } - - following = true; - } - w.Write('}'); - break; - - case JsonType.Array: - w.Write('['); - following = false; - foreach (JsonValue v in ((JsonArray)this)) - { - if (following) - { - w.Write(", "); - } - - if (v != null) - { - v.SaveInternal(w); - } - else - { - w.Write("null"); - } - - following = true; - } - w.Write(']'); - break; - - case JsonType.Boolean: - w.Write(this ? "true" : "false"); - break; - - case JsonType.String: - w.Write('"'); - w.Write(EscapeString(((JsonPrimitive)this).GetFormattedString())); - w.Write('"'); - break; - - default: - w.Write(((JsonPrimitive)this).GetFormattedString()); - break; - } - } - - public override string ToString() - { - var sw = new StringWriter(); - Save(sw); - return sw.ToString(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - throw new InvalidOperationException(); - } - - // Characters which have to be escaped: - // - Required by JSON Spec: Control characters, '"' and '\\' - // - Broken surrogates to make sure the JSON string is valid Unicode - // (and can be encoded as UTF8) - // - JSON does not require U+2028 and U+2029 to be escaped, but - // JavaScript does require this: - // http://stackoverflow.com/questions/2965293/javascript-parse-error-on-u2028-unicode-character/9168133#9168133 - // - '/' also does not have to be escaped, but escaping it when - // preceeded by a '<' avoids problems with JSON in HTML